eve 0.75.1 → 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 (599) hide show
  1. package/CHANGELOG.md +42 -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/dev/environment.d.ts +0 -6
  9. package/dist/src/cli/dev/environment.js +1 -1
  10. package/dist/src/cli/dev/tui/conversation-view.js +1 -1
  11. package/dist/src/cli/dev/tui/runner.js +1 -1
  12. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  13. package/dist/src/cli/dev/tui/transcript.js +1 -1
  14. package/dist/src/client/message-action-parts.d.ts +3 -0
  15. package/dist/src/client/message-action-parts.js +1 -1
  16. package/dist/src/client/message-reducer-types.d.ts +6 -1
  17. package/dist/src/client/message-reducer.js +1 -1
  18. package/dist/src/compiled/.vendor-stamp.json +3 -2
  19. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  20. package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
  21. package/dist/src/compiled/@vercel/queue/index.js +47 -0
  22. package/dist/src/compiler/connection-ownership.d.ts +6 -0
  23. package/dist/src/compiler/connection-ownership.js +1 -0
  24. package/dist/src/compiler/default-tool-policy.d.ts +0 -3
  25. package/dist/src/compiler/default-tool-policy.js +1 -1
  26. package/dist/src/compiler/extension-compatibility.d.ts +21 -20
  27. package/dist/src/compiler/extension-compatibility.js +1 -1
  28. package/dist/src/compiler/manifest.d.ts +9 -6
  29. package/dist/src/compiler/manifest.js +1 -1
  30. package/dist/src/compiler/normalize-connection.js +1 -1
  31. package/dist/src/compiler/normalize-manifest.js +1 -1
  32. package/dist/src/compiler/normalize-skill.d.ts +5 -0
  33. package/dist/src/compiler/normalize-skill.js +1 -1
  34. package/dist/src/compiler/normalize-subagent.d.ts +2 -1
  35. package/dist/src/compiler/normalize-subagent.js +1 -1
  36. package/dist/src/compiler/normalize-tool.js +1 -1
  37. package/dist/src/compiler/remote-agent-node.d.ts +2 -1
  38. package/dist/src/compiler/remote-agent-node.js +1 -1
  39. package/dist/src/connections/ownership.d.ts +18 -0
  40. package/dist/src/connections/ownership.js +1 -0
  41. package/dist/src/context/build-dynamic-tools.d.ts +3 -9
  42. package/dist/src/context/build-dynamic-tools.js +1 -1
  43. package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
  44. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
  45. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  46. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  47. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  48. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  49. package/dist/src/context/keys.d.ts +5 -4
  50. package/dist/src/context/memory-tools.js +1 -1
  51. package/dist/src/context/schedule-collection-tools.js +1 -1
  52. package/dist/src/discover/grammar.d.ts +11 -0
  53. package/dist/src/discover/grammar.js +1 -1
  54. package/dist/src/discover/manifest.d.ts +1 -0
  55. package/dist/src/discover/manifest.js +1 -1
  56. package/dist/src/discover/skills.d.ts +1 -0
  57. package/dist/src/discover/skills.js +1 -1
  58. package/dist/src/dynamic/definition.d.ts +7 -5
  59. package/dist/src/evals/assertions/collector.d.ts +4 -0
  60. package/dist/src/evals/assertions/collector.js +1 -1
  61. package/dist/src/evals/assertions/run.d.ts +2 -3
  62. package/dist/src/evals/assertions/run.js +2 -2
  63. package/dist/src/evals/assertions/scoped.js +1 -1
  64. package/dist/src/evals/index.d.ts +1 -1
  65. package/dist/src/evals/match.d.ts +9 -6
  66. package/dist/src/evals/reported-tool-name.d.ts +9 -0
  67. package/dist/src/evals/reported-tool-name.js +1 -0
  68. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  69. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  70. package/dist/src/evals/runner/execute-task.js +1 -1
  71. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  72. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
  73. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
  74. package/dist/src/evals/runner/reporters/datadog.js +2 -2
  75. package/dist/src/evals/session.js +2 -2
  76. package/dist/src/evals/target.d.ts +7 -0
  77. package/dist/src/evals/target.js +1 -1
  78. package/dist/src/evals/types.d.ts +17 -1
  79. package/dist/src/execution/agent-sessions/remote.js +1 -1
  80. package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
  81. package/dist/src/execution/catalog/connection-auth.js +1 -0
  82. package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
  83. package/dist/src/execution/catalog/connection-entry.js +1 -0
  84. package/dist/src/execution/catalog/listing.d.ts +9 -0
  85. package/dist/src/execution/catalog/listing.js +3 -0
  86. package/dist/src/execution/catalog/rank.d.ts +44 -0
  87. package/dist/src/execution/catalog/rank.js +1 -0
  88. package/dist/src/execution/catalog/search.d.ts +28 -0
  89. package/dist/src/execution/catalog/search.js +1 -0
  90. package/dist/src/execution/catalog/signatures.d.ts +11 -0
  91. package/dist/src/execution/catalog/signatures.js +1 -0
  92. package/dist/src/execution/catalog/skills.d.ts +24 -0
  93. package/dist/src/execution/catalog/skills.js +1 -0
  94. package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
  95. package/dist/src/execution/catalog/step-catalog.js +1 -0
  96. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  97. package/dist/src/execution/dynamic-connections.js +1 -1
  98. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  99. package/dist/src/execution/invoke-tool.js +1 -1
  100. package/dist/src/execution/node-step.js +1 -1
  101. package/dist/src/execution/session/active-turn.d.ts +1 -1
  102. package/dist/src/execution/session/pending-turn-state.js +1 -1
  103. package/dist/src/execution/session/turn-step.js +1 -1
  104. package/dist/src/execution/session/turn.d.ts +5 -5
  105. package/dist/src/execution/session/turn.js +1 -1
  106. package/dist/src/execution/session.js +1 -1
  107. package/dist/src/execution/skills/instructions.d.ts +20 -10
  108. package/dist/src/execution/skills/instructions.js +2 -2
  109. package/dist/src/execution/tasks/calls.d.ts +6 -5
  110. package/dist/src/execution/tasks/calls.js +1 -1
  111. package/dist/src/execution/tasks/model-step.d.ts +10 -10
  112. package/dist/src/execution/tasks/model-step.js +1 -1
  113. package/dist/src/execution/tasks/render.d.ts +3 -3
  114. package/dist/src/execution/tasks/render.js +3 -3
  115. package/dist/src/execution/tasks/session.d.ts +2 -1
  116. package/dist/src/execution/tasks/table.d.ts +1 -1
  117. package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
  118. package/dist/src/execution/tool-auth.js +1 -1
  119. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  120. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  121. package/dist/src/extensions/code/extension/extension.d.ts +4 -18
  122. package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
  123. package/dist/src/extensions/code/extension/instructions/github.js +1 -0
  124. package/dist/src/extensions/code/extension/instructions.md +1 -13
  125. package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
  126. package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
  127. package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
  128. package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
  129. package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
  130. package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
  131. package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
  132. package/dist/src/extensions/code/extension/lib/patch.js +4 -4
  133. package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
  134. package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
  135. package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
  136. package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
  137. package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
  138. package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
  139. package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
  140. package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
  141. package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
  142. package/dist/src/extensions/code/extension/skills/pr.js +1 -0
  143. package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
  144. package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
  145. package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
  146. package/dist/src/extensions/code/extension/tools/gh.js +1 -1
  147. package/dist/src/extensions/code/extension/tools/grep.js +1 -1
  148. package/dist/src/extensions/code/tools.d.ts +2 -1
  149. package/dist/src/extensions/code/tools.js +1 -1
  150. package/dist/src/extensions/git/extension/extension.d.ts +12 -0
  151. package/dist/src/extensions/git/extension/extension.js +1 -0
  152. package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
  153. package/dist/src/extensions/git/extension/instructions/github.js +1 -0
  154. package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
  155. package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
  156. package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
  157. package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
  158. package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
  159. package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
  160. package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
  161. package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
  162. package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
  163. package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
  164. package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
  165. package/dist/src/extensions/git/extension/lib/shell.js +1 -0
  166. package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
  167. package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
  168. package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
  169. package/dist/src/extensions/git/extension/skills/pr.js +1 -0
  170. package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
  171. package/dist/src/extensions/git/extension/tools/gh.js +1 -0
  172. package/dist/src/extensions/git/tools.d.ts +27 -0
  173. package/dist/src/extensions/git/tools.js +1 -0
  174. package/dist/src/framework/sources/registry.js +1 -1
  175. package/dist/src/harness/action-presentation.d.ts +2 -2
  176. package/dist/src/harness/action-result-helpers.d.ts +10 -2
  177. package/dist/src/harness/action-result-helpers.js +1 -1
  178. package/dist/src/harness/announcements.d.ts +2 -8
  179. package/dist/src/harness/announcements.js +1 -1
  180. package/dist/src/harness/coordination.d.ts +11 -11
  181. package/dist/src/harness/coordination.js +1 -1
  182. package/dist/src/harness/current-messages.d.ts +1 -5
  183. package/dist/src/harness/current-messages.js +1 -1
  184. package/dist/src/harness/emission.d.ts +2 -2
  185. package/dist/src/harness/emission.js +1 -1
  186. package/dist/src/harness/execute-call.d.ts +48 -0
  187. package/dist/src/harness/execute-call.js +1 -0
  188. package/dist/src/harness/execute-tool.d.ts +3 -1
  189. package/dist/src/harness/final-output.d.ts +2 -6
  190. package/dist/src/harness/final-output.js +1 -1
  191. package/dist/src/harness/hitl/approvals.d.ts +5 -0
  192. package/dist/src/harness/hitl/approvals.js +1 -1
  193. package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
  194. package/dist/src/harness/hitl/approved-calls.js +1 -1
  195. package/dist/src/harness/hitl/candidates.d.ts +13 -2
  196. package/dist/src/harness/hitl/candidates.js +1 -1
  197. package/dist/src/harness/hitl/coordinator.d.ts +3 -3
  198. package/dist/src/harness/hitl/coordinator.js +1 -1
  199. package/dist/src/harness/hitl/index.d.ts +6 -4
  200. package/dist/src/harness/hitl/index.js +1 -1
  201. package/dist/src/harness/hitl/intake.d.ts +3 -3
  202. package/dist/src/harness/hitl/intake.js +1 -1
  203. package/dist/src/harness/input-extraction.d.ts +4 -1
  204. package/dist/src/harness/input-extraction.js +1 -1
  205. package/dist/src/harness/input-request-resolution.d.ts +15 -0
  206. package/dist/src/harness/input-request-resolution.js +1 -1
  207. package/dist/src/harness/model-call/call.d.ts +3 -5
  208. package/dist/src/harness/model-call/call.js +1 -1
  209. package/dist/src/harness/model-call/errors.js +1 -1
  210. package/dist/src/harness/model-call/request.d.ts +3 -2
  211. package/dist/src/harness/model-call/request.js +1 -1
  212. package/dist/src/harness/model-call/response.d.ts +2 -1
  213. package/dist/src/harness/model-call/response.js +1 -1
  214. package/dist/src/harness/model-call/run.d.ts +5 -3
  215. package/dist/src/harness/model-call/run.js +1 -1
  216. package/dist/src/harness/model-call/tools.d.ts +12 -21
  217. package/dist/src/harness/model-call/tools.js +1 -1
  218. package/dist/src/harness/model-profile.d.ts +5 -0
  219. package/dist/src/harness/model-profile.js +1 -1
  220. package/dist/src/harness/provider-tools.d.ts +6 -5
  221. package/dist/src/harness/provider-tools.js +1 -1
  222. package/dist/src/harness/session-machine/commit.js +1 -1
  223. package/dist/src/harness/session-machine/transitions.d.ts +5 -2
  224. package/dist/src/harness/session-machine/transitions.js +1 -1
  225. package/dist/src/harness/step/after-model.js +1 -1
  226. package/dist/src/harness/step-hooks.d.ts +4 -6
  227. package/dist/src/harness/step-hooks.js +1 -1
  228. package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
  229. package/dist/src/harness/tool-call-io.d.ts +3 -0
  230. package/dist/src/harness/tool-call-io.js +1 -1
  231. package/dist/src/harness/tools.d.ts +22 -19
  232. package/dist/src/harness/tools.js +1 -1
  233. package/dist/src/harness/types.d.ts +14 -0
  234. package/dist/src/instrumentation/lifecycle.d.ts +0 -1
  235. package/dist/src/instrumentation/native-events.js +1 -1
  236. package/dist/src/instrumentation/runtime.d.ts +2 -1
  237. package/dist/src/internal/application/package.js +1 -1
  238. package/dist/src/internal/authored-definition/core.js +1 -1
  239. package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
  240. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
  241. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  242. package/dist/src/internal/authored-module.d.ts +2 -1
  243. package/dist/src/internal/authored-module.js +1 -1
  244. package/dist/src/internal/helpers/markdown.js +1 -1
  245. package/dist/src/internal/mcp/skills.js +1 -1
  246. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  247. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  248. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
  249. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
  250. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
  251. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  252. package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
  253. package/dist/src/internal/schedules/consumer-route.js +1 -1
  254. package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
  255. package/dist/src/internal/schedules/dev-environment.js +1 -0
  256. package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
  257. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
  258. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
  259. package/dist/src/protocol/catalog-tools.d.ts +12 -0
  260. package/dist/src/protocol/catalog-tools.js +1 -0
  261. package/dist/src/protocol/message-version.js +1 -1
  262. package/dist/src/protocol/message.d.ts +1 -1
  263. package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
  264. package/dist/src/protocol/remote-agent-protocol.js +1 -1
  265. package/dist/src/protocol/reply-tool.d.ts +2 -0
  266. package/dist/src/protocol/reply-tool.js +1 -0
  267. package/dist/src/protocol/runtime-tools.d.ts +6 -0
  268. package/dist/src/protocol/runtime-tools.js +1 -0
  269. package/dist/src/protocol/session-projection.js +1 -1
  270. package/dist/src/protocol/task-tools.d.ts +4 -4
  271. package/dist/src/protocol/task-tools.js +1 -1
  272. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
  273. package/dist/src/public/channels/linear/defaults.js +2 -2
  274. package/dist/src/public/channels/slack/action-status.d.ts +0 -9
  275. package/dist/src/public/channels/slack/action-status.js +1 -1
  276. package/dist/src/public/channels/slack/defaults.js +2 -2
  277. package/dist/src/public/channels/slack/task-card.d.ts +1 -1
  278. package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
  279. package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
  280. package/dist/src/public/definitions/remote-agent.d.ts +6 -3
  281. package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
  282. package/dist/src/public/experimental/schedules/index.d.ts +1 -1
  283. package/dist/src/public/schedules/providers/in-memory.js +1 -1
  284. package/dist/src/public/schedules/providers/vercel.js +1 -1
  285. package/dist/src/public/schedules/subscription.d.ts +36 -16
  286. package/dist/src/public/tools/web-search.d.ts +1 -1
  287. package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
  288. package/dist/src/runtime/agent/bootstrap.js +1 -1
  289. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  290. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  291. package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
  292. package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
  293. package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
  294. package/dist/src/runtime/connections/mcp-client.js +1 -1
  295. package/dist/src/runtime/connections/registry.js +1 -1
  296. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  297. package/dist/src/runtime/connections/tool-result.d.ts +2 -2
  298. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  299. package/dist/src/runtime/resolve-tool.js +1 -1
  300. package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
  301. package/dist/src/runtime/schedules/collection-client.js +1 -1
  302. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
  303. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
  304. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  305. package/dist/src/runtime/subagents/registry.d.ts +2 -1
  306. package/dist/src/runtime/subagents/registry.js +1 -1
  307. package/dist/src/runtime/tools/registry.d.ts +2 -0
  308. package/dist/src/runtime/tools/registry.js +1 -1
  309. package/dist/src/runtime/types.d.ts +3 -3
  310. package/dist/src/setup/connection-connector.js +1 -2
  311. package/dist/src/setup/index.d.ts +1 -1
  312. package/dist/src/setup/index.js +1 -1
  313. package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
  314. package/dist/src/setup/integrations/slack/setup.js +1 -1
  315. package/dist/src/setup/primitives/process-output.d.ts +5 -0
  316. package/dist/src/setup/primitives/process-output.js +2 -1
  317. package/dist/src/setup/scaffold/create/project.js +1 -1
  318. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  319. package/dist/src/setup/scaffold/create/web-template.js +1 -1
  320. package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
  321. package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
  322. package/dist/src/setup/slack-connect-create.d.ts +10 -2
  323. package/dist/src/setup/slack-connect-create.js +1 -1
  324. package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
  325. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  326. package/dist/src/setup/slack-connect.d.ts +30 -11
  327. package/dist/src/setup/slack-connect.js +1 -1
  328. package/dist/src/setup/slack-setup-plan.d.ts +72 -0
  329. package/dist/src/setup/slack-setup-plan.js +1 -0
  330. package/dist/src/setup/slackbot.d.ts +75 -35
  331. package/dist/src/setup/slackbot.js +2 -1
  332. package/dist/src/shared/action-label.d.ts +10 -0
  333. package/dist/src/shared/action-label.js +1 -0
  334. package/dist/src/shared/action-request-name.d.ts +3 -1
  335. package/dist/src/shared/action-request-name.js +1 -1
  336. package/dist/src/shared/action-types.d.ts +7 -8
  337. package/dist/src/shared/action-types.js +1 -1
  338. package/dist/src/shared/agent-definition.d.ts +11 -3
  339. package/dist/src/shared/development-env-files.d.ts +4 -0
  340. package/dist/src/shared/development-env-files.js +1 -0
  341. package/dist/src/shared/input.d.ts +0 -1
  342. package/dist/src/shared/map-with-concurrency.d.ts +2 -0
  343. package/dist/src/shared/map-with-concurrency.js +1 -0
  344. package/dist/src/shared/skill-definition.d.ts +6 -0
  345. package/dist/src/shared/skill-package.d.ts +1 -0
  346. package/dist/src/shared/skill-package.js +1 -1
  347. package/dist/src/shared/web-search.d.ts +15 -2
  348. package/dist/src/shared/web-search.js +1 -1
  349. package/dist/src/svelte/index.js +1 -1
  350. package/dist/src/svelte/use-eve-agent.js +1 -1
  351. package/dist/src/tool-stubs/execute.d.ts +0 -3
  352. package/dist/src/tool-stubs/execute.js +1 -1
  353. package/dist/src/tool-stubs/rules.js +1 -1
  354. package/dist/src/tool-stubs/validate-targets.js +1 -1
  355. package/dist/src/tools/behavior.d.ts +3 -6
  356. package/dist/src/tools/definition.d.ts +5 -0
  357. package/dist/src/tools/dynamic.d.ts +5 -2
  358. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  359. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  360. package/dist/src/tools/provided/task-cancel.d.ts +1 -1
  361. package/dist/src/tools/provided/task-wait.d.ts +1 -1
  362. package/dist/src/tools/provided/web-search.d.ts +20 -7
  363. package/dist/src/tools/provided/web-search.js +1 -1
  364. package/dist/src/tools/schema.d.ts +5 -0
  365. package/dist/src/tools/schema.js +1 -1
  366. package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
  367. package/dist/src/tools/workflow-definition.d.ts +1 -1
  368. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  369. package/dist/src/tracing/agent-otel-provider.js +2 -2
  370. package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
  371. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  372. package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
  373. package/dist/src/tracing/agent-otel-turn-state.js +1 -0
  374. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  375. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  376. package/dist/src/tracing/agent-trace-state.d.ts +4 -1
  377. package/dist/src/vue/index.js +1 -1
  378. package/dist/src/vue/use-eve-agent.js +1 -1
  379. package/docs/agent-config.md +8 -8
  380. package/docs/channels/chat-sdk.mdx +1 -1
  381. package/docs/channels/slack.mdx +32 -82
  382. package/docs/code-extension.mdx +28 -7
  383. package/docs/concepts/built-in-tools.md +43 -43
  384. package/docs/concepts/context-control.md +1 -1
  385. package/docs/concepts/execution-model-and-durability.mdx +1 -1
  386. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  387. package/docs/connections/mcp.mdx +5 -5
  388. package/docs/connections/openapi.mdx +1 -1
  389. package/docs/connections/overview.mdx +4 -2
  390. package/docs/evals/assertions.mdx +5 -3
  391. package/docs/evals/reporters.mdx +3 -1
  392. package/docs/evals/tool-stubs.mdx +3 -1
  393. package/docs/extensions.md +2 -0
  394. package/docs/guides/dev-tui.md +2 -2
  395. package/docs/guides/dynamic-capabilities.md +14 -4
  396. package/docs/guides/frontend/overview.mdx +1 -1
  397. package/docs/guides/remote-agents.md +10 -3
  398. package/docs/instructions.mdx +5 -5
  399. package/docs/reference/cli.md +2 -2
  400. package/docs/reference/typescript-api.md +3 -3
  401. package/docs/skills.mdx +19 -4
  402. package/docs/subagents/index.mdx +5 -3
  403. package/docs/tools/overview.mdx +22 -1
  404. package/docs/tools/tasks-upgrade.md +1 -1
  405. package/docs/tools/tasks.md +32 -32
  406. package/docs/tools/workflows.mdx +6 -6
  407. package/docs/tutorial/team-playbooks.mdx +2 -2
  408. package/package.json +22 -6
  409. package/dist/src/execution/connection-announcement.d.ts +0 -7
  410. package/dist/src/execution/connection-announcement.js +0 -4
  411. package/dist/src/execution/tools/connection-approval.d.ts +0 -25
  412. package/dist/src/execution/tools/connection-approval.js +0 -1
  413. package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
  414. package/dist/src/execution/tools/connection-search-rank.js +0 -1
  415. package/dist/src/execution/tools/connection-target.d.ts +0 -18
  416. package/dist/src/execution/tools/connection-target.js +0 -1
  417. package/dist/src/execution/tools/connection-tools.d.ts +0 -4
  418. package/dist/src/execution/tools/connection-tools.js +0 -2
  419. package/dist/src/execution/tools/load-skill.d.ts +0 -10
  420. package/dist/src/execution/tools/load-skill.js +0 -1
  421. package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
  422. package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
  423. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
  424. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
  425. package/dist/src/harness/advertised-tools.d.ts +0 -26
  426. package/dist/src/harness/advertised-tools.js +0 -1
  427. package/dist/src/harness/nested-actions.d.ts +0 -23
  428. package/dist/src/harness/nested-actions.js +0 -1
  429. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
  430. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
  431. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
  432. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
  433. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
  434. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
  435. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  436. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  437. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  438. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  439. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  440. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  441. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  442. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  443. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  444. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  445. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  446. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  447. 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
  448. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
  449. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  450. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  451. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  452. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  453. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
  454. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  455. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
  456. 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
  457. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
  458. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
  459. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  460. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  461. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  462. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  463. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  464. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  465. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  466. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  467. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  468. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  469. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  470. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  471. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  472. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  473. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  474. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  475. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  476. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  477. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  478. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  479. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  480. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  481. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  482. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  483. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  484. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  485. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  486. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  487. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  488. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  489. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  490. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  491. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  492. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  493. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  494. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  495. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  496. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  497. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  498. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  499. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  500. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  501. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  502. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  503. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  504. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  505. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  506. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  507. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  508. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  509. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  510. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  511. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  512. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  513. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  514. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  515. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  516. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  517. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  518. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  519. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  520. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  521. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  522. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  523. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  524. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  525. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  526. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  527. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  528. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  529. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  530. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  531. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  532. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  533. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  534. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  535. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  536. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  537. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  538. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  539. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  540. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  541. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  542. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  543. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  544. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  545. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  546. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  547. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  548. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  549. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  550. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  551. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  552. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  553. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  554. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  555. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  556. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  557. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  558. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  559. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  560. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  561. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  562. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  563. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  564. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  565. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  566. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  567. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
  568. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
  569. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
  570. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
  571. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
  572. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
  573. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
  574. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  575. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  576. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
  577. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  578. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
  579. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  580. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  581. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  582. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  583. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  584. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  585. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
  586. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
  587. package/dist/src/public/tools/load-skill.d.ts +0 -3
  588. package/dist/src/public/tools/load-skill.js +0 -1
  589. package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
  590. package/dist/src/runtime/skills/fragment-context.js +0 -1
  591. package/dist/src/tools/framework/connection-tools.d.ts +0 -3
  592. package/dist/src/tools/framework/connection-tools.js +0 -1
  593. package/dist/src/tools/provided/load-skill.d.ts +0 -2
  594. package/dist/src/tools/provided/load-skill.js +0 -1
  595. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
  596. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
  597. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
  598. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
  599. /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
