eve 0.50.0 → 0.51.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 (450) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/src/acp/adapter.js +1 -1
  3. package/dist/src/channel/types.d.ts +12 -19
  4. package/dist/src/chunks/{use-eve-agent-DUMU6dap.js → use-eve-agent-B4xN7-fK.js} +4 -4
  5. package/dist/src/chunks/{use-eve-agent-B5I-k6Ek.js → use-eve-agent-C3vUG5g2.js} +4 -4
  6. package/dist/src/cli/acp/command.d.ts +1 -1
  7. package/dist/src/cli/acp/command.js +2 -2
  8. package/dist/src/cli/agent-command.d.ts +5 -0
  9. package/dist/src/cli/agent-command.js +1 -0
  10. package/dist/src/cli/application-command.d.ts +2 -0
  11. package/dist/src/cli/commands/build.d.ts +1 -1
  12. package/dist/src/cli/commands/build.js +1 -1
  13. package/dist/src/cli/commands/deploy.d.ts +2 -0
  14. package/dist/src/cli/commands/deploy.js +1 -1
  15. package/dist/src/cli/commands/init-agent-workspace.d.ts +14 -0
  16. package/dist/src/cli/commands/init-agent-workspace.js +1 -0
  17. package/dist/src/cli/commands/init-repl.js +1 -1
  18. package/dist/src/cli/commands/init.d.ts +2 -13
  19. package/dist/src/cli/commands/init.js +1 -1
  20. package/dist/src/cli/commands/integration-connect.js +1 -1
  21. package/dist/src/cli/commands/link.d.ts +2 -0
  22. package/dist/src/cli/commands/link.js +1 -1
  23. package/dist/src/cli/commands/preconditions.d.ts +15 -0
  24. package/dist/src/cli/commands/preconditions.js +1 -1
  25. package/dist/src/cli/commands/register-integration-commands.d.ts +1 -1
  26. package/dist/src/cli/commands/register-integration-commands.js +1 -1
  27. package/dist/src/cli/commands/register-registry-commands.js +2 -2
  28. package/dist/src/cli/commands/registry.js +1 -1
  29. package/dist/src/cli/dev/environment.d.ts +1 -1
  30. package/dist/src/cli/dev/environment.js +1 -1
  31. package/dist/src/cli/dev/local-server-process.js +1 -1
  32. package/dist/src/cli/dev/tui/runner.js +1 -1
  33. package/dist/src/cli/invoke/command.d.ts +1 -1
  34. package/dist/src/cli/invoke/command.js +1 -1
  35. package/dist/src/cli/option-parsers.d.ts +1 -0
  36. package/dist/src/cli/option-parsers.js +1 -1
  37. package/dist/src/cli/run.js +3 -3
  38. package/dist/src/client/agent-info-schema.d.ts +0 -1
  39. package/dist/src/client/agent-info-schema.js +1 -1
  40. package/dist/src/client/message-action-parts.js +1 -1
  41. package/dist/src/compiled/.vendor-stamp.json +1 -1
  42. package/dist/src/compiler/extension-compatibility.d.ts +18 -18
  43. package/dist/src/compiler/extension-compatibility.js +1 -1
  44. package/dist/src/compiler/manifest.js +1 -1
  45. package/dist/src/compiler/normalize-agent-config.js +1 -1
  46. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  47. package/dist/src/compiler/normalize-manifest.js +1 -1
  48. package/dist/src/context/build-dynamic-tools.js +1 -1
  49. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  50. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  51. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  52. package/dist/src/context/keys.d.ts +0 -3
  53. package/dist/src/context/keys.js +1 -1
  54. package/dist/src/discover/project.js +1 -1
  55. package/dist/src/evals/cli/eval.js +1 -1
  56. package/dist/src/evals/mock-model.js +1 -1
  57. package/dist/src/eve-channel/index.js +1 -1
  58. package/dist/src/execution/activity-work-id.js +1 -1
  59. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  60. package/dist/src/execution/channel-context.js +1 -1
  61. package/dist/src/execution/coordination-dispatch-shared.d.ts +103 -0
  62. package/dist/src/execution/coordination-dispatch-shared.js +1 -0
  63. package/dist/src/execution/coordination-dispatch-step.d.ts +7 -0
  64. package/dist/src/execution/coordination-dispatch-step.js +1 -0
  65. package/dist/src/execution/create-session-step.d.ts +1 -2
  66. package/dist/src/execution/create-session-step.js +1 -1
  67. package/dist/src/execution/deliver-payloads.js +1 -1
  68. package/dist/src/execution/dispatch-action-failures.d.ts +5 -5
  69. package/dist/src/execution/dispatch-action-failures.js +1 -1
  70. package/dist/src/execution/dispatch-start-operation.d.ts +1 -1
  71. package/dist/src/execution/dispatch-start-operation.js +1 -1
  72. package/dist/src/execution/durable-session-store.d.ts +1 -1
  73. package/dist/src/execution/eve-workflow-attributes.d.ts +1 -1
  74. package/dist/src/execution/inline-turn.js +1 -1
  75. package/dist/src/execution/next-driver-action.d.ts +7 -10
  76. package/dist/src/execution/node-step.d.ts +1 -2
  77. package/dist/src/execution/node-step.js +1 -1
  78. package/dist/src/execution/pending-turn-state.d.ts +1 -2
  79. package/dist/src/execution/pending-turn-state.js +1 -1
  80. package/dist/src/execution/proxied-deliver-step.js +1 -1
  81. package/dist/src/execution/route-child-delivery.js +1 -1
  82. package/dist/src/execution/runtime-context.js +1 -1
  83. package/dist/src/execution/session-command-inbox.d.ts +2 -3
  84. package/dist/src/execution/session.d.ts +1 -1
  85. package/dist/src/execution/session.js +2 -2
  86. package/dist/src/execution/settle-cancelled-turn-step.d.ts +1 -1
  87. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  88. package/dist/src/execution/stable-workflow-names.d.ts +1 -1
  89. package/dist/src/execution/stable-workflow-names.js +1 -1
  90. package/dist/src/execution/task-event-callback.js +1 -1
  91. package/dist/src/execution/tasks/child/steps.d.ts +18 -18
  92. package/dist/src/execution/tasks/child/steps.js +1 -1
  93. package/dist/src/execution/tasks/child/update-step.d.ts +6 -0
  94. package/dist/src/execution/tasks/child/update-step.js +1 -0
  95. package/dist/src/execution/tasks/child/update.d.ts +7 -10
  96. package/dist/src/execution/tasks/child/update.js +1 -1
  97. package/dist/src/execution/tasks/child/workflow.d.ts +21 -29
  98. package/dist/src/execution/tasks/child/workflow.js +1 -1
  99. package/dist/src/execution/tasks/parent/control-shared.d.ts +6 -17
  100. package/dist/src/execution/tasks/parent/control-shared.js +1 -1
  101. package/dist/src/execution/tasks/parent/delegate.d.ts +15 -50
  102. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  103. package/dist/src/execution/tasks/parent/dispatch.d.ts +19 -34
  104. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  105. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +5 -15
  106. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  107. package/dist/src/execution/tasks/parent/run-parent.d.ts +2 -2
  108. package/dist/src/execution/tasks/parent/task-cancel.d.ts +11 -0
  109. package/dist/src/execution/tasks/parent/task-cancel.js +1 -0
  110. package/dist/src/execution/tasks/parent/tool-execution.d.ts +2 -3
  111. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  112. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  113. package/dist/src/execution/tools/subagent/accept-event-step.d.ts +7 -0
  114. package/dist/src/execution/tools/subagent/accept-event-step.js +1 -0
  115. package/dist/src/execution/tools/subagent/emit-called-step.d.ts +9 -0
  116. package/dist/src/execution/tools/subagent/emit-called-step.js +1 -0
  117. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +51 -0
  118. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -0
  119. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +37 -0
  120. package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -0
  121. package/dist/src/execution/tools/subagent/invoke-step.d.ts +55 -0
  122. package/dist/src/execution/tools/subagent/invoke-step.js +1 -0
  123. package/dist/src/execution/tools/subagent/receipt-identity.d.ts +11 -0
  124. package/dist/src/execution/tools/subagent/receipt-identity.js +1 -0
  125. package/dist/src/execution/{dispatch-runtime-actions-start.d.ts → tools/subagent/start.d.ts} +17 -5
  126. package/dist/src/execution/tools/subagent/start.js +1 -0
  127. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +24 -0
  128. package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -0
  129. package/dist/src/execution/tools/subagent/task-cancel.d.ts +10 -0
  130. package/dist/src/execution/tools/subagent/task-cancel.js +1 -0
  131. package/dist/src/execution/tools/tasks.d.ts +10 -0
  132. package/dist/src/execution/tools/tasks.js +1 -0
  133. package/dist/src/execution/{tool-run → tools/workflow}/answer.d.ts +1 -1
  134. package/dist/src/execution/tools/workflow/answer.js +1 -0
  135. package/dist/src/execution/tools/workflow/ask.d.ts +22 -0
  136. package/dist/src/execution/tools/workflow/ask.js +1 -0
  137. package/dist/src/execution/tools/workflow/background.d.ts +18 -0
  138. package/dist/src/execution/tools/workflow/background.js +1 -0
  139. package/dist/src/execution/tools/workflow/body.d.ts +25 -0
  140. package/dist/src/execution/tools/workflow/body.js +1 -0
  141. package/dist/src/execution/tools/workflow/cancel.d.ts +11 -0
  142. package/dist/src/execution/tools/workflow/cancel.js +1 -0
  143. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +7 -0
  144. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -0
  145. package/dist/src/execution/tools/workflow/messages.d.ts +88 -0
  146. package/dist/src/execution/tools/workflow/messages.js +1 -0
  147. package/dist/src/execution/tools/workflow/owner-inbox.d.ts +13 -0
  148. package/dist/src/execution/tools/workflow/owner-inbox.js +1 -0
  149. package/dist/src/execution/tools/workflow/owner.d.ts +13 -0
  150. package/dist/src/execution/tools/workflow/owner.js +1 -0
  151. package/dist/src/execution/tools/workflow/run-control.d.ts +18 -0
  152. package/dist/src/execution/tools/workflow/run-control.js +1 -0
  153. package/dist/src/execution/tools/workflow/start.d.ts +33 -0
  154. package/dist/src/execution/tools/workflow/start.js +1 -0
  155. package/dist/src/execution/tools/workflow/types.d.ts +26 -0
  156. package/dist/src/execution/tools/workflow/types.js +1 -0
  157. package/dist/src/execution/tools/workflow/workflow.d.ts +3 -0
  158. package/dist/src/execution/tools/workflow/workflow.js +1 -0
  159. package/dist/src/execution/turn-workflow-tool-run.d.ts +16 -0
  160. package/dist/src/execution/turn-workflow-tool-run.js +1 -0
  161. package/dist/src/execution/turn-workflow.js +1 -1
  162. package/dist/src/execution/wire/session-inbox-contract.d.ts +2 -2
  163. package/dist/src/execution/wire/session-inbox-contract.js +1 -1
  164. package/dist/src/execution/wire/session-inbox-encoder.d.ts +6 -2
  165. package/dist/src/execution/wire/session-inbox-encoder.js +1 -1
  166. package/dist/src/execution/wire/session-inbox-wire.d.ts +3 -3
  167. package/dist/src/execution/wire/session-inbox-wire.js +1 -1
  168. package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
  169. package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +267 -0
  170. package/dist/src/execution/wire/session-inbox-wire.v4.js +1 -0
  171. package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +3 -0
  172. package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +1 -0
  173. package/dist/src/execution/workflow-entry-finalization.d.ts +6 -0
  174. package/dist/src/execution/workflow-entry-finalization.js +1 -1
  175. package/dist/src/execution/workflow-entry.d.ts +2 -1
  176. package/dist/src/execution/workflow-entry.js +1 -1
  177. package/dist/src/execution/workflow-runtime.d.ts +1 -1
  178. package/dist/src/execution/workflow-runtime.js +1 -1
  179. package/dist/src/execution/workflow-steps.js +1 -1
  180. package/dist/src/framework/sources/registry.js +1 -1
  181. package/dist/src/harness/advertised-tools.d.ts +1 -7
  182. package/dist/src/harness/advertised-tools.js +1 -1
  183. package/dist/src/harness/background-tools.d.ts +8 -2
  184. package/dist/src/harness/{runtime-actions.d.ts → coordination.d.ts} +40 -27
  185. package/dist/src/harness/coordination.js +1 -0
  186. package/dist/src/harness/emission.d.ts +9 -2
  187. package/dist/src/harness/emission.js +1 -1
  188. package/dist/src/harness/execute-tool.d.ts +52 -0
  189. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
  190. package/dist/src/harness/input-requests.js +1 -1
  191. package/dist/src/harness/proxy-input-requests.d.ts +6 -2
  192. package/dist/src/harness/stale-input-responses.js +1 -1
  193. package/dist/src/harness/step-hooks.d.ts +1 -2
  194. package/dist/src/harness/step-hooks.js +1 -1
  195. package/dist/src/harness/tool-call-action.js +1 -1
  196. package/dist/src/harness/tool-call-input-errors.js +1 -1
  197. package/dist/src/harness/tool-loop.js +2 -2
  198. package/dist/src/harness/tools.js +1 -1
  199. package/dist/src/harness/turn-tag-state.d.ts +3 -1
  200. package/dist/src/harness/types.d.ts +4 -7
  201. package/dist/src/harness/workflow-interrupt-state.js +1 -1
  202. package/dist/src/harness/workflow-lifecycle.d.ts +10 -0
  203. package/dist/src/harness/workflow-lifecycle.js +1 -1
  204. package/dist/src/harness/workflow-sandbox.d.ts +1 -1
  205. package/dist/src/harness/workflow-sandbox.js +2 -2
  206. package/dist/src/harness/workflow-subagent-limit.d.ts +7 -7
  207. package/dist/src/harness/workflow-subagent-limit.js +1 -1
  208. package/dist/src/harness/workflow-task-state.d.ts +9 -0
  209. package/dist/src/harness/workflow-task-state.js +1 -0
  210. package/dist/src/harness/workflow-tool-runs.d.ts +27 -0
  211. package/dist/src/harness/workflow-tool-runs.js +1 -0
  212. package/dist/src/instrumentation/native-events.js +1 -1
  213. package/dist/src/instrumentation/parent-lineage.js +1 -1
  214. package/dist/src/internal/agent-name.d.ts +4 -0
  215. package/dist/src/internal/agent-name.js +1 -0
  216. package/dist/src/internal/agent-workspace.d.ts +15 -0
  217. package/dist/src/internal/agent-workspace.js +1 -0
  218. package/dist/src/internal/application/package.js +1 -1
  219. package/dist/src/internal/authored-definition/core.js +1 -1
  220. package/dist/src/internal/nitro/host/build-application.js +1 -1
  221. package/dist/src/internal/nitro/host/start-development-server.js +1 -1
  222. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  223. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
  224. package/dist/src/internal/project-context.d.ts +26 -0
  225. package/dist/src/internal/project-context.js +1 -0
  226. package/dist/src/internal/vercel/assemble-eve-services.d.ts +17 -0
  227. package/dist/src/internal/vercel/assemble-eve-services.js +1 -0
  228. package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -0
  229. package/dist/src/internal/vercel/build-agent-workspace.js +1 -0
  230. package/dist/src/internal/vercel/build-command.d.ts +4 -0
  231. package/dist/src/internal/vercel/build-command.js +1 -0
  232. package/dist/src/internal/vercel/eve-service-contribution.d.ts +27 -0
  233. package/dist/src/internal/vercel/eve-service-contribution.js +1 -0
  234. package/dist/src/internal/vercel/vercel-service-config-operations.d.ts +18 -0
  235. package/dist/src/internal/vercel/vercel-service-config-operations.js +1 -0
  236. package/dist/src/internal/vercel/vercel-service-name.d.ts +6 -0
  237. package/dist/src/internal/vercel/vercel-service-name.js +1 -0
  238. package/dist/src/internal/vercel/vercel-services-config.d.ts +53 -0
  239. package/dist/src/internal/vercel/vercel-services-config.js +1 -0
  240. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  241. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  242. package/dist/src/protocol/message.d.ts +2 -0
  243. package/dist/src/protocol/message.js +1 -1
  244. package/dist/src/public/channels/slack/action-status.js +1 -1
  245. package/dist/src/public/memory/file/backends/vercel-blob.js +1 -1
  246. package/dist/src/public/next/index.js +1 -1
  247. package/dist/src/public/next/vercel-output-config.js +1 -1
  248. package/dist/src/public/workflow/index.d.ts +3 -1
  249. package/dist/src/public/workflow/index.js +1 -1
  250. package/dist/src/runtime/actions/results.d.ts +3 -3
  251. package/dist/src/runtime/actions/results.js +1 -1
  252. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
  253. package/dist/src/runtime/agent/bootstrap.d.ts +1 -0
  254. package/dist/src/runtime/agent/bootstrap.js +1 -1
  255. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  256. package/dist/src/runtime/channels/registry.js +1 -1
  257. package/dist/src/runtime/prompt/compose.d.ts +0 -1
  258. package/dist/src/runtime/prompt/compose.js +1 -1
  259. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  260. package/dist/src/runtime/resolve-agent.js +1 -1
  261. package/dist/src/runtime/sessions/turn.d.ts +16 -1
  262. package/dist/src/runtime/subagents/registry.js +1 -1
  263. package/dist/src/runtime/subagents/workflow-reference.d.ts +5 -0
  264. package/dist/src/runtime/subagents/workflow-reference.js +1 -0
  265. package/dist/src/runtime/subagents/workflow.d.ts +8 -0
  266. package/dist/src/runtime/subagents/workflow.js +1 -0
  267. package/dist/src/runtime/tools/registry.js +1 -1
  268. package/dist/src/setup/integrations/discord/setup.js +1 -1
  269. package/dist/src/setup/integrations/file-memory/vercel.js +1 -1
  270. package/dist/src/setup/integrations/linear/setup.js +1 -1
  271. package/dist/src/setup/integrations/linq/setup.js +3 -3
  272. package/dist/src/setup/integrations/shopify/setup.js +1 -1
  273. package/dist/src/setup/scaffold/create/project.js +1 -1
  274. package/dist/src/setup/scaffold/update/channels.d.ts +4 -12
  275. package/dist/src/setup/scaffold/update/channels.js +1 -1
  276. package/dist/src/shared/action-types.d.ts +74 -14
  277. package/dist/src/shared/action-types.js +1 -1
  278. package/dist/src/shared/json.js +1 -1
  279. package/dist/src/shared/workflow-sandbox.d.ts +1 -1
  280. package/dist/src/{execution/subagent-adapter-state.d.ts → subagents/adapter-state.d.ts} +2 -0
  281. package/dist/src/{execution/subagent-adapter-state.js → subagents/adapter-state.js} +1 -1
  282. package/dist/src/subagents/adapter.js +1 -0
  283. package/dist/src/{harness → subagents}/agent-handle-errors.d.ts +6 -0
  284. package/dist/src/subagents/agent-handle-errors.js +1 -0
  285. package/dist/src/subagents/callback-route.js +1 -0
  286. package/dist/src/subagents/callback-step.js +1 -0
  287. package/dist/src/{execution/agent-continuation-bundle.d.ts → subagents/continuation-bundle.d.ts} +1 -1
  288. package/dist/src/subagents/continuation-bundle.js +1 -0
  289. package/dist/src/{execution/subagent-event-proxy-step.d.ts → subagents/event-proxy-step.d.ts} +2 -8
  290. package/dist/src/subagents/event-proxy-step.js +1 -0
  291. package/dist/src/subagents/handle-dispatch.d.ts +54 -0
  292. package/dist/src/subagents/handle-dispatch.js +1 -0
  293. package/dist/src/{harness → subagents}/handles/prompt.d.ts +4 -4
  294. package/dist/src/{harness → subagents}/handles/prompt.js +1 -1
  295. package/dist/src/{harness → subagents}/handles/query.d.ts +8 -2
  296. package/dist/src/subagents/handles/query.js +1 -0
  297. package/dist/src/subagents/handles/rebase.d.ts +4 -0
  298. package/dist/src/subagents/handles/rebase.js +1 -0
  299. package/dist/src/{harness → subagents}/handles/store.d.ts +90 -15
  300. package/dist/src/subagents/handles/store.js +1 -0
  301. package/dist/src/subagents/handles/transitions.d.ts +103 -0
  302. package/dist/src/subagents/handles/transitions.js +1 -0
  303. package/dist/src/{execution/delegated-parent-notification.d.ts → subagents/parent-notification.d.ts} +1 -7
  304. package/dist/src/subagents/parent-notification.js +1 -0
  305. package/dist/src/subagents/parent-result.js +1 -0
  306. package/dist/src/{execution/remote-agent-dispatch.d.ts → subagents/remote-dispatch.d.ts} +3 -2
  307. package/dist/src/subagents/remote-dispatch.js +1 -0
  308. package/dist/src/{execution/subagent-start-local.d.ts → subagents/start-local.d.ts} +5 -6
  309. package/dist/src/subagents/start-local.js +1 -0
  310. package/dist/src/{execution/subagent-start-remote.d.ts → subagents/start-remote.d.ts} +5 -5
  311. package/dist/src/subagents/start-remote.js +1 -0
  312. package/dist/src/{execution/subagent-tool.d.ts → subagents/tool.d.ts} +5 -3
  313. package/dist/src/subagents/tool.js +1 -0
  314. package/dist/src/svelte/index.js +1 -1
  315. package/dist/src/svelte/use-eve-agent.js +1 -1
  316. package/dist/src/tasks/json.js +1 -1
  317. package/dist/src/tasks/session-index.d.ts +2 -3
  318. package/dist/src/tasks/session-index.js +1 -1
  319. package/dist/src/tasks/task-id.d.ts +3 -4
  320. package/dist/src/tasks/task-id.js +1 -1
  321. package/dist/src/tasks/transitions.d.ts +3 -47
  322. package/dist/src/tasks/transitions.js +1 -1
  323. package/dist/src/tasks/types.d.ts +69 -247
  324. package/dist/src/tasks/types.js +1 -1
  325. package/dist/src/tools/dynamic.d.ts +3 -1
  326. package/dist/src/tools/framework/agent.d.ts +18 -2
  327. package/dist/src/tools/framework/agent.js +1 -1
  328. package/dist/src/tools/framework/task-cancel.d.ts +2 -6
  329. package/dist/src/tools/framework/task-contract.d.ts +44 -65
  330. package/dist/src/tools/framework/task-contract.js +1 -1
  331. package/dist/src/tools/framework/task-update.d.ts +1 -0
  332. package/dist/src/tools/framework/task-update.js +1 -1
  333. package/dist/src/vue/index.js +1 -1
  334. package/dist/src/vue/use-eve-agent.js +1 -1
  335. package/docs/concepts/built-in-tools.md +9 -90
  336. package/docs/concepts/context-control.md +2 -2
  337. package/docs/concepts/execution-model-and-durability.mdx +1 -1
  338. package/docs/concepts/sessions-runs-and-streaming.md +3 -3
  339. package/docs/guides/deployment/vercel.mdx +20 -2
  340. package/docs/guides/dynamic-capabilities.md +2 -2
  341. package/docs/guides/frontend/overview.mdx +1 -1
  342. package/docs/guides/instrumentation-providers.md +242 -0
  343. package/docs/guides/instrumentation.md +2 -0
  344. package/docs/guides/meta.json +1 -0
  345. package/docs/guides/remote-agents.md +8 -9
  346. package/docs/reference/cli.md +5 -2
  347. package/docs/sandbox.mdx +2 -0
  348. package/docs/subagents/index.mdx +9 -8
  349. package/docs/tools/overview.mdx +11 -10
  350. package/docs/tools/workflows.mdx +52 -18
  351. package/package.json +1 -1
  352. package/dist/src/execution/agent-continuation-bundle.js +0 -1
  353. package/dist/src/execution/agent-handle-dispatch.d.ts +0 -79
  354. package/dist/src/execution/agent-handle-dispatch.js +0 -1
  355. package/dist/src/execution/delegated-parent-notification.js +0 -1
  356. package/dist/src/execution/delegated-parent-result.js +0 -1
  357. package/dist/src/execution/delegation-tool.d.ts +0 -10
  358. package/dist/src/execution/delegation-tool.js +0 -1
  359. package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +0 -165
  360. package/dist/src/execution/dispatch-runtime-actions-shared.js +0 -1
  361. package/dist/src/execution/dispatch-runtime-actions-start.js +0 -1
  362. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +0 -18
  363. package/dist/src/execution/dispatch-runtime-actions-step.js +0 -1
  364. package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +0 -18
  365. package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +0 -1
  366. package/dist/src/execution/finalize-terminal-session.d.ts +0 -17
  367. package/dist/src/execution/finalize-terminal-session.js +0 -1
  368. package/dist/src/execution/prepared-agent-action.d.ts +0 -7
  369. package/dist/src/execution/prepared-agent-action.js +0 -1
  370. package/dist/src/execution/remote-agent-dispatch.js +0 -1
  371. package/dist/src/execution/session-callback-route.js +0 -1
  372. package/dist/src/execution/session-callback-step.js +0 -1
  373. package/dist/src/execution/subagent-adapter.js +0 -1
  374. package/dist/src/execution/subagent-event-proxy-step.js +0 -1
  375. package/dist/src/execution/subagent-start-local.js +0 -1
  376. package/dist/src/execution/subagent-start-remote.js +0 -1
  377. package/dist/src/execution/subagent-tool.js +0 -1
  378. package/dist/src/execution/tasks/child/instructions.d.ts +0 -3
  379. package/dist/src/execution/tasks/child/instructions.js +0 -1
  380. package/dist/src/execution/tasks/parent/agent-identity.d.ts +0 -13
  381. package/dist/src/execution/tasks/parent/agent-identity.js +0 -1
  382. package/dist/src/execution/tasks/parent/agent-views.d.ts +0 -7
  383. package/dist/src/execution/tasks/parent/agent-views.js +0 -1
  384. package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +0 -43
  385. package/dist/src/execution/tasks/parent/continuation-dispatch.js +0 -1
  386. package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +0 -19
  387. package/dist/src/execution/tasks/parent/dispatch-task-step.js +0 -1
  388. package/dist/src/execution/tool-run/answer.js +0 -1
  389. package/dist/src/execution/tool-run/background.d.ts +0 -14
  390. package/dist/src/execution/tool-run/background.js +0 -1
  391. package/dist/src/execution/tool-run/cancel.d.ts +0 -7
  392. package/dist/src/execution/tool-run/cancel.js +0 -1
  393. package/dist/src/execution/tool-run/dispatch.d.ts +0 -24
  394. package/dist/src/execution/tool-run/dispatch.js +0 -1
  395. package/dist/src/execution/tool-run/emit-run-report-step.d.ts +0 -7
  396. package/dist/src/execution/tool-run/emit-run-report-step.js +0 -1
  397. package/dist/src/execution/tool-run/messages.d.ts +0 -70
  398. package/dist/src/execution/tool-run/messages.js +0 -1
  399. package/dist/src/execution/tool-run/owner-inbox.d.ts +0 -11
  400. package/dist/src/execution/tool-run/owner-inbox.js +0 -1
  401. package/dist/src/execution/tool-run/owner.d.ts +0 -13
  402. package/dist/src/execution/tool-run/owner.js +0 -1
  403. package/dist/src/execution/tool-run/run-control.d.ts +0 -18
  404. package/dist/src/execution/tool-run/run-control.js +0 -1
  405. package/dist/src/execution/tool-run/start.d.ts +0 -11
  406. package/dist/src/execution/tool-run/start.js +0 -1
  407. package/dist/src/execution/tool-run/types.d.ts +0 -21
  408. package/dist/src/execution/tool-run/types.js +0 -1
  409. package/dist/src/execution/tool-run/workflow.d.ts +0 -9
  410. package/dist/src/execution/tool-run/workflow.js +0 -1
  411. package/dist/src/execution/tools/subagent/local.d.ts +0 -40
  412. package/dist/src/execution/tools/subagent/local.js +0 -1
  413. package/dist/src/execution/tools/subagent/remote.d.ts +0 -26
  414. package/dist/src/execution/tools/subagent/remote.js +0 -1
  415. package/dist/src/harness/agent-handle-errors.js +0 -1
  416. package/dist/src/harness/handles/query.js +0 -1
  417. package/dist/src/harness/handles/store.js +0 -1
  418. package/dist/src/harness/handles/transitions.d.ts +0 -167
  419. package/dist/src/harness/handles/transitions.js +0 -1
  420. package/dist/src/harness/runtime-actions.js +0 -1
  421. package/dist/src/harness/subagent-depth.d.ts +0 -10
  422. package/dist/src/harness/subagent-depth.js +0 -1
  423. package/dist/src/harness/tool-runs.d.ts +0 -21
  424. package/dist/src/harness/tool-runs.js +0 -1
  425. package/dist/src/harness/workflow-runtime-action-state.d.ts +0 -9
  426. package/dist/src/harness/workflow-runtime-action-state.js +0 -1
  427. package/dist/src/runtime/actions/keys.d.ts +0 -14
  428. package/dist/src/runtime/actions/keys.js +0 -1
  429. package/dist/src/tasks/wire.d.ts +0 -25
  430. package/dist/src/tasks/wire.js +0 -1
  431. /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.d.ts +0 -0
  432. /package/dist/src/execution/{tool-run → tools/workflow}/owner-channels.js +0 -0
  433. /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.d.ts +0 -0
  434. /package/dist/src/execution/{tool-run → tools/workflow}/resume-hook-step.js +0 -0
  435. /package/dist/src/{execution/subagent-adapter.d.ts → subagents/adapter.d.ts} +0 -0
  436. /package/dist/src/{execution/session-callback-route.d.ts → subagents/callback-route.d.ts} +0 -0
  437. /package/dist/src/{execution/session-callback-step.d.ts → subagents/callback-step.d.ts} +0 -0
  438. /package/dist/src/{harness → subagents}/handles/operation-id.d.ts +0 -0
  439. /package/dist/src/{harness → subagents}/handles/operation-id.js +0 -0
  440. /package/dist/src/{harness → subagents}/handles/state-key.d.ts +0 -0
  441. /package/dist/src/{harness → subagents}/handles/state-key.js +0 -0
  442. /package/dist/src/{execution/subagent-hitl-proxy.d.ts → subagents/hitl-proxy.d.ts} +0 -0
  443. /package/dist/src/{execution/subagent-hitl-proxy.js → subagents/hitl-proxy.js} +0 -0
  444. /package/dist/src/{execution/subagent-invocation.d.ts → subagents/invocation.d.ts} +0 -0
  445. /package/dist/src/{execution/subagent-invocation.js → subagents/invocation.js} +0 -0
  446. /package/dist/src/{execution/delegated-parent-result.d.ts → subagents/parent-result.d.ts} +0 -0
  447. /package/dist/src/{execution/remote-agent-route-url.d.ts → subagents/remote-route-url.d.ts} +0 -0
  448. /package/dist/src/{execution/remote-agent-route-url.js → subagents/remote-route-url.js} +0 -0
  449. /package/dist/src/{harness/subagent-token-budget.d.ts → subagents/token-budget.d.ts} +0 -0
  450. /package/dist/src/{harness/subagent-token-budget.js → subagents/token-budget.js} +0 -0
