eve 0.51.0 → 0.52.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 (462) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/src/channel/session.d.ts +2 -1
  3. package/dist/src/channel/session.js +1 -1
  4. package/dist/src/channel/types.d.ts +4 -1
  5. package/dist/src/chunks/{use-eve-agent-C3vUG5g2.js → use-eve-agent-3DZuvuWE.js} +17 -6
  6. package/dist/src/chunks/{use-eve-agent-B4xN7-fK.js → use-eve-agent-D7apPojZ.js} +17 -6
  7. package/dist/src/cli/agent-command.js +1 -1
  8. package/dist/src/cli/commands/agent-instructions.d.ts +3 -1
  9. package/dist/src/cli/commands/agent-instructions.js +1 -1
  10. package/dist/src/cli/commands/build.js +1 -1
  11. package/dist/src/cli/commands/deploy.js +1 -1
  12. package/dist/src/cli/commands/init-agent-workspace.js +1 -1
  13. package/dist/src/cli/commands/init-repl.js +1 -1
  14. package/dist/src/cli/commands/init.js +1 -1
  15. package/dist/src/cli/commands/integration-connect.js +1 -1
  16. package/dist/src/cli/commands/link.js +1 -1
  17. package/dist/src/cli/commands/preconditions.js +1 -1
  18. package/dist/src/cli/commands/register-project-commands.d.ts +1 -1
  19. package/dist/src/cli/commands/register-project-commands.js +1 -1
  20. package/dist/src/cli/commands/registry.js +1 -1
  21. package/dist/src/cli/dev/boot-progress.d.ts +3 -0
  22. package/dist/src/cli/dev/boot-progress.js +1 -0
  23. package/dist/src/cli/dev/environment.js +1 -1
  24. package/dist/src/cli/dev/run-interactive-ui.js +1 -1
  25. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  26. package/dist/src/cli/dev/tui/setup-commands.d.ts +3 -1
  27. package/dist/src/cli/dev/tui/setup-commands.js +1 -1
  28. package/dist/src/cli/run.d.ts +4 -0
  29. package/dist/src/cli/run.js +3 -3
  30. package/dist/src/cli/telemetry/command.d.ts +9 -0
  31. package/dist/src/cli/telemetry/command.js +1 -0
  32. package/dist/src/cli/telemetry/flush.d.ts +2 -0
  33. package/dist/src/cli/telemetry/flush.js +1 -0
  34. package/dist/src/cli/telemetry/identity.d.ts +13 -0
  35. package/dist/src/cli/telemetry/identity.js +1 -0
  36. package/dist/src/cli/telemetry/index.d.ts +25 -0
  37. package/dist/src/cli/telemetry/index.js +3 -0
  38. package/dist/src/cli/telemetry/preference.d.ts +9 -0
  39. package/dist/src/cli/telemetry/preference.js +1 -0
  40. package/dist/src/client/open-stream.js +1 -1
  41. package/dist/src/client/session-controls.d.ts +3 -0
  42. package/dist/src/client/session-controls.js +1 -1
  43. package/dist/src/client/session.d.ts +4 -1
  44. package/dist/src/client/types.d.ts +3 -2
  45. package/dist/src/compiled/.vendor-stamp.json +11 -11
  46. package/dist/src/compiled/@clack/core/LICENSE +9 -0
  47. package/dist/src/compiled/@clack/core/index.d.ts +363 -0
  48. package/dist/src/compiled/@clack/core/index.js +20 -0
  49. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  50. package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +1 -0
  51. package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +34 -92
  52. package/dist/src/compiled/@vercel/sandbox/api-client/base-client.d.ts +1 -1
  53. package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
  54. package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +13 -29
  55. package/dist/src/compiled/@vercel/sandbox/constants.d.ts +11 -1
  56. package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -3
  57. package/dist/src/compiled/@vercel/sandbox/index.js +9 -9
  58. package/dist/src/compiled/@vercel/sandbox/sandbox-user.d.ts +5 -6
  59. package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +79 -67
  60. package/dist/src/compiled/@vercel/sandbox/session.d.ts +5 -3
  61. package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +9 -0
  62. package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-client.d.ts +86 -1
  63. package/dist/src/compiled/@vercel/sandbox-drives/api-client/index.d.ts +2 -0
  64. package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/validators.d.ts +26 -1
  65. package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/constants.d.ts +2 -2
  66. package/dist/src/compiled/@vercel/{sandbox → sandbox-drives}/drive.d.ts +10 -0
  67. package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/index.d.ts +3 -2
  68. package/dist/src/compiled/@vercel/sandbox-drives/index.js +9 -0
  69. package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox.d.ts +35 -6
  70. package/dist/src/compiled/@workflow/core/index.js +1 -1
  71. package/dist/src/compiled/@workflow/core/private.d.ts +2 -4
  72. package/dist/src/compiled/@workflow/core/private.js +1 -1
  73. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +9 -7
  74. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +13 -0
  75. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +54 -1
  76. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  77. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +7 -0
  78. package/dist/src/compiled/@workflow/core/serialization.d.ts +24 -2
  79. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  80. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  81. package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
  82. package/dist/src/compiled/@workflow/errors/index.d.ts +19 -0
  83. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  84. package/dist/src/compiled/@workflow/world/analytics.d.ts +46 -2
  85. package/dist/src/compiled/@workflow/world/events.d.ts +26 -1
  86. package/dist/src/compiled/@workflow/world/index.d.ts +1 -1
  87. package/dist/src/compiled/@workflow/world/runs.d.ts +2 -2
  88. package/dist/src/compiled/@workflow/world-local/index.js +3 -3
  89. package/dist/src/compiled/@workflow/world-vercel/index.js +12 -12
  90. package/dist/src/compiled/_chunks/node/{auth-BSKyPAEP.js → auth-Bx1Aoyfo.js} +1 -1
  91. package/dist/src/compiled/_chunks/node/{auth-YpKlwhP1.js → auth-CA8ZMfB8.js} +1 -1
  92. package/dist/src/compiled/_chunks/node/esm-CE0tAvRh.js +7 -0
  93. package/dist/src/compiled/_chunks/node/version-BC6t2Txc.js +1 -0
  94. package/dist/src/compiled/_chunks/node/version-DSQqVZ5T.js +1 -0
  95. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BwAadFfB.js → attribute-changes-03lzo29R.js} +1 -1
  96. package/dist/src/compiled/_chunks/workflow/dist-BIdMK5N8.js +40 -0
  97. package/dist/src/compiled/_chunks/workflow/dist-DMQ3CtWt.js +3 -0
  98. package/dist/src/compiled/_chunks/workflow/frames-Boesh7kU.js +3 -0
  99. package/dist/src/compiled/_chunks/workflow/{private-CZFMABEf.js → private-CKx3PkSS.js} +1 -1
  100. package/dist/src/compiled/_chunks/workflow/{resume-hook-BToMtPbH.js → resume-hook-C6eL-S_T.js} +1 -1
  101. package/dist/src/compiled/_chunks/workflow/run-BV0S6Zc2.js +1 -0
  102. package/dist/src/compiled/_chunks/workflow/sleep-Bh3jP9ii.js +1 -0
  103. package/dist/src/compiled/_chunks/workflow/wait-until-l-cwfJvm.js +15 -0
  104. package/dist/src/compiled/_chunks/workflow/{ws-transport-PnVVxT0R.js → ws-transport-BagXNxCE.js} +1 -1
  105. package/dist/src/compiler/compile-from-memory.d.ts +1 -0
  106. package/dist/src/compiler/extension-compatibility.d.ts +38 -20
  107. package/dist/src/compiler/extension-compatibility.js +1 -1
  108. package/dist/src/compiler/manifest.d.ts +2 -2
  109. package/dist/src/compiler/manifest.js +1 -1
  110. package/dist/src/compiler/normalize-agent-config.js +1 -1
  111. package/dist/src/compiler/normalize-channel.js +1 -1
  112. package/dist/src/compiler/normalize-schedule.js +1 -1
  113. package/dist/src/compiler/normalize-tool.js +1 -1
  114. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  115. package/dist/src/discover/extensions.d.ts +2 -0
  116. package/dist/src/discover/extensions.js +1 -1
  117. package/dist/src/discover/filesystem.d.ts +1 -0
  118. package/dist/src/discover/filesystem.js +1 -1
  119. package/dist/src/discover/project.js +1 -1
  120. package/dist/src/evals/runner/execute-task.js +1 -1
  121. package/dist/src/evals/session-cleanup.d.ts +7 -0
  122. package/dist/src/evals/session-cleanup.js +1 -0
  123. package/dist/src/evals/session.d.ts +4 -0
  124. package/dist/src/evals/session.js +1 -1
  125. package/dist/src/eve-channel/index.js +1 -1
  126. package/dist/src/eve-channel/request.d.ts +1 -0
  127. package/dist/src/eve-channel/request.js +1 -1
  128. package/dist/src/execution/activity-collector.js +1 -1
  129. package/dist/src/execution/activity-work.d.ts +8 -0
  130. package/dist/src/execution/activity-work.js +1 -1
  131. package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +6 -0
  132. package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -0
  133. package/dist/src/execution/continuation-conflict-step.js +1 -1
  134. package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -2
  135. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  136. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  137. package/dist/src/execution/create-session-step.js +1 -1
  138. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +1 -1
  139. package/dist/src/execution/inline-turn.d.ts +4 -2
  140. package/dist/src/execution/inline-turn.js +1 -1
  141. package/dist/src/execution/next-driver-action.d.ts +0 -3
  142. package/dist/src/execution/parked-delivery-wait.js +1 -1
  143. package/dist/src/execution/proxied-deliver-step.js +1 -1
  144. package/dist/src/execution/run-session-limits.d.ts +5 -5
  145. package/dist/src/execution/sandbox/bindings/vercel-create-sdk.js +1 -1
  146. package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +4 -4
  147. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  148. package/dist/src/execution/session-activity-projection.js +1 -1
  149. package/dist/src/execution/session-activity.js +1 -1
  150. package/dist/src/execution/session-timeout-workflow.js +1 -1
  151. package/dist/src/execution/session.d.ts +1 -0
  152. package/dist/src/execution/session.js +1 -1
  153. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  154. package/dist/src/execution/tasks/child/steps.d.ts +19 -1
  155. package/dist/src/execution/tasks/child/steps.js +1 -1
  156. package/dist/src/execution/tasks/child/workflow.d.ts +2 -0
  157. package/dist/src/execution/tasks/child/workflow.js +1 -1
  158. package/dist/src/execution/tasks/parent/control-shared.js +1 -1
  159. package/dist/src/execution/tasks/parent/delegate.d.ts +2 -0
  160. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  161. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  162. package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +26 -0
  163. package/dist/src/execution/tasks/parent/subagent-task-projection.js +1 -0
  164. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  165. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  166. package/dist/src/execution/tools/sleep-workflow.d.ts +3 -0
  167. package/dist/src/execution/tools/sleep-workflow.js +1 -0
  168. package/dist/src/execution/tools/sleep.d.ts +1 -5
  169. package/dist/src/execution/tools/sleep.js +1 -1
  170. package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
  171. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -7
  172. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
  173. package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
  174. package/dist/src/execution/tools/workflow/ask.d.ts +1 -2
  175. package/dist/src/execution/tools/workflow/ask.js +1 -1
  176. package/dist/src/execution/tools/workflow/body.d.ts +6 -1
  177. package/dist/src/execution/tools/workflow/body.js +1 -1
  178. package/dist/src/execution/tools/workflow/cancel.js +1 -1
  179. package/dist/src/execution/tools/workflow/messages.d.ts +9 -8
  180. package/dist/src/execution/tools/workflow/messages.js +1 -1
  181. package/dist/src/execution/tools/workflow/owner-inbox.d.ts +2 -2
  182. package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
  183. package/dist/src/execution/tools/workflow/owner.d.ts +5 -11
  184. package/dist/src/execution/tools/workflow/owner.js +1 -1
  185. package/dist/src/execution/tools/workflow/run-control.d.ts +0 -4
  186. package/dist/src/execution/tools/workflow/run-control.js +1 -1
  187. package/dist/src/execution/tools/workflow/start.d.ts +5 -14
  188. package/dist/src/execution/tools/workflow/start.js +1 -1
  189. package/dist/src/execution/tools/workflow/workflow.d.ts +1 -1
  190. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  191. package/dist/src/execution/turn-cancellation-control.d.ts +1 -0
  192. package/dist/src/execution/turn-cancellation-control.js +1 -1
  193. package/dist/src/execution/turn-cancellation-token.d.ts +1 -0
  194. package/dist/src/execution/turn-control-receiver.d.ts +3 -0
  195. package/dist/src/execution/turn-control-receiver.js +1 -1
  196. package/dist/src/execution/turn-dispatch.d.ts +2 -0
  197. package/dist/src/execution/turn-dispatch.js +1 -1
  198. package/dist/src/execution/turn-workflow-tool-run.d.ts +2 -8
  199. package/dist/src/execution/turn-workflow-tool-run.js +1 -1
  200. package/dist/src/execution/turn-workflow.d.ts +1 -0
  201. package/dist/src/execution/turn-workflow.js +1 -1
  202. package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
  203. package/dist/src/execution/wire/session-inbox-contract.js +1 -1
  204. package/dist/src/execution/wire/session-inbox-encoder.d.ts +10 -2
  205. package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
  206. package/dist/src/execution/wire/session-inbox-resume.js +1 -1
  207. package/dist/src/execution/wire/session-inbox-wire.js +1 -1
  208. package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +341 -0
  209. package/dist/src/execution/wire/session-inbox-wire.v5.js +1 -0
  210. package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +3 -0
  211. package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +1 -0
  212. package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +341 -0
  213. package/dist/src/execution/wire/session-inbox-wire.v6.js +1 -0
  214. package/dist/src/execution/workflow-entry.js +1 -1
  215. package/dist/src/execution/workflow-runtime.js +1 -1
  216. package/dist/src/execution/workflow-steps.js +1 -1
  217. package/dist/src/harness/emission-state.js +1 -1
  218. package/dist/src/harness/session-limit-continuation.d.ts +5 -5
  219. package/dist/src/harness/session-limit-continuation.js +1 -1
  220. package/dist/src/harness/session-limit-enforcement.d.ts +4 -4
  221. package/dist/src/harness/session-limit-enforcement.js +1 -1
  222. package/dist/src/harness/session-usage-limits.d.ts +48 -0
  223. package/dist/src/harness/session-usage-limits.js +1 -0
  224. package/dist/src/harness/tool-loop.js +2 -2
  225. package/dist/src/harness/turn-client-context.d.ts +9 -0
  226. package/dist/src/harness/turn-client-context.js +1 -0
  227. package/dist/src/harness/turn-tag-state.d.ts +17 -20
  228. package/dist/src/harness/turn-tag-state.js +1 -1
  229. package/dist/src/harness/types.d.ts +5 -0
  230. package/dist/src/harness/workflow-tool-runs.d.ts +0 -1
  231. package/dist/src/harness/workflow-tool-runs.js +1 -1
  232. package/dist/src/internal/application/build-output-environment.d.ts +1 -0
  233. package/dist/src/internal/application/build-output-environment.js +1 -1
  234. package/dist/src/internal/application/package.js +1 -1
  235. package/dist/src/internal/application/paths.js +1 -1
  236. package/dist/src/internal/authored-definition/core.js +1 -1
  237. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  238. package/dist/src/internal/eve-project-root.d.ts +8 -0
  239. package/dist/src/internal/eve-project-root.js +1 -0
  240. package/dist/src/internal/invocation/workflow-execution.js +1 -1
  241. package/dist/src/internal/mcp/streamable-http-server.d.ts +29 -1
  242. package/dist/src/internal/mcp/streamable-http-server.js +1 -1
  243. package/dist/src/internal/nitro/host/build-application.js +1 -1
  244. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -0
  245. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  246. package/dist/src/internal/nitro/host/types.d.ts +2 -0
  247. package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +1 -0
  248. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
  249. package/dist/src/internal/project-context.d.ts +13 -8
  250. package/dist/src/internal/project-context.js +1 -1
  251. package/dist/src/internal/vercel/build-agent-workspace.d.ts +1 -1
  252. package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
  253. package/dist/src/internal/vercel/eve-service-contribution.d.ts +1 -0
  254. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  255. package/dist/src/internal/workflow/reference.d.ts +2 -0
  256. package/dist/src/internal/workflow/reference.js +1 -0
  257. package/dist/src/internal/workflow/runtime.d.ts +6 -0
  258. package/dist/src/internal/workflow/runtime.js +1 -1
  259. package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +1 -3
  260. package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
  261. package/dist/src/internal/workflow-bundle/authored-workflow-modules.d.ts +1 -11
  262. package/dist/src/internal/workflow-bundle/authored-workflow-modules.js +1 -1
  263. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  264. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  265. package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +1 -3
  266. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  267. package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +1 -1
  268. package/dist/src/internal/workflow-bundle/workflow-transformer.js +2 -2
  269. package/dist/src/protocol/message.d.ts +3 -2
  270. package/dist/src/public/channels/mcp.js +1 -1
  271. package/dist/src/public/channels/slack/activity-plan.d.ts +4 -0
  272. package/dist/src/public/channels/slack/activity-plan.js +1 -0
  273. package/dist/src/public/channels/slack/activity.d.ts +45 -2
  274. package/dist/src/public/channels/slack/activity.js +2 -1
  275. package/dist/src/public/channels/slack/index.d.ts +1 -1
  276. package/dist/src/public/channels/slack/index.js +1 -1
  277. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  278. package/dist/src/public/memory/index.js +1 -1
  279. package/dist/src/public/models/openai/chatgpt/model.js +2 -2
  280. package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
  281. package/dist/src/public/nuxt/index.js +1 -1
  282. package/dist/src/public/nuxt/module.d.ts +3 -2
  283. package/dist/src/public/nuxt/module.js +1 -1
  284. package/dist/src/public/sandbox/vercel-sandbox.d.ts +9 -5
  285. package/dist/src/public/sandbox/vercel.d.ts +1 -1
  286. package/dist/src/public/sandbox/vercel.js +1 -1
  287. package/dist/src/public/tools/index.d.ts +3 -1
  288. package/dist/src/public/tools/index.js +1 -1
  289. package/dist/src/runtime/resolve-agent.js +1 -1
  290. package/dist/src/runtime/subagents/workflow.js +1 -1
  291. package/dist/src/self-modification/agent.d.ts +22 -0
  292. package/dist/src/self-modification/agent.js +1 -0
  293. package/dist/src/self-modification/extension/classify-registry-item.d.ts +19 -0
  294. package/dist/src/self-modification/extension/classify-registry-item.js +1 -0
  295. package/dist/src/self-modification/extension/eve-add.d.ts +56 -0
  296. package/dist/src/self-modification/extension/eve-add.js +2 -0
  297. package/dist/src/self-modification/extension/extension.d.ts +2 -0
  298. package/dist/src/self-modification/extension/extension.js +1 -0
  299. package/dist/src/self-modification/extension/instructions.d.ts +4 -0
  300. package/dist/src/self-modification/extension/instructions.js +23 -0
  301. package/dist/src/self-modification/extension/source-lock.d.ts +2 -0
  302. package/dist/src/self-modification/extension/source-lock.js +1 -0
  303. package/dist/src/self-modification/extension/tools/edit_file.d.ts +16 -0
  304. package/dist/src/self-modification/extension/tools/edit_file.js +1 -0
  305. package/dist/src/self-modification/extension/tools/registry_add.d.ts +52 -0
  306. package/dist/src/self-modification/extension/tools/registry_add.js +1 -0
  307. package/dist/src/self-modification/extension/tools/search_models.d.ts +22 -0
  308. package/dist/src/self-modification/extension/tools/search_models.js +1 -0
  309. package/dist/src/self-modification/extension/tools/search_registry.d.ts +103 -0
  310. package/dist/src/self-modification/extension/tools/search_registry.js +1 -0
  311. package/dist/src/self-modification/filesystem.d.ts +6 -0
  312. package/dist/src/self-modification/filesystem.js +1 -0
  313. package/dist/src/self-modification/sandbox.d.ts +2 -0
  314. package/dist/src/self-modification/sandbox.js +1 -0
  315. package/dist/src/services/dev-client/target.d.ts +3 -1
  316. package/dist/src/setup/boxes/select-model.d.ts +3 -21
  317. package/dist/src/setup/boxes/select-model.js +1 -1
  318. package/dist/src/setup/cli/prompt-ui.js +4 -4
  319. package/dist/src/setup/cli/select-component.d.ts +1 -1
  320. package/dist/src/setup/cli/select-component.js +1 -1
  321. package/dist/src/setup/flows/model.d.ts +3 -0
  322. package/dist/src/setup/flows/model.js +1 -1
  323. package/dist/src/setup/prompter.js +1 -1
  324. package/dist/src/setup/scaffold/create/project.js +1 -1
  325. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  326. package/dist/src/shared/action-types.d.ts +35 -22
  327. package/dist/src/shared/action-types.js +1 -1
  328. package/dist/src/shared/agent-definition.d.ts +13 -0
  329. package/dist/src/shared/agent-turn-outcome.d.ts +2 -0
  330. package/dist/src/shared/agent-turn-outcome.js +1 -1
  331. package/dist/src/shared/extension-package-contract.d.ts +2 -0
  332. package/dist/src/shared/extension-package-contract.js +1 -1
  333. package/dist/src/shared/gateway-model-catalog.d.ts +21 -0
  334. package/dist/src/shared/gateway-model-catalog.js +1 -0
  335. package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
  336. package/dist/src/shared/token-usage.d.ts +11 -15
  337. package/dist/src/shared/token-usage.js +1 -1
  338. package/dist/src/shared/workflow-tool-context.d.ts +2 -0
  339. package/dist/src/shared/workflow-tool-context.js +1 -0
  340. package/dist/src/subagents/callback-route.js +1 -1
  341. package/dist/src/subagents/event-proxy-step.js +1 -1
  342. package/dist/src/subagents/start-remote.js +1 -1
  343. package/dist/src/subagents/token-budget.js +1 -1
  344. package/dist/src/svelte/index.js +1 -1
  345. package/dist/src/svelte/use-eve-agent.js +1 -1
  346. package/dist/src/tasks/types.d.ts +18 -1
  347. package/dist/src/tasks/types.js +1 -1
  348. package/dist/src/tools/behavior.d.ts +5 -0
  349. package/dist/src/tools/definition.d.ts +16 -12
  350. package/dist/src/tools/definition.js +1 -1
  351. package/dist/src/tools/dynamic.d.ts +2 -2
  352. package/dist/src/tools/provided/sleep.d.ts +4 -4
  353. package/dist/src/tools/provided/sleep.js +1 -1
  354. package/dist/src/tools/task.d.ts +28 -80
  355. package/dist/src/tools/task.js +1 -1
  356. package/dist/src/tools/workflow-definition.d.ts +60 -0
  357. package/dist/src/tools/workflow-definition.js +1 -0
  358. package/dist/src/vue/index.js +1 -1
  359. package/dist/src/vue/use-eve-agent.js +1 -1
  360. package/docs/agent-config.md +24 -19
  361. package/docs/channels/eve.mdx +1 -1
  362. package/docs/channels/mcp.mdx +25 -3
  363. package/docs/concepts/built-in-tools.md +1 -1
  364. package/docs/concepts/execution-model-and-durability.mdx +13 -2
  365. package/docs/concepts/sessions-runs-and-streaming.md +9 -1
  366. package/docs/guides/client/messages.mdx +1 -1
  367. package/docs/guides/client/streaming.mdx +1 -1
  368. package/docs/guides/deployment/vercel.mdx +3 -1
  369. package/docs/guides/frontend/overview.mdx +1 -1
  370. package/docs/memory/overview.mdx +41 -12
  371. package/docs/reference/cli.md +31 -33
  372. package/docs/reference/meta.json +1 -4
  373. package/docs/reference/telemetry.md +56 -0
  374. package/docs/reference/typescript-api.md +38 -35
  375. package/docs/sandbox.mdx +1 -1
  376. package/docs/tools/overview.mdx +59 -18
  377. package/docs/tools/workflows.mdx +146 -70
  378. package/package.json +38 -19
  379. package/dist/src/compiled/@vercel/sandbox-delete/api-client/index.d.ts +0 -2
  380. package/dist/src/compiled/@vercel/sandbox-delete/index.js +0 -9
  381. package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +0 -201
  382. package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +0 -8
  383. package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +0 -5
  384. package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +0 -1456
  385. package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +0 -29
  386. package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +0 -39
  387. package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +0 -66
  388. package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +0 -2
  389. package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +0 -899
  390. package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +0 -10
  391. package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +0 -15
  392. package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +0 -18
  393. package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +0 -6
  394. package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +0 -111
  395. package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +0 -28
  396. package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +0 -40
  397. package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +0 -292
  398. package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +0 -5
  399. package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +0 -116
  400. package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +0 -258
  401. package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +0 -12
  402. package/dist/src/compiled/@vercel/sandbox-stable/index.js +0 -1
  403. package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +0 -169
  404. package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +0 -55
  405. package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +0 -212
  406. package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +0 -1216
  407. package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +0 -433
  408. package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +0 -229
  409. package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +0 -21
  410. package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +0 -16
  411. package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +0 -15
  412. package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +0 -11
  413. package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +0 -11
  414. package/dist/src/compiled/_chunks/node/decode_jwt-Col8JOnf.js +0 -7
  415. package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +0 -1
  416. package/dist/src/compiled/_chunks/node/version-DH6yRy-M.js +0 -1
  417. package/dist/src/compiled/_chunks/workflow/dist-CgbVZs5l.js +0 -40
  418. package/dist/src/compiled/_chunks/workflow/dist-DjojkP5e.js +0 -3
  419. package/dist/src/compiled/_chunks/workflow/frames-CZ9eHShe.js +0 -3
  420. package/dist/src/compiled/_chunks/workflow/run-DzyAoGh4.js +0 -1
  421. package/dist/src/compiled/_chunks/workflow/sleep-3_A5uOp-.js +0 -1
  422. package/dist/src/compiled/_chunks/workflow/wait-until-BtySPYD0.js +0 -15
  423. package/dist/src/harness/session-token-limits.d.ts +0 -41
  424. package/dist/src/harness/session-token-limits.js +0 -1
  425. package/dist/src/harness/turn-sleep.d.ts +0 -12
  426. package/dist/src/harness/turn-sleep.js +0 -1
  427. package/dist/src/internal/agent-workspace.d.ts +0 -15
  428. package/dist/src/internal/agent-workspace.js +0 -1
  429. package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +0 -16
  430. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js +0 -1
  431. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js +0 -1
  432. package/dist/src/node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js +0 -1
  433. package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js +0 -5
  434. package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js +0 -1
  435. package/dist/src/public/workflow/index.d.ts +0 -5
  436. package/dist/src/public/workflow/index.js +0 -1
  437. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/LICENSE +0 -0
  438. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_async-retry.d.ts +0 -0
  439. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/_workflow-serde.d.ts +0 -0
  440. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/api-error.d.ts +0 -0
  441. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/base-client.d.ts +0 -0
  442. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/file-writer.d.ts +0 -0
  443. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/api-client/with-retry.d.ts +0 -0
  444. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/error.d.ts +0 -0
  445. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/file.d.ts +0 -0
  446. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/index.d.ts +0 -0
  447. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/oauth.d.ts +0 -0
  448. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/poll-for-token.d.ts +0 -0
  449. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/auth/project.d.ts +0 -0
  450. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/command.d.ts +0 -0
  451. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/execution-context.d.ts +0 -0
  452. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/filesystem.d.ts +0 -0
  453. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/network-policy.d.ts +0 -0
  454. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/proxy.d.ts +0 -0
  455. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/sandbox-user.d.ts +0 -0
  456. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/session.d.ts +0 -0
  457. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/snapshot.d.ts +0 -0
  458. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/get-credentials.d.ts +0 -0
  459. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/paginator.d.ts +0 -0
  460. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/resolveSignal.d.ts +0 -0
  461. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/sandbox-snapshot.d.ts +0 -0
  462. /package/dist/src/compiled/@vercel/{sandbox-delete → sandbox-drives}/utils/types.d.ts +0 -0