@@ -1 +1 @@
1
- function actionRequestName(e){switch(e.kind){case`load-skill`:return`load_skill`;case`subagent-call`:return e.subagentName;case`remote-agent-call`:return e.remoteAgentName;case`tool-call`:case`workflow-tool-call`:return e.toolName}}export{actionRequestName};
1
+ import{isObject}from"#shared/guards.js";function actionRequestName(e){switch(e.kind){case`load-skill`:return e.name;case`subagent-call`:return e.subagentName;case`remote-agent-call`:return e.remoteAgentName;case`tool-call`:case`workflow-tool-call`:return e.toolName}}function skillTarget(e){return isObject(e)&&typeof e.name==`string`?e.name:void 0}export{actionRequestName,skillTarget};
@@ -13,7 +13,6 @@ export declare const runtimeToolCallActionRequestSchema: z.ZodObject<{
13
13
  callId: z.ZodString;
14
14
  input: z.ZodType<import("#shared/json.js").JsonObject, unknown, z.core.$ZodTypeInternals<import("#shared/json.js").JsonObject, unknown>>;
15
15
  kind: z.ZodLiteral<"tool-call">;
16
- parentCallId: z.ZodOptional<z.ZodString>;
17
16
  toolName: z.ZodString;
18
17
  }, z.core.$strict>;