@@ -1,87 +1,16 @@
1
- import type { AgentAddress, AgentIdentity } from "#harness/handles/store.js";
1
+ import type { SubagentAuthorizationEvent, SubagentAuthorizationEventHookPayload } from "#channel/types.js";
2
+ import type { WorkflowToolAgentRequest } from "#execution/tools/workflow/messages.js";
2
3
  import { type JsonValue } from "#shared/json.js";
3
4
  import type { TaskExecutorBinding } from "#tools/task.js";
4
- import type { SubagentAuthorizationEvent } from "#channel/types.js";
5
- /**
6
- * Task lifecycle contract for `experimental.tasks`.
7
- *
8
- * A task is one durable unit of delegated work owned by a parent session.
9
- * The durable task run is the single writer for lifecycle transitions
10
- * (see `#execution/tasks/child/workflow.js`); every other path submits
11
- * commands and reads views. This module is dependency-free on
12
- * purpose: it is bundled into workflow bodies, which reject Node.js
13
- * builtins and heavyweight validators.
14
- */
15
- /**
16
- * Task lifecycle status.
17
- *
18
- * `completed`, `failed`, and `cancelled` are terminal and final.
19
- * `input_required` is not terminal but is ready for parent action; the
20
- * child must wake its parent rather than deadlock while waiting for input.
21
- */
5
+ /** Durable lifecycle status for one unit of background work. */
22
6
  export type TaskStatus = "working" | "input_required" | "completed" | "failed" | "cancelled";