@@ -7,11 +7,11 @@ import type { TokenResult } from "#shared/connection-types.js";
7
7
  import type { ToolAuthOptions, ToolAuthProvider } from "#tools/auth.js";
8
8
  import type { InputOption } from "#shared/input.js";
9
9
  import type { ToolModelOutput } from "#tools/model-output.js";
10
- import type { TaskDelegated, TaskExec, TaskReceipt } from "#tools/task.js";
10
+ import type { TaskExec, TaskReceipt } from "#tools/task.js";
11
11
  type ApprovalContextInput<TInput> = unknown extends TInput ? Record<string, unknown> : TInput;
12
12
  export type { ToolAuthDefinition, ToolAuthOptions, ToolAuthProvider } from "#tools/auth.js";
13
13
  export type { ToolModelOutput, ToolModelOutputPart } from "#tools/model-output.js";
14
- export type { TaskBinding, TaskDelegated, TaskExec, TaskExecutorBinding, TaskReceipt, TaskSendCommand, } from "#tools/task.js";
14
+ export type { TaskExec, TaskExecutorBinding, TaskReceipt } from "#tools/task.js";
15
15
  export type ToolExecuteOptions = Omit<ToolExecutionOptions<unknown>, "context">;
16
16
  export type ToolExecuteFn<TInput = unknown, TOutput = unknown> = (input: TInput, options: ToolExecuteOptions, task?: TaskExec) => Promise<TOutput> | TOutput | AsyncIterable<TOutput>;
