eve 0.71.3 → 0.72.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 (436) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +22 -6
  3. package/dist/src/acp/adapter.js +1 -1
  4. package/dist/src/ai/decide.d.ts +7 -0
  5. package/dist/src/ai/decide.js +1 -0
  6. package/dist/src/chunks/{use-eve-agent-CFCaYnrI.js → use-eve-agent-C1GYGCtb.js} +698 -388
  7. package/dist/src/chunks/{use-eve-agent-DcDhXNv1.js → use-eve-agent-hZJ7CB8t.js} +698 -388
  8. package/dist/src/cli/commands/integration-setup.js +1 -1
  9. package/dist/src/cli/commands/registry.js +1 -1
  10. package/dist/src/cli/commands/trace-detail.d.ts +1 -1
  11. package/dist/src/cli/commands/trace-detail.js +1 -1
  12. package/dist/src/cli/dev/tui/runner.js +1 -1
  13. package/dist/src/cli/dev/tui/setup-flow.d.ts +1 -0
  14. package/dist/src/cli/dev/tui/setup-panel.d.ts +1 -0
  15. package/dist/src/cli/dev/tui/setup-panel.js +2 -1
  16. package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +2 -2
  17. package/dist/src/cli/dev/tui/traces/trace-conversation.js +2 -2
  18. package/dist/src/cli/dev/tui/transcript-parts.d.ts +2 -1
  19. package/dist/src/cli/dev/tui/transcript-parts.js +1 -1
  20. package/dist/src/cli/dev/tui/transcript.js +1 -1
  21. package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
  22. package/dist/src/client/conversation-projection.d.ts +4 -0
  23. package/dist/src/client/conversation-projection.js +1 -0
  24. package/dist/src/client/conversation-reducer.js +1 -1
  25. package/dist/src/client/conversation-state.d.ts +5 -26
  26. package/dist/src/client/conversation-state.js +1 -1
  27. package/dist/src/client/index.d.ts +1 -0
  28. package/dist/src/client/index.js +1 -1
  29. package/dist/src/client/message-action-parts.d.ts +1 -11
  30. package/dist/src/client/message-action-parts.js +1 -1
  31. package/dist/src/client/message-reducer.d.ts +3 -1
  32. package/dist/src/client/message-reducer.js +1 -1
  33. package/dist/src/client/session-utils.js +1 -1
  34. package/dist/src/client/session.js +1 -1
  35. package/dist/src/client/tool-call-state.d.ts +23 -0
  36. package/dist/src/client/tool-call-state.js +1 -0
  37. package/dist/src/client/tool-part-state.d.ts +7 -0
  38. package/dist/src/client/tool-part-state.js +1 -0
  39. package/dist/src/compiled/.vendor-stamp.json +10 -10
  40. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1453 -1358
  41. package/dist/src/compiled/@ai-sdk/anthropic/index.js +1 -2
  42. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +172 -163
  43. package/dist/src/compiled/@ai-sdk/code-mode/index.js +15 -20
  44. package/dist/src/compiled/@ai-sdk/google/index.d.ts +772 -733
  45. package/dist/src/compiled/@ai-sdk/google/index.js +6 -8
  46. package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +887 -790
  47. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  48. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1722 -1691
  49. package/dist/src/compiled/@ai-sdk/openai/index.js +3 -14
  50. package/dist/src/compiled/@ai-sdk/otel/index.d.ts +216 -159
  51. package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
  52. package/dist/src/compiled/@ai-sdk/provider/index.d.ts +7542 -7271
  53. package/dist/src/compiled/@ai-sdk/provider/index.js +1 -3
  54. package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +1799 -1600
  55. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  56. package/dist/src/compiled/_chunks/workflow/dist-DXLdlucM.js +15 -0
  57. package/dist/src/compiled/_chunks/workflow/experimental-decision-BrfWf6-n.js +3 -0
  58. package/dist/src/compiler/extension-compatibility.d.ts +36 -20
  59. package/dist/src/compiler/extension-compatibility.js +1 -1
  60. package/dist/src/compiler/manifest.js +1 -1
  61. package/dist/src/context/build-dynamic-tools.js +1 -1
  62. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  63. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  64. package/dist/src/context/providers/session.js +1 -1
  65. package/dist/src/evals/define-eval.d.ts +1 -1
  66. package/dist/src/evals/judge.d.ts +1 -1
  67. package/dist/src/evals/judge.js +2 -2
  68. package/dist/src/evals/types.d.ts +8 -8
  69. package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -0
  70. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  71. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  72. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  73. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  74. package/dist/src/execution/durable-session-read.d.ts +5 -0
  75. package/dist/src/execution/durable-session-read.js +1 -0
  76. package/dist/src/execution/durable-session-store.d.ts +4 -10
  77. package/dist/src/execution/durable-session-store.js +1 -1
  78. package/dist/src/execution/dynamic-connections.d.ts +3 -3
  79. package/dist/src/execution/dynamic-connections.js +1 -1
  80. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  81. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  82. package/dist/src/execution/legacy-session/snapshot.d.ts +3 -0
  83. package/dist/src/execution/legacy-session/snapshot.js +1 -1
  84. package/dist/src/execution/model-call-batching.js +1 -1
  85. package/dist/src/execution/node-step.d.ts +2 -0
  86. package/dist/src/execution/node-step.js +1 -1
  87. package/dist/src/execution/proxied-deliver-step.js +1 -1
  88. package/dist/src/execution/publish-session-events.d.ts +7 -2
  89. package/dist/src/execution/publish-session-events.js +1 -1
  90. package/dist/src/execution/session/active-turn.js +1 -1
  91. package/dist/src/execution/session/answer-caller.js +1 -1
  92. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  93. package/dist/src/execution/session/finalization.js +1 -1
  94. package/dist/src/execution/session/handoff-steps.d.ts +3 -1
  95. package/dist/src/execution/session/handoff-steps.js +1 -1
  96. package/dist/src/execution/session/handoff.d.ts +1 -1
  97. package/dist/src/execution/session/handoff.js +1 -1
  98. package/dist/src/execution/session/pending-turn-state.d.ts +8 -3
  99. package/dist/src/execution/session/pending-turn-state.js +1 -1
  100. package/dist/src/execution/session/task-tool-tracing-step.d.ts +5 -0
  101. package/dist/src/execution/session/task-tool-tracing-step.js +1 -0
  102. package/dist/src/execution/session/turn-step-result.js +1 -1
  103. package/dist/src/execution/session/turn-step.js +1 -1
  104. package/dist/src/execution/session/turn-waiting-step.js +1 -1
  105. package/dist/src/execution/session/turn.d.ts +1 -0
  106. package/dist/src/execution/session/turn.js +1 -1
  107. package/dist/src/execution/settle-cancelled-turn-step.d.ts +4 -6
  108. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  109. package/dist/src/execution/tasks/start.d.ts +3 -3
  110. package/dist/src/execution/tasks/start.js +1 -1
  111. package/dist/src/execution/tasks/steps.d.ts +1 -1
  112. package/dist/src/execution/tasks/steps.js +1 -1
  113. package/dist/src/execution/terminal-session-completion-step.d.ts +5 -1
  114. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  115. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  116. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  117. package/dist/src/execution/tools/connection-tools.js +1 -1
  118. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  119. package/dist/src/execution/tools/workflow/step.js +1 -1
  120. package/dist/src/execution/tools/workflow/withdraw-step.d.ts +7 -9
  121. package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
  122. package/dist/src/execution/workflow-trace-context.d.ts +2 -2
  123. package/dist/src/harness/authorization.d.ts +4 -2
  124. package/dist/src/harness/authorization.js +1 -1
  125. package/dist/src/harness/{compaction.js → compaction/engine.js} +1 -1
  126. package/dist/src/harness/compaction/step.d.ts +46 -0
  127. package/dist/src/harness/compaction/step.js +1 -0
  128. package/dist/src/harness/coordination.d.ts +32 -68
  129. package/dist/src/harness/coordination.js +1 -1
  130. package/dist/src/harness/current-messages.d.ts +1 -3
  131. package/dist/src/harness/current-messages.js +1 -1
  132. package/dist/src/harness/emission.d.ts +4 -52
  133. package/dist/src/harness/emission.js +1 -1
  134. package/dist/src/harness/execute-tool.d.ts +1 -0
  135. package/dist/src/harness/final-output.d.ts +5 -0
  136. package/dist/src/harness/final-output.js +1 -1
  137. package/dist/src/harness/hitl/approvals.d.ts +115 -0
  138. package/dist/src/harness/hitl/approvals.js +1 -0
  139. package/dist/src/harness/hitl/approved-call-callers.d.ts +14 -0
  140. package/dist/src/harness/hitl/approved-call-callers.js +1 -0
  141. package/dist/src/harness/hitl/approved-calls.d.ts +37 -0
  142. package/dist/src/harness/hitl/approved-calls.js +1 -0
  143. package/dist/src/harness/hitl/budget.d.ts +21 -0
  144. package/dist/src/harness/hitl/budget.js +1 -0
  145. package/dist/src/harness/{approval-candidates.d.ts → hitl/candidates.d.ts} +9 -18
  146. package/dist/src/harness/hitl/candidates.js +1 -0
  147. package/dist/src/harness/hitl/coordinator.js +1 -0
  148. package/dist/src/harness/hitl/delivery.d.ts +37 -0
  149. package/dist/src/harness/hitl/delivery.js +1 -0
  150. package/dist/src/harness/hitl/index.d.ts +49 -0
  151. package/dist/src/harness/hitl/index.js +1 -0
  152. package/dist/src/harness/hitl/intake.d.ts +67 -0
  153. package/dist/src/harness/hitl/intake.js +1 -0
  154. package/dist/src/harness/{stale-input-responses.d.ts → hitl/stale-responses.d.ts} +5 -3
  155. package/dist/src/harness/hitl/stale-responses.js +3 -0
  156. package/dist/src/harness/inline-tool-authorization.d.ts +4 -0
  157. package/dist/src/harness/inline-tool-authorization.js +1 -1
  158. package/dist/src/harness/input-extraction.d.ts +1 -10
  159. package/dist/src/harness/input-extraction.js +1 -1
  160. package/dist/src/harness/input-request-resolution.d.ts +1 -5
  161. package/dist/src/harness/input-request-resolution.js +1 -1
  162. package/dist/src/harness/model-call/call.d.ts +78 -0
  163. package/dist/src/harness/model-call/call.js +1 -0
  164. package/dist/src/harness/{model-call-error.d.ts → model-call/errors.d.ts} +1 -1
  165. package/dist/src/harness/model-call/failure.d.ts +52 -0
  166. package/dist/src/harness/model-call/failure.js +1 -0
  167. package/dist/src/harness/model-call/model.d.ts +18 -0
  168. package/dist/src/harness/model-call/model.js +1 -0
  169. package/dist/src/harness/model-call/recovery.d.ts +52 -0
  170. package/dist/src/harness/model-call/recovery.js +1 -0
  171. package/dist/src/harness/model-call/request.d.ts +30 -0
  172. package/dist/src/harness/model-call/request.js +3 -0
  173. package/dist/src/harness/model-call/response.d.ts +39 -0
  174. package/dist/src/harness/model-call/response.js +1 -0
  175. package/dist/src/harness/model-call/retry.d.ts +11 -0
  176. package/dist/src/harness/model-call/retry.js +1 -0
  177. package/dist/src/harness/model-call/run.d.ts +38 -0
  178. package/dist/src/harness/model-call/run.js +1 -0
  179. package/dist/src/harness/model-call/tools.d.ts +48 -0
  180. package/dist/src/harness/model-call/tools.js +1 -0
  181. package/dist/src/harness/model-call/usage.d.ts +23 -0
  182. package/dist/src/harness/model-call/usage.js +1 -0
  183. package/dist/src/harness/nested-actions.d.ts +2 -2
  184. package/dist/src/harness/provider-tools.d.ts +2 -2
  185. package/dist/src/harness/provider-tools.js +1 -1
  186. package/dist/src/harness/proxy-input-requests.d.ts +4 -12
  187. package/dist/src/harness/proxy-input-requests.js +1 -1
  188. package/dist/src/harness/session-machine/commit.d.ts +28 -0
  189. package/dist/src/harness/session-machine/commit.js +1 -0
  190. package/dist/src/harness/session-machine/current.d.ts +29 -0
  191. package/dist/src/harness/session-machine/current.js +1 -0
  192. package/dist/src/harness/session-machine/events.d.ts +6 -0
  193. package/dist/src/harness/session-machine/events.js +1 -0
  194. package/dist/src/harness/session-machine/resolver-events.d.ts +12 -0
  195. package/dist/src/harness/session-machine/resolver-events.js +1 -0
  196. package/dist/src/harness/session-machine/state.d.ts +47 -0
  197. package/dist/src/harness/session-machine/state.js +1 -0
  198. package/dist/src/harness/session-machine/transitions.d.ts +188 -0
  199. package/dist/src/harness/session-machine/transitions.js +1 -0
  200. package/dist/src/harness/session-machine/view.d.ts +58 -0
  201. package/dist/src/harness/session-machine/view.js +1 -0
  202. package/dist/src/harness/step/after-model.d.ts +7 -0
  203. package/dist/src/harness/step/after-model.js +1 -0
  204. package/dist/src/harness/step/context.d.ts +59 -0
  205. package/dist/src/harness/step/context.js +1 -0
  206. package/dist/src/harness/step/intake.d.ts +34 -0
  207. package/dist/src/harness/step/intake.js +1 -0
  208. package/dist/src/harness/step/prompt.d.ts +37 -0
  209. package/dist/src/harness/step/prompt.js +1 -0
  210. package/dist/src/harness/step-hooks.d.ts +8 -13
  211. package/dist/src/harness/step-hooks.js +1 -1
  212. package/dist/src/harness/tool-loop.d.ts +7 -22
  213. package/dist/src/harness/tool-loop.js +1 -3
  214. package/dist/src/harness/tools.d.ts +13 -0
  215. package/dist/src/harness/tools.js +1 -1
  216. package/dist/src/harness/turn-tag-state.d.ts +1 -1
  217. package/dist/src/harness/types.d.ts +6 -0
  218. package/dist/src/instrumentation/ai-sdk-hook-bridge.d.ts +1 -1
  219. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  220. package/dist/src/instrumentation/content.js +1 -1
  221. package/dist/src/instrumentation/dispatch.js +1 -1
  222. package/dist/src/instrumentation/lifecycle.d.ts +28 -56
  223. package/dist/src/instrumentation/native-events.d.ts +2 -1
  224. package/dist/src/instrumentation/native-events.js +1 -1
  225. package/dist/src/instrumentation/provider.d.ts +1 -1
  226. package/dist/src/instrumentation/runtime-context.d.ts +2 -3
  227. package/dist/src/instrumentation/runtime-context.js +1 -1
  228. package/dist/src/instrumentation/runtime.d.ts +11 -1
  229. package/dist/src/instrumentation/runtime.js +1 -1
  230. package/dist/src/instrumentation/state.d.ts +6 -1
  231. package/dist/src/instrumentation/state.js +1 -1
  232. package/dist/src/internal/application/package.js +1 -1
  233. package/dist/src/internal/attachments/limited-read.d.ts +16 -0
  234. package/dist/src/internal/attachments/limited-read.js +1 -0
  235. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -1
  236. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  237. package/dist/src/internal/mcp/published-tools.d.ts +13 -0
  238. package/dist/src/internal/mcp/published-tools.js +1 -0
  239. package/dist/src/internal/mcp/request-trace-context.d.ts +12 -0
  240. package/dist/src/internal/mcp/request-trace-context.js +1 -0
  241. package/dist/src/internal/mcp/streamable-http-server.d.ts +7 -3
  242. package/dist/src/internal/mcp/streamable-http-server.js +1 -1
  243. package/dist/src/internal/model-auth/transport.d.ts +3 -3
  244. package/dist/src/internal/model-auth/transport.js +1 -1
  245. package/dist/src/models/auto.d.ts +5 -5
  246. package/dist/src/models/auto.js +2 -2
  247. package/dist/src/protocol/message.d.ts +7 -0
  248. package/dist/src/protocol/message.js +1 -1
  249. package/dist/src/protocol/session-projection.d.ts +159 -0
  250. package/dist/src/protocol/session-projection.js +1 -0
  251. package/dist/src/public/ai/index.d.ts +1 -1
  252. package/dist/src/public/ai/index.js +1 -1
  253. package/dist/src/public/channels/chat-sdk/attachment-refs.d.ts +15 -0
  254. package/dist/src/public/channels/chat-sdk/attachment-refs.js +1 -0
  255. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  256. package/dist/src/public/channels/chat-sdk/messageToUserContent.d.ts +11 -5
  257. package/dist/src/public/channels/chat-sdk/messageToUserContent.js +1 -1
  258. package/dist/src/public/channels/discord/attachments.d.ts +15 -0
  259. package/dist/src/public/channels/discord/attachments.js +1 -0
  260. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  261. package/dist/src/public/channels/discord/inbound.d.ts +13 -0
  262. package/dist/src/public/channels/discord/inbound.js +1 -1
  263. package/dist/src/public/channels/linear/inbound-uploads.d.ts +21 -0
  264. package/dist/src/public/channels/linear/inbound-uploads.js +1 -0
  265. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  266. package/dist/src/public/channels/linq/inboundContent.d.ts +7 -1
  267. package/dist/src/public/channels/linq/inboundContent.js +1 -1
  268. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  269. package/dist/src/public/channels/mcp.d.ts +17 -2
  270. package/dist/src/public/channels/mcp.js +1 -1
  271. package/dist/src/public/channels/photon/attachments.d.ts +21 -0
  272. package/dist/src/public/channels/photon/attachments.js +1 -0
  273. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  274. package/dist/src/public/channels/slack/attachments.d.ts +3 -1
  275. package/dist/src/public/channels/slack/attachments.js +1 -1
  276. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  277. package/dist/src/public/channels/teams/attachments.d.ts +4 -4
  278. package/dist/src/public/channels/teams/attachments.js +1 -1
  279. package/dist/src/public/channels/telegram/attachments.js +1 -1
  280. package/dist/src/public/channels/twilio/api.d.ts +7 -0
  281. package/dist/src/public/channels/twilio/api.js +1 -1
  282. package/dist/src/public/channels/twilio/inbound.d.ts +7 -0
  283. package/dist/src/public/channels/twilio/inbound.js +2 -2
  284. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  285. package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
  286. package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
  287. package/dist/src/react/index.d.ts +1 -0
  288. package/dist/src/react/index.js +1 -1
  289. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  290. package/dist/src/runtime/resolve-tool.js +1 -1
  291. package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -0
  292. package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
  293. package/dist/src/setup/cli/prompt-ui.d.ts +3 -0
  294. package/dist/src/setup/cli/prompt-ui.js +3 -1
  295. package/dist/src/setup/cli/select-component.d.ts +1 -0
  296. package/dist/src/setup/cli/select-component.js +1 -1
  297. package/dist/src/setup/flows/ensure-vercel-project.d.ts +2 -0
  298. package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
  299. package/dist/src/setup/integrations/discord/api.js +1 -1
  300. package/dist/src/setup/integrations/web/auth-options.d.ts +4 -0
  301. package/dist/src/setup/integrations/web/auth-options.js +1 -0
  302. package/dist/src/setup/integrations/web/auth-scaffold.d.ts +7 -0
  303. package/dist/src/setup/integrations/web/auth-scaffold.js +1 -0
  304. package/dist/src/setup/integrations/web/provision-auth.d.ts +3 -0
  305. package/dist/src/setup/integrations/web/provision-auth.js +1 -0
  306. package/dist/src/setup/integrations/web/setup.d.ts +11 -6
  307. package/dist/src/setup/integrations/web/setup.js +3 -3
  308. package/dist/src/setup/prompter.d.ts +2 -0
  309. package/dist/src/setup/prompter.js +1 -1
  310. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  311. package/dist/src/setup/scaffold/create/project.js +2 -2
  312. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  313. package/dist/src/setup/scaffold/create/web-template.js +1 -0
  314. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  315. package/dist/src/setup/vercel-project-api.d.ts +9 -0
  316. package/dist/src/setup/vercel-project-api.js +1 -1
  317. package/dist/src/setup/vercel-project.d.ts +4 -2
  318. package/dist/src/setup/vercel-project.js +0 -0
  319. package/dist/src/shared/web-search.d.ts +1 -1
  320. package/dist/src/subagents/adapter.js +1 -1
  321. package/dist/src/subagents/event-proxy-step.js +1 -1
  322. package/dist/src/subagents/hitl-proxy.d.ts +4 -28
  323. package/dist/src/subagents/hitl-proxy.js +1 -1
  324. package/dist/src/svelte/index.d.ts +2 -0
  325. package/dist/src/svelte/index.js +39 -2
  326. package/dist/src/svelte/use-eve-agent.js +1 -1
  327. package/dist/src/tools/approval/policies.d.ts +5 -5
  328. package/dist/src/tools/approval/policies.js +1 -1
  329. package/dist/src/tools/framework/agent.js +1 -1
  330. package/dist/src/tools/provided/agent-router.js +1 -1
  331. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  332. package/dist/src/tools/provided/ask-question.js +2 -2
  333. package/dist/src/tools/provided/bash.js +1 -1
  334. package/dist/src/tools/provided/framework-tool.d.ts +3 -0
  335. package/dist/src/tools/provided/framework-tool.js +1 -0
  336. package/dist/src/tools/provided/glob.js +2 -2
  337. package/dist/src/tools/provided/grep.js +2 -2
  338. package/dist/src/tools/provided/load-skill.js +1 -1
  339. package/dist/src/tools/provided/no-reply.js +1 -1
  340. package/dist/src/tools/provided/read-file.js +2 -2
  341. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  342. package/dist/src/tools/provided/sleep.js +1 -1
  343. package/dist/src/tools/provided/task-cancel.js +1 -1
  344. package/dist/src/tools/provided/task-wait.js +1 -1
  345. package/dist/src/tools/provided/web-fetch.js +2 -2
  346. package/dist/src/tools/provided/web-search.js +1 -1
  347. package/dist/src/tools/provided/workflow.js +1 -1
  348. package/dist/src/tools/provided/write-file.js +2 -2
  349. package/dist/src/tracing/agent-approval-instrumentation.d.ts +2 -2
  350. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  351. package/dist/src/tracing/agent-otel-provider.js +2 -2
  352. package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
  353. package/dist/src/tracing/agent-otel-usage.js +1 -1
  354. package/dist/src/tracing/agent-span-contract.d.ts +0 -1
  355. package/dist/src/tracing/agent-span-contract.js +1 -1
  356. package/dist/src/tracing/agent-tool-instrumentation.d.ts +16 -6
  357. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  358. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  359. package/dist/src/tracing/agent-trace-state.d.ts +7 -3
  360. package/dist/src/tracing/invoke-tool-span.js +1 -1
  361. package/dist/src/tracing/local-trace-analysis.js +1 -1
  362. package/dist/src/vue/index.d.ts +2 -0
  363. package/dist/src/vue/index.js +39 -2
  364. package/dist/src/vue/use-eve-agent.js +1 -1
  365. package/docs/agent-config.md +2 -2
  366. package/docs/channels/chat-sdk.mdx +3 -1
  367. package/docs/channels/custom.mdx +2 -0
  368. package/docs/channels/discord.mdx +5 -4
  369. package/docs/channels/eve.mdx +65 -0
  370. package/docs/channels/linear.mdx +1 -1
  371. package/docs/channels/linq.mdx +2 -0
  372. package/docs/channels/mcp.mdx +39 -1
  373. package/docs/channels/photon.mdx +5 -0
  374. package/docs/channels/teams.mdx +4 -7
  375. package/docs/channels/twilio.mdx +1 -1
  376. package/docs/concepts/built-in-tools.md +12 -0
  377. package/docs/concepts/sessions-runs-and-streaming.md +3 -3
  378. package/docs/connections/overview.mdx +1 -1
  379. package/docs/dynamic-configuration/meta.json +1 -1
  380. package/docs/evals/judge.mdx +16 -16
  381. package/docs/evals/overview.mdx +1 -1
  382. package/docs/guides/{evaluate.md → decide.md} +35 -35
  383. package/docs/guides/dynamic-capabilities.md +1 -1
  384. package/docs/guides/frontend/overview.mdx +3 -1
  385. package/docs/guides/hooks.md +1 -1
  386. package/docs/guides/instrumentation/instrumentation.mdx +23 -22
  387. package/docs/guides/instrumentation/otel.mdx +13 -2
  388. package/docs/reference/cli.md +3 -3
  389. package/docs/reference/typescript-api.md +4 -2
  390. package/docs/tools/human-in-the-loop.md +6 -4
  391. package/docs/tools/workflows.mdx +4 -4
  392. package/package.json +11 -11
  393. package/dist/src/ai/evaluate.d.ts +0 -7
  394. package/dist/src/ai/evaluate.js +0 -1
  395. package/dist/src/client/message-task-parts.d.ts +0 -8
  396. package/dist/src/client/message-task-parts.js +0 -1
  397. package/dist/src/compiled/_chunks/workflow/dist-C3ZE62yI.js +0 -25
  398. package/dist/src/compiled/_chunks/workflow/experimental-evaluation-Dm32egEG.js +0 -5
  399. package/dist/src/harness/active-turn-id.d.ts +0 -11
  400. package/dist/src/harness/active-turn-id.js +0 -1
  401. package/dist/src/harness/approval-candidates.js +0 -1
  402. package/dist/src/harness/approval-delivery-coordinator.js +0 -1
  403. package/dist/src/harness/approved-call-callers.d.ts +0 -11
  404. package/dist/src/harness/approved-call-callers.js +0 -1
  405. package/dist/src/harness/cancelled-turn-emission.d.ts +0 -12
  406. package/dist/src/harness/cancelled-turn-emission.js +0 -1
  407. package/dist/src/harness/emission-state.d.ts +0 -36
  408. package/dist/src/harness/emission-state.js +0 -1
  409. package/dist/src/harness/held-requests.d.ts +0 -18
  410. package/dist/src/harness/held-requests.js +0 -1
  411. package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -27
  412. package/dist/src/harness/hitl/approval-input-requests.js +0 -1
  413. package/dist/src/harness/hitl/pending-input-resolution.d.ts +0 -54
  414. package/dist/src/harness/hitl/pending-input-resolution.js +0 -1
  415. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +0 -12
  416. package/dist/src/harness/hitl/session-limit-input-requests.js +0 -1
  417. package/dist/src/harness/input-requests.d.ts +0 -37
  418. package/dist/src/harness/input-requests.js +0 -1
  419. package/dist/src/harness/pending-input-batches.d.ts +0 -81
  420. package/dist/src/harness/pending-input-batches.js +0 -1
  421. package/dist/src/harness/session-limit-enforcement.d.ts +0 -45
  422. package/dist/src/harness/session-limit-enforcement.js +0 -1
  423. package/dist/src/harness/stale-input-responses.js +0 -3
  424. package/dist/src/harness/workflow-dispatch.d.ts +0 -30
  425. package/dist/src/harness/workflow-dispatch.js +0 -1
  426. package/dist/src/public/channels/linear/inbound-images.d.ts +0 -19
  427. package/dist/src/public/channels/linear/inbound-images.js +0 -1
  428. package/dist/src/tracing/agent-action-instrumentation.d.ts +0 -26
  429. package/dist/src/tracing/agent-action-instrumentation.js +0 -1
  430. /package/dist/src/harness/{compaction.d.ts → compaction/engine.d.ts} +0 -0
  431. /package/dist/src/harness/{compaction-prompt.d.ts → compaction/prompt.d.ts} +0 -0
  432. /package/dist/src/harness/{compaction-prompt.js → compaction/prompt.js} +0 -0
  433. /package/dist/src/harness/{session-limit-continuation.d.ts → hitl/budget-request.d.ts} +0 -0
  434. /package/dist/src/harness/{session-limit-continuation.js → hitl/budget-request.js} +0 -0
  435. /package/dist/src/harness/{approval-delivery-coordinator.d.ts → hitl/coordinator.d.ts} +0 -0
  436. /package/dist/src/harness/{model-call-error.js → model-call/errors.js} +0 -0