19
18
  export type RuntimeSubagentCallActionRequest = z.infer<typeof runtimeSubagentCallActionRequestSchema>;
@@ -87,7 +86,7 @@ export type WorkflowToolRunEntry = Exclude<WorkflowToolCallEntry, {
87
86
  readonly entryPoint: "receive";
88
87
  }>;
89
88
  /**
90
- * How a deferred call enters its tool's workflow: through the entry point of
89
+ * How a workflow tool call enters its tool's workflow: through the entry point of
91
90
  * a new run, or, for a call with `taskId` to a `serve` tool, through the
92
91
  * `receive()` of the running task that id names.
93
92
  */
@@ -139,12 +138,14 @@ export declare const runtimeWorkflowTaskRequestSchema: z.ZodObject<{
139
138
  */
140
139
  type RuntimeLoadSkillActionRequest = z.infer<typeof runtimeLoadSkillActionRequestSchema>;
141
140
  /**
142
- * Zod schema for one Eve-owned `load-skill` action request.
141
+ * Zod schema for one Eve-owned `load-skill` action request: the model's
142
+ * `eve__skill` call, named for the skill it loads.
143
143
  */
144
144
  declare const runtimeLoadSkillActionRequestSchema: z.ZodObject<{
145
145
  callId: z.ZodString;
146
146
  input: z.ZodType<import("#shared/json.js").JsonObject, unknown, z.core.$ZodTypeInternals<import("#shared/json.js").JsonObject, unknown>>;
147
147
  kind: z.ZodLiteral<"load-skill">;
148
+ name: z.ZodString;
148
149
  }, z.core.$strict>;
149
150
  /**
150
151
  * Eve-owned action request surfaced by the harness.
@@ -234,17 +235,15 @@ export type RuntimeSubagentResult = RuntimeSubagentChildResult | RuntimeSubagent
234
235
  */
235
236
  type RuntimeLoadSkillActionResult = z.infer<typeof runtimeLoadSkillActionResultSchema>;
236
237
  /**
237
- * Zod schema for one runtime-owned load-skill action result.
238
- *
239
- * The result still reports whether a skill became active during the turn; the
240
- * action name reflects how the model requests those instructions.
238
+ * Zod schema for one runtime-owned load-skill action result, named for the
239
+ * skill its `load-skill` request loads.
241
240
  */
242
241
  declare const runtimeLoadSkillActionResultSchema: z.ZodObject<{
243
242
  callId: z.ZodString;
244
243
  isError: z.ZodOptional<z.ZodBoolean>;
245
244
  kind: z.ZodLiteral<"load-skill-result">;
245
+ name: z.ZodString;
246
246
  output: z.ZodType<import("#shared/json.js").JsonValue, unknown, z.core.$ZodTypeInternals<import("#shared/json.js").JsonValue, unknown>>;
247
- name: z.ZodOptional<z.ZodString>;
248
247
  }, z.core.$strict>;
249
248
  /**
250
249
  * Runtime-owned action result produced by framework-owned runtime code.
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";const runtimeToolCallActionRequestSchema=z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`tool-call`),parentCallId:z.string().optional(),toolName:z.string()}).strict();z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict(),z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`workflow-tool-call`),toolName:z.string(),workflowId:z.string()}).strict(),z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict();const runtimeRemoteAgentDispatchRequestSchema=z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),workflowToolCallEntrySchema=z.discriminatedUnion(`entryPoint`,[z.object({entryPoint:z.literal(`execute`)}).strict(),z.object({entryPoint:z.literal(`task`),taskId:z.string()}).strict(),z.object({entryPoint:z.literal(`serve`),taskId:z.string()}).strict(),z.object({entryPoint:z.literal(`receive`),taskId:z.string()}).strict()]),runtimeWorkflowTaskRequestSchema=z.object({callId:z.string(),entry:workflowToolCallEntrySchema,executeInput:jsonValueSchema.optional(),input:jsonObjectSchema,kind:z.literal(`workflow-task`),toolName:z.string(),workflowId:z.string()}).strict();z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`load-skill`)}).strict();const RUNTIME_WORKFLOW_TOOL_ACTION=Symbol.for(`eve:runtime-workflow-tool-action`);function markRuntimeWorkflowToolAction(e){return Object.defineProperty(e,RUNTIME_WORKFLOW_TOOL_ACTION,{value:!0}),e}function isRuntimeWorkflowToolAction(e){return e.kind===`workflow-tool-call`||e.kind===`tool-call`&&Reflect.get(e,RUNTIME_WORKFLOW_TOOL_ACTION)===!0}z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`tool-result`),output:jsonValueSchema,toolName:z.string()}).strict(),z.object({callId:z.string(),isError:z.literal(!0),kind:z.literal(`subagent-result`),origin:z.literal(`dispatch`),output:jsonValueSchema,subagentName:z.string()}).strict(),z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`load-skill-result`),output:jsonValueSchema,name:z.string().optional()}).strict();export{isRuntimeWorkflowToolAction,markRuntimeWorkflowToolAction,runtimeRemoteAgentDispatchRequestSchema,runtimeToolCallActionRequestSchema,runtimeWorkflowTaskRequestSchema};
1
+ import{z}from"#compiled/zod/index.js";import{jsonObjectSchema,jsonValueSchema}from"#shared/json-schemas.js";const runtimeToolCallActionRequestSchema=z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`tool-call`),toolName:z.string()}).strict();z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict(),z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`workflow-tool-call`),toolName:z.string(),workflowId:z.string()}).strict(),z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`subagent-call`),name:z.string(),nodeId:z.string(),subagentName:z.string()}).strict();const runtimeRemoteAgentDispatchRequestSchema=z.object({callId:z.string(),description:z.string(),input:jsonObjectSchema,kind:z.literal(`remote-agent-call`),name:z.string(),nodeId:z.string(),remoteAgentName:z.string()}).strict(),workflowToolCallEntrySchema=z.discriminatedUnion(`entryPoint`,[z.object({entryPoint:z.literal(`execute`)}).strict(),z.object({entryPoint:z.literal(`task`),taskId:z.string()}).strict(),z.object({entryPoint:z.literal(`serve`),taskId:z.string()}).strict(),z.object({entryPoint:z.literal(`receive`),taskId:z.string()}).strict()]),runtimeWorkflowTaskRequestSchema=z.object({callId:z.string(),entry:workflowToolCallEntrySchema,executeInput:jsonValueSchema.optional(),input:jsonObjectSchema,kind:z.literal(`workflow-task`),toolName:z.string(),workflowId:z.string()}).strict();z.object({callId:z.string(),input:jsonObjectSchema,kind:z.literal(`load-skill`),name:z.string()}).strict();const RUNTIME_WORKFLOW_TOOL_ACTION=Symbol.for(`eve:runtime-workflow-tool-action`);function markRuntimeWorkflowToolAction(e){return Object.defineProperty(e,RUNTIME_WORKFLOW_TOOL_ACTION,{value:!0}),e}function isRuntimeWorkflowToolAction(e){return e.kind===`workflow-tool-call`||e.kind===`tool-call`&&Reflect.get(e,RUNTIME_WORKFLOW_TOOL_ACTION)===!0}z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`tool-result`),output:jsonValueSchema,toolName:z.string()}).strict(),z.object({callId:z.string(),isError:z.literal(!0),kind:z.literal(`subagent-result`),origin:z.literal(`dispatch`),output:jsonValueSchema,subagentName:z.string()}).strict(),z.object({callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`load-skill-result`),name:z.string(),output:jsonValueSchema}).strict();export{isRuntimeWorkflowToolAction,markRuntimeWorkflowToolAction,runtimeRemoteAgentDispatchRequestSchema,runtimeToolCallActionRequestSchema,runtimeWorkflowTaskRequestSchema};
@@ -263,6 +263,12 @@ export interface AgentWorkflowDefinition {
263
263
  */
264
264
  readonly world?: AgentWorkflowWorldDefinition;
265
265
  }