17
17
  export type ToolExecution = "background";
@@ -53,7 +53,7 @@ export interface PublicToolDefinitionWithExecuteFn<TInput = unknown, TOutput = u
53
53
  }
54
54
  /**
55
55
  * A question a workflow tool asks the human on the session's channel, sent
56
- * with `ask` from `eve/workflow`. Channels render it the way they render
56
+ * with `ctx.ask` from a `defineWorkflowTool` executor. Channels render it the way they render
57
57
  * `ask_question` and tool approvals.
58
58
  */
59
59
  export interface ToolInputRequest {
@@ -82,10 +82,8 @@ export interface ToolInputResponse {
82
82
  * Extends {@link SessionContext} with token accessors. Passing a provider
83
83
  * resolves that provider inline, which lets one tool use multiple credentials.
84
84
  *
85
- * A tool whose `execute` is a workflow (`"use workflow"`) receives the same
86
- * context inside its durable body, except that `getSandbox`, `getSkill`,
87
- * `getToken`, and `requireAuth` are unavailable there and throw when touched —
88
- * read credentials inside a `"use step"` function instead.
85
+ * Workflow tools use the separate `WorkflowToolContext` provided by
86
+ * `defineWorkflowTool`.
89
87
  */
90
88
  export type ToolContext = SessionContext & {
91
89
  /**
@@ -152,14 +150,14 @@ export interface ToolDefinition<TInput = unknown, TOutput = unknown> extends Pub
152
150
  toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
153
151
  }
154
152
  /** A tool whose executor can outlive the model tool-call phase as a durable task. */
155
- export interface BackgroundToolDefinition<TInput = unknown, TOutput = unknown> extends PublicToolDefinition<TInput, TOutput> {
153
+ export interface BackgroundToolDefinition<TInput = unknown, TOutput = unknown> extends PublicToolDefinition<TInput, TaskReceipt> {
156
154
  readonly execution: "background";
157
- execute(input: TInput, ctx: ToolContext, task: TaskExec): Promise<TaskDelegated | TOutput> | TaskDelegated | TOutput | AsyncIterable<TOutput>;
155
+ execute(input: TInput, ctx: ToolContext, task: TaskExec): Promise<TOutput> | TOutput | AsyncIterable<unknown>;
158
156
  approval?: Approval<ApprovalContextInput<TInput>>;
159
- toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
157
+ toModelOutput?: (output: TaskReceipt) => ToolModelOutput | Promise<ToolModelOutput>;
160
158
  }
161
159
  type ToolOutputFromExecuteReturn<TReturn> = TReturn extends Promise<infer TOutput> ? TOutput : TReturn extends AsyncIterable<infer TOutput> ? TOutput : TReturn;
162
- type BackgroundToolOutputFromExecuteReturn<TReturn> = ToolOutputFromExecuteReturn<TReturn> extends infer TOutput ? TOutput extends TaskDelegated<infer TData> ? TaskReceipt<TData> : TOutput : never;
160
+ type BackgroundToolOutputFromExecuteReturn<TReturn> = TReturn extends AsyncGenerator<unknown, infer TOutput> ? TOutput : TReturn extends AsyncIterable<unknown> ? null : Awaited<TReturn>;
163
161
  type ToolDefinitionWithExecuteReturn<TInput, TOutput, TReturn> = ToolDefinition<TInput, TOutput> & {
164
162
  execute(input: TInput, ctx: ToolContext): TReturn;
165
163
  };
@@ -178,7 +176,7 @@ export declare function defineTool<TSchema extends StandardSchemaV1<unknown, unk
178
176
  description: BackgroundToolDefinition<unknown, unknown>["description"];
179
177
  execution: "background";
180
178
  inputSchema: TSchema;
181
- outputSchema?: PublicToolDefinition<unknown, BackgroundToolOutputFromExecuteReturn<TReturn>>["outputSchema"];
179
+ outputSchema?: PublicToolDefinition<unknown, TaskReceipt>["outputSchema"];
182
180
  execute(input: StandardSchemaV1.InferOutput<TSchema>, ctx: ToolContext, task: TaskExec): TReturn;
183
181
  approval?: BackgroundToolDefinition<StandardSchemaV1.InferOutput<TSchema>, unknown>["approval"];
184
182
  toModelOutput?: BackgroundToolDefinition<unknown, BackgroundToolOutputFromExecuteReturn<TReturn>>["toModelOutput"];
@@ -216,6 +214,12 @@ export declare function defineTool<TReturn>(definition: {
216
214
  toModelOutput?: ToolDefinition<unknown, ToolOutputFromExecuteReturn<TReturn>>["toModelOutput"];
217
215
  }): ToolDefinitionWithExecuteReturn<Record<string, unknown>, ToolOutputFromExecuteReturn<TReturn>, TReturn>;
218
216
  export declare function defineTool<TInput = unknown, TOutput = unknown>(definition: ToolDefinition<TInput, TOutput>): ToolDefinition<TInput, TOutput>;
217
+ export declare function stampToolDefinition<T extends {
218
+ readonly description: string;
219
+ readonly execute: (...args: never[]) => unknown;
220
+ readonly approval?: Approval<never>;
221
+ readonly toModelOutput?: (...args: never[]) => unknown;
222
+ }>(definition: T, definer: "defineTool" | "defineWorkflowTool"): T;
219
223
  /**
220
224
  * Marker discriminator written into every {@link DisabledToolSentinel}.
221
225
  */
@@ -1 +1 @@
1
- import{collectDurableDynamicToolCallbacks,stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(t){if(t.auth!==void 0)throw Error(`defineTool: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(t,{[TOOL_BRAND]:!0}),stampDurableDynamicToolCallbacks(t,collectDurableDynamicToolCallbacks({approval:t.approval,execute:t.execute,toModelOutput:t.toModelOutput})),stampDefinitionKey(t,`tool:${t.description}`),t}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}export{defineTool,disableTool,isDisabledToolSentinel};
1
+ import{collectDurableDynamicToolCallbacks,stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(e){return stampToolDefinition(e,`defineTool`)}function stampToolDefinition(t,n){if(t.auth!==void 0)throw Error(`${n}: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(t,{[TOOL_BRAND]:!0}),stampDurableDynamicToolCallbacks(t,collectDurableDynamicToolCallbacks({approval:t.approval,execute:t.execute,toModelOutput:t.toModelOutput})),stampDefinitionKey(t,`tool:${t.description}`),t}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}export{defineTool,disableTool,isDisabledToolSentinel,stampToolDefinition};
@@ -1,7 +1,7 @@
1
1
  import type { Approval } from "#approval/definition.js";
2
2
  import type { DynamicResolveContext, DynamicToolEventName } from "#dynamic/definition.js";
3
3
  import type { PublicToolInputSchema, PublicToolOutputSchema, ToolContext } from "#tools/definition.js";
4
- import type { TaskDelegated, TaskExec } from "#tools/task.js";
4
+ import type { TaskExec } from "#tools/task.js";
5
5
  import type { ToolModelOutput } from "#tools/model-output.js";
6
6
  /**
7
7
  * A single tool entry within a resolved dynamic tool set.
@@ -20,7 +20,7 @@ export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = an
20
20
  readonly inputSchema: PublicToolInputSchema<TInput>;
21
21
  readonly outputSchema?: PublicToolOutputSchema<TOutput>;
22
22
  readonly execution?: "background";
23
- execute(input: TInput, ctx: ToolContext, task?: TaskExec): TOutput | TaskDelegated | Promise<TOutput | TaskDelegated>;
23
+ execute(input: TInput, ctx: ToolContext, task?: TaskExec): TOutput | Promise<TOutput>;
24
24
  readonly toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
25
25
  /**
26
26
  * Optional per-call approval gate, mirroring the authored-tool
@@ -1,4 +1,4 @@
1
- import { type ToolDefinition } from "#tools/definition.js";
1
+ import { type BlockingWorkflowToolDefinition } from "#tools/workflow-definition.js";
2
2
  import { type SleepToolInput, type SleepToolOutput } from "#execution/tools/sleep.js";
3
3
  export type { SleepToolInput, SleepToolOutput };
4
4
  /**
@@ -12,7 +12,7 @@ export type { SleepToolInput, SleepToolOutput };
12
12
  * export default sleep();
13
13
  * ```
14
14
  *
15
- * Calls pause the durable turn workflow rather than holding an application
16
- * runtime open with an in-process timer.
15
+ * Each call runs as a durable workflow, so the wait does not hold an
16
+ * application runtime open.
17
17
  */
18
- export declare function sleep(): ToolDefinition<SleepToolInput, SleepToolOutput>;
18
+ export declare function sleep(): BlockingWorkflowToolDefinition<SleepToolInput, SleepToolOutput>;
@@ -1 +1 @@
1
- import{defineTool}from"#tools/definition.js";import{SLEEP_INPUT_SCHEMA,SLEEP_OUTPUT_SCHEMA,SLEEP_TOOL_DESCRIPTION,executeSleepTool}from"#execution/tools/sleep.js";function sleep(){return defineTool({description:SLEEP_TOOL_DESCRIPTION,execute:executeSleepTool,inputSchema:SLEEP_INPUT_SCHEMA,outputSchema:SLEEP_OUTPUT_SCHEMA})}export{sleep};
1
+ import{defineWorkflowTool}from"#tools/workflow-definition.js";import{SLEEP_INPUT_SCHEMA,SLEEP_OUTPUT_SCHEMA,SLEEP_TOOL_DESCRIPTION,executeSleepTool}from"#execution/tools/sleep.js";function sleep(){return defineWorkflowTool({description:SLEEP_TOOL_DESCRIPTION,execute:executeSleepTool,inputSchema:SLEEP_INPUT_SCHEMA,outputSchema:SLEEP_OUTPUT_SCHEMA})}export{sleep};
@@ -1,48 +1,25 @@
1
1
  import type { BackgroundTask } from "#execution/tasks/parent/delegate.js";
2
- import type { BackgroundToolCall } from "#harness/background-tools.js";
3
2
  import type { HarnessSession } from "#harness/types.js";
4
3
  import type { JsonObject, JsonValue } from "#shared/json.js";
5
- declare const TASK_DELEGATED_KIND = "eve:task-delegated";
6
- /** Private address an executor uses to report lifecycle changes to its owning task. */
7
- export interface TaskBinding {
8
- readonly taskId: string;
9
- readonly token: string;
10
- readonly url?: string;
11
- }
12
- /**
13
- * Opaque, task-private address used to control an external executor. `data`
14
- * means nothing to the task layer beyond deep equality (replay idempotency);
15
- * only the executor `kind` that wrote it may parse it (e.g. cancel routing).
16
- */
4
+ declare const TASK_MESSAGE_KIND: "eve:task-message";
5
+ export type TaskMessage = JsonObject & {
6
+ readonly kind: typeof TASK_MESSAGE_KIND;
7
+ readonly message: string;
8
+ };
9
+ export declare function createTaskMessage(message: string): TaskMessage;
10
+ export declare function isTaskMessage(value: unknown): value is TaskMessage;
11
+ /** Opaque, framework-private address used to control a task executor. */
17
12
  export interface TaskExecutorBinding {
18
13
  readonly kind: string;
19
14
  readonly data: JsonObject;
20
15
  }
21
- /**
22
- * What the model sees as this call's tool output when work is delegated: the
23
- * author-supplied data plus `status: "working"` and the `taskId` it can poll
24
- * or cancel. It acknowledges delegation — it is not the task's result, which
25
- * arrives later through task completion.
26
- */
27
- export type TaskReceipt<TData extends JsonObject = JsonObject> = TData & {
28
- readonly status: "working";
16
+ /** @deprecated Use workflow-backed background tools with yield descriptors. */
17
+ export interface TaskBinding {
29
18
  readonly taskId: string;
30
- };
31
- /**
32
- * Sentinel returned by a background tool after an external executor accepts
33
- * responsibility for the task. Returning it ends `execute`; it does not
34
- * complete the durable task.
35
- */
36
- export interface TaskDelegated<TData extends JsonObject = JsonObject> {
37
- readonly kind: typeof TASK_DELEGATED_KIND;
38
- readonly executor: TaskExecutorBinding;
39
- readonly receipt: TaskReceipt<TData>;
19
+ readonly token: string;
20
+ readonly url?: string;
40
21
  }
41
- /**
42
- * Commands an in-process executor may report to its task via
43
- * {@link TaskExec.send}. Deliberately narrower than the task run's full
44
- * command surface — bind, ready, and input routing stay runtime-owned.
45
- */
22
+ /** @deprecated Use workflow-backed background tools with yield descriptors. */
46
23
  export type TaskSendCommand = {
47
24
  readonly kind: "update";
48
25
  readonly message: string;
@@ -55,53 +32,24 @@ export type TaskSendCommand = {
55
32
  } | {
56
33
  readonly kind: "cancel";
57
34
  };
58
- /** Task capability passed only to tools declared with `execution: "background"`. */
35
+ /** Fixed acknowledgement returned when a background task is admitted. */
36
+ export interface TaskReceipt {
37
+ readonly status: "working";
38
+ readonly taskId: string;
39
+ }
40
+ /** Capability passed only to tools declared with `execution: "background"`. */
59
41
  export interface TaskExec {
60
- /**
61
- * The sibling background calls admitted in the same step. The only view a
62
- * tool has of what launched alongside it, for enforcing batch-wide
63
- * invariants before delegating.
64
- */
65
- readonly batch: readonly BackgroundToolCall[];
66
- /**
67
- * The task-private address for reporting lifecycle changes back to this
68
- * task. Hand it to the external executor so completion routes to the task
69
- * directly instead of through the (already finished) tool call.
70
- */
42
+ /** Model-facing durable task identity. */
43
+ readonly taskId: string;
44
+ /** Returns a descriptor which sends one message to the parent when yielded. */
45
+ postMessage(message: string): TaskMessage;
46
+ /** @deprecated Use yields from a workflow-backed background tool. */
71
47
  readonly binding: TaskBinding;
72
- /**
73
- * Snapshot of the harness session at step start, for reading context.
74
- * Mutating it changes nothing durable: session writes belong to the
75
- * runtime, keyed off the executor binding at step commit.
76
- */
77
- readonly session: HarnessSession;
78
- /**
79
- * Delivers progress or a terminal command to this task's inbox from the same
80
- * process, for executors that outlive `execute` in-memory (e.g. a callback firing
81
- * after delegation). Call it only after `execute` returned `delegated(...)`
82
- * — the runtime settles non-delegated returns itself, and a second terminal
83
- * command is refused. Not restart-safe: an in-process callback dies with
84
- * the process; the persisted executor binding remains the durable
85
- * cancellation path. Throws when the task no longer accepts commands
86
- * (already terminal).
87
- */
48
+ /** @deprecated Use yields from a workflow-backed background tool. */
88
49
  readonly send: (command: TaskSendCommand) => Promise<void>;
89
- /** The durable task backing this call; its identity outlives `execute`. */
50
+ /** @deprecated Use ctx.session. */
51
+ readonly session: HarnessSession;
52
+ /** @deprecated Framework-owned task internals are not part of the authoring API. */
90
53
  readonly task: BackgroundTask;
91
- /**
92
- * Builds the `TaskDelegated` sentinel to return from `execute`. Centralizes
93
- * receipt stamping so every receipt carries this task's `taskId` and
94
- * `status: "working"` — tools cannot mint receipts for tasks they don't own.
95
- */
96
- delegated<TData extends JsonObject>(input: {
97
- readonly executor: TaskExecutorBinding;
98
- readonly receipt: TData;
99
- }): TaskDelegated<TData>;
100
54
  }
101
- export declare function createTaskDelegated<TData extends JsonObject>(input: {
102
- readonly binding: TaskBinding;
103
- readonly executor: TaskExecutorBinding;
104
- readonly receipt: TData;
105
- }): TaskDelegated<TData>;
106
- export declare function isTaskDelegated(value: unknown): value is TaskDelegated;
107
55
  export {};
@@ -1 +1 @@
1
- const TASK_DELEGATED_KIND=`eve:task-delegated`;function createTaskDelegated(e){return{executor:e.executor,kind:TASK_DELEGATED_KIND,receipt:{...e.receipt,status:`working`,taskId:e.binding.taskId}}}function isTaskDelegated(e){return typeof e==`object`&&!!e&&`kind`in e&&e.kind===TASK_DELEGATED_KIND}export{createTaskDelegated,isTaskDelegated};
1
+ const TASK_MESSAGE_KIND=`eve:task-message`;function createTaskMessage(e){if(e.trim()===``)throw TypeError(`Task messages must not be empty.`);return{kind:TASK_MESSAGE_KIND,message:e}}function isTaskMessage(e){return typeof e==`object`&&!!e&&Reflect.get(e,`kind`)===TASK_MESSAGE_KIND}export{createTaskMessage,isTaskMessage};
@@ -0,0 +1,60 @@
1
+ import type { StandardJSONSchemaV1, StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
2
+ import type { Approval } from "#approval/definition.js";
3
+ import type { JsonObject, JsonValue } from "#shared/json.js";
4
+ import { type PublicToolDefinition, type BackgroundToolDefinition, type ToolContext, type ToolInputRequest, type ToolInputResponse } from "#tools/definition.js";
5
+ import type { TaskExec } from "#tools/task.js";
6
+ import type { ToolModelOutput } from "#tools/model-output.js";
7
+ export interface AgentInput {
8
+ readonly agentId?: string;
9
+ readonly key: string;
10
+ readonly message: string;
11
+ readonly outputSchema?: JsonObject;
12
+ readonly target: string;
13
+ }
14
+ /** Context supplied only to a defineWorkflowTool executor, inside its durable run. */
15
+ export type WorkflowToolContext = Pick<ToolContext, "abortSignal" | "callId" | "session" | "toolName"> & {
16
+ /** Invoke a visible subagent. The key must be unique within this workflow run. */
17
+ agent(input: AgentInput): Promise<JsonValue>;
18
+ /** Ask the human on the session's channel; awaiting the answer suspends the run. */
19
+ ask(request: ToolInputRequest): PromiseLike<ToolInputResponse>;
20
+ };
21
+ declare const WORKFLOW_TOOL_BRAND: unique symbol;
22
+ /** A static tool whose executor runs as a durable workflow. Its executor must start with "use workflow". */
23
+ export interface BlockingWorkflowToolDefinition<TInput = unknown, TOutput = unknown> extends PublicToolDefinition<TInput, TOutput> {
24
+ readonly [WORKFLOW_TOOL_BRAND]: true;
25
+ readonly execution?: never;
26
+ execute(input: TInput, ctx: WorkflowToolContext): Promise<TOutput> | AsyncIterable<TOutput>;
27
+ approval?: Approval<unknown extends TInput ? Record<string, unknown> : TInput>;
28
+ toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
29
+ }
30
+ type BackgroundWorkflowToolDefinition<TInput, TOutput> = Omit<BackgroundToolDefinition<TInput, TOutput>, "execute"> & {
31
+ readonly [WORKFLOW_TOOL_BRAND]: true;
32
+ execute(input: TInput, ctx: WorkflowToolContext, task: TaskExec): Promise<TOutput> | AsyncIterable<unknown>;
33
+ };
34
+ /** A static tool whose executor runs as a durable workflow. */
35
+ export type WorkflowToolDefinition<TInput = unknown, TOutput = unknown> = BlockingWorkflowToolDefinition<TInput, TOutput> | BackgroundWorkflowToolDefinition<TInput, TOutput>;
36
+ type Unbranded<T> = T extends unknown ? Omit<T, typeof WORKFLOW_TOOL_BRAND> : never;
37
+ type BackgroundReturn<T> = T extends AsyncGenerator<unknown, infer Output> ? Output : T extends AsyncIterable<unknown> ? null : Awaited<T>;
38
+ type BackgroundDefinition<TInput, TReturn> = Omit<BackgroundWorkflowToolDefinition<TInput, BackgroundReturn<TReturn>>, typeof WORKFLOW_TOOL_BRAND | "execute"> & {
39
+ execute(input: TInput, ctx: WorkflowToolContext, task: TaskExec): TReturn;
40
+ };
41
+ type WorkflowReturn<T> = T extends AsyncIterable<infer Output> ? Output : Awaited<T>;
42
+ type Schema = StandardSchemaV1<unknown, unknown> | StandardJSONSchemaV1<unknown, unknown>;
43
+ type Definition<TInput, TReturn> = Omit<BlockingWorkflowToolDefinition<TInput, WorkflowReturn<TReturn>>, typeof WORKFLOW_TOOL_BRAND | "execute"> & {
44
+ execute(input: TInput, ctx: WorkflowToolContext): TReturn;
45
+ };
46
+ export declare function defineWorkflowTool<TSchema extends Schema, TReturn extends Promise<unknown> | AsyncIterable<unknown>>(definition: Omit<BackgroundDefinition<StandardSchemaV1.InferOutput<TSchema>, TReturn>, "inputSchema"> & {
47
+ inputSchema: TSchema;
48
+ }): BackgroundWorkflowToolDefinition<StandardSchemaV1.InferOutput<TSchema>, BackgroundReturn<TReturn>>;
49
+ export declare function defineWorkflowTool<TReturn extends Promise<unknown> | AsyncIterable<unknown>>(definition: BackgroundDefinition<Record<string, unknown>, TReturn> & {
50
+ inputSchema: JsonObject;
51
+ }): BackgroundWorkflowToolDefinition<Record<string, unknown>, BackgroundReturn<TReturn>>;
52
+ export declare function defineWorkflowTool<TSchema extends Schema, TReturn extends Promise<unknown> | AsyncIterable<unknown>>(definition: Omit<Definition<StandardSchemaV1.InferOutput<TSchema>, TReturn>, "inputSchema"> & {
53
+ inputSchema: TSchema;
54
+ }): BlockingWorkflowToolDefinition<StandardSchemaV1.InferOutput<TSchema>, WorkflowReturn<TReturn>>;
55
+ export declare function defineWorkflowTool<TReturn extends Promise<unknown> | AsyncIterable<unknown>>(definition: Definition<Record<string, unknown>, TReturn> & {
56
+ inputSchema: JsonObject;
57
+ }): BlockingWorkflowToolDefinition<Record<string, unknown>, WorkflowReturn<TReturn>>;
58
+ export declare function defineWorkflowTool<TInput = unknown, TOutput = unknown>(definition: Unbranded<WorkflowToolDefinition<TInput, TOutput>>): WorkflowToolDefinition<TInput, TOutput>;
59
+ export declare function isWorkflowToolDefinition(value: unknown): boolean;
60
+ export {};
@@ -0,0 +1 @@
1
+ import{stampToolDefinition}from"#tools/definition.js";const WORKFLOW_TOOL_BRAND=Symbol.for(`eve:workflow-tool-brand`);function defineWorkflowTool(t){return stampToolDefinition(t,`defineWorkflowTool`),Object.assign(t,{[WORKFLOW_TOOL_BRAND]:!0})}function isWorkflowToolDefinition(e){return typeof e==`object`&&!!e&&Reflect.get(e,WORKFLOW_TOOL_BRAND)===!0}export{defineWorkflowTool,isWorkflowToolDefinition};
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-B4xN7-fK.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-D7apPojZ.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-B4xN7-fK.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-D7apPojZ.js";
2
2
 
3
3
  export { useEveAgent };
@@ -147,9 +147,9 @@ See [Default harness](./concepts/default-harness#compaction) for how the loop ap
147
147
 
148
148
  ## Runtime limits
149
149
 
150
- Use `limits` for framework-owned runtime caps. Session token limits stop the
150
+ Use `limits` for framework-owned runtime caps. Session usage limits stop the
151
151
  current durable session from starting another model call after accumulated
152
- provider-reported input or output token usage reaches the configured limit:
152
+ provider-reported tokens or model token cost reaches a configured limit:
153
153
 
154
154
  ```ts title="agent/agent.ts"
155
155
  export default defineAgent({
@@ -157,6 +157,7 @@ export default defineAgent({
157
157
  limits: {
158
158
  maxInputTokensPerSession: 200_000,
159
159
  maxOutputTokensPerSession: 20_000,
160
+ maxTokenCostUsdPerSession: 1.5,
160
161
  sessionTimeoutMs: 7 * 24 * 60 * 60 * 1_000,
161
162
  },
162
163
  });
@@ -169,14 +170,13 @@ then emits `session.completed` and releases the continuation; the next
169
170
  qualifying channel message starts fresh. Set it to `false` to disable the
170
171
  timeout. Expiration does not delete stored session data.
171
172
 
172
- Input and output budgets are checked independently. The model call that crosses
173
- either limit is allowed to finish because providers only report exact token
174
- usage after a call completes. Before the next model call, eve pauses the
173
+ Input tokens, output tokens, and model token cost are checked independently.
174
+ The model call that crosses a limit is allowed to finish because exact usage
175
+ arrives after the call completes. Before the next model call, eve pauses the
175
176
  session and sends a deterministic continuation prompt with two options:
176
- **Approve** grants a fresh budget window of the configured size (both input
177
- and output windows reset together), and **Stop** cancels the in-flight turn
178
- through the standard cancellation path (`turn.cancelled` → `session.waiting`)
179
- — a user decision, not an error. The session stays resumable; because it is
177
+ **Approve** grants a fresh window of each configured size, and **Stop**
178
+ cancels the in-flight turn through the standard cancellation path
179
+ (`turn.cancelled` → `session.waiting`) — a user decision, not an error. The session stays resumable; because it is
180
180
  still over budget, the next message re-raises the prompt. Declining a
181
181
  delegated child's prompt cancels the root turn, which cascades to the whole
182
182
  delegation tree — the delegating parent never receives an error result it
@@ -186,23 +186,28 @@ copy. The reply is processed once the budget is granted.
186
186
 
187
187
  Sessions that cannot reach a human — task-mode runs such as schedules and
188
188
  delegated runs without input proxying — skip the prompt and fail the next model
189
- call with `SESSION_TOKEN_LIMIT_REACHED`. A delegated task with no inherited
190
- quota also fails instead of raising a continuation prompt that could only
191
- grant another zero-token window.
189
+ call with `SESSION_TOKEN_LIMIT_REACHED` for token budgets or
190
+ `SESSION_TOKEN_COST_LIMIT_REACHED` for model token cost. A delegated task with
191
+ no inherited quota also fails instead of raising a continuation prompt that
192
+ could only grant another zero-value window.
192
193
 
193
194
  When `maxInputTokensPerSession` is omitted, root sessions apply a default
194
195
  input budget of `40_000_000` provider-reported input tokens.
195
- `maxOutputTokensPerSession` is unset unless configured. Setting either limit
196
- to `false` uncaps that axis — the session never stops on it.
196
+ `maxOutputTokensPerSession` and `maxTokenCostUsdPerSession` are unset by
197
+ default. `maxTokenCostUsdPerSession` is a US-dollar limit on model token cost,
198
+ not tool or infrastructure spend. It uses the cost reported with each model
199
+ step; AI Gateway supplies this value, while model steps without reported cost
200
+ do not add to the limit. Set any usage limit to `false` to uncap that axis.
197
201
 
198
202
  Delegated subagent sessions have no fixed default. Each child receives a
199
203
  share of the delegating parent's remaining quota at dispatch time — the
200
204
  remainder in the current budget window split evenly across the batch's local
201
205
  subagent calls — and a completed child's usage counts against the parent's
202
- quota, so a delegation tree can never outspend the budget configured at its
203
- root. Approving a continuation opens a fresh parent window for later child
204
- grants without erasing lifetime usage. An authored child limit applies only
205
- when it is tighter than the parent's grant; an uncapped parent delegates
206
+ quota. Token-cost budgets follow the same rules, including splitting the
207
+ remaining US-dollar budget across a batch and adding completed child cost back
208
+ to the parent. Approving a continuation opens a fresh parent window for later
209
+ child grants without erasing lifetime usage. An authored child limit applies
210
+ only when it is tighter than the parent's grant; an uncapped parent delegates
206
211
  uncapped children.
207
212
 
208
213
  ## Workflow world
@@ -250,7 +255,7 @@ installed package must stay external in hosted output, list it in
250
255
  | -------------- | --------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
251
256
  | `reasoning` | `AgentReasoningDefinition` | provider default | Provider-agnostic reasoning effort forwarded to the agent's turn model calls. |
252
257
  | `modelOptions` | `AgentModelOptionsDefinition` | none | Provider option overrides forwarded to the model call. |
253
- | `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. Sessions complete after 30 days by default; token-limit defaults and inheritance are described above. Set a limit to `false` to disable it. |
258
+ | `limits` | `AgentLimitsDefinition` | field-specific | Framework-owned runtime limits. Sessions complete after 30 days by default; usage-limit defaults and inheritance are described above. Set a limit to `false` to disable it. |
254
259
  | `experimental` | `{ workflow?: { world?: string } }` | unset | Opt-in settings that can change or disappear in any release. Treat them as unstable. `workflow.world` selects the Workflow world package backing session state, queues, hooks, and streams on the root agent. |
255
260
  | `outputSchema` | Standard Schema or a JSON Schema object | none | Structured return type for function-like invocations such as a subagent turn, schedule, or remote job. Ordinary interactive turns ignore it unless the client supplies a per-message schema. |
256
261
  | `build` | `{ externalDependencies?: string[] }` | none | Hosted-build packaging controls. `externalDependencies` keeps listed packages external while eve compiles authored modules such as tools and channels, and traces those packages into the hosted output. |
@@ -91,7 +91,7 @@ Stream a session as newline-delimited JSON from `GET /eve/v1/session/:sessionId/
91
91
 
92
92
  ### Cancel a turn
93
93
 
94
- Post to `/eve/v1/session/:sessionId/cancel` to request cancellation of the active turn. You can include the observed `turnId` to keep a late request from cancelling a newer turn. Cancellation is asynchronous; confirm it on the stream as `turn.cancelled` followed by `session.waiting`.
94
+ Post to `/eve/v1/session/:sessionId/cancel` to request cancellation of the active turn. You can include the observed `turnId` to keep a late request from cancelling a newer turn. Include `tasks: true` to also cancel every background task owned by the session, including while the session is parked. Cancellation is asynchronous; confirm the turn boundary on the stream as `turn.cancelled` followed by `session.waiting`, and inspect task state in a later turn to confirm task cancellation.
95
95
 
96
96
  See [Cancel the in-flight turn](../concepts/sessions-runs-and-streaming#cancel-the-in-flight-turn) for response statuses, HTTP status codes, subagent cancellation, and race behavior.
97
97
 
@@ -67,6 +67,8 @@ The authorization server identified by `issuer` must issue tokens accepted by th
67
67
 
68
68
  `oauthResource()` does not issue tokens or run an authorization server. It decorates an ordinary inbound `AuthFn` with OAuth protected-resource metadata so `mcpChannel()` can publish discovery and add `resource_metadata` to Bearer challenges. Client registration, consent, token issuance, and authorization-server metadata remain the identity provider's responsibility.
69
69
 
70
+ Most hosted MCP clients (Claude, ChatGPT, Grok, and similar) register themselves with the authorization server through Dynamic Client Registration ([RFC 7591](https://www.rfc-editor.org/rfc/rfc7591)) the first time a user connects. Choose an issuer that supports it, or pre-register each client with the issuer before the demo. If registration fails, the client stops before it ever reaches eve.
71
+
70
72
  ### Verify the bearer token yourself
71
73
 
72
74
  Use a custom `AuthFn` when token verification needs application-specific logic:
@@ -144,7 +146,7 @@ export default mcpChannel({
144
146
  });
145
147
  ```
146
148
 
147
- This allows anyone to invoke the agent. Every caller shares the anonymous principal, so invocation IDs become bearer capabilities until workflow retention expires. Use public access only when anonymous invocation is intentional.
149
+ This allows anyone to invoke the agent. Every caller shares the anonymous principal, so invocation IDs become bearer capabilities until workflow retention expires: anyone holding an ID can read, answer, or cancel that invocation. Use public access only when anonymous invocation is intentional. For a public demo, prefer [Interactive OAuth](#interactive-oauth) so each caller owns their own invocations.
148
150
 
149
151
  ## HTTP security
150
152
 
@@ -171,6 +173,10 @@ MCP clients receive four tools:
171
173
  | `agent_update` | `{ invocationId, responses }` | Answer the complete pending human-input batch. |
172
174
  | `agent_cancel` | `{ invocationId }` | Request cooperative cancellation of non-terminal work. |
173
175
 
176
+ The server also returns `instructions` from `initialize` and `server/discover` that summarize this
177
+ protocol for the connecting model, so a hosted client does not have to infer it from the tool
178
+ schemas alone.
179
+
174
180
  `agent_start` creates one task-mode eve session and returns after durable acceptance without
175
181
  waiting for the session continuation hook to become readable. Keep its `invocationId`, then call
176
182
  `agent_get` until the invocation reaches a terminal state. While the status is `working`, wait at
@@ -179,15 +185,31 @@ least `pollAfterMs` before polling again.
179
185
  The invocation response is discriminated by `status`:
180
186
 
181
187
  - `working`: work is active; continue polling according to `pollAfterMs`.
182
- - `input_required`: present `inputRequests`, then send the complete answer batch through `agent_update`. A successful update returns fresh `working` state.
188
+ - `input_required`: present `inputRequests`, then send the complete answer batch through `agent_update`. A successful update returns the current invocation state.
183
189
  - `authorization_required`: present the returned sign-in URL, user code, or instructions. The connection callback resumes the invocation automatically; continue polling.
184
190
  - `completed`: consume the optional `result`.
185
191
  - `failed`: inspect the structured `error`.
186
192
  - `cancelled`: cancellation reached a terminal state.
187
193
 
194
+ A tool result with `isError: true` means the call itself was rejected. A `failed` status means the call succeeded and the task itself failed. Handle them differently: correct the call in the first case, report the task failure in the second. Rejected calls carry `structuredContent.error` with a stable `code`, a short `message`, and `retryable`:
195
+
196
+ | `code` | Meaning | `retryable` |
197
+ | --------------- | ------------------------------------------------------------------------------ | ----------- |
198
+ | `invalid_input` | An argument was rejected, for example an oversized or external `outputSchema`. | `false` |
199
+ | `not_found` | The invocation does not exist, has expired, or belongs to another caller. | `false` |
200
+ | `conflict` | The invocation is not in the expected state; read it with `agent_get` first. | `true` |
201
+ | `internal` | eve failed; `errorId` correlates with server logs. No details are exposed. | `false` |
202
+
188
203
  Cancellation is cooperative, so call `agent_get` after `agent_cancel` until the state becomes terminal.
189
204
 
190
- Optional output schemas are limited to 64 KiB, 32 levels, and 2,048 nodes. External `$ref` values are rejected.
205
+ Requests are bounded: the whole MCP request body is limited to 1 MiB, `message` to 64 KiB, each input-response `text` to 16 KiB (both measured as UTF-8 bytes, not characters), and one `agent_update` to 64 responses. Optional output schemas are limited to 64 KiB, 32 levels, and 2,048 nodes, and external `$ref` values are rejected. Oversized bodies receive a JSON-RPC `413`; oversized fields fail input validation before any work starts.
206
+
207
+ ### Durability guarantees
208
+
209
+ - Once `agent_start` returns, the work is durable. A dropped HTTP connection, a client restart, or a closed MCP session does not cancel it. Only `agent_cancel` stops work.
210
+ - `agent_start` is not idempotent. If its response is lost, the client has no `invocationId` to check, and a second call starts a second task. Ask the user before starting again rather than retrying blindly.
211
+ - `agent_update` answers one pending batch. Re-sending the same answers after eve has accepted them returns the current invocation state; sending different answers for an already-answered batch is a conflict.
212
+ - `agent_cancel` is cooperative and can race with completion. Poll `agent_get` until the status is terminal (`cancelled`, `completed`, or `failed`), not specifically `cancelled`.
191
213
 
192
214
  ## Invocation ownership
193
215
 
@@ -134,7 +134,7 @@ import { sleep } from "eve/tools/sleep";
134
134
  export default sleep();
135
135
  ```
136
136
 
137
- The model calls it with `{ seconds }` when it is useful to wait before checking progress or status again. The pause sleeps the durable turn workflow, so it does not hold an application runtime open, and the same turn continues automatically when the duration elapses. If one model response makes concurrent `sleep` calls, eve waits for the longest requested duration.
137
+ The model calls it with `{ seconds }` when it is useful to wait before checking progress or status again. Each call runs as a durable tool workflow, so it does not hold an application runtime open, and the same turn continues automatically when the duration elapses. Concurrent `sleep` calls run in parallel, so the turn continues after the longest requested duration.
138
138
 
139
139
  ## What to read next
140
140
 
@@ -60,11 +60,22 @@ Crash the process, hit a timeout, or redeploy mid-turn, and the run picks up fro
60
60
 
61
61
  There's nothing to configure. eve owns the workflow lifecycle, and sessions are durable by default.
62
62
 
63
- You don't write workflow code directly. Workflow primitives (`start()`, `resumeHook()`, etc.) are an implementation detail of eve's runtime layer; channels, tools, and hooks never touch them. Two surfaces give your own code session data: tools read the current session's metadata (id, turn, auth, parent lineage) via `ctx.session`, and [`defineState`](./state) reads or writes session-scoped durable state. See [State](./state) for the read/write model.
63
+ For ordinary tools, eve manages the workflow around your executor. Use [`defineWorkflowTool`](../tools/workflows) when your own tool body needs durable waits, such as a timer, webhook, or human answer. Two surfaces give your own code session data: tools read the current session's metadata (id, turn, auth, parent lineage) via `ctx.session`, and [`defineState`](./state) reads or writes session-scoped durable state. See [State](./state) for the read/write model.
64
64
 
65
65
  ## Parked work
66
66
 
67
- Some work has to wait, including a human approving a [tool](../tools) or an interactive OAuth sign-in for a [connection](../connections). At those points the turn parks durably. The workflow suspends and holds no compute until the input it's waiting on arrives, even if that's much later. When it does, the conversation picks up exactly where it left off. Background tools and subagents return a task receipt instead, so the turn continues and later task notifications deliver progress or the outcome.
67
+ Some work has to wait, including a human approving a [tool](../tools) or an interactive OAuth sign-in for a [connection](../connections). At those points the turn parks durably. The workflow suspends and holds no compute until the input it's waiting on arrives, even if that's much later. When it does, the conversation picks up exactly where it left off.
68
+
69
+ Background execution is a separate choice about result delivery. A background workflow tool
70
+ returns a task receipt so the parent turn can continue; the tool's workflow may then run or
71
+ suspend independently. A default workflow tool can suspend too, with its original tool call
72
+ still pending. Ordinary background tools run their executor inside the initiating step and do
73
+ not gain durable waits by setting `execution: "background"`.
74
+
75
+ A generator's `yield` reports progress; an awaited workflow operation provides the durable wait.
76
+ For background tools, ordinary yields are stream-only, while `yield task.postMessage(...)`
77
+ requests a parent-agent turn. See [background execution](../tools#background-execution) and
78
+ [workflow suspension](../tools/workflows#how-suspension-works) for the execution and result rules.
68
79
 
69
80
  ## Message delivery and steering
70
81
 
@@ -191,7 +191,15 @@ curl -X POST http://127.0.0.1:2000/eve/v1/session/<sessionId>/cancel
191
191
  # {"ok":true,"sessionId":"<sessionId>","status":"accepted"}
192
192
  ```
193
193
 
194
- `"accepted"` means the live session durably queued the request. Confirm an actual cancellation on the stream as `turn.cancelled` followed by `session.waiting`; the session then accepts the next message normally. Background tasks that were already admitted survive initiating-turn cancellation and are stopped with `task_cancel`; background work that has not yet been admitted is rejected with the cancelled step. Each cancelled child reports its own boundary on its child-session stream. A live but already-parked session also returns `"accepted"` and consumes the command as a no-op. `"no_active_turn"` means the session or channel address is unknown or terminal. Both statuses are success, so clients can fire and forget. See the [eve channel](../channels/eve) for the full route contract.
194
+ By default, background tasks that were already admitted survive initiating-turn cancellation. Pass `tasks: true` to cancel every background task owned by the session as well. This works while the session is parked, so you can stop background work without resetting the session:
195
+
196
+ ```bash
197
+ curl -X POST http://127.0.0.1:2000/eve/v1/session/<sessionId>/cancel \
198
+ -H 'content-type: application/json' \
199
+ -d '{"tasks":true}'
200
+ ```
201
+
202
+ `"accepted"` means the live session durably queued the request; cancellation completes asynchronously. Confirm turn cancellation on the stream as `turn.cancelled` followed by `session.waiting`. Inspect task state in a later turn to confirm task cancellation. The session then accepts the next message normally. Background work that has not yet been admitted is rejected with the cancelled step. Each cancelled child reports its own boundary on its child-session stream. A live but already-parked session returns `"accepted"`; plain cancellation is a no-op there, while `tasks: true` still cancels indexed tasks. `"no_active_turn"` means the session or channel address is unknown or terminal. Both statuses are success, so clients can fire and forget. See the [eve channel](../channels/eve) for the full route contract.
195
203
 
196
204
  The HTTP route returns `202` for `"accepted"` and `200` for
197
205
  `"no_active_turn"`. Only the accepted result includes `sessionId`.
@@ -59,7 +59,7 @@ const { session, response } = await client.sessions.create({
59
59
  await response.result();
60
60
  ```
61
61
 
62
- `clientContext` is one-turn context for the next model call. Strings become user-role context messages, arrays of strings become multiple context messages, and objects are JSON-serialized into one context message. It isn't persisted to durable session history and doesn't dispatch a turn by itself.
62
+ `clientContext` is ephemeral context for the current turn. Strings become user-role context messages, arrays of strings become multiple context messages, and objects are JSON-serialized into one context message. The context remains available to every model call in the turn, then disappears before the next turn. It isn't persisted to durable session history and doesn't dispatch a turn by itself.
63
63
 
64
64
  ## Send attachments
65
65
 
@@ -237,7 +237,7 @@ stream index after the captured prefix.
237
237
 
238
238
  ## Abort a request
239
239
 
240
- Pass an `AbortSignal` to cancel the POST or stream. Aborting is local transport cancellation: turns are resumable across disconnects, so detaching never stops the server-side turn — it keeps running and remains attachable by index. To stop the turn itself, POST the session's [cancel route](../../channels/eve#routes) and watch the stream settle with `turn.cancelled` followed by `session.waiting`.
240
+ Pass an `AbortSignal` to cancel the POST or stream. Aborting is local transport cancellation: turns are resumable across disconnects, so detaching never stops server-side work. Use `session.cancel()` to stop the active turn, or `session.cancel({ tasks: true })` to also stop background tasks owned by the session. Cancellation is asynchronous; watch the stream for `turn.cancelled` followed by `session.waiting`, and inspect task state in a later turn to confirm task cancellation.
241
241
 
242
242
  Arm the timeout before awaiting `send()` so it covers the POST as well as the stream:
243
243
 
@@ -63,12 +63,14 @@ my-project/
63
63
  └── agent/
64
64
  ```
65
65
 
66
- An `agents/` directory marks the project as a workspace. eve validates and discovers only direct `agents/<name>/agent/` children. Their directory names become their public identities, exposed at `/<name>/eve/v1/*`. Run an agent-specific command from a child directory or pass `--agent <name>` at the workspace root; interactive commands open a picker when the name is omitted. Run project-level build, link, and deploy commands from the workspace root. The workspace root owns the project package, dependencies, and build scripts.
66
+ In an eve workspace, eve discovers direct `agents/<name>/` children that contain nested or flat agent files and do not have their own `package.json`. Their directory names become their public identities, exposed at `/<name>/eve/v1/*`. A child with its own `package.json` is a separate package rather than a member of the parent eve workspace. Run an agent-specific command from a member directory or pass `--agent <name>` at the workspace root; interactive commands open a picker when the name is omitted. Run project-level build, link, and deploy commands from the workspace root. Workspace members share the root package, dependencies, and build scripts.
67
67
 
68
68
  Create this layout with `eve init my-project --agents support,research`, or add one agent to an existing workspace with `eve init billing`.
69
69
 
70
70
  With no authored `vercel.json#services`, `eve build` derives the complete Vercel Services graph on every build. If `vercel.json` declares `services`, that authored graph is authoritative instead; use `vercel build` to build and validate the complete project. This supports heterogeneous projects with frontends, private APIs, bindings, and other non-eve services without generated configuration files.
71
71
 
72
+ An authored eve service routed at `/eve/v1` already uses the protocol path; callbacks remain at `/eve/v1/callback/*`. A named mount such as `/support` adds that mount before the protocol path, giving `/support/eve/v1/callback/*`.
73
+
72
74
  Deploy the linked project to production:
73
75
 
74
76
  ```bash