23
- /**
24
- * Immutable identity of the delegated work behind a task.
25
- *
26
- * `agentId` is parent-controlled and exists before the child acknowledges its
27
- * private address, so the durable task can bind to persistent identity before
28
- * the dispatch side effect runs.
29
- */
7
+ /** Executor-neutral identity shown for one task. */
30
8
  export interface TaskMetadata {
31
- /** Stable model-visible identity of the persistent child session. */
32
- readonly agentId: string;
33
- readonly kind: "subagent";
34
- readonly mode: "local" | "remote";
35
- /** Authored subagent name the parent dispatched. */
36
- readonly name: string;
37
- }
38
- export type SubagentTaskMetadata = TaskMetadata;
39
- /** Executor-neutral metadata retained by a non-subagent durable task. */
40
- export interface BackgroundTaskMetadata {
41
9
  readonly kind: string;
42
10
  readonly name: string;
11
+ readonly [key: string]: JsonValue | undefined;
43
12
  }
44
- export type DurableTaskMetadata = BackgroundTaskMetadata | TaskMetadata;
45
- export declare function createSubagentTaskMetadata(metadata: Omit<SubagentTaskMetadata, "kind" | "name"> & {
46
- readonly name: string;
47
- }): SubagentTaskMetadata;
48
- export declare function readSubagentTaskMetadata(task: {
49
- readonly executor?: TaskExecutorBinding | TaskExecutorState;
50
- readonly metadata: DurableTaskMetadata;
51
- }): SubagentTaskMetadata | undefined;
52
- /**
53
- * Durable subagent executor binding payload: the child's stable identity and
54
- * private delivery address, copied from the parent's agent handle store at
55
- * delegation time. Every field derives deterministically from the
56
- * originating call (operation-hashed id, dispatch-chosen continuation
57
- * token), so a replayed delegation produces a deep-equal binding — the
58
- * equality the task run's `bind` replay check compares.
59
- */
60
- export interface SubagentExecutorData {
61
- readonly address: AgentAddress;
62
- readonly identity: AgentIdentity;
63
- }
64
- export declare function createSubagentExecutorBinding(executor: SubagentExecutorData): TaskExecutorBinding;
65
- export declare function readSubagentExecutor(executor: TaskExecutorBinding | TaskExecutorState | undefined): SubagentExecutorData | undefined;
66
- export declare function sameTaskMetadata(left: DurableTaskMetadata, right: DurableTaskMetadata): boolean;
67
- /** Private executor state retained for cancellation and address reconciliation. */
68
- export interface TaskExecutorState {
69
- /** Write-once executor address recorded by the `bind` command. */
70
- readonly binding?: TaskExecutorBinding;
71
- readonly childSessionId?: string;
72
- readonly childTurnId?: string;
73
- /**
74
- * Child-session verdict from the last settled turn: `parked` survived
75
- * and can take another delivery, `terminal` ended with the turn.
76
- */
77
- readonly lifecycle?: "parked" | "terminal";
78
- }
79
- /**
80
- * Terminal task output. Failure is the state (`failed`); the `error`
81
- * output is its consequence — a `failed` task always carries one.
82
- * This intentionally diverges from MCP, which reserves `failed` for
83
- * protocol-level errors.
84
- */
13
+ export declare function sameTaskMetadata(left: TaskMetadata, right: TaskMetadata): boolean;
85
14
  export type TaskOutput = {
86
15
  readonly type: "result";
87
16
  readonly data: JsonValue;
@@ -89,67 +18,28 @@ export type TaskOutput = {
89
18
  readonly type: "error";
90
19
  readonly data: JsonValue;
91
20
  };
92
- /**
93
- * One outstanding request forwarded from a blocked child. Carried
94
- * opaquely: the task layer routes the batch, the input contract owns
95
- * its shape.
96
- */
21
+ /** An outstanding request carried opaquely by the task lifecycle. */
97
22
  export type TaskInputRequest = JsonValue;
98
- /**
99
- * Provider token usage a child turn reported. Structural on purpose: it
100
- * mirrors `TokenUsage` (#shared/token-usage.js) without importing its
101
- * zod-backed module into a workflow-bundled file.
102
- */
103
23
  export interface TaskUsage {
104
24
  readonly cacheReadTokens: number;
105
25
  readonly cacheWriteTokens: number;
106
26
  readonly inputTokens: number;
107
27
  readonly outputTokens: number;
108
28
  }
109
- /**
110
- * Validates one wire-carried usage value into {@link TaskUsage}.
111
- * Anything malformed is dropped rather than rejected: retention is
112
- * best-effort and must never fail a lifecycle transition.
113
- */
29
+ /** Reads valid provider usage without making task settlement depend on it. */
114
30
  export declare function readTaskUsage(value: unknown): TaskUsage | undefined;
115
- /**
116
- * One human answer to an outstanding request. Structural on purpose: it
117
- * mirrors the input contract's `InputResponse` without importing its
118
- * zod-backed module into a workflow-bundled file.
119
- */
120
- export interface TaskInputResponse {
121
- readonly optionId?: string;
122
- readonly requestId: string;
123
- readonly text?: string;
124
- }
125
- /** Stable task blocker id shared by one authorization attempt's events. */
126
- export declare function taskAuthorizationRequestId(event: SubagentAuthorizationEvent): string;
127
- /** Reads the `requestId` of one opaque outstanding request. */
31
+ /** Reads the request identity from one opaque request. */
128
32
  export declare function readTaskInputRequestId(request: TaskInputRequest): string | undefined;
129
- /** Fields shared by every durable task view. */
130
33
  interface TaskViewBase {
131
34
  readonly taskId: string;
132
- readonly metadata: DurableTaskMetadata;
133
- /** Private executor state; deliberately excluded from model-visible JSON. */
134
- readonly executor?: TaskExecutorState;
135
- /**
136
- * Provider usage the child reported at settlement; present when the
137
- * terminal command carried it. Retained for later accounting only —
138
- * budgets stay best-effort until a reservation model lands — and
139
- * deliberately excluded from model-visible task views (tasks/json.ts).
140
- */
35
+ readonly metadata: TaskMetadata;
36
+ /** Private executor state, excluded from model-visible JSON. */
37
+ readonly executor?: {
38
+ readonly binding?: TaskExecutorBinding;
39
+ };
40
+ /** Retained for accounting, excluded from model-visible JSON. */
141
41
  readonly usage?: TaskUsage;
142
42
  }
143
- /**
144
- * Full durable task view discriminated by lifecycle status.
145
- *
146
- * The task run appends one per accepted command; readers always observe a
147
- * complete view, never a delta. A view never contains routing credentials,
148
- * continuation tokens, or authorization capabilities.
149
- *
150
- * Completed and failed tasks carry their corresponding output, cancelled
151
- * tasks carry no output, and only input-required tasks carry requests.
152
- */
153
43
  export type TaskView = TaskViewBase & ({
154
44
  readonly status: "working";
155
45
  readonly inputRequests?: never;
@@ -175,171 +65,103 @@ export type TaskView = TaskViewBase & ({
175
65
  readonly inputRequests?: never;
176
66
  readonly lastOutput?: never;
177
67
  });
178
- /** Commands accepted by the durable task run's transition function. */
68
+ /** Executor-neutral commands accepted by the durable task run. */
179
69
  export type TaskCommand = {
180
70
  readonly executor: TaskExecutorBinding;
181
71
  readonly kind: "bind";
182
72
  } | {
183
73
  readonly kind: "complete";
184
74
  readonly data: JsonValue;
185
- readonly lifecycle?: "parked" | "terminal";
186
75
  readonly usage?: TaskUsage;
187
76
  } | {
188
77
  readonly kind: "fail";
189
78
  readonly data: JsonValue;
190
- readonly lifecycle?: "parked" | "terminal";
191
79
  readonly usage?: TaskUsage;
192
- }
193
- /** Terminal dispatch rejection for a task that was never indexed by its parent. */
194
- | {
80
+ } | {
195
81
  readonly kind: "reject-dispatch";
196
82
  readonly data: JsonValue;
197
- readonly lifecycle?: never;
198
- readonly usage?: never;
199
83
  } | {
200
84
  readonly kind: "cancel";
201
- readonly lifecycle?: "parked" | "terminal";
202
- readonly usage?: TaskUsage;
203
- }
204
- /** Retains a late executor settlement without changing task terminal status. */
205
- | {
206
- readonly kind: "settle-executor";
207
85
  readonly usage?: TaskUsage;
208
- } | {
209
- readonly kind: "require-authorization";
210
- readonly requestId: string;
211
86
  } | {
212
87
  readonly kind: "require-input";
213
88
  readonly inputRequests: readonly TaskInputRequest[];
214
89
  } | {
215
90
  readonly kind: "ready";
216
- }
217
- /**
218
- * Clears the listed requests from the outstanding batch. Bound to
219
- * ids rather than unbound like the former `resume`, so an answer can
220
- * only ever release the batch it was written against.
221
- */
222
- | {
91
+ } | {
223
92
  readonly kind: "answered";
224
93
  readonly requestIds: readonly string[];
225
- } | {
226
- readonly kind: "start-turn";
227
- readonly childSessionId: string;
228
- readonly childTurnId: string;
229
- readonly taskId: string;
230
94
  };
231
- /** Hook payload envelope commanding a durable task run. */
232
95
  export interface TaskCommandHookPayload {
233
96
  readonly kind: "task-command";
234
97
  readonly command: TaskCommand;
235
98
  }
236
- /**
237
- * Structural shapes of the child wire payloads a task run consumes.
238
- *
239
- * These mirror the existing parent-notification contracts (the local
240
- * `notifyDelegatedParentStep`, the subagent adapter's HITL forwarding,
241
- * and the remote callback route) without importing their zod-backed
242
- * modules: this file is bundled into workflow bodies. The wire itself
243
- * is unchanged — delegated dispatch only points it at the task run's
244
- * hook instead of the parent turn's inbox.
245
- */
246
- export interface TaskInboundChildResult {
247
- readonly kind: "runtime-action-result";
248
- readonly results: readonly {
249
- readonly isError?: boolean;
250
- readonly outcome?: {
251
- readonly kind: "parked" | "terminal";
252
- readonly result: {
253
- readonly kind: "succeeded";
254
- readonly output: JsonValue;
255
- } | {
256
- readonly error: JsonValue;
257
- readonly kind: "failed";
258
- } | {
259
- readonly kind: "cancelled";
260
- };
261
- /**
262
- * Provider usage this turn added. Retained on the terminal task
263
- * view ({@link TaskView.usage}); folding it into parent
264
- * budgets is deferred until a reservation model lands.
265
- */
266
- readonly usageDelta?: unknown;
267
- };
268
- readonly output: JsonValue;
269
- }[];
270
- }
271
- /**
272
- * Arrives when the delegated child emits `input.requested`. After dispatch is
273
- * acknowledged, the task run exposes the batch in an `input_required`
274
- * view and forwards the request to the parent session.
275
- */
276
- export interface TaskInboundInputRequest {
277
- readonly callId: string;
278
- readonly childContinuationToken: string;
279
- readonly childSessionId: string;
280
- readonly kind: "subagent-input-request";
281
- readonly event: {
282
- readonly requests: readonly TaskInputRequest[];
283
- readonly sequence: number;
284
- readonly stepIndex: number;
285
- readonly turnId: string;
286
- };
287
- readonly subagentName: string;
288
- }
289
- /**
290
- * Arrives when a delegated child turn starts and its session and turn ids are
291
- * known. The task run records those ids for executor addressing; this payload
292
- * does not itself make the task ready or wake the parent.
293
- */
294
- export interface TaskInboundTurnStarted {
295
- readonly childSessionId: string;
296
- readonly childTurnId: string;
297
- readonly kind: "turn-started";
298
- readonly taskId: string;
299
- }
300
- /** Intermediate progress sent by a running child to its parent agent. */
99
+ /** Intermediate progress reported by an executor. */
301
100
  export interface TaskInboundUpdate {
302
101
  readonly callId: string;
303
- /** Executor-neutral monotonic index within {@link updateEpoch}. */
304
102
  readonly updateIndex: number;
305
- /** Executor-neutral epoch id used with {@link updateIndex} for update dedupe. */
306
103
  readonly updateEpoch: string;
307
104
  readonly kind: "task-update";
308
105
  readonly message: string;
309
106
  }
310
- /**
311
- * Arrives when the delegated child emits `authorization.required` or
312
- * `authorization.completed`. The former exposes an authorization blocker in
313
- * the task view; the latter clears it. The event is forwarded separately
314
- * to the parent and is never copied into the view.
315
- */
316
- export interface TaskInboundAuthorizationEvent {
317
- readonly callId: string;
318
- readonly childSessionId: string;
319
- readonly kind: "authorization-event";
320
- readonly event: SubagentAuthorizationEvent;
321
- readonly subagentName: string;
322
- }
323
- /**
324
- * Human answers routed to the task run rather than straight to the
325
- * child. The run owns both the delivery and the state change, so the
326
- * batch it clears is exactly the batch it forwarded — the parent can no
327
- * longer unblock the child while the run still believes it is blocked.
328
- */
107
+ /** One workflow-executor request bound to its private answer hook. */
108
+ export interface TaskInboundInputRequest {
109
+ readonly kind: "task-input-request";
110
+ readonly replyTo: string;
111
+ readonly requests: readonly TaskInputRequest[];
112
+ readonly sequence: number;
113
+ readonly stepIndex: number;
114
+ readonly turnId: string;
115
+ }
116
+ /** One human answer routed through the task that owns the blocked executor. */
329
117
  export interface TaskInboundAnswerInput {
330
118
  readonly auth?: unknown;
331
119
  readonly childContinuationToken: string;
332
120
  readonly childResponseUrl?: string;
333
- readonly inputResponses: readonly TaskInputResponse[];
121
+ readonly inputResponses: readonly {
122
+ readonly optionId?: string;
123
+ readonly requestId: string;
124
+ readonly text?: string;
125
+ }[];
334
126
  readonly kind: "input-response";
335
127
  readonly taskId: string;
336
128
  }
337
- /** Everything a task run's inbound continuation hook may receive. */
338
- export type TaskRunInboundPayload = TaskCommandHookPayload | TaskInboundChildResult | TaskInboundInputRequest | TaskInboundTurnStarted | TaskInboundUpdate | TaskInboundAuthorizationEvent | TaskInboundAnswerInput;
339
- /** Namespaced run stream carrying appended `TaskView` records. */
129
+ export type TaskRunInboundPayload = TaskCommandHookPayload | TaskInboundAnswerInput | TaskInboundUpdate;
130
+ /** Generic task-owned request sent through the parent session payload. */
131
+ interface TaskInputRequestDeliveryBase {
132
+ readonly replyTo: string;
133
+ readonly sequence: number;
134
+ readonly stepIndex: number;
135
+ readonly taskId: string;
136
+ readonly turnId: string;
137
+ }
138
+ export type TaskInputRequestDelivery = TaskInputRequestDeliveryBase & ({
139
+ readonly request: TaskInputRequest;
140
+ readonly requests?: never;
141
+ } | {
142
+ readonly request?: never;
143
+ readonly requests: readonly TaskInputRequest[];
144
+ });
145
+ /**
146
+ * Child authorization event projected through the parent channel. Display
147
+ * only: the authorization callback completes against the child directly.
148
+ */
149
+ export interface TaskAuthorizationEventDelivery {
150
+ readonly hookPayload: SubagentAuthorizationEventHookPayload;
151
+ readonly taskId: string;
152
+ }
153
+ /** Stable id shared by one authorization attempt's events, used to dedupe deliveries. */
154
+ export declare function taskAuthorizationRequestId(event: SubagentAuthorizationEvent): string;
155
+ /**
156
+ * Agent spawn or settlement a task-owned workflow tool run asks its parent to
157
+ * apply, forwarded after task admission. `replyTo` is the run's reply hook.
158
+ */
159
+ export interface TaskAgentRequestDelivery {
160
+ readonly replyTo: string;
161
+ readonly request: WorkflowToolAgentRequest;
162
+ readonly taskId: string;
163
+ }
340
164
  export declare const TASK_VIEW_STREAM_NAMESPACE = "eve.task";
341
- /** True when the status can never change again. */
342
165
  export declare function isTerminalTaskStatus(status: TaskStatus): boolean;
343
- /** True when a transition into this status should wake the parent. */
344
166
  export declare function isReadyTaskStatus(status: TaskStatus): boolean;
345
167
  export {};
@@ -1 +1 @@
1
- import{isJsonObjectValue}from"#shared/json.js";function createSubagentTaskMetadata(e){return{...e,kind:`subagent`}}function readSubagentTaskMetadata(e){if(e.metadata.kind===`subagent`&&`agentId`in e.metadata)return e.metadata;let t=readSubagentExecutor(e.executor);if(t!==void 0)return{agentId:t.identity.id,kind:`subagent`,mode:t.address.kind===`agent/remote`?`remote`:`local`,name:t.identity.name}}function createSubagentExecutorBinding(e){let{address:t,identity:n}=e;return{data:{address:{...t},identity:{id:n.id,name:n.name,nodeId:n.nodeId}},kind:`subagent`}}function readSubagentExecutor(e){let t=e!==void 0&&`kind`in e?e:e?.binding;if(t?.kind!==`subagent`)return;let n=readAgentIdentity(t.data.identity),r=readAgentAddress(t.data.address);return n===void 0||r===void 0?void 0:{address:r,identity:n}}function readAgentIdentity(t){if(t===void 0||!isJsonObjectValue(t))return;let{id:n,name:r,nodeId:i}=t;return typeof n==`string`&&typeof r==`string`&&typeof i==`string`?{id:n,name:r,nodeId:i}:void 0}function readAgentAddress(t){if(t===void 0||!isJsonObjectValue(t))return;let{callbackBaseUrl:n,continuationToken:r,credentialResolver:i,kind:a,sessionId:o,url:s}=t;if(typeof o==`string`){if(a===`agent/local`||a===`agent/self`)return typeof r==`string`?{continuationToken:r,kind:a,sessionId:o}:void 0;if(a===`agent/remote`){let e=readCredentialResolver(i);if(i!==void 0&&e===void 0||typeof s!=`string`||typeof n!=`string`)return;let t={callbackBaseUrl:n,kind:a,sessionId:o,url:s};return e!==void 0&&(t.credentialResolver=e),t}}}function readCredentialResolver(t){if(t===void 0||!isJsonObjectValue(t))return;let{resolverId:n}=t;if(!(n!==void 0&&typeof n!=`string`))return n===void 0?{}:{resolverId:n}}function sameTaskMetadata(e,t){if(e.kind!==t.kind||e.name!==t.name)return!1;let n=`agentId`in e,r=`agentId`in t;return n===r&&(!n||!r||e.agentId===t.agentId&&e.mode===t.mode)}function readTaskUsage(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=readUsageAxis(e,`cacheReadTokens`),n=readUsageAxis(e,`cacheWriteTokens`),r=readUsageAxis(e,`inputTokens`),i=readUsageAxis(e,`outputTokens`);if(!(t===void 0||n===void 0||r===void 0||i===void 0))return{cacheReadTokens:t,cacheWriteTokens:n,inputTokens:r,outputTokens:i}}function readUsageAxis(e,t){let n=Reflect.get(e,t);return typeof n==`number`&&Number.isFinite(n)&&n>=0?n:void 0}const TASK_AUTHORIZATION_REQUEST_ID_PREFIX=`task:authorization`;function taskAuthorizationRequestId(e){return e.type===`approval.candidate`||e.type===`approval.settled`?`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.requestId}`:`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.attemptId??e.data.name}`}function readTaskInputRequestId(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Reflect.get(e,`requestId`);return typeof t==`string`?t:void 0}const TASK_VIEW_STREAM_NAMESPACE=`eve.task`;function isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}function isReadyTaskStatus(e){return e===`input_required`||isTerminalTaskStatus(e)}export{TASK_VIEW_STREAM_NAMESPACE,createSubagentExecutorBinding,createSubagentTaskMetadata,isReadyTaskStatus,isTerminalTaskStatus,readSubagentExecutor,readSubagentTaskMetadata,readTaskInputRequestId,readTaskUsage,sameTaskMetadata,taskAuthorizationRequestId};
1
+ import{jsonValuesEqual}from"#shared/json.js";function sameTaskMetadata(t,n){return jsonValuesEqual(t,n)}function readTaskUsage(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=readUsageAxis(e,`cacheReadTokens`),n=readUsageAxis(e,`cacheWriteTokens`),r=readUsageAxis(e,`inputTokens`),i=readUsageAxis(e,`outputTokens`);if(!(t===void 0||n===void 0||r===void 0||i===void 0))return{cacheReadTokens:t,cacheWriteTokens:n,inputTokens:r,outputTokens:i}}function readUsageAxis(e,t){let n=Reflect.get(e,t);return typeof n==`number`&&Number.isFinite(n)&&n>=0?n:void 0}function readTaskInputRequestId(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=Reflect.get(e,`requestId`);return typeof t==`string`?t:void 0}const TASK_AUTHORIZATION_REQUEST_ID_PREFIX=`task:authorization`;function taskAuthorizationRequestId(e){return e.type===`approval.candidate`||e.type===`approval.settled`?`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.requestId}`:`${TASK_AUTHORIZATION_REQUEST_ID_PREFIX}:${e.data.attemptId??e.data.name}`}const TASK_VIEW_STREAM_NAMESPACE=`eve.task`;function isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}function isReadyTaskStatus(e){return e===`input_required`||isTerminalTaskStatus(e)}export{TASK_VIEW_STREAM_NAMESPACE,isReadyTaskStatus,isTerminalTaskStatus,readTaskInputRequestId,readTaskUsage,sameTaskMetadata,taskAuthorizationRequestId};
@@ -1,6 +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
5
  import type { ToolModelOutput } from "#tools/model-output.js";
5
6
  /**
6
7
  * A single tool entry within a resolved dynamic tool set.
@@ -18,7 +19,8 @@ export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = an
18
19
  readonly description: string;
19
20
  readonly inputSchema: PublicToolInputSchema<TInput>;
20
21
  readonly outputSchema?: PublicToolOutputSchema<TOutput>;
21
- execute(input: TInput, ctx: ToolContext): TOutput | Promise<TOutput>;
22
+ readonly execution?: "background";
23
+ execute(input: TInput, ctx: ToolContext, task?: TaskExec): TOutput | TaskDelegated | Promise<TOutput | TaskDelegated>;
22
24
  readonly toModelOutput?: (output: TOutput) => ToolModelOutput | Promise<ToolModelOutput>;
23
25
  /**
24
26
  * Optional per-call approval gate, mirroring the authored-tool
@@ -1,8 +1,24 @@
1
- export declare const agent: import("#tools/native-definition.js").NativeToolDefinition<{
1
+ export declare const agent: import("#tools/definition.js").BackgroundToolDefinition<{
2
2
  agentId?: string | null | undefined;
3
3
  message: string;
4
4
  outputSchema?: {
5
5
  [x: string]: unknown;
6
6
  } | undefined;
7
- }, unknown>;
7
+ }, {
8
+ agentId: string;
9
+ status: "working";
10
+ taskId: string;
11
+ }> & {
12
+ execute(input: {
13
+ agentId?: string | null | undefined;
14
+ message: string;
15
+ outputSchema?: {
16
+ [x: string]: unknown;
17
+ } | undefined;
18
+ }, ctx: import("#tools/definition.js").ToolContext, task: import("#tools/definition.js").TaskExec): {
19
+ agentId: string;
20
+ status: "working";
21
+ taskId: string;
22
+ };
23
+ };
8
24
  export default agent;
@@ -1 +1 @@
1
- import{AGENT_TOOL_DESCRIPTION,SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{defineNativeTool}from"#tools/native-definition.js";const agent=defineNativeTool({description:AGENT_TOOL_DESCRIPTION,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA},{availability:[`root-session`],handling:{action:`self-agent`,kind:`dispatch`}});export{agent,agent as default};
1
+ import{defineTool}from"#tools/definition.js";import{SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA}from"#tools/framework/task-contract.js";import{AGENT_TOOL_DESCRIPTION,SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{attachToolBehavior}from"#tools/behavior.js";const agent=attachToolBehavior(defineTool({description:`${AGENT_TOOL_DESCRIPTION} This call starts a background task and returns a task receipt immediately.`,execution:`background`,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA,outputSchema:SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA,execute(){"use workflow";throw Error(`The framework "agent" tool was executed directly. It must be resolved through the runtime tool registry, which dispatches it to the shared subagent workflow.`)}}),{availability:[`root-session`],handling:{action:`self-agent`,kind:`dispatch`}});export{agent,agent as default};
@@ -8,13 +8,9 @@ export declare const taskCancel: import("#tools/native-definition.js").NativeToo
8
8
  type: "error" | "result";
9
9
  } | undefined;
10
10
  metadata: {
11
- agentId: string;
12
- kind: "subagent";
13
- mode: "local" | "remote";
14
- name: string;
15
- } | {
16
- data?: Record<string, unknown> | undefined;
11
+ agentId?: string | undefined;
17
12
  kind: string;
13
+ mode?: "local" | "remote" | undefined;
18
14
  name: string;
19
15
  };
20
16
  status: "cancelled" | "completed" | "failed" | "input_required" | "working";
@@ -1,6 +1,8 @@
1
1
  import { z } from "#compiled/zod/index.js";
2
2
  export declare const TASK_CANCEL_TOOL_NAME = "task_cancel";
3
3
  export declare const TASK_UPDATE_TOOL_NAME = "task_update";
4
+ /** Framework task-control tool names lowered by the runtime. */
5
+ export declare const TASK_TOOL_NAMES: ReadonlySet<string>;
4
6
  export declare const TASK_CANCEL_INPUT_SCHEMA: z.ZodObject<{
5
7
  taskIds: z.ZodArray<z.ZodString>;
6
8
  }, z.core.$strict>;
@@ -9,49 +11,40 @@ export declare const TASK_UPDATE_INPUT_SCHEMA: z.ZodObject<{
9
11
  }, z.core.$strict>;
10
12
  /** Strict model-visible task projection. */
11
13
  export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
- metadata: z.ZodUnion<readonly [z.ZodObject<{
13
- agentId: z.ZodString;
14
- kind: z.ZodLiteral<"subagent">;
15
- mode: z.ZodEnum<{
14
+ metadata: z.ZodObject<{
15
+ agentId: z.ZodOptional<z.ZodString>;
16
+ kind: z.ZodString;
17
+ mode: z.ZodOptional<z.ZodEnum<{
16
18
  local: "local";
17
19
  remote: "remote";
18
- }>;
20
+ }>>;
19
21
  name: z.ZodString;
20
- }, z.core.$strip>, z.ZodObject<{
21
- kind: z.ZodString;
22
- name: z.ZodString;
23
- }, z.core.$strip>]>;
22
+ }, z.core.$strip>;
24
23
  taskId: z.ZodString;
25
24
  status: z.ZodLiteral<"working">;
26
25
  }, z.core.$strip>, z.ZodObject<{
27
- metadata: z.ZodUnion<readonly [z.ZodObject<{
28
- agentId: z.ZodString;
29
- kind: z.ZodLiteral<"subagent">;
30
- mode: z.ZodEnum<{
26
+ metadata: z.ZodObject<{
27
+ agentId: z.ZodOptional<z.ZodString>;
28
+ kind: z.ZodString;
29
+ mode: z.ZodOptional<z.ZodEnum<{
31
30
  local: "local";
32
31
  remote: "remote";
33
- }>;
34
- name: z.ZodString;
35
- }, z.core.$strip>, z.ZodObject<{
36
- kind: z.ZodString;
32
+ }>>;
37
33
  name: z.ZodString;
38
- }, z.core.$strip>]>;
34
+ }, z.core.$strip>;
39
35
  taskId: z.ZodString;
40
36
  inputRequests: z.ZodReadonly<z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
41
37
  status: z.ZodLiteral<"input_required">;
42
38
  }, z.core.$strip>, z.ZodObject<{
43
- metadata: z.ZodUnion<readonly [z.ZodObject<{
44
- agentId: z.ZodString;
45
- kind: z.ZodLiteral<"subagent">;
46
- mode: z.ZodEnum<{
39
+ metadata: z.ZodObject<{
40
+ agentId: z.ZodOptional<z.ZodString>;
41
+ kind: z.ZodString;
42
+ mode: z.ZodOptional<z.ZodEnum<{
47
43
  local: "local";
48
44
  remote: "remote";
49
- }>;
50
- name: z.ZodString;
51
- }, z.core.$strip>, z.ZodObject<{
52
- kind: z.ZodString;
45
+ }>>;
53
46
  name: z.ZodString;
54
- }, z.core.$strip>]>;
47
+ }, z.core.$strip>;
55
48
  taskId: z.ZodString;
56
49
  lastOutput: z.ZodObject<{
57
50
  data: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
@@ -59,18 +52,15 @@ export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject
59
52
  }, z.core.$strip>;
60
53
  status: z.ZodLiteral<"completed">;
61
54
  }, z.core.$strip>, z.ZodObject<{
62
- metadata: z.ZodUnion<readonly [z.ZodObject<{
63
- agentId: z.ZodString;
64
- kind: z.ZodLiteral<"subagent">;
65
- mode: z.ZodEnum<{
55
+ metadata: z.ZodObject<{
56
+ agentId: z.ZodOptional<z.ZodString>;
57
+ kind: z.ZodString;
58
+ mode: z.ZodOptional<z.ZodEnum<{
66
59
  local: "local";
67
60
  remote: "remote";
68
- }>;
61
+ }>>;
69
62
  name: z.ZodString;
70
- }, z.core.$strip>, z.ZodObject<{
71
- kind: z.ZodString;
72
- name: z.ZodString;
73
- }, z.core.$strip>]>;
63
+ }, z.core.$strip>;
74
64
  taskId: z.ZodString;
75
65
  lastOutput: z.ZodObject<{
76
66
  data: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
@@ -78,18 +68,15 @@ export declare const TASK_VIEW_JSON_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject
78
68
  }, z.core.$strip>;
79
69
  status: z.ZodLiteral<"failed">;
80
70
  }, z.core.$strip>, z.ZodObject<{
81
- metadata: z.ZodUnion<readonly [z.ZodObject<{
82
- agentId: z.ZodString;
83
- kind: z.ZodLiteral<"subagent">;
84
- mode: z.ZodEnum<{
71
+ metadata: z.ZodObject<{
72
+ agentId: z.ZodOptional<z.ZodString>;
73
+ kind: z.ZodString;
74
+ mode: z.ZodOptional<z.ZodEnum<{
85
75
  local: "local";
86
76
  remote: "remote";
87
- }>;
77
+ }>>;
88
78
  name: z.ZodString;
89
- }, z.core.$strip>, z.ZodObject<{
90
- kind: z.ZodString;
91
- name: z.ZodString;
92
- }, z.core.$strip>]>;
79
+ }, z.core.$strip>;
93
80
  taskId: z.ZodString;
94
81
  status: z.ZodLiteral<"cancelled">;
95
82
  }, z.core.$strip>], "status">;