266
+ /**
267
+ * How eve exposes an agent to its parent model: `true` as a tool in the
268
+ * model's tool list, `"deferred"` as a catalog entry the model finds with
269
+ * `eve__search` and calls with `eve__tool`, and `false` not at all.
270
+ */
271
+ export type AgentToolExposure = boolean | "deferred";
266
272
  /**
267
273
  * Compiled-side agent definition. Carries a `name` because the compiler
268
274
  * stamps the path-derived `agentId` onto every compiled agent node.
@@ -277,7 +283,7 @@ export type InternalAgentDefinition = {
277
283
  model: InternalAgentModelDefinition;
278
284
  reasoning?: AgentReasoningDefinition;
279
285
  source?: ModuleSourceRef;
280
- tool?: boolean;
286
+ tool?: AgentToolExposure;
281
287
  limits?: AgentLimitsDefinition;
282
288
  };
283
289
  /**
@@ -317,13 +323,15 @@ type PublicAgentDefinitionBase = {
317
323
  */
318
324
  readonly limits?: AgentLimitsDefinition;
319
325
  /**
320
- * Whether eve exposes this agent to its parent model as a tool. On the root
326
+ * How eve exposes this agent to its parent model. `true` lists it as a
327
+ * tool, `"deferred"` makes it a catalog entry the model finds with `eve__search`
328
+ * and calls with `eve__tool`, and `false` hides it from the model. On the root
321
329
  * agent, this controls the built-in `agent` tool. Defaults to `true`.
322
330
  *
323
331
  * A subagent with this set to `false` remains callable through `ctx.agent()`
324
332
  * in workflow tools.
325
333
  */
326
- readonly tool?: boolean;
334
+ readonly tool?: AgentToolExposure;
327
335
  };
328
336
  /**
329
337
  * Shared public definition for an agent. Static models may carry definition-level
@@ -0,0 +1,4 @@
1
+ /** Development env files, from highest to lowest precedence. */
2
+ export declare const DEVELOPMENT_ENV_FILE_NAMES: readonly [".env.development.local", ".env.local", ".env.development", ".env"];
3
+ /** Merged values of the development env files in `environmentRoot`, by precedence. */
4
+ export declare function readDevelopmentEnvironmentValues(environmentRoot: string): Map<string, string>;
@@ -0,0 +1 @@
1
+ import{isObject}from"#shared/guards.js";import{readFileSync}from"node:fs";import{join}from"node:path";import{parseEnv}from"node:util";const DEVELOPMENT_ENV_FILE_NAMES=[`.env.development.local`,`.env.local`,`.env.development`,`.env`];function isMissingEnvironmentFileError(e){return isObject(e)&&e.code===`ENOENT`}function readDevelopmentEnvironmentValues(e){let t=new Map;for(let n of[...DEVELOPMENT_ENV_FILE_NAMES].reverse())try{let r=parseEnv(readFileSync(join(e,n),`utf8`));for(let[e,n]of Object.entries(r))n!==void 0&&t.set(e,n)}catch(e){if(!isMissingEnvironmentFileError(e))throw e}return t}export{DEVELOPMENT_ENV_FILE_NAMES,readDevelopmentEnvironmentValues};
@@ -37,7 +37,6 @@ export declare const inputRequestSchema: z.ZodObject<{
37
37
  callId: z.ZodString;
38
38
  input: z.ZodType<import("./json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./json.ts").JsonObject, unknown>>;
39
39
  kind: z.ZodLiteral<"tool-call">;
40
- parentCallId: z.ZodOptional<z.ZodString>;
41
40
  toolName: z.ZodString;
42
41
  }, z.core.$strict>;
43
42
  allowFreeform: z.ZodOptional<z.ZodBoolean>;
@@ -0,0 +1,2 @@
1
+ /** Maps `items` with at most `limit` calls in flight, preserving input order. */
2
+ export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, map: (item: T) => Promise<R>): Promise<R[]>;
@@ -0,0 +1 @@
1
+ async function mapWithConcurrency(e,t,n){let r=Array.from({length:e.length}),i=0;return await Promise.all(Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i;i+=1,r[t]=await n(e[t])}})),r}export{mapWithConcurrency};
@@ -8,6 +8,12 @@ export type SkillFileContent = string | Uint8Array;
8
8
  * resolvers.
9
9
  */