@@ -1,37 +0,0 @@
1
- import type { ModelMessage } from "ai";
2
- import type { InputRequest } from "#shared/input.js";
3
- import { getApprovedTools } from "#harness/hitl/approval-input-requests.js";
4
- import type { RejectedActionBatch } from "#harness/hitl/approval-input-requests.js";
5
- import type { PendingInputBatch } from "#harness/pending-input-batches.js";
6
- import type { ResolvePendingInputResult } from "#harness/hitl/pending-input-resolution.js";
7
- import { clearPendingSessionLimitPrompt } from "#harness/hitl/session-limit-input-requests.js";
8
- import type { HarnessSession, StepInput } from "#harness/types.js";
9
- export { getApprovedTools, clearPendingSessionLimitPrompt };
10
- export type { RejectedActionBatch };
11
- export type { ResolvedInputBatch } from "#harness/input-request-resolution.js";
12
- export { appendPendingInputBatch, consumeDeferredStepInput, getPendingInputRequestIds, hasPendingInputBatch, } from "#harness/pending-input-batches.js";
13
- /** Returns true when the step input carries user-facing turn input. */
14
- export declare function hasStepInput(input?: StepInput): boolean;
15
- /** Stored partial answers are not runnable work until they can resolve a batch. */
16
- export declare function hasRunnableDeferredStepInput(session: HarnessSession): boolean;
17
- /** Selects the complete approval batch that pending-input resolution will resume. */
18
- export declare function selectApprovalReplayBatch(session: HarnessSession, stepInput?: StepInput): PendingInputBatch | undefined;
19
- /**
20
- * Resolves pending input at the start of a harness step.
21
- *
22
- * Ordered batches remain independently answerable. Session-limit prompts own
23
- * resolution while open; approval batches preserve AI SDK's tail-message
24
- * requirement.
25
- */
26
- export declare function resolvePendingInput(input: {
27
- readonly history?: readonly ModelMessage[];
28
- readonly resolveApprovalKey?: (request: InputRequest) => string | undefined;
29
- readonly session: HarnessSession;
30
- readonly stepInput?: StepInput;
31
- }): ResolvePendingInputResult;
32
- /**
33
- * Answers an open budget prompt from new input's text before that input joins
34
- * a message deferred behind the prompt. Joined, the text no longer matches an
35
- * option, so the answer would queue behind the message it should release.
36
- */
37
- export declare function answerSessionLimitFromText(session: HarnessSession, stepInput: StepInput | undefined): StepInput | undefined;
@@ -1 +0,0 @@
1
- import{readClientContext}from"#internal/client-context.js";import{readAnswerText}from"#internal/input-text.js";import{resolveTextToResponses}from"#channel/resolve-text.js";import{appendPendingInputBatch,consumeDeferredStepInput,getDeferredStepInput,getPendingInputBatches,getPendingInputRequestIds,hasPendingInputBatch,queueDeferredStepInput}from"#harness/pending-input-batches.js";import{findAnsweredApprovalBatches,getApprovedTools,resolveApprovalInputBatches}from"#harness/hitl/approval-input-requests.js";import{isApprovalRequest}from"#harness/input-request-class.js";import{compactStepInput,finishResolvedInput}from"#harness/hitl/pending-input-resolution.js";import{hasTailApprovalResponse}from"#harness/current-messages.js";import{clearPendingSessionLimitPrompt,isSessionLimitInputBatch,resolveSessionLimitInput}from"#harness/hitl/session-limit-input-requests.js";function hasStepInput(e){return e===void 0?!1:e.message!==void 0||(e.inputResponses?.length??0)>0}function hasRunnableDeferredStepInput(e){let t=getDeferredStepInput(e);if(t===void 0)return!1;if(t.message!==void 0||(t.context?.length??0)>0||readClientContext(t)!==void 0||t.outputSchema!==void 0||(t.runtimeActionResults?.length??0)>0)return!0;let n=[...t.inputResponses??[],...(t.attributedInputResponses??[]).map(({response:e})=>e)];if(n.length===0)return!1;let r=getPendingInputBatches(e.state),i=routePendingInput(r);switch(i.kind){case`session-limit`:return i.batch.requests.every(e=>n.some(t=>t.requestId===e.requestId));case`approvals`:return findAnsweredApprovalBatches(r,n).length>0}}function selectApprovalReplayBatch(e,t){let n=getPendingInputBatches(e.state);if(n.some(isSessionLimitInputBatch))return;let r=canonicalizeInputResponses((n.length===1?resolveTextMessageInput(n[0],t):t)?.inputResponses??[]),i=findAnsweredApprovalBatches(n,r)[0];return i?.requests.some(e=>isApprovalRequest(e)&&r.some(t=>t.requestId===e.requestId&&t.optionId===`approve`))?i:void 0}function resolvePendingInput(e){let t=[...e.history??e.session.history],n=getPendingInputBatches(e.session.state),r=routePendingInput(n);if(r.kind===`approvals`&&hasTailApprovalResponse(t)&&(n.length>0||hasApprovedTailResponse(t)))return finishResolvedInput({deferTurnInput:!0,leftoverResponses:e.stepInput?.inputResponses??[],messages:t,resolvedStepInput:e.stepInput,session:e.session});if(n.length===0)return{outcome:`continue`,messages:t,session:e.session};let i=hasTailApprovalResponse(t),a=r.kind===`session-limit`?r.batch:n.length===1?n[0]:void 0,o=a===void 0?e.stepInput:resolveTextMessageInput(a,e.stepInput),s=canonicalizeInputResponses(o?.inputResponses??[]);if(s.length===0&&o?.message===void 0){let n=compactStepInput(o);return{outcome:`unresolved`,messages:t,session:n.context!==void 0||readClientContext(n)!==void 0||n.outputSchema!==void 0?queueDeferredStepInput(e.session,n):e.session}}let c={baseHistory:t,batches:n,deferTurnInput:i,resolvedStepInput:o,responses:s,session:e.session};switch(r.kind){case`session-limit`:return resolveSessionLimitInput({...c,pendingBatch:r.batch});case`approvals`:return resolveApprovalInputBatches({...c,resolveApprovalKey:e.resolveApprovalKey})}}function answerSessionLimitFromText(e,t){if(t===void 0||getDeferredStepInput(e)===void 0)return t;let n=getPendingInputBatches(e.state).find(isSessionLimitInputBatch);return n===void 0?t:resolveTextMessageInput(n,t)}function routePendingInput(e){let t=e.find(e=>isSessionLimitInputBatch(e));if(t!==void 0)return{batch:t,kind:`session-limit`};for(let t of e)for(let e of t.requests)if(!isApprovalRequest(e))throw TypeError(`Unhandled pending input request kind: ${e.kind}`);return{kind:`approvals`}}function hasApprovedTailResponse(e){let t=e.at(-1);return t?.role===`tool`&&t.content.some(e=>e.type===`tool-approval-response`&&e.approved)}function canonicalizeInputResponses(e){let t=new Map;for(let n of e)t.set(n.requestId,n);return[...t.values()]}function resolveTextMessageInput(e,t){let n=readAnswerText(t);if(t===void 0||n===void 0)return t;let r=new Set(e.requests.map(e=>e.requestId));if(t.inputResponses?.some(e=>r.has(e.requestId)))return t;let i=new Set(e.responseAuthRequiredRequestIds??[]),a=e.requests.filter(e=>!i.has(e.requestId)),o=resolveTextToResponses(n,a);return o.length===0?t:compactStepInput({...t,inputResponses:[...t.inputResponses??[],...o],messageConsumed:!0,message:void 0})}export{answerSessionLimitFromText,appendPendingInputBatch,clearPendingSessionLimitPrompt,consumeDeferredStepInput,getApprovedTools,getPendingInputRequestIds,hasPendingInputBatch,hasRunnableDeferredStepInput,hasStepInput,resolvePendingInput,selectApprovalReplayBatch};
@@ -1,81 +0,0 @@
1
- import type { ModelMessage } from "ai";
2
- import type { SessionAuthContext } from "#channel/types.js";
3
- import type { InputRequest } from "#shared/input.js";
4
- import type { HarnessSession, SessionStateMap, StepInput } from "#harness/types.js";
5
- /**
6
- * Stream-emit coordinates carried so a parked batch's resolution can attribute
7
- * its events to the turn and step that requested the input.
8
- */
9
- export interface PendingInputBatchEvent {
10
- readonly sequence: number;
11
- readonly stepIndex: number;
12
- readonly turnId: string;
13
- }
14
- /**
15
- * Serializable pending input batch stored on the session state: one parked
16
- * assistant turn's requests plus its withheld model output.
17
- */
18
- export interface PendingInputBatch {
19
- readonly event?: PendingInputBatchEvent;
20
- readonly requests: readonly InputRequest[];
21
- /**
22
- * Auth of the caller whose turn parked the batch, captured when it parked;
23
- * `null` when that caller was unauthenticated.
24
- */
25
- readonly requester?: SessionAuthContext | null;
26
- readonly responseAuthRequiredRequestIds?: readonly string[];
27
- readonly responseMessages: readonly ModelMessage[];
28
- }
29
- /**
30
- * Returns true when the session holds at least one pending HITL batch
31
- * (tool approvals or a session-limit continuation prompt).
32
- */
33
- export declare function hasPendingInputBatch(state: SessionStateMap | undefined): boolean;
34
- /**
35
- * Returns the request IDs across every pending HITL batch.
36
- */
37
- export declare function getPendingInputRequestIds(state: SessionStateMap | undefined): ReadonlySet<string>;
38
- /**
39
- * Reads the ordered pending batches. Sessions parked before the collection
40
- * shape carry the legacy singleton key; it reads as a one-element list and
41
- * is rewritten to the list shape on the next batch write.
42
- */
43
- export declare function getPendingInputBatches(state: SessionStateMap | undefined): readonly PendingInputBatch[];
44
- /**
45
- * Removes the given batches (matched by identity from a prior
46
- * {@link getPendingInputBatches} read) and keeps every other batch open.
47
- *
48
- * Removal is the only exported way to shrink the collection: a wholesale
49
- * setter would reintroduce the overwrite hazard the collection exists to
50
- * prevent — a writer clobbering batches it never resolved.
51
- */
52
- export declare function removePendingInputBatches(session: HarnessSession, batches: readonly PendingInputBatch[]): HarnessSession;
53
- /**
54
- * Appends one pending HITL batch for a parked assistant turn. Earlier
55
- * batches stay open and independently answerable.
56
- */
57
- export declare function appendPendingInputBatch(input: {
58
- readonly event?: PendingInputBatchEvent;
59
- readonly requests: readonly InputRequest[];
60
- readonly responseAuthRequiredRequestIds?: readonly string[];
61
- readonly responseMessages: readonly ModelMessage[];
62
- readonly session: HarnessSession;
63
- }): HarnessSession;
64
- /** The requester recorded on the pending batch that holds `requestId`. */
65
- export declare function pendingInputRequester(state: SessionStateMap | undefined, requestId: string): SessionAuthContext | null;
66
- /**
67
- * Merges any queued follow-up input into the current step input and clears it
68
- * from session state.
69
- *
70
- * Used when the harness has to process a pending tool-approval response first
71
- * and defer the user's new message to the next internal model step.
72
- */
73
- export declare function consumeDeferredStepInput(input: {
74
- readonly input?: StepInput;
75
- readonly session: HarnessSession;
76
- }): {
77
- readonly input?: StepInput;
78
- readonly session: HarnessSession;
79
- };
80
- export declare function getDeferredStepInput(session: HarnessSession): StepInput | undefined;
81
- export declare function queueDeferredStepInput(session: HarnessSession, input: StepInput): HarnessSession;
@@ -1 +0,0 @@
1
- import{contextStorage}from"#context/container.js";import{AuthKey,SessionKey}from"#context/keys.js";import{coalesceTurnInputs}from"#harness/messages.js";const PENDING_INPUT_BATCHES_KEY=`eve.runtime.pendingInputBatches`,LEGACY_PENDING_INPUT_BATCH_KEY=`eve.runtime.pendingInputBatch`,DEFERRED_STEP_INPUT_KEY=`eve.runtime.deferredStepInput`;function hasPendingInputBatch(e){return getPendingInputBatches(e).length>0}function getPendingInputRequestIds(e){return new Set(getPendingInputBatches(e).flatMap(e=>e.requests.map(e=>e.requestId)))}function coercePendingInputBatch(e){if(typeof e!=`object`||!e)return;let t=e;if(Array.isArray(t.requests)&&Array.isArray(t.responseMessages))return t}function getPendingInputBatches(e){let t=e?.[PENDING_INPUT_BATCHES_KEY];if(Array.isArray(t)){let e=t.map(e=>coercePendingInputBatch(e)).filter(e=>e!==void 0);return assertUniqueRequestIds(e),e}let n=coercePendingInputBatch(e?.[LEGACY_PENDING_INPUT_BATCH_KEY]),r=n===void 0?[]:[n];return assertUniqueRequestIds(r),r}function assertUniqueRequestIds(e){let t=new Set;for(let n of e)for(let e of n.requests){if(t.has(e.requestId))throw TypeError(`Internal pending input invariant violated: requestId must be unique across all pending batches: ${JSON.stringify(e.requestId)}.`);t.add(e.requestId)}}function removePendingInputBatches(e,t){let n=new Set(t);return setPendingInputBatches(e,getPendingInputBatches(e.state).filter(e=>!n.has(e)))}function setPendingInputBatches(e,t){assertUniqueRequestIds(t);let n={...e.state};return delete n[LEGACY_PENDING_INPUT_BATCH_KEY],t.length===0?delete n[PENDING_INPUT_BATCHES_KEY]:n[PENDING_INPUT_BATCHES_KEY]=t.map(e=>({event:e.event,requester:e.requester,responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,requests:[...e.requests],responseMessages:[...e.responseMessages]})),{...e,state:Object.keys(n).length>0?n:void 0}}function appendPendingInputBatch(e){return setPendingInputBatches(e.session,[...getPendingInputBatches(e.session.state),{event:e.event,requester:currentRequester(),responseAuthRequiredRequestIds:e.responseAuthRequiredRequestIds,requests:e.requests,responseMessages:e.responseMessages}])}function currentRequester(){let e=contextStorage.getStore(),t=e?.get(AuthKey)??e?.get(SessionKey)?.auth.current??null;return t?.principalType===`anonymous`?null:t}function pendingInputRequester(e,t){return getPendingInputBatches(e).find(e=>e.requests.some(e=>e.requestId===t))?.requester??null}function consumeDeferredStepInput(e){let t=getDeferredStepInput(e.session);if(t===void 0)return e;let n=clearDeferredStepInput(e.session);return e.input===void 0?{input:t,session:n}:{input:coalesceTurnInputs(t,e.input),session:n}}function getDeferredStepInput(e){return e.state?.[DEFERRED_STEP_INPUT_KEY]}function queueDeferredStepInput(e,t){let n=getDeferredStepInput(e),r=n===void 0?t:coalesceTurnInputs(n,t),i={...e.state};return i[DEFERRED_STEP_INPUT_KEY]=r,{...e,state:i}}function clearDeferredStepInput(e){if(e.state?.[DEFERRED_STEP_INPUT_KEY]===void 0)return e;let t={...e.state};return delete t[DEFERRED_STEP_INPUT_KEY],{...e,state:Object.keys(t).length>0?t:void 0}}export{appendPendingInputBatch,consumeDeferredStepInput,getDeferredStepInput,getPendingInputBatches,getPendingInputRequestIds,hasPendingInputBatch,pendingInputRequester,queueDeferredStepInput,removePendingInputBatches};
@@ -1,45 +0,0 @@
1
- import { type HarnessEmissionState } from "#harness/emission.js";
2
- import type { HarnessModelMessage } from "#harness/messages.js";
3
- import type { HarnessSession, StepResult, ToolLoopHarnessConfig } from "#harness/types.js";
4
- interface SessionLimitPolicyInput {
5
- readonly config: ToolLoopHarnessConfig;
6
- readonly emit?: ToolLoopHarnessConfig["handleEvent"];
7
- readonly emissionState: HarnessEmissionState;
8
- readonly session: HarnessSession;
9
- }
10
- /**
11
- * Acts on a resolved session-limit continuation answer.
12
- *
13
- * Granted: bumps the runtime token limits via
14
- * {@link bumpSessionRuntimeUsageLimits} and lets the step continue
15
- * transparently.
16
- * Declined: a user decision, not an error — the decline cancels the
17
- * in-flight turn tree through the standard cancellation path, settling as
18
- * `turn.cancelled` → `session.waiting` with no failure surfaced anywhere.
19
- * The harness only declares the intent by throwing
20
- * {@link SessionLimitDeclinedError}; the execution layer detects it at the
21
- * step boundary and cancels the root turn, whose cancelled arm cascades to
22
- * every descendant, so the delegating parent never receives an error result
23
- * it could retry against a fresh budget share.
24
- *
25
- * Returns `result: null` when the step should continue with `session`.
26
- */
27
- export declare function applySessionLimitContinuation(input: SessionLimitPolicyInput & {
28
- readonly limitContinuation: {
29
- readonly granted: boolean;
30
- } | undefined;
31
- }): Promise<{
32
- readonly result: StepResult | null;
33
- readonly session: HarnessSession;
34
- }>;
35
- /**
36
- * Pre-model-call gate for the session token budget.
37
- *
38
- * Returns `null` when the session is within budget. Over budget, sessions
39
- * that can request input park on the deterministic continuation prompt;
40
- * others fail fast with `SESSION_TOKEN_LIMIT_REACHED`.
41
- */
42
- export declare function enforceSessionUsageLimit(input: SessionLimitPolicyInput & {
43
- readonly messages: readonly HarnessModelMessage[];
44
- }): Promise<StepResult | null>;
45
- export {};
@@ -1 +0,0 @@
1
- import{createInputRequestedEvent}from"#protocol/message.js";import{emitFailedStep,emitTurnEpilogue,setHarnessEmissionState}from"#harness/emission.js";import{bumpSessionRuntimeUsageLimits,getSessionTokenUsage,getSessionUsage,getSessionUsageLimitViolation}from"#harness/turn-tag-state.js";import{SessionLimitDeclinedError}from"#harness/turn-cancellation.js";import{appendPendingInputBatch}from"#harness/input-requests.js";import{createSessionLimitContinuationRequest}from"#harness/session-limit-continuation.js";async function applySessionLimitContinuation(e){if(e.limitContinuation===void 0)return{result:null,session:e.session};if(e.limitContinuation.granted)return{result:null,session:bumpSessionRuntimeUsageLimits(e.session)};throw new SessionLimitDeclinedError}async function enforceSessionUsageLimit(e){let t=getSessionUsageLimitViolation(e.session);if(t===null)return null;let{emit:n}=e;return violationWindow(t)>0&&n!==void 0&&e.config.capabilities?.requestInput===!0?parkOnSessionUsageLimit({...e,emit:n,violation:t}):failSessionUsageLimit({...e,violation:t})}async function parkOnSessionUsageLimit(e){let t=createSessionLimitContinuationRequest({sessionId:e.session.sessionId,turnSequence:e.emissionState.sequence,violation:e.violation}),n=e.emissionState,r=appendPendingInputBatch({event:{sequence:n.sequence,stepIndex:n.stepIndex,turnId:n.turnId},requests:[t],responseMessages:[],session:{...e.session,history:[...e.messages]}});return await e.emit(createInputRequestedEvent({requests:[t],sequence:n.sequence,stepIndex:n.stepIndex,turnId:n.turnId})),n=await emitTurnEpilogue(e.emit,n,r.history,getSessionUsage(r)),{next:null,session:setHarnessEmissionState(r,n)}}function violationWindow(e){return e.kind===`token-cost`?e.limitUsd:e.limit}function formatSessionLimitMessage(e){return e===`token-cost`?`The session reached its configured model token-cost limit.`:`The session reached its configured ${e} token limit.`}async function failSessionUsageLimit(e){let t=getSessionTokenUsage(e.session),n=formatSessionLimitMessage(e.violation.kind),r=e.violation.kind===`token-cost`?{costUsd:t.costUsd,kind:e.violation.kind,limitUsd:e.violation.limitUsd,usedCostUsd:e.violation.usedCostUsd}:{inputTokens:t.inputTokens,kind:e.violation.kind,limit:e.violation.limit,outputTokens:t.outputTokens,usedTokens:e.violation.usedTokens};return e.emit&&await emitFailedStep(e.emit,e.emissionState,{code:e.violation.kind===`token-cost`?`SESSION_TOKEN_COST_LIMIT_REACHED`:`SESSION_TOKEN_LIMIT_REACHED`,details:r,message:n,sessionId:e.session.sessionId,usage:getSessionUsage(e.session)}),{next:{done:!0,output:``},session:e.session}}export{applySessionLimitContinuation,enforceSessionUsageLimit};
@@ -1,3 +0,0 @@
1
- import{appendUserContent,normalizeUserContent}from"#harness/messages.js";import{extractHistoricalInputRequests}from"#harness/input-extraction.js";import{isSessionLimitContinuationRequestId}from"#harness/session-limit-continuation.js";function dropStaleSessionLimitContinuationResponses(e){if(e.stepInput===void 0)return;let t=e.stepInput.inputResponses??[],n=e.stepInput.attributedInputResponses??[],keep=t=>e.pendingRequestIds.has(t)||!isSessionLimitContinuationRequestId(t),r=t.filter(e=>keep(e.requestId)),i=n.filter(({response:e})=>keep(e.requestId));if(r.length===t.length&&i.length===n.length)return e.stepInput;let{attributedInputResponses:a,inputResponses:o,...s}=e.stepInput,c=s;return r.length>0&&(c.inputResponses=r),i.length>0&&(c.attributedInputResponses=i),c}function convertStaleResponsesToUserMessage(e){if(e.stepInput===void 0)return{kind:`unchanged`};let t=e.stepInput.inputResponses??[],n=e.stepInput.attributedInputResponses??[];if(t.length===0&&n.length===0)return{kind:`unchanged`,stepInput:e.stepInput};let r=[],i=[],a=[];for(let n of t)(e.pendingRequestIds.has(n.requestId)?r:a).push(n);for(let t of n)e.pendingRequestIds.has(t.response.requestId)?i.push(t):a.push(t.response);if(a.length===0)return{kind:`unchanged`,stepInput:e.stepInput};let o=extractHistoricalInputRequests({history:e.history,requestIds:new Set(a.map(e=>e.requestId))}),s=appendOptionalUserContent(e.stepInput.message,formatModelMessage(a,o)),c=appendOptionalUserContent(e.stepInput.message,formatDisplayMessage(a,o)),{attributedInputResponses:l,inputResponses:u,...d}=e.stepInput,f={...d,message:s};return r.length>0&&(f.inputResponses=r),i.length>0&&(f.attributedInputResponses=i),{displayMessage:c,kind:`converted`,stepInput:f}}function formatModelMessage(e,t){let n=e.map(e=>{let n=t.get(e.requestId),r=n?.options?.find(t=>t.id===e.optionId),i={};if(e.optionId!==void 0&&(i.optionId=e.optionId),r!==void 0){let e={id:r.id,label:r.label};r.description!==void 0&&(e.description=r.description),i.selectedOption=e}e.text!==void 0&&(i.text=e.text);let a={requestId:e.requestId,response:i};return n!==void 0&&(a.prompt=n.prompt,a.requestType=`approval`,a.toolName=n.action.toolName),a});return[`The user submitted the following response to an earlier interactive prompt.`,`Treat it as new input at the current point in the conversation and decide whether it is still relevant. This does not authorize an earlier action; request approval again if that action is still needed.`,JSON.stringify(n,null,2)].join(`
2
- `)}function formatDisplayMessage(e,t){return e.map(e=>e.text!==void 0&&e.text.length>0?e.text:t.get(e.requestId)?.options?.find(t=>t.id===e.optionId)?.label??e.optionId??`Response to an earlier interactive prompt`).join(`
3
- `)}function appendOptionalUserContent(e,t){let n=normalizeUserContent(e);return n===void 0?t:appendUserContent({appended:t,existing:n})}export{convertStaleResponsesToUserMessage,dropStaleSessionLimitContinuationResponses};
@@ -1,30 +0,0 @@
1
- import type { ModelMessage } from "ai";
2
- import { type CoordinationToolCall } from "#harness/coordination.js";
3
- import type { ResolvedInputBatch } from "#harness/input-request-resolution.js";
4
- import type { HarnessSession, HarnessToolMap } from "#harness/types.js";
5
- import type { RuntimeWorkflowTaskRequest } from "#shared/action-types.js";
6
- /**
7
- * Parks the step on the workflow tools a person just approved. The approval
8
- * tool message moves into the batch's response so workflow results join it:
9
- * AI SDK then resumes approved sibling tools without replaying the workflows.
10
- */
11
- export declare function dispatchApprovedWorkflowCalls(input: {
12
- readonly messages: readonly ModelMessage[];
13
- readonly resolvedInputs: readonly ResolvedInputBatch[] | undefined;
14
- readonly session: HarnessSession;
15
- readonly tools: HarnessToolMap;
16
- }): HarnessSession | undefined;
17
- /**
18
- * Turns a step's deferred calls into workflow runs, committing a task record
19
- * for each call that starts a task. Task tool calls stay in the response
20
- * alone: the session reads them from there.
21
- */
22
- export declare function collectDeferredCalls(input: {
23
- readonly session: HarnessSession;
24
- readonly toolCalls: readonly CoordinationToolCall[];
25
- readonly tools: HarnessToolMap;
26
- readonly turnId: string;
27
- }): {
28
- readonly session: HarnessSession;
29
- readonly workflowRequests: readonly RuntimeWorkflowTaskRequest[];
30
- };
@@ -1 +0,0 @@
1
- import{validateHarnessModelMessages}from"#harness/messages.js";import{createCoordinationRequestFromToolCall,resolveToolCallInputObject,setPendingCoordinationBatch}from"#harness/coordination.js";import{approverOfRequest}from"#harness/approval-candidates.js";import{hasTailApprovalResponse}from"#harness/current-messages.js";import{commitCallEntry,isTaskTool}from"#execution/tasks/model-step.js";function dispatchApprovedWorkflowCalls(e){for(let t of e.resolvedInputs??[]){let n=t.inputs.filter(({outcome:t,request:n})=>t===`approved`&&e.tools.get(n.action.toolName)?.workflowId!==void 0);if(n.length===0)continue;if(!hasTailApprovalResponse(e.messages))throw Error(`Approved workflow calls must follow their approval tool message.`);let r=collectDeferredCalls({session:e.session,toolCalls:n.map(({request:e})=>({input:e.action.input,toolCallId:e.action.callId,toolName:e.action.toolName})),tools:e.tools,turnId:t.event.turnId}),i={};for(let{request:t}of n){let n=approverOfRequest(e.session.state,t.requestId);n!==void 0&&(i[t.action.callId]=n)}return setPendingCoordinationBatch({approvers:i,tasks:r.workflowRequests,event:t.event,responseMessages:e.messages.slice(-1),session:{...r.session,history:validateHarnessModelMessages(e.messages.slice(0,-1))}})}}function collectDeferredCalls(e){let{session:t}=e,n=[];for(let r of e.toolCalls){let i=e.tools.get(r.toolName);if(isTaskTool(i))continue;let a=commitCallEntry(t,{callId:r.toolCallId,definition:i,input:resolveToolCallInputObject(r.input,{callId:r.toolCallId,toolName:r.toolName}),toolName:r.toolName,turnId:e.turnId});t=a.session,n.push(createCoordinationRequestFromToolCall({entry:a.entry,input:a.input,toolCall:r,tools:e.tools}))}return{session:t,workflowRequests:n}}export{collectDeferredCalls,dispatchApprovedWorkflowCalls};
@@ -1,19 +0,0 @@
1
- import type { UserContent } from "ai";
2
- import type { LinearFetch } from "#public/channels/linear/api.js";
3
- import { type LinearChannelCredentials } from "#public/channels/linear/auth.js";
4
- /** One trusted Linear upload referenced by markdown image syntax. */
5
- interface LinearUploadImageReference {
6
- readonly altText: string;
7
- readonly end: number;
8
- readonly start: number;
9
- readonly url: URL;
10
- }
11
- /** Extracts markdown image references that target Linear's exact upload origin. */
12
- export declare function extractLinearUploadImageReferences(markdown: string): readonly LinearUploadImageReference[];
13
- /** Adds authenticated Linear upload images to otherwise text-only inbound content. */
14
- export declare function attachLinearInboundImages(input: {
15
- readonly content: UserContent;
16
- readonly credentials?: LinearChannelCredentials;
17
- readonly fetch?: LinearFetch;
18
- }): Promise<UserContent>;
19
- export {};
@@ -1 +0,0 @@
1
- import{resolveLinearAccessToken}from"#public/channels/linear/auth.js";const MARKDOWN_IMAGE_PATTERN=/!\[([^\]\r\n]*)\]\(\s*(?:<([^>\r\n]+)>|([^\s)\r\n]+))(?:\s+(?:"[^"\r\n]*"|'[^'\r\n]*'|\([^)\r\n]*\)))?\s*\)/gu;function extractLinearUploadImageReferences(e){let t=[];for(let n of e.matchAll(MARKDOWN_IMAGE_PATTERN)){let e=n[2]??n[3],r=n.index;if(e===void 0||r===void 0)continue;let i=parseLinearUploadUrl(e);i!==null&&t.push({altText:n[1]??``,end:r+n[0].length,start:r,url:i})}return t}async function attachLinearInboundImages(e){if(typeof e.content!=`string`)return e.content;let t=extractLinearUploadImageReferences(e.content);if(t.length===0)return e.content;let n;try{n=await resolveLinearAccessToken(e.credentials?.accessToken)}catch{return e.content}let r=e.fetch??fetch,i=await Promise.all(t.map(e=>fetchLinearUploadImage(e.url,n,r)));return i.every(e=>e===null)?e.content:buildLinearImageContent(e.content,t,i)}function parseLinearUploadUrl(e){let t;try{t=new URL(e)}catch{return null}return t.origin!==`https://uploads.linear.app`||t.username!==``||t.password!==``?null:t}async function fetchLinearUploadImage(e,t,n){if(parseLinearUploadUrl(e.href)===null)return null;try{let r=await n(e.href,{credentials:`omit`,headers:{accept:`image/*`,authorization:`Bearer ${t}`},redirect:`manual`});if(!r.ok)return null;let i=readImageMediaType(r.headers.get(`content-type`));return i===null?null:{data:Buffer.from(await r.arrayBuffer()),mediaType:i,type:`file`}}catch{return null}}function readImageMediaType(e){let t=e?.split(`;`,1)[0]?.trim().toLowerCase();return t?.startsWith(`image/`)===!0&&t.length>6?t:null}function buildLinearImageContent(e,t,n){let r=0,i=``,a=[];for(let[o,s]of t.entries()){let t=n[o];t!=null&&(i+=e.slice(r,s.start),i+=s.altText,r=s.end,a.push(t))}return i+=e.slice(r),i.trim().length===0?a:[{text:i,type:`text`},...a]}export{attachLinearInboundImages,extractLinearUploadImageReferences};
@@ -1,26 +0,0 @@
1
- import { type Context, type SpanContext, type Tracer } from "#compiled/@opentelemetry/api/index.js";
2
- import type { InstrumentationActionStartedEvent, InstrumentationAttemptScope, InstrumentationProviderDefinition } from "#instrumentation/lifecycle.js";
3
- import type { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";
4
- import type { AgentTraceStateStore } from "#tracing/agent-trace-state.js";
5
- interface AgentActionInstrumentation {
6
- readonly events: Pick<NonNullable<InstrumentationProviderDefinition["events"]>, "action.completed" | "action.failed" | "action.started">;
7
- deleteForSession(sessionId: string): void | PromiseLike<void>;
8
- failForAttempt(scope: InstrumentationAttemptScope, error: unknown): Promise<void>;
9
- contextFor(sessionId: string, turnId: string, callId: string): Promise<AgentActionContext | undefined>;
10
- }
11
- export interface AgentActionContext {
12
- readonly context: Context;
13
- readonly spanContext: SpanContext;
14
- }
15
- /** Builds durable `agent.action` spans around eve's runtime dispatch boundary. */
16
- export declare function createAgentActionInstrumentation(input: {
17
- readonly frameworkVersion: string;
18
- readonly idGenerator: AgentSpanIdGenerator;
19
- readonly recordInputs: boolean;
20
- readonly recordOutputs: boolean;
21
- readonly resolveTraceContext: (event: InstrumentationActionStartedEvent) => SpanContext | undefined | PromiseLike<SpanContext | undefined>;
22
- readonly stateStore: AgentTraceStateStore;
23
- readonly toolStartTimeForAction: (idempotencyKey: string) => number | undefined;
24
- readonly tracer: Tracer;
25
- }): AgentActionInstrumentation;
26
- export {};
@@ -1 +0,0 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{AGENT_SPAN_NAMES}from"#tracing/agent-span-contract.js";import{isSampledTrace}from"#tracing/sampled-trace.js";import{ROOT_CONTEXT,SpanKind,trace}from"#compiled/@opentelemetry/api/index.js";import{actionIdempotencyKey,attemptIdempotencyKey}from"#instrumentation/lifecycle.js";import{agentSpanNamingAttributes}from"#tracing/agent-span-naming.js";import{contentAttribute,textContentAttribute}from"#tracing/agent-otel-content.js";import{recordAgentSpanError}from"#tracing/agent-span-error.js";import{agentTraceIdentityAttributes,traceSessionIdOf}from"#tracing/agent-otel-attributes.js";import{setAgentUsage}from"#tracing/agent-otel-usage.js";import{withChannelAudience}from"#tracing/channel-audience-context.js";function createAgentActionInstrumentation(e){let t=new Map,onStarted=async n=>{let r=Math.min(n.startedAtMs??Date.now(),e.toolStartTimeForAction(n.idempotencyKey)??1/0),i=await e.resolveTraceContext(n);if(i===void 0||!isSampledTrace(i))return;let a=await e.stateStore.getAction(n.idempotencyKey)??{attemptIndex:n.scope.attemptIndex,callId:n.callId,channelAudience:normalizeChannelAudience(n.scope.channelAudience),inputAttribute:e.recordInputs?contentAttribute(n.input):void 0,kind:n.kind,name:n.name,parent:{spanId:e.idGenerator.deriveSpanId(n.parentCallId===void 0?attemptIdempotencyKey(n.scope):`action:${actionIdempotencyKey(n.scope.sessionId,n.scope.turnId,n.parentCallId)}`),traceFlags:i.traceFlags,traceId:i.traceId},parentCallId:n.parentCallId,rootSessionId:n.scope.rootSessionId??n.scope.sessionId,traceSessionId:traceSessionIdOf(n.scope),sessionId:n.scope.sessionId,spanId:e.idGenerator.deriveSpanId(`action:${n.idempotencyKey}`),startTimeMs:r,stepIndex:n.scope.stepIndex,turnId:n.scope.turnId};await e.stateStore.setAction(n.idempotencyKey,a),n.isWorkflowTool===!0&&await e.stateStore.setActionAnchor(n.idempotencyKey,a);let o=t.get(n.scope.attemptId)??new Set;o.add(n.idempotencyKey),t.set(n.scope.attemptId,o)},onTerminal=async t=>{let n=await e.stateStore.getAction(t.idempotencyKey);if(n!==void 0)try{finishActionSpan(n,t)}finally{await e.stateStore.deleteAction(t.idempotencyKey),forget(t.idempotencyKey)}},startSpan=t=>{let n=isAgentInvocation(t.kind),r=e.idGenerator.withSpanId(t.spanId,()=>e.tracer.startSpan(AGENT_SPAN_NAMES.action,{attributes:{"agent.action.call_id":t.callId,"agent.action.kind":t.kind,...t.parentCallId===void 0?void 0:{"agent.action.parent_call_id":t.parentCallId},"agent.action.name":t.name,"agent.framework.name":`eve`,"agent.framework.version":e.frameworkVersion,"agent.step.attempt":t.attemptIndex,"agent.step.index":t.stepIndex,"agent.turn.id":t.turnId,...agentSpanNamingAttributes(AGENT_SPAN_NAMES.action),...agentTraceIdentityAttributes({rootSessionId:t.rootSessionId,traceSessionId:t.traceSessionId,sessionId:t.sessionId}),...n?{"gen_ai.agent.name":t.name,"agent.invocation.role":`caller`}:void 0},kind:t.kind===`remote-agent-call`?SpanKind.CLIENT:SpanKind.INTERNAL,startTime:t.startTimeMs},contextFromActionState(t)));return!n&&t.inputAttribute!==void 0&&r.setAttribute(`gen_ai.tool.call.arguments`,t.inputAttribute),r};return{async contextFor(t,n,r){let i=actionIdempotencyKey(t,n,r),a=await e.stateStore.getAction(i);if(a!==void 0)return actionContext(a);let o=await e.stateStore.findAction(t,r);return o===void 0?void 0:actionContext(o)},async deleteForSession(t){await e.stateStore.deleteActions(t),await e.stateStore.deleteActionAnchors(t)},async failForAttempt(n,r){let i=t.get(n.attemptId);if(i!==void 0){t.delete(n.attemptId);for(let t of i){let n=await e.stateStore.getAction(t);if(n===void 0)continue;let i=startSpan(n);recordAgentSpanError(i,r),i.end(),await e.stateStore.deleteAction(t)}}},events:{"action.completed":onTerminal,"action.failed":onTerminal,"action.started":onStarted}};function forget(e){for(let[n,r]of t)r.delete(e),r.size===0&&t.delete(n)}function finishActionSpan(t,n){let r=startSpan(t);if(r.setAttribute(`agent.action.outcome`,n.outcome),n.usage!==void 0&&setAgentUsage(r,n.usage),n.type===`action.failed`)n.errorCode!==void 0&&r.setAttribute(`agent.action.error.code`,n.errorCode),recordActionError(r,n.error,n.errorCode);else if(n.output.type===`error`)recordActionError(r,n.output.error);else if(e.recordOutputs&&!isAgentInvocation(t.kind)){let e=contentAttribute(n.output.output);e!==void 0&&r.setAttribute(`gen_ai.tool.call.result`,e)}r.end(n.acceptedAtMs)}}function actionContext(e){let t={isRemote:!1,spanId:e.spanId,traceFlags:e.parent.traceFlags,traceId:e.parent.traceId};return{context:withChannelAudience(trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext(t)),e.channelAudience),spanContext:t}}function contextFromActionState(e){return withChannelAudience(trace.setSpan(ROOT_CONTEXT,trace.wrapSpanContext({...e.parent,isRemote:!1})),e.channelAudience)}function isAgentInvocation(e){return e===`subagent-call`||e===`remote-agent-call`}function recordActionError(e,t,n){if(t instanceof Error||t===void 0){recordAgentSpanError(e,t,n);return}let r=serializedErrorDetail(t);if(r===void 0){recordAgentSpanError(e,void 0,n);return}let i=Error(r);n!==void 0&&(i.name=n),recordAgentSpanError(e,i,n)}function serializedErrorDetail(e){if(typeof e==`string`)return textContentAttribute(e);let t=contentAttribute(e);if(typeof e!=`object`||!e||Array.isArray(e))return t;let n=Reflect.get(e,`message`);return typeof n==`string`?textContentAttribute(t===void 0?n:`${n}\n${t}`):t}export{createAgentActionInstrumentation};