@@ -103,19 +90,15 @@ export declare const TASK_VIEW_OUTPUT_SCHEMA: z.ZodObject<{
103
90
  result: "result";
104
91
  }>;
105
92
  }, z.core.$strip>>;
106
- metadata: z.ZodUnion<readonly [z.ZodObject<{
107
- agentId: z.ZodString;
108
- kind: z.ZodLiteral<"subagent">;
109
- mode: z.ZodEnum<{
93
+ metadata: z.ZodObject<{
94
+ agentId: z.ZodOptional<z.ZodString>;
95
+ kind: z.ZodString;
96
+ mode: z.ZodOptional<z.ZodEnum<{
110
97
  local: "local";
111
98
  remote: "remote";
112
- }>;
113
- name: z.ZodString;
114
- }, z.core.$strip>, z.ZodObject<{
115
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
116
- kind: z.ZodString;
99
+ }>>;
117
100
  name: z.ZodString;
118
- }, z.core.$strip>]>;
101
+ }, z.core.$strip>;
119
102
  status: z.ZodEnum<{
120
103
  cancelled: "cancelled";
121
104
  completed: "completed";
@@ -135,19 +118,15 @@ export declare const TASK_VIEWS_OUTPUT_SCHEMA: z.ZodObject<{
135
118
  result: "result";
136
119
  }>;
137
120
  }, z.core.$strip>>;
138
- metadata: z.ZodUnion<readonly [z.ZodObject<{
139
- agentId: z.ZodString;
140
- kind: z.ZodLiteral<"subagent">;
141
- mode: z.ZodEnum<{
121
+ metadata: z.ZodObject<{
122
+ agentId: z.ZodOptional<z.ZodString>;
123
+ kind: z.ZodString;
124
+ mode: z.ZodOptional<z.ZodEnum<{
142
125
  local: "local";
143
126
  remote: "remote";
144
- }>;
145
- name: z.ZodString;
146
- }, z.core.$strip>, z.ZodObject<{
147
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
148
- kind: z.ZodString;
127
+ }>>;
149
128
  name: z.ZodString;
150
- }, z.core.$strip>]>;
129
+ }, z.core.$strip>;
151
130
  status: z.ZodEnum<{
152
131
  cancelled: "cancelled";
153
132
  completed: "completed";