10
10
  export interface SkillPackageDefinition {
11
+ /**
12
+ * Keeps this skill out of the system prompt and the dynamic skill
13
+ * announcement. The model finds it with `eve__search` and loads it with
14
+ * `eve__skill({ name })`. Defaults to `false`.
15
+ */
16
+ readonly deferred?: boolean;
11
17
  readonly description: string;
12
18
  readonly license?: string;
13
19
  readonly markdown: string;
@@ -6,6 +6,7 @@ export interface NormalizedSkillPackageFile {
6
6
  readonly relativePath: string;
7
7
  }
8
8
  export interface MaterializableSkillPackage {
9
+ readonly deferred?: boolean;
9
10
  readonly description: string;
10
11
  readonly files: readonly NormalizedSkillPackageFile[];
11
12
  readonly license?: string;
@@ -1 +1 @@
1
- import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{Buffer}from"node:buffer";function stripSkillFrontmatter(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)}function skillPackageRevision(e){let t=createHash(`sha256`);for(let n of e.files)t.update(`${n.relativePath}\0${n.content.byteLength}\0`).update(n.content);return t.digest(`hex`)}function normalizeSkillPackage(e){assertSafeSkillPackageName(e.name);let t=[{content:Buffer.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))assertSafeSkillPackageFilePath(n),t.push({content:contentToBuffer(r),relativePath:n});return t.sort((e,t)=>comparePaths(e.relativePath,t.relativePath)),{description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function writeSkillPackageDirectory(e){for(let t of e.skill.files){let n=join(e.rootPath,`skills`,e.skill.name,t.relativePath);await mkdir(dirname(n),{recursive:!0}),await writeFile(n,t.content)}}async function writeSkillPackageToSandbox(e){for(let t of e.skill.files)await e.sandbox.writeBinaryFile({content:t.content,path:await resolveSandboxSkillWritePath({name:e.skill.name,relativePath:t.relativePath,sandbox:e.sandbox})})}async function removeSkillPackageFromSandbox(e){assertSafeSkillPackageName(e.name);let t=await resolveSandboxSkillRoot({sandbox:e.sandbox});await e.sandbox.removePath({force:!0,path:`${t}/${e.name}`,recursive:!0})}function assertSafeSkillPackageName(e){if(e.length===0||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`)}function assertSafeSkillPackageFilePath(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function contentToBuffer(e){return typeof e==`string`?Buffer.from(e,`utf8`):Buffer.from(e)}function comparePaths(e,t){return e<t?-1:+(e>t)}export{normalizeSkillPackage,removeSkillPackageFromSandbox,skillPackageRevision,stripSkillFrontmatter,writeSkillPackageDirectory,writeSkillPackageToSandbox};
1
+ import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{Buffer}from"node:buffer";function stripSkillFrontmatter(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)}function skillPackageRevision(e){let t=createHash(`sha256`);for(let n of e.files)t.update(`${n.relativePath}\0${n.content.byteLength}\0`).update(n.content);return t.digest(`hex`)}function normalizeSkillPackage(e){assertSafeSkillPackageName(e.name);let t=[{content:Buffer.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))assertSafeSkillPackageFilePath(n),t.push({content:contentToBuffer(r),relativePath:n});return t.sort((e,t)=>comparePaths(e.relativePath,t.relativePath)),{deferred:e.deferred,description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function writeSkillPackageDirectory(e){for(let t of e.skill.files){let n=join(e.rootPath,`skills`,e.skill.name,t.relativePath);await mkdir(dirname(n),{recursive:!0}),await writeFile(n,t.content)}}async function writeSkillPackageToSandbox(e){for(let t of e.skill.files)await e.sandbox.writeBinaryFile({content:t.content,path:await resolveSandboxSkillWritePath({name:e.skill.name,relativePath:t.relativePath,sandbox:e.sandbox})})}async function removeSkillPackageFromSandbox(e){assertSafeSkillPackageName(e.name);let t=await resolveSandboxSkillRoot({sandbox:e.sandbox});await e.sandbox.removePath({force:!0,path:`${t}/${e.name}`,recursive:!0})}function assertSafeSkillPackageName(e){if(e.length===0||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`)}function assertSafeSkillPackageFilePath(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function contentToBuffer(e){return typeof e==`string`?Buffer.from(e,`utf8`):Buffer.from(e)}function comparePaths(e,t){return e<t?-1:+(e>t)}export{normalizeSkillPackage,removeSkillPackageFromSandbox,skillPackageRevision,stripSkillFrontmatter,writeSkillPackageDirectory,writeSkillPackageToSandbox};
@@ -1,2 +1,15 @@
1
- /** Web search providers available through Vercel AI Gateway. */
2
- export type WebSearchProvider = "exa" | "parallel" | "browserbase";
1
+ /** Web search providers that AI Gateway runs for any Gateway model. */
2
+ export declare const WEB_SEARCH_FALLBACK_PROVIDERS: readonly ["exa", "parallel", "browserbase"];
3
+ /**
4
+ * Web search providers available through Vercel AI Gateway. `native` is the model vendor's own
5
+ * hosted search, which only some vendors' models have.
6
+ */
7
+ export declare const WEB_SEARCH_PROVIDERS: readonly ["exa", "parallel", "browserbase", "native"];
8
+ export type WebSearchProvider = (typeof WEB_SEARCH_PROVIDERS)[number];
9
+ export type WebSearchFallbackProvider = (typeof WEB_SEARCH_FALLBACK_PROVIDERS)[number];
10
+ /** The Gateway search an agent selected, and what a model the provider can't serve uses instead. */
11
+ export interface WebSearchSelection {
12
+ readonly provider: WebSearchProvider;
13
+ /** Used when `provider` can't serve the model; without it, that model gets no `web_search`. */
14
+ readonly fallback?: WebSearchFallbackProvider;
15
+ }
@@ -1 +1 @@
1
- export{};
1
+ const WEB_SEARCH_FALLBACK_PROVIDERS=[`exa`,`parallel`,`browserbase`],WEB_SEARCH_PROVIDERS=[...WEB_SEARCH_FALLBACK_PROVIDERS,`native`];export{WEB_SEARCH_FALLBACK_PROVIDERS,WEB_SEARCH_PROVIDERS};
@@ -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-B2Kne9z6.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-D2V9UhLt.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-B2Kne9z6.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-D2V9UhLt.js";
2
2
 
3
3
  export { useEveAgent };
@@ -1,9 +1,6 @@
1
- import type { StubResult } from "#tool-stubs/types.js";
2
1
  import type { ToolExecuteOptions } from "#tools/definition.js";
3
2
  /** Tool inputs and approvals have already been checked before a stub can replace execution. */
4
3
  export declare function executeWithToolStub(tool: string, input: unknown, options: ToolExecuteOptions, execute: () => unknown): unknown;
5
- /** The connection wrapper checks operation inputs and approvals before requesting a stub. */
6
- export declare function connectionToolStub(tool: string, input: unknown, callId: string): Promise<StubResult>;
7
4
  /** Record errors converting stub responses so eval verification can detect them. */
8
5
  export declare function recordToolStubFailure(tool: string, callId: string | undefined, turnId?: string): Promise<void>;
9
6
  /** Record stub failures even when the caller recovers with fallback output. */
@@ -1 +1 @@
1
- import{contextStorage}from"#context/container.js";import{SessionKey,ToolStubsKey}from"#context/keys.js";import{ToolStubPlaybackKey}from"#context/providers/tool-stubs-key.js";import{findStubTarget,stubCallId}from"#tool-stubs/target.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{toolStubOutput}from"#tool-stubs/output.js";function executeWithToolStub(e,t,n,r){let i=contextStubCall(e,t,n.toolCallId);return i===void 0?r():executeStubbedTool(i.playback,i.call,n,r)}async function*executeStubbedTool(e,t,n,r){n.abortSignal?.throwIfAborted();let i=await e.call(t);if(i.kind===`error`)throw Error(i.error);if(i.kind===`stub`){yield toolStubOutput(i.outcome);return}let a=await r();isAsyncIterable(a)?yield*a:yield a}async function connectionToolStub(e,t,n){let r=contextStubCall(e,t,n);return r===void 0?{kind:`real`}:await r.playback.call(r.call)}function contextStubCall(e,t,n){let r=contextStorage.getStore();if(r===void 0)return;let i=findStubTarget(r.get(ToolStubsKey),e);if(i===void 0)return;let a=r.require(SessionKey);return{playback:r.require(ToolStubPlaybackKey),call:{tool:i.tool,input:t,callId:stubCallId(a.sessionId,a.turn.id,n)}}}async function recordToolStubFailure(e,t,n){let r=contextStorage.getStore(),i=r?.get(ToolStubsKey);if(i===void 0||t===void 0||e!==`connection_execute`&&findStubTarget(i,e)===void 0)return;let a=r.require(SessionKey);await r.require(ToolStubPlaybackKey).fail(stubCallId(a.sessionId,n??a.turn.id,t),`Stubbed tool "${e}" failed during output processing.`)}async function observeToolOutput(e,t,n,r){try{return await n()}catch(n){try{for(let n of t)await recordToolStubFailure(e,n.callId,n.turnId)}catch(e){throw AggregateError([n,e],`Tool output processing and failure reporting failed.`,{cause:n})}if(r!==void 0)return r(n);throw n}}export{connectionToolStub,executeWithToolStub,observeToolOutput,recordToolStubFailure};
1
+ import{contextStorage}from"#context/container.js";import{SessionKey,ToolStubsKey}from"#context/keys.js";import{ToolStubPlaybackKey}from"#context/providers/tool-stubs-key.js";import{findStubTarget,stubCallId}from"#tool-stubs/target.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{toolStubOutput}from"#tool-stubs/output.js";function executeWithToolStub(e,t,n,r){let i=contextStubCall(e,t,n.toolCallId);return i===void 0?r():executeStubbedTool(i.playback,i.call,n,r)}async function*executeStubbedTool(e,t,n,r){n.abortSignal?.throwIfAborted();let i=await e.call(t);if(i.kind===`error`)throw Error(i.error);if(i.kind===`stub`){yield toolStubOutput(i.outcome);return}let a=await r();isAsyncIterable(a)?yield*a:yield a}function contextStubCall(e,t,n){let r=contextStorage.getStore();if(r===void 0)return;let i=findStubTarget(r.get(ToolStubsKey),e);if(i===void 0)return;let a=r.require(SessionKey);return{playback:r.require(ToolStubPlaybackKey),call:{tool:i.tool,input:t,callId:stubCallId(a.sessionId,a.turn.id,n)}}}async function recordToolStubFailure(e,t,n){let r=contextStorage.getStore(),i=r?.get(ToolStubsKey);if(i===void 0||t===void 0||findStubTarget(i,e)===void 0)return;let a=r.require(SessionKey);await r.require(ToolStubPlaybackKey).fail(stubCallId(a.sessionId,n??a.turn.id,t),`Stubbed tool "${e}" failed during output processing.`)}async function observeToolOutput(e,t,n,r){try{return await n()}catch(n){try{for(let n of t)await recordToolStubFailure(e,n.callId,n.turnId)}catch(e){throw AggregateError([n,e],`Tool output processing and failure reporting failed.`,{cause:n})}if(r!==void 0)return r(n);throw n}}export{executeWithToolStub,observeToolOutput,recordToolStubFailure};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{parseJsonValue}from"#shared/json.js";import{createStubValidator,validateStubConstraint}from"#tool-stubs/schema.js";const ruleSchema=z.strictObject({id:z.string().min(1),tool:z.string().min(1),match:z.record(z.string(),z.union([z.boolean(),z.record(z.string(),z.json())])).optional()}),outcomeSchema=z.union([z.strictObject({response:z.json()}),z.strictObject({throw:z.strictObject({message:z.string(),name:z.string().min(1).optional()})})]),toolStubsSchema=z.array(z.union([ruleSchema.extend({outcome:outcomeSchema}),ruleSchema.extend({outcomes:z.tuple([outcomeSchema]).rest(outcomeSchema)})])).max(100);function parseToolStubs(e){boundStubConfiguration(e);let t=toolStubsSchema.parse(parseJsonValue(e)),n=new Set;for(let e of t){if(n.has(e.id))throw Error(`Duplicate tool stub id "${e.id}".`);if(n.add(e.id),[`connection_execute`,`connection_search`].includes(e.tool.split(`/`).at(-1)))throw Error(`Cannot stub connection_execute or connection_search. Stub a specific connection operation, such as linear__list_issues.`);for(let[t,n]of Object.entries(e.match??{})){validateStubConstraint(n,e.id,t);try{createStubValidator(n)}catch(n){throw Error(`Could not create matcher "${t}" in tool stub "${e.id}".`,{cause:n})}}}return t}function boundStubConfiguration(e){let t=[{value:e,depth:0}],n=0,r=0;for(;t.length>0;){let e=t.pop();if(++n>2e4||e.depth>32)throw Error(`Tool stubs exceed the size or nesting limit.`);if(typeof e.value==`string`&&(r+=e.value.length),e.value!==null&&typeof e.value==`object`)for(let[n,i]of Object.entries(e.value)){if(n===`__proto__`)throw Error(`Tool stubs cannot contain prototype keys.`);r+=n.length,t.push({value:i,depth:e.depth+1})}if(r>1e6)throw Error(`Tool stubs exceed the size or nesting limit.`)}}export{parseToolStubs};
1
+ import{z}from"#compiled/zod/index.js";import{CALL_TOOL_NAME,SEARCH_TOOL_NAME,SKILL_TOOL_NAME}from"#protocol/catalog-tools.js";import{parseJsonValue}from"#shared/json.js";import{createStubValidator,validateStubConstraint}from"#tool-stubs/schema.js";const ruleSchema=z.strictObject({id:z.string().min(1),tool:z.string().min(1),match:z.record(z.string(),z.union([z.boolean(),z.record(z.string(),z.json())])).optional()}),outcomeSchema=z.union([z.strictObject({response:z.json()}),z.strictObject({throw:z.strictObject({message:z.string(),name:z.string().min(1).optional()})})]),toolStubsSchema=z.array(z.union([ruleSchema.extend({outcome:outcomeSchema}),ruleSchema.extend({outcomes:z.tuple([outcomeSchema]).rest(outcomeSchema)})])).max(100);function parseToolStubs(e){boundStubConfiguration(e);let t=toolStubsSchema.parse(parseJsonValue(e)),n=new Set;for(let e of t){if(n.has(e.id))throw Error(`Duplicate tool stub id "${e.id}".`);if(n.add(e.id),[SEARCH_TOOL_NAME,CALL_TOOL_NAME,SKILL_TOOL_NAME].includes(e.tool.split(`/`).at(-1)))throw Error(`Cannot stub ${SEARCH_TOOL_NAME}, ${CALL_TOOL_NAME}, or ${SKILL_TOOL_NAME}. Stub the tool an ${CALL_TOOL_NAME} call reaches, such as linear__list_issues.`);for(let[t,n]of Object.entries(e.match??{})){validateStubConstraint(n,e.id,t);try{createStubValidator(n)}catch(n){throw Error(`Could not create matcher "${t}" in tool stub "${e.id}".`,{cause:n})}}}return t}function boundStubConfiguration(e){let t=[{value:e,depth:0}],n=0,r=0;for(;t.length>0;){let e=t.pop();if(++n>2e4||e.depth>32)throw Error(`Tool stubs exceed the size or nesting limit.`);if(typeof e.value==`string`&&(r+=e.value.length),e.value!==null&&typeof e.value==`object`)for(let[n,i]of Object.entries(e.value)){if(n===`__proto__`)throw Error(`Tool stubs cannot contain prototype keys.`);r+=n.length,t.push({value:i,depth:e.depth+1})}if(r>1e6)throw Error(`Tool stubs exceed the size or nesting limit.`)}}export{parseToolStubs};
@@ -1 +1 @@
1
- var InvalidToolStubTargetError=class extends Error{};function validateToolStubTargets(e,t){for(let n of e)if(!hasToolPath(t,n.tool.split(`/`)))throw new InvalidToolStubTargetError(`Tool stub "${n.id}" names an unknown or unsupported tool path "${n.tool}".`)}function hasToolPath(e,t){if(t.some(e=>e.length===0))return!1;let n=e.root;for(let[r,i]of t.entries()){let a=n.turnAgent.tools.find(e=>e.name===i);if(r===t.length-1)return a===void 0?n.agent.dynamicToolResolvers.some(e=>e.slug!==`connection_tools`&&(e.extensionNamespace===void 0||i.startsWith(`${e.extensionNamespace}__`)))||n.subagentRegistry.dynamicResolvers.some(e=>e.name===i)||i.includes(`__`)&&((n.agent.dynamicConnectionResolvers?.length??0)>0||n.agent.connections.some(e=>i.startsWith(`${e.connectionName}__`))):a.behavior?.handling?.kind!==`provider-tool`;if(a===void 0)return n.subagentRegistry.dynamicResolvers.some(e=>e.name===i);let o=a.behavior?.handling;if(o?.kind!==`dispatch`||o.target.kind!==`subagent-call`&&o.target.kind!==`self-agent-call`)return!1;n=e.nodesByNodeId.get(o.target.nodeId)}return!1}export{InvalidToolStubTargetError,validateToolStubTargets};
1
+ var InvalidToolStubTargetError=class extends Error{};function validateToolStubTargets(e,t){for(let n of e)if(!hasToolPath(t,n.tool.split(`/`)))throw new InvalidToolStubTargetError(`Tool stub "${n.id}" names an unknown or unsupported tool path "${n.tool}".`)}function hasToolPath(e,t){if(t.some(e=>e.length===0))return!1;let n=e.root;for(let[r,i]of t.entries()){let a=n.turnAgent.tools.find(e=>e.name===i);if(r===t.length-1)return a===void 0?n.agent.dynamicToolResolvers.some(e=>e.extensionNamespace===void 0||i.startsWith(`${e.extensionNamespace}__`))||n.subagentRegistry.dynamicResolvers.some(e=>e.name===i)||i.includes(`__`)&&((n.agent.dynamicConnectionResolvers?.length??0)>0||n.agent.connections.some(e=>i.startsWith(`${e.connectionName}__`))):a.behavior?.handling?.kind!==`provider-tool`;if(a===void 0)return n.subagentRegistry.dynamicResolvers.some(e=>e.name===i);let o=a.behavior?.handling;if(o?.kind!==`dispatch`||o.target.kind!==`subagent-call`&&o.target.kind!==`self-agent-call`)return!1;n=e.nodesByNodeId.get(o.target.nodeId)}return!1}export{InvalidToolStubTargetError,validateToolStubTargets};
@@ -1,4 +1,4 @@
1
- import type { WebSearchProvider } from "#shared/web-search.js";
1
+ import type { WebSearchSelection } from "#shared/web-search.js";
2
2
  import type { WorkflowToolEntryPoint } from "#tools/workflow-entry-point.js";
3
3
  /** Session facts that can hide a selected tool without changing source composition. */
4
4
  export type ToolAvailabilityCondition = "root-session";
@@ -6,10 +6,9 @@ export type ToolAvailabilityCondition = "root-session";
6
6
  export type CompiledToolHandling = {
7
7
  readonly kind: "dispatch";
8
8
  readonly action: "self-agent";
9
- } | {
9
+ } | ({
10
10
  readonly kind: "provider-tool";
11
- readonly provider: WebSearchProvider;
12
- } | {
11
+ } & WebSearchSelection) | {
13
12
  readonly kind: "workflow-tool";
14
13
  readonly entryPoint: WorkflowToolEntryPoint;
15
14
  readonly workflowId: string;
@@ -21,7 +20,6 @@ export interface ToolExecutionShape {
21
20
  export interface CompiledToolBehavior {
22
21
  readonly availability: readonly ToolAvailabilityCondition[];
23
22
  readonly handling?: CompiledToolHandling;
24
- readonly presentation?: "load-skill";
25
23
  readonly shape?: ToolExecutionShape;
26
24
  }
27
25
  /** Concrete dispatch identity prepared before a tool reaches the harness. */
@@ -53,7 +51,6 @@ export type PreparedToolHandling = {
53
51
  export interface PreparedToolBehavior {
54
52
  readonly availability: readonly ToolAvailabilityCondition[];
55
53
  readonly handling?: PreparedToolHandling;
56
- readonly presentation?: CompiledToolBehavior["presentation"];
57
54
  }
58
55
  /** Attaches internal behavior without adding a public string-keyed definition field. */
59
56
  export declare function attachToolBehavior<TDefinition extends object>(definition: TDefinition, behavior: CompiledToolBehavior): TDefinition;
@@ -15,6 +15,11 @@ export type ToolExecuteFn<TInput = unknown, TOutput = unknown> = (input: TInput,
15
15
  interface ToolDefinitionBase {
16
16
  /** Whether delegated agent sessions receive this tool. Defaults to `true`. */
17
17
  readonly availableInSubagents?: boolean;
18
+ /**
19
+ * Keeps this tool out of the model's tool list. The model finds it with
20
+ * `eve__search` and calls it with `eve__tool`. Defaults to `false`.
21
+ */
22
+ readonly deferred?: boolean;
18
23
  readonly description: string;
19
24
  }
20
25
  export interface ToolLabelDefinition<TInput = unknown, TOutput = unknown> {
@@ -7,7 +7,8 @@ import type { ToolModelOutput } from "#tools/model-output.js";
7
7
  *
8
8
  * Identity comes from context: a single returned entry is named after
9
9
  * the file slug; entries in a returned `Record<string, DynamicToolEntry>`
10
- * are each named `slug__key`.
10
+ * are each named by their bare key, prefixed with the mount namespace for an
11
+ * extension's resolver.
11
12
  *
12
13
  * `TInput` defaults to `Record<string, unknown>` but is inferred when
13
14
  * `inputSchema` is a Standard Schema (e.g. Zod) via the `defineTool`
@@ -16,6 +17,8 @@ import type { ToolModelOutput } from "#tools/model-output.js";
16
17
  */
17
18
  export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = any> {
18
19
  readonly availableInSubagents?: boolean;
20
+ /** Keeps this entry out of the model's tool list, as `deferred` on `defineTool`. */
21
+ readonly deferred?: boolean;
19
22
  readonly label?: ToolLabelDefinition<TInput, TOutput>;
20
23
  readonly description: string;
21
24
  /**
@@ -48,7 +51,7 @@ export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = an
48
51
  export type DynamicToolSet = Readonly<Record<string, DynamicToolEntry<any, any>>>;
49
52
  /**
50
53
  * Return type for a `defineDynamic` event handler: a single tool entry
51
- * (named after the file slug), a map of entries (named `slug__key`), or
54
+ * (named after the file slug), a map of entries (named by their keys), or
52
55
  * `null` for no tools.
53
56
  */
54
57
  export type DynamicToolResult = DynamicToolEntry<any, any> | DynamicToolSet | null;
@@ -1 +1 @@
1
- async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.75.1//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
1
+ async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.76.0//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
@@ -1 +1 @@
1
- import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.75.1//executeSleepTool`;export{executeSleepTool};
1
+ import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.76.0//executeSleepTool`;export{executeSleepTool};
@@ -2,5 +2,5 @@ import type { HarnessToolDefinition } from "#harness/execute-tool.js";
2
2
  export interface TaskCancelInput {
3
3
  readonly taskId: string;
4
4
  }
5
- /** `task_cancel`, offered to agents that can start tasks; the session answers each call. */
5
+ /** `eve__task_cancel`, offered to agents that can start tasks; the session answers each call. */
6
6
  export declare const taskCancelTool: HarnessToolDefinition;
@@ -3,7 +3,7 @@ export interface TaskWaitInput {
3
3
  readonly timeoutSeconds?: number;
4
4
  }
5
5
  /**
6
- * `task_wait`, offered to agents that can start tasks. It is not a workflow tool: the
6
+ * `eve__task_wait`, offered to agents that can start tasks. It is not a workflow tool: the
7
7
  * call defers out of the model step and the session parks the turn itself.
8
8
  */
9
9
  export declare const taskWaitTool: HarnessToolDefinition;
@@ -1,11 +1,23 @@
1
- import type { WebSearchProvider } from "#shared/web-search.js";
2
- export type { WebSearchProvider };
1
+ import type { WebSearchFallbackProvider, WebSearchProvider } from "#shared/web-search.js";
2
+ export type { WebSearchFallbackProvider, WebSearchProvider };
3
3
  declare const WEB_SEARCH_TOOL_KIND = "eve:web-search-tool";
4
- /** Configuration accepted by {@link webSearch}. */
5
- export interface WebSearchToolInput {
6
- /** Provider to use when the agent model is routed through AI Gateway. */
7
- readonly provider: WebSearchProvider;
8
- }
4
+ /**
5
+ * Configuration accepted by {@link webSearch}: the provider to use when the agent model is routed
6
+ * through AI Gateway.
7
+ */
8
+ export type WebSearchToolInput = {
9
+ /**
10
+ * The model vendor's own hosted search: OpenAI's for OpenAI models, Anthropic's for Claude,
11
+ * and Google Search grounding for Gemini 3 and later.
12
+ */
13
+ readonly provider: "native";
14
+ /** Provider for Gateway models without native search. Without it, they don't get `web_search`. */
15
+ readonly fallback?: WebSearchFallbackProvider;
16
+ } | {
17
+ /** A search provider that AI Gateway runs for any Gateway model. */
18
+ readonly provider: WebSearchFallbackProvider;
19
+ readonly fallback?: never;
20
+ };
9
21
  /**
10
22
  * Provider-managed web search configuration.
11
23
  *
@@ -16,6 +28,7 @@ export interface WebSearchToolInput {
16
28
  export interface WebSearchToolDefinition {
17
29
  readonly kind: typeof WEB_SEARCH_TOOL_KIND;
18
30
  readonly provider: WebSearchProvider;
31
+ readonly fallback?: WebSearchFallbackProvider;
19
32
  }
20
33
  /**
21
34
  * Configures the framework-provided `web_search` tool.
@@ -1 +1 @@
1
- import{frameworkTool}from"./framework-tool.js";const WEB_SEARCH_TOOL_KIND=`eve:web-search-tool`;function webSearch(e){return frameworkTool({kind:WEB_SEARCH_TOOL_KIND,provider:e.provider})}const defaultWebSearch=webSearch({provider:`exa`});function isWebSearchToolDefinition(e){return typeof e==`object`&&!!e&&e.kind===WEB_SEARCH_TOOL_KIND}export{defaultWebSearch as default,defaultWebSearch,isWebSearchToolDefinition,webSearch};
1
+ import{frameworkTool}from"./framework-tool.js";const WEB_SEARCH_TOOL_KIND=`eve:web-search-tool`;function webSearch(e){return frameworkTool({kind:WEB_SEARCH_TOOL_KIND,provider:e.provider,...e.fallback!==void 0&&{fallback:e.fallback}})}const defaultWebSearch=webSearch({provider:`exa`});function isWebSearchToolDefinition(e){return typeof e==`object`&&!!e&&e.kind===WEB_SEARCH_TOOL_KIND}export{defaultWebSearch as default,defaultWebSearch,isWebSearchToolDefinition,webSearch};
@@ -66,6 +66,11 @@ export declare function isToolSchema(value: unknown): value is ToolSchema;
66
66
  * for constraints JSON Schema cannot express.
67
67
  */
68
68
  export declare function defineJsonSchema<T = unknown>(schema: JsonObject, check?: (value: T) => string | undefined): ToolSchema<T>;
69
+ /**
70
+ * A JSON Schema advertised exactly as written whose accepted values `refine`
71
+ * then checks further, rejecting them or returning the value to use.
72
+ */
73
+ export declare function refineJsonSchema(schema: JsonObject, refine: (value: unknown) => Promise<StandardSchemaV1.Result<unknown>>): ToolSchema;
69
74
  /** An optional string property added to an input schema. */
70
75
  export interface OptionalStringProperty {
71
76
  readonly description: string;
@@ -1 +1 @@
1
- import{TypeValidationError,asSchema,jsonSchema}from"ai";import{isObject}from"#shared/guards.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonObject}from"#shared/json.js";import{emitJsonSchema,getStandardSchemaProperties,readJsonSchemaEmitter,serializeOutputSchema}from"#tools/schema-emission.js";import{Validator}from"#compiled/@cfworker/json-schema/index.js";function toInputSchema(e){return toSchema(e,`input`)}function toOutputSchema(e){return toSchema(e,`output`)}function serializeInputSchema(e){return serializeSchema(e,`input`)}function serializeModelInputSchema(e){let t=toSchema(e,`input`);return t==null?t:toModelJsonSchema(t,`input`)}function isToolSchema(e){let t=getStandardSchemaProperties(e);if(t===void 0)return!1;let n=t.jsonSchema;return typeof t.validate==`function`&&typeof n==`object`&&!!n&&typeof n.input==`function`&&typeof n.output==`function`}function defineJsonSchema(e,t){let emit=()=>structuredClone(e),n={"~standard":{version:1,vendor:`eve`,validate:createJsonSchemaValidator(e,t),jsonSchema:{input:emit,output:emit}}};return plainJsonSchemas.add(n),n}const plainJsonSchemas=new WeakSet;function withOptionalStringProperty(e,t){let emit=()=>addOptionalStringProperty(serializeInputSchema(e),t),n={"~standard":{version:1,vendor:`eve`,validate:n=>validateWithProperty(e,t.name,n),jsonSchema:{input:emit,output:emit}}};return plainJsonSchemas.has(e)&&plainJsonSchemas.add(n),n}function addOptionalStringProperty(e,t){let n=isObject(e.properties)?e.properties:{};return{...e,type:e.type??`object`,properties:{...n,[t.name]:{description:t.description,type:`string`}}}}async function validateWithProperty(e,t,n){if(!isObject(n)||!(t in n))return await e[`~standard`].validate(n);let{[t]:r,...i}=n;if(typeof r!=`string`)return{issues:[{message:`Expected "${t}" to be a string.`,path:[t]}]};let a=await e[`~standard`].validate(i);return a.issues!==void 0||!isObject(a.value)?a:{value:{...a.value,[t]:r}}}const UNSPECIFIED_INPUT_SCHEMA=defineJsonSchema({});function toModelSchema(e,t){if(e===void 0||typeof e==`function`||!(`~standard`in e))return e;let n=e;return jsonSchema(()=>toModelJsonSchema(n,t),{validate:async e=>{let t=await n[`~standard`].validate(e);return t.issues===void 0?{success:!0,value:t.value}:{success:!1,error:new TypeValidationError({value:e,cause:t.issues})}}})}function toModelJsonSchema(e,t){let n=serializeSchema(e,t);return plainJsonSchemas.has(e)?n:closeObjectSchemas(n)}function closeObjectSchemas(e){if(!isObject(e))return e;let t={...e},{type:n}=t;(n===`object`||Array.isArray(n)&&n.includes(`object`))&&(t.additionalProperties=isObject(t.additionalProperties)?closeObjectSchemas(t.additionalProperties):!1,isObject(t.properties)&&(t.properties=mapValues(t.properties,closeObjectSchemas))),Array.isArray(t.items)?t.items=t.items.map(closeObjectSchemas):isObject(t.items)&&(t.items=closeObjectSchemas(t.items));for(let e of[`allOf`,`anyOf`,`oneOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(closeObjectSchemas))}return isObject(t.definitions)&&(t.definitions=mapValues(t.definitions,closeObjectSchemas)),t}function mapValues(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]))}function toSchema(e,t){return e==null||isToolSchema(e)?e:defineJsonSchema(toJsonObject(e,t))}function serializeSchema(e,t){return e==null?e:toJsonObject(e,t)}function toJsonObject(e,t){if(t===`input`&&isLegacyZodSchema(e)){let t=asSchema(e),{$schema:n,...r}=parseJsonObject(t.jsonSchema);return r}return emitJsonSchema(e,t)}function isLegacyZodSchema(e){let t=getStandardSchemaProperties(e);return t!==void 0&&t.vendor===`zod`&&readJsonSchemaEmitter(t,`input`)===void 0}function createJsonSchemaValidator(e,t){let n,r=!1,passThrough=(e,t)=>(r||(r=!0,console.warn(`[eve] Tool schema cannot validate values locally; passing them through unvalidated: ${t}`)),{value:e});return r=>{if(n===void 0){let t=buildValidator(e);if(typeof t==`string`)return n=null,passThrough(r,t);n=t}if(n===null)return{value:r};let i;try{i=n.validate(r)}catch(e){return r===void 0?{issues:[{message:`Expected a JSON value.`}]}:passThrough(r,toErrorMessage(e))}if(!i.valid)return{issues:toIssues(i.errors)};let a=applyDefaults(e,e,r),o=t?.(a);return o===void 0?{value:a}:{issues:[{message:o}]}}}function applyDefaults(e,t,n){let r=n;for(let n of followRefs(e,t)){let{items:t,properties:i}=n;if(isObject(r)&&isObject(i))r=fillProperties(e,i,r);else if(Array.isArray(r)&&isObject(t)){let n=r,i=n.map(n=>applyDefaults(e,t,n));i.some((e,t)=>e!==n[t])&&(r=i)}}return r}function fillProperties(e,t,n){let r=n;for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0,o=t===void 0?findDefault(e,a):applyDefaults(e,a,t);o!==t&&(r===n&&(r={...n}),r[i]=o)}return r}function findDefault(e,t){for(let n of followRefs(e,t))if(`default`in n)return structuredClone(n.default)}function*followRefs(e,t){let n=new Set,r=t;for(;isObject(r)&&!n.has(r);)n.add(r),yield r,r=resolveLocalRef(e,r.$ref)}function resolveLocalRef(e,t){if(typeof t!=`string`||t!==`#`&&!t.startsWith(`#/`))return;let n=e;for(let e of decodePointer(t)){if(typeof n!=`object`||!n||!Object.hasOwn(n,e))return;n=n[e]}return n}function buildValidator(e){try{let t=structuredClone(e);return prepareForValidation(t)??new Validator(t,`2020-12`,!1)}catch(e){return toErrorMessage(e)}}const JSON_TYPES=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),EXCLUSIVE_BOUNDS=[[`exclusiveMinimum`,`minimum`],[`exclusiveMaximum`,`maximum`]],SUBSCHEMA_KEYWORDS=[`additionalItems`,`additionalProperties`,`contains`,`else`,`if`,`not`,`propertyNames`,`then`,`unevaluatedItems`,`unevaluatedProperties`],SUBSCHEMA_LIST_KEYWORDS=[`allOf`,`anyOf`,`oneOf`,`prefixItems`],SUBSCHEMA_MAP_KEYWORDS=[`$defs`,`definitions`,`dependencies`,`dependentSchemas`,`patternProperties`,`properties`];function prepareForValidation(e){if(typeof e==`boolean`)return;if(typeof e!=`object`||!e||Array.isArray(e))return`a subschema is neither an object nor a boolean`;let t=e;delete t.format;for(let[e,n]of EXCLUSIVE_BOUNDS)typeof t[e]==`boolean`&&(t[e]&&typeof t[n]==`number`?(t[e]=t[n],delete t[n]):delete t[e]);let{enum:n,pattern:r,required:i,type:a}=t;if(a!==void 0&&!(Array.isArray(a)?a.every(isJsonType):isJsonType(a)))return`unsupported type ${JSON.stringify(a)}`;if(n!==void 0&&!Array.isArray(n))return"`enum` is not an array";if(i!==void 0&&!(Array.isArray(i)&&i.every(e=>typeof e==`string`)))return"`required` is not an array of strings";if(r!==void 0&&!isRegExpSource(r))return`invalid pattern ${JSON.stringify(r)}`;for(let e of SUBSCHEMA_KEYWORDS)if(e in t){let n=prepareForValidation(t[e]);if(n!==void 0)return n}let o=t.items;for(let e of Array.isArray(o)?o:o===void 0?[]:[o]){let t=prepareForValidation(e);if(t!==void 0)return t}for(let e of SUBSCHEMA_LIST_KEYWORDS){let n=t[e];if(n!==void 0){if(!Array.isArray(n))return`\`${e}\` is not an array`;for(let e of n){let t=prepareForValidation(e);if(t!==void 0)return t}}}for(let e of SUBSCHEMA_MAP_KEYWORDS){let n=t[e];if(n!==void 0){if(typeof n!=`object`||!n||Array.isArray(n))return`\`${e}\` is not an object`;for(let[t,r]of Object.entries(n)){if(e===`patternProperties`&&!isRegExpSource(t))return`invalid pattern ${JSON.stringify(t)}`;if(e===`dependencies`&&Array.isArray(r))continue;let n=prepareForValidation(r);if(n!==void 0)return n}}}}function isJsonType(e){return typeof e==`string`&&JSON_TYPES.has(e)}function isRegExpSource(e){if(typeof e!=`string`)return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}const CLOSED_OBJECT_KEYWORD=/\/(?:additional|unevaluated)Properties$/;function toIssues(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=e[n+1];if(CLOSED_OBJECT_KEYWORD.test(r.keywordLocation)&&i?.keyword===`false`){let e=decodePointer(i.instanceLocation).at(-1);t.push({keyword:`false`,location:i.instanceLocation,message:`Unrecognized key: ${JSON.stringify(e)}`,object:r.instanceLocation}),n++}else t.push({keyword:r.keyword,location:r.instanceLocation,message:r.error})}let n=t.filter(e=>e.object===void 0||!t.some(t=>t.object===void 0&&(t.location===e.location||t.location.startsWith(`${e.location}/`))));return n.filter((e,t)=>{let r=n[t+1];return r===void 0?!0:r.location.startsWith(`${e.location}/`)?!1:e.keyword!==`$ref`||r.location!==e.location}).map(({location:e,message:t,object:n})=>{let r=decodePointer(n??e);return r.length===0?{message:t}:{message:t,path:r}})}function decodePointer(e){return e.split(`/`).slice(1).map(e=>{let t=e;try{t=decodeURIComponent(e)}catch{}return t.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)})}export{UNSPECIFIED_INPUT_SCHEMA,defineJsonSchema,isToolSchema,serializeInputSchema,serializeModelInputSchema,serializeOutputSchema,toInputSchema,toModelSchema,toOutputSchema,withOptionalStringProperty};
1
+ import{TypeValidationError,asSchema,jsonSchema}from"ai";import{isObject}from"#shared/guards.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonObject}from"#shared/json.js";import{emitJsonSchema,getStandardSchemaProperties,readJsonSchemaEmitter,serializeOutputSchema}from"#tools/schema-emission.js";import{Validator}from"#compiled/@cfworker/json-schema/index.js";function toInputSchema(e){return toSchema(e,`input`)}function toOutputSchema(e){return toSchema(e,`output`)}function serializeInputSchema(e){return serializeSchema(e,`input`)}function serializeModelInputSchema(e){let t=toSchema(e,`input`);return t==null?t:toModelJsonSchema(t,`input`)}function isToolSchema(e){let t=getStandardSchemaProperties(e);if(t===void 0)return!1;let n=t.jsonSchema;return typeof t.validate==`function`&&typeof n==`object`&&!!n&&typeof n.input==`function`&&typeof n.output==`function`}function defineJsonSchema(e,t){let emit=()=>structuredClone(e),n={"~standard":{version:1,vendor:`eve`,validate:createJsonSchemaValidator(e,t),jsonSchema:{input:emit,output:emit}}};return plainJsonSchemas.add(n),n}const plainJsonSchemas=new WeakSet;function refineJsonSchema(e,t){let n=defineJsonSchema(e),r={"~standard":{...n[`~standard`],validate:async e=>{let r=await n[`~standard`].validate(e);return r.issues===void 0?await t(r.value):r}}};return plainJsonSchemas.add(r),r}function withOptionalStringProperty(e,t){let emit=()=>addOptionalStringProperty(serializeInputSchema(e),t),n={"~standard":{version:1,vendor:`eve`,validate:n=>validateWithProperty(e,t.name,n),jsonSchema:{input:emit,output:emit}}};return plainJsonSchemas.has(e)&&plainJsonSchemas.add(n),n}function addOptionalStringProperty(e,t){let n=isObject(e.properties)?e.properties:{};return{...e,type:e.type??`object`,properties:{...n,[t.name]:{description:t.description,type:`string`}}}}async function validateWithProperty(e,t,n){if(!isObject(n)||!(t in n))return await e[`~standard`].validate(n);let{[t]:r,...i}=n;if(typeof r!=`string`)return{issues:[{message:`Expected "${t}" to be a string.`,path:[t]}]};let a=await e[`~standard`].validate(i);return a.issues!==void 0||!isObject(a.value)?a:{value:{...a.value,[t]:r}}}const UNSPECIFIED_INPUT_SCHEMA=defineJsonSchema({});function toModelSchema(e,t){if(e===void 0||typeof e==`function`||!(`~standard`in e))return e;let n=e;return jsonSchema(()=>toModelJsonSchema(n,t),{validate:async e=>{let t=await n[`~standard`].validate(e);return t.issues===void 0?{success:!0,value:t.value}:{success:!1,error:new TypeValidationError({value:e,cause:t.issues})}}})}function toModelJsonSchema(e,t){let n=serializeSchema(e,t);return plainJsonSchemas.has(e)?n:closeObjectSchemas(n)}function closeObjectSchemas(e){if(!isObject(e))return e;let t={...e},{type:n}=t;(n===`object`||Array.isArray(n)&&n.includes(`object`))&&(t.additionalProperties=isObject(t.additionalProperties)?closeObjectSchemas(t.additionalProperties):!1,isObject(t.properties)&&(t.properties=mapValues(t.properties,closeObjectSchemas))),Array.isArray(t.items)?t.items=t.items.map(closeObjectSchemas):isObject(t.items)&&(t.items=closeObjectSchemas(t.items));for(let e of[`allOf`,`anyOf`,`oneOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(closeObjectSchemas))}return isObject(t.definitions)&&(t.definitions=mapValues(t.definitions,closeObjectSchemas)),t}function mapValues(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)]))}function toSchema(e,t){return e==null||isToolSchema(e)?e:defineJsonSchema(toJsonObject(e,t))}function serializeSchema(e,t){return e==null?e:toJsonObject(e,t)}function toJsonObject(e,t){if(t===`input`&&isLegacyZodSchema(e)){let t=asSchema(e),{$schema:n,...r}=parseJsonObject(t.jsonSchema);return r}return emitJsonSchema(e,t)}function isLegacyZodSchema(e){let t=getStandardSchemaProperties(e);return t!==void 0&&t.vendor===`zod`&&readJsonSchemaEmitter(t,`input`)===void 0}function createJsonSchemaValidator(e,t){let n,r=!1,passThrough=(e,t)=>(r||(r=!0,console.warn(`[eve] Tool schema cannot validate values locally; passing them through unvalidated: ${t}`)),{value:e});return r=>{if(n===void 0){let t=buildValidator(e);if(typeof t==`string`)return n=null,passThrough(r,t);n=t}if(n===null)return{value:r};let i;try{i=n.validate(r)}catch(e){return r===void 0?{issues:[{message:`Expected a JSON value.`}]}:passThrough(r,toErrorMessage(e))}if(!i.valid)return{issues:toIssues(i.errors)};let a=applyDefaults(e,e,r),o=t?.(a);return o===void 0?{value:a}:{issues:[{message:o}]}}}function applyDefaults(e,t,n){let r=n;for(let n of followRefs(e,t)){let{items:t,properties:i}=n;if(isObject(r)&&isObject(i))r=fillProperties(e,i,r);else if(Array.isArray(r)&&isObject(t)){let n=r,i=n.map(n=>applyDefaults(e,t,n));i.some((e,t)=>e!==n[t])&&(r=i)}}return r}function fillProperties(e,t,n){let r=n;for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0,o=t===void 0?findDefault(e,a):applyDefaults(e,a,t);o!==t&&(r===n&&(r={...n}),r[i]=o)}return r}function findDefault(e,t){for(let n of followRefs(e,t))if(`default`in n)return structuredClone(n.default)}function*followRefs(e,t){let n=new Set,r=t;for(;isObject(r)&&!n.has(r);)n.add(r),yield r,r=resolveLocalRef(e,r.$ref)}function resolveLocalRef(e,t){if(typeof t!=`string`||t!==`#`&&!t.startsWith(`#/`))return;let n=e;for(let e of decodePointer(t)){if(typeof n!=`object`||!n||!Object.hasOwn(n,e))return;n=n[e]}return n}function buildValidator(e){try{let t=structuredClone(e);return prepareForValidation(t)??new Validator(t,`2020-12`,!1)}catch(e){return toErrorMessage(e)}}const JSON_TYPES=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),EXCLUSIVE_BOUNDS=[[`exclusiveMinimum`,`minimum`],[`exclusiveMaximum`,`maximum`]],SUBSCHEMA_KEYWORDS=[`additionalItems`,`additionalProperties`,`contains`,`else`,`if`,`not`,`propertyNames`,`then`,`unevaluatedItems`,`unevaluatedProperties`],SUBSCHEMA_LIST_KEYWORDS=[`allOf`,`anyOf`,`oneOf`,`prefixItems`],SUBSCHEMA_MAP_KEYWORDS=[`$defs`,`definitions`,`dependencies`,`dependentSchemas`,`patternProperties`,`properties`];function prepareForValidation(e){if(typeof e==`boolean`)return;if(typeof e!=`object`||!e||Array.isArray(e))return`a subschema is neither an object nor a boolean`;let t=e;delete t.format;for(let[e,n]of EXCLUSIVE_BOUNDS)typeof t[e]==`boolean`&&(t[e]&&typeof t[n]==`number`?(t[e]=t[n],delete t[n]):delete t[e]);let{enum:n,pattern:r,required:i,type:a}=t;if(a!==void 0&&!(Array.isArray(a)?a.every(isJsonType):isJsonType(a)))return`unsupported type ${JSON.stringify(a)}`;if(n!==void 0&&!Array.isArray(n))return"`enum` is not an array";if(i!==void 0&&!(Array.isArray(i)&&i.every(e=>typeof e==`string`)))return"`required` is not an array of strings";if(r!==void 0&&!isRegExpSource(r))return`invalid pattern ${JSON.stringify(r)}`;for(let e of SUBSCHEMA_KEYWORDS)if(e in t){let n=prepareForValidation(t[e]);if(n!==void 0)return n}let o=t.items;for(let e of Array.isArray(o)?o:o===void 0?[]:[o]){let t=prepareForValidation(e);if(t!==void 0)return t}for(let e of SUBSCHEMA_LIST_KEYWORDS){let n=t[e];if(n!==void 0){if(!Array.isArray(n))return`\`${e}\` is not an array`;for(let e of n){let t=prepareForValidation(e);if(t!==void 0)return t}}}for(let e of SUBSCHEMA_MAP_KEYWORDS){let n=t[e];if(n!==void 0){if(typeof n!=`object`||!n||Array.isArray(n))return`\`${e}\` is not an object`;for(let[t,r]of Object.entries(n)){if(e===`patternProperties`&&!isRegExpSource(t))return`invalid pattern ${JSON.stringify(t)}`;if(e===`dependencies`&&Array.isArray(r))continue;let n=prepareForValidation(r);if(n!==void 0)return n}}}}function isJsonType(e){return typeof e==`string`&&JSON_TYPES.has(e)}function isRegExpSource(e){if(typeof e!=`string`)return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}const CLOSED_OBJECT_KEYWORD=/\/(?:additional|unevaluated)Properties$/;function toIssues(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=e[n+1];if(CLOSED_OBJECT_KEYWORD.test(r.keywordLocation)&&i?.keyword===`false`){let e=decodePointer(i.instanceLocation).at(-1);t.push({keyword:`false`,location:i.instanceLocation,message:`Unrecognized key: ${JSON.stringify(e)}`,object:r.instanceLocation}),n++}else t.push({keyword:r.keyword,location:r.instanceLocation,message:r.error})}let n=t.filter(e=>e.object===void 0||!t.some(t=>t.object===void 0&&(t.location===e.location||t.location.startsWith(`${e.location}/`))));return n.filter((e,t)=>{let r=n[t+1];return r===void 0?!0:r.location.startsWith(`${e.location}/`)?!1:e.keyword!==`$ref`||r.location!==e.location}).map(({location:e,message:t,object:n})=>{let r=decodePointer(n??e);return r.length===0?{message:t}:{message:t,path:r}})}function decodePointer(e){return e.split(`/`).slice(1).map(e=>{let t=e;try{t=decodeURIComponent(e)}catch{}return t.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)})}export{UNSPECIFIED_INPUT_SCHEMA,defineJsonSchema,isToolSchema,refineJsonSchema,serializeInputSchema,serializeModelInputSchema,serializeOutputSchema,toInputSchema,toModelSchema,toOutputSchema,withOptionalStringProperty};
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Renders a connection tool's input and output JSON Schemas as a compact
3
- * TypeScript signature, e.g.
2
+ * Renders a tool's input and output JSON Schemas as a compact TypeScript
3
+ * signature, e.g.
4
4
  * `list_issues(input: { teamId: string; first?: number /* maximum: 50 *\/ }): Promise<unknown>`.
5
5
  *
6
6
  * Constraints the model must respect (`minimum`, `maximum`, `pattern`, …) stay
@@ -71,7 +71,7 @@ export type WorkflowSharedContext = Pick<ToolContext, "session" | "toolName" | "
71
71
  export type WorkflowToolContext = WorkflowSharedContext & Pick<ToolContext, "callId"> & {
72
72
  /**
73
73
  * Aborts when the call's work should stop: the call is cancelled, by
74
- * `task_cancel`, `session.cancel()`, a failed turn, or the end of the
74
+ * `eve__task_cancel`, `session.cancel()`, a failed turn, or the end of the
75
75
  * session, or, for an `execute` call, a steering message arrives while the
76
76
  * turn waits on it. Stop and return what you have. After a steering
77
77
  * message the call settles with what the body returns, or with
@@ -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};