eve 0.67.2 → 0.69.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 (1116) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/bin/eve.js +15 -0
  3. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  4. package/dist/src/approval/definition.d.ts +19 -5
  5. package/dist/src/channel/adapter.d.ts +2 -0
  6. package/dist/src/channel/auth/oidc.js +1 -1
  7. package/dist/src/channel/channel-address.d.ts +1 -4
  8. package/dist/src/channel/channel-address.js +1 -1
  9. package/dist/src/channel/channel-operations.d.ts +4 -11
  10. package/dist/src/channel/channel-operations.js +1 -1
  11. package/dist/src/channel/compiled-channel.d.ts +0 -2
  12. package/dist/src/channel/compiled-channel.js +2 -2
  13. package/dist/src/channel/cross-channel-receive.d.ts +1 -3
  14. package/dist/src/channel/cross-channel-receive.js +1 -1
  15. package/dist/src/channel/forwarded-principal.js +1 -1
  16. package/dist/src/channel/schedule-auth.d.ts +16 -0
  17. package/dist/src/channel/schedule-auth.js +1 -1
  18. package/dist/src/channel/session-callback.js +1 -1
  19. package/dist/src/channel/session.d.ts +3 -8
  20. package/dist/src/channel/session.js +1 -1
  21. package/dist/src/channel/task-card.d.ts +121 -0
  22. package/dist/src/channel/task-card.js +1 -0
  23. package/dist/src/channel/types.d.ts +12 -54
  24. package/dist/src/chunks/{use-eve-agent-DXcE_8Ja.js → use-eve-agent-D_5129A9.js} +295 -205
  25. package/dist/src/chunks/{use-eve-agent-D4HVZBjn.js → use-eve-agent-Dab2MnT2.js} +295 -205
  26. package/dist/src/cli/commands/info.d.ts +11 -0
  27. package/dist/src/cli/commands/info.js +1 -1
  28. package/dist/src/cli/commands/init-agent-workspace.js +1 -1
  29. package/dist/src/cli/commands/init.js +1 -1
  30. package/dist/src/cli/dev/command-options.d.ts +3 -2
  31. package/dist/src/cli/dev/command.js +1 -1
  32. package/dist/src/cli/dev/local-server-process.js +1 -1
  33. package/dist/src/cli/dev/tui/blocks.d.ts +19 -18
  34. package/dist/src/cli/dev/tui/blocks.js +3 -3
  35. package/dist/src/cli/dev/tui/command-typeahead.d.ts +3 -6
  36. package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +10 -0
  37. package/dist/src/cli/dev/tui/diagnostic-presentation.js +3 -2
  38. package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +2 -0
  39. package/dist/src/cli/dev/tui/prompt-placeholder.js +1 -0
  40. package/dist/src/cli/dev/tui/rail.d.ts +1 -1
  41. package/dist/src/cli/dev/tui/runner.d.ts +25 -2
  42. package/dist/src/cli/dev/tui/runner.js +3 -3
  43. package/dist/src/cli/dev/tui/status-line.d.ts +4 -2
  44. package/dist/src/cli/dev/tui/status-line.js +1 -1
  45. package/dist/src/cli/dev/tui/subagent-pump.d.ts +44 -52
  46. package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
  47. package/dist/src/cli/dev/tui/task-activity.d.ts +55 -0
  48. package/dist/src/cli/dev/tui/task-activity.js +1 -0
  49. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +13 -30
  50. package/dist/src/cli/dev/tui/terminal-renderer.js +11 -11
  51. package/dist/src/cli/dev/tui/theme.d.ts +1 -1
  52. package/dist/src/cli/dev/tui/theme.js +1 -1
  53. package/dist/src/cli/dev/tui/tool-block-groups.d.ts +6 -9
  54. package/dist/src/cli/dev/tui/tool-block-groups.js +1 -1
  55. package/dist/src/cli/dev/tui/tool-presentation.d.ts +16 -3
  56. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  57. package/dist/src/cli/dev/tui/traces/trace-conversation.js +3 -1
  58. package/dist/src/cli/dev/tui/traces/trace-view.js +1 -1
  59. package/dist/src/cli/dev/tui/tui.js +1 -1
  60. package/dist/src/cli/dev/tui/types.d.ts +11 -5
  61. package/dist/src/cli/dev/ui-options.d.ts +2 -2
  62. package/dist/src/cli/option-parsers.d.ts +3 -1
  63. package/dist/src/cli/option-parsers.js +1 -1
  64. package/dist/src/cli/ui/terminal-text.js +1 -1
  65. package/dist/src/client/agent-info-schema.d.ts +150 -9
  66. package/dist/src/client/agent-info-schema.js +1 -1
  67. package/dist/src/client/agent-session.d.ts +28 -0
  68. package/dist/src/client/agent-session.js +1 -0
  69. package/dist/src/client/eve-agent-store-helpers.d.ts +1 -1
  70. package/dist/src/client/eve-agent-store-helpers.js +2 -2
  71. package/dist/src/client/eve-agent-store.js +1 -1
  72. package/dist/src/client/index.d.ts +2 -1
  73. package/dist/src/client/index.js +1 -1
  74. package/dist/src/client/message-action-parts.js +1 -1
  75. package/dist/src/client/message-reducer.js +1 -1
  76. package/dist/src/client/message-task-parts.d.ts +8 -0
  77. package/dist/src/client/message-task-parts.js +1 -0
  78. package/dist/src/client/optimistic-message-submissions.js +1 -1
  79. package/dist/src/client/session-controls.d.ts +0 -1
  80. package/dist/src/client/session-utils.d.ts +10 -0
  81. package/dist/src/client/session-utils.js +1 -1
  82. package/dist/src/client/session.d.ts +8 -16
  83. package/dist/src/client/session.js +1 -1
  84. package/dist/src/client/stream-version.js +1 -1
  85. package/dist/src/client/types.d.ts +2 -4
  86. package/dist/src/compiled/.vendor-stamp.json +3 -2
  87. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  88. package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +55 -55
  89. package/dist/src/compiled/@vercel/blob/index.js +1 -1
  90. package/dist/src/compiled/@vercel/connect/LICENSE +202 -0
  91. package/dist/src/compiled/@vercel/connect/authorization-details.d.ts +11 -0
  92. package/dist/src/compiled/@vercel/connect/authorization.d.ts +47 -0
  93. package/dist/src/compiled/@vercel/connect/connector.d.ts +32 -0
  94. package/dist/src/compiled/@vercel/connect/index.d.ts +5 -0
  95. package/dist/src/compiled/@vercel/connect/index.js +26 -0
  96. package/dist/src/compiled/@vercel/connect/installation.d.ts +48 -0
  97. package/dist/src/compiled/@vercel/connect/token.d.ts +137 -0
  98. package/dist/src/compiled/@vercel/oidc/index.js +1 -1
  99. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  100. package/dist/src/compiled/@workflow/world-vercel/index.js +1 -1
  101. package/dist/src/compiler/bundled-extension.d.ts +7 -1
  102. package/dist/src/compiler/bundled-extension.js +1 -1
  103. package/dist/src/compiler/default-tool-policy.d.ts +2 -2
  104. package/dist/src/compiler/default-tool-policy.js +1 -1
  105. package/dist/src/compiler/development-extensions.js +1 -1
  106. package/dist/src/compiler/extension-compatibility.d.ts +54 -18
  107. package/dist/src/compiler/extension-compatibility.js +1 -1
  108. package/dist/src/compiler/extension-mount-bindings.d.ts +5 -0
  109. package/dist/src/compiler/extension-mount-bindings.js +1 -0
  110. package/dist/src/compiler/load-binding-namespace.d.ts +10 -2
  111. package/dist/src/compiler/load-binding-namespace.js +1 -1
  112. package/dist/src/compiler/manifest.d.ts +19 -17
  113. package/dist/src/compiler/manifest.js +1 -1
  114. package/dist/src/compiler/module-lifecycle.d.ts +2 -2
  115. package/dist/src/compiler/module-lifecycle.js +1 -1
  116. package/dist/src/compiler/module-map.d.ts +1 -1
  117. package/dist/src/compiler/module-map.js +3 -3
  118. package/dist/src/compiler/normalize-manifest-helpers.d.ts +18 -1
  119. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  120. package/dist/src/compiler/normalize-manifest-types.d.ts +2 -0
  121. package/dist/src/compiler/normalize-manifest.js +1 -1
  122. package/dist/src/compiler/normalize-subagent.js +1 -1
  123. package/dist/src/compiler/normalize-tool.js +1 -1
  124. package/dist/src/compiler/project-sources.d.ts +4 -0
  125. package/dist/src/compiler/project-sources.js +1 -1
  126. package/dist/src/compiler/remote-agent-node.js +1 -1
  127. package/dist/src/compiler/source-graph.d.ts +5 -0
  128. package/dist/src/compiler/source-graph.js +1 -1
  129. package/dist/src/computer-use/extension/extension.d.ts +2 -0
  130. package/dist/src/computer-use/extension/extension.js +1 -0
  131. package/dist/src/computer-use/extension/lib/command-failure.d.ts +7 -0
  132. package/dist/src/computer-use/extension/lib/command-failure.js +2 -0
  133. package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-sandbox.d.ts +8 -0
  134. package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-sandbox.js +3 -3
  135. package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use.d.ts +2 -0
  136. package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use.js +2 -1
  137. package/dist/src/computer-use/extension/lib/sandbox.d.ts +1 -0
  138. package/dist/src/computer-use/extension/lib/sandbox.js +1 -0
  139. package/dist/src/computer-use/extension/lib/shell.d.ts +1 -0
  140. package/dist/src/computer-use/extension/lib/shell.js +1 -0
  141. package/dist/src/computer-use/extension/tools/computer_use.js +1 -0
  142. package/dist/src/computer-use/tools.d.ts +1 -0
  143. package/dist/src/computer-use/tools.js +1 -0
  144. package/dist/src/context/build-dynamic-tools.js +1 -1
  145. package/dist/src/context/dynamic-subagent-lifecycle.d.ts +5 -0
  146. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  147. package/dist/src/context/dynamic-tool-lifecycle.d.ts +1 -1
  148. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  149. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -1
  150. package/dist/src/context/hook-lifecycle.d.ts +4 -3
  151. package/dist/src/context/hook-lifecycle.js +1 -1
  152. package/dist/src/context/key-names.d.ts +0 -1
  153. package/dist/src/context/key-names.js +1 -1
  154. package/dist/src/context/keys.d.ts +8 -14
  155. package/dist/src/context/keys.js +1 -1
  156. package/dist/src/context/memory-lifecycle.js +1 -1
  157. package/dist/src/context/memory-tools.d.ts +0 -1
  158. package/dist/src/context/provider.d.ts +1 -3
  159. package/dist/src/context/run-step.d.ts +2 -3
  160. package/dist/src/context/run-step.js +1 -1
  161. package/dist/src/context/serialize.js +1 -1
  162. package/dist/src/discover/bundled-extension.js +1 -1
  163. package/dist/src/discover/discover-agent.js +1 -1
  164. package/dist/src/discover/extensions.d.ts +0 -7
  165. package/dist/src/discover/extensions.js +1 -1
  166. package/dist/src/discover/manifest.d.ts +4 -0
  167. package/dist/src/evals/assertions/run.d.ts +4 -3
  168. package/dist/src/evals/assertions/run.js +1 -1
  169. package/dist/src/evals/index.d.ts +1 -1
  170. package/dist/src/evals/match.d.ts +4 -4
  171. package/dist/src/evals/mock-model.js +1 -1
  172. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  173. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  174. package/dist/src/evals/runner/reporters/assertion-scores.d.ts +19 -0
  175. package/dist/src/evals/runner/reporters/assertion-scores.js +1 -0
  176. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  177. package/dist/src/evals/runner/reporters/datadog-client.d.ts +123 -0
  178. package/dist/src/evals/runner/reporters/datadog-client.js +4 -0
  179. package/dist/src/evals/runner/reporters/datadog.d.ts +9 -98
  180. package/dist/src/evals/runner/reporters/datadog.js +2 -3
  181. package/dist/src/evals/session-content.js +1 -1
  182. package/dist/src/evals/session.d.ts +4 -4
  183. package/dist/src/evals/session.js +2 -2
  184. package/dist/src/evals/types.d.ts +18 -15
  185. package/dist/src/eve-channel/create-request.d.ts +5 -4
  186. package/dist/src/eve-channel/create-request.js +1 -1
  187. package/dist/src/eve-channel/index.d.ts +0 -9
  188. package/dist/src/eve-channel/index.js +1 -1
  189. package/dist/src/eve-channel/request.d.ts +3 -7
  190. package/dist/src/eve-channel/request.js +1 -1
  191. package/dist/src/eve-channel/support.d.ts +15 -5
  192. package/dist/src/eve-channel/support.js +1 -1
  193. package/dist/src/eve-channel/turn-policy-request.d.ts +2 -0
  194. package/dist/src/eve-channel/turn-policy-request.js +1 -0
  195. package/dist/src/eve-channel/types.d.ts +4 -0
  196. package/dist/src/execution/agent-sessions/context.d.ts +60 -0
  197. package/dist/src/execution/agent-sessions/context.js +1 -0
  198. package/dist/src/{subagents/remote-dispatch.d.ts → execution/agent-sessions/remote.d.ts} +17 -40
  199. package/dist/src/execution/agent-sessions/remote.js +1 -0
  200. package/dist/src/execution/agent-sessions/requests.d.ts +20 -0
  201. package/dist/src/execution/agent-sessions/requests.js +1 -0
  202. package/dist/src/execution/agent-sessions/session.d.ts +12 -0
  203. package/dist/src/execution/agent-sessions/session.js +1 -0
  204. package/dist/src/execution/agent-sessions/steps.d.ts +59 -0
  205. package/dist/src/execution/agent-sessions/steps.js +1 -0
  206. package/dist/src/execution/agent-sessions/target.d.ts +45 -0
  207. package/dist/src/execution/agent-sessions/target.js +1 -0
  208. package/dist/src/execution/agent-sessions/usage.d.ts +18 -0
  209. package/dist/src/execution/agent-sessions/usage.js +1 -0
  210. package/dist/src/execution/authorization-callback-match.d.ts +2 -4
  211. package/dist/src/execution/authorization-callback-match.js +1 -1
  212. package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -5
  213. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  214. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  215. package/dist/src/execution/connection-announcement.d.ts +7 -0
  216. package/dist/src/execution/connection-announcement.js +4 -0
  217. package/dist/src/execution/continuation-conflict-step.d.ts +2 -3
  218. package/dist/src/execution/continuation-conflict-step.js +1 -1
  219. package/dist/src/execution/coordination-dispatch-shared.d.ts +9 -27
  220. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  221. package/dist/src/execution/coordination-dispatch-step.d.ts +3 -2
  222. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  223. package/dist/src/execution/create-session-step.d.ts +0 -1
  224. package/dist/src/execution/create-session-step.js +1 -1
  225. package/dist/src/execution/deliver-payloads.js +1 -1
  226. package/dist/src/execution/durable-session-store.d.ts +0 -1
  227. package/dist/src/execution/dynamic-connections.js +1 -1
  228. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  229. package/dist/src/execution/dynamic-workflow/schema.d.ts +1 -3
  230. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  231. package/dist/src/execution/dynamic-workflow/tool.d.ts +1 -1
  232. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  233. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  234. package/dist/src/execution/forward-session-input.d.ts +4 -0
  235. package/dist/src/execution/forward-session-input.js +1 -0
  236. package/dist/src/execution/legacy-remote-agent/protocol.d.ts +41 -0
  237. package/dist/src/execution/legacy-remote-agent/protocol.js +1 -0
  238. package/dist/src/execution/legacy-session/authorization.js +1 -1
  239. package/dist/src/execution/legacy-session/completion-step.js +1 -1
  240. package/dist/src/execution/legacy-session/inbox.js +1 -1
  241. package/dist/src/execution/legacy-session/input.js +1 -1
  242. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  243. package/dist/src/execution/model-call-batching.js +1 -1
  244. package/dist/src/execution/node-step.d.ts +1 -1
  245. package/dist/src/execution/node-step.js +1 -1
  246. package/dist/src/execution/proxied-deliver-step.d.ts +9 -6
  247. package/dist/src/execution/proxied-deliver-step.js +1 -1
  248. package/dist/src/execution/publish-session-events.d.ts +130 -0
  249. package/dist/src/execution/publish-session-events.js +1 -0
  250. package/dist/src/execution/route-child-delivery.d.ts +5 -4
  251. package/dist/src/execution/route-child-delivery.js +1 -3
  252. package/dist/src/execution/runtime-context.js +1 -1
  253. package/dist/src/execution/sandbox/prewarm.js +1 -1
  254. package/dist/src/execution/session/admission.d.ts +1 -12
  255. package/dist/src/execution/session/admission.js +1 -1
  256. package/dist/src/execution/session/entry-input.d.ts +0 -2
  257. package/dist/src/execution/session/entry.js +1 -1
  258. package/dist/src/execution/session/finalization.js +1 -1
  259. package/dist/src/execution/session/handoff-steps.d.ts +13 -2
  260. package/dist/src/execution/session/handoff-steps.js +1 -1
  261. package/dist/src/execution/session/handoff.d.ts +17 -3
  262. package/dist/src/execution/session/handoff.js +1 -1
  263. package/dist/src/execution/session/input-queue.d.ts +27 -28
  264. package/dist/src/execution/session/input-queue.js +1 -1
  265. package/dist/src/execution/session/next-input.d.ts +5 -0
  266. package/dist/src/execution/session/next-input.js +1 -1
  267. package/dist/src/execution/session/pending-turn-state.d.ts +2 -0
  268. package/dist/src/execution/session/pending-turn-state.js +1 -1
  269. package/dist/src/execution/session/principal.d.ts +14 -0
  270. package/dist/src/execution/session/principal.js +1 -0
  271. package/dist/src/execution/session/program.js +1 -1
  272. package/dist/src/execution/session/route-selected-delivery.js +1 -1
  273. package/dist/src/execution/session/state-cursor.d.ts +17 -15
  274. package/dist/src/execution/session/state-cursor.js +1 -1
  275. package/dist/src/execution/session/state-delta.d.ts +33 -0
  276. package/dist/src/execution/session/state-delta.js +1 -0
  277. package/dist/src/execution/session/timeout-steps.js +1 -1
  278. package/dist/src/execution/session/turn-event-handler.d.ts +27 -0
  279. package/dist/src/execution/session/turn-event-handler.js +1 -0
  280. package/dist/src/execution/session/turn-step-result.d.ts +1 -3
  281. package/dist/src/execution/session/turn-step-result.js +1 -1
  282. package/dist/src/execution/session/turn-step-types.d.ts +24 -15
  283. package/dist/src/execution/session/turn-step.d.ts +2 -2
  284. package/dist/src/execution/session/turn-step.js +1 -1
  285. package/dist/src/execution/session/turn-waiting-step.d.ts +4 -0
  286. package/dist/src/execution/session/turn-waiting-step.js +1 -0
  287. package/dist/src/execution/session/turn.d.ts +33 -2
  288. package/dist/src/execution/session/turn.js +1 -1
  289. package/dist/src/execution/session-callback-request.js +1 -1
  290. package/dist/src/execution/session-event-stream.d.ts +33 -0
  291. package/dist/src/execution/session-event-stream.js +1 -0
  292. package/dist/src/execution/session-inbox/inbox.d.ts +2 -0
  293. package/dist/src/execution/session-inbox/inbox.js +1 -1
  294. package/dist/src/execution/session-inbox/protocol.js +1 -1
  295. package/dist/src/execution/session-inbox/release-step.js +1 -1
  296. package/dist/src/execution/session-inbox/resume.js +1 -1
  297. package/dist/src/execution/session-workflow-tool-run.d.ts +11 -2
  298. package/dist/src/execution/session-workflow-tool-run.js +1 -1
  299. package/dist/src/execution/session.d.ts +0 -1
  300. package/dist/src/execution/session.js +2 -2
  301. package/dist/src/execution/settle-cancelled-turn-step.d.ts +21 -9
  302. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  303. package/dist/src/execution/stable-workflow-names.d.ts +0 -1
  304. package/dist/src/execution/stable-workflow-names.js +1 -1
  305. package/dist/src/execution/tasks/calls.d.ts +42 -0
  306. package/dist/src/execution/tasks/calls.js +1 -0
  307. package/dist/src/execution/tasks/model-step.d.ts +58 -0
  308. package/dist/src/execution/tasks/model-step.js +1 -0
  309. package/dist/src/execution/tasks/render.d.ts +66 -0
  310. package/dist/src/execution/tasks/render.js +8 -0
  311. package/dist/src/execution/tasks/session.d.ts +19 -0
  312. package/dist/src/execution/tasks/session.js +1 -0
  313. package/dist/src/execution/tasks/start.d.ts +34 -0
  314. package/dist/src/execution/tasks/start.js +1 -0
  315. package/dist/src/execution/tasks/steps.d.ts +31 -0
  316. package/dist/src/execution/tasks/steps.js +1 -0
  317. package/dist/src/execution/tasks/table.d.ts +192 -0
  318. package/dist/src/execution/tasks/table.js +1 -0
  319. package/dist/src/execution/tasks/task-id-input.d.ts +19 -0
  320. package/dist/src/execution/tasks/task-id-input.js +1 -0
  321. package/dist/src/execution/tasks/tool-entry-point.d.ts +11 -0
  322. package/dist/src/execution/tasks/tool-entry-point.js +1 -0
  323. package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
  324. package/dist/src/execution/tasks/workflow-target.js +1 -1
  325. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  326. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  327. package/dist/src/execution/terminate-child-sessions-step.d.ts +2 -9
  328. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  329. package/dist/src/execution/tool-auth.js +1 -1
  330. package/dist/src/execution/tools/agent-router-workflow.d.ts +1 -1
  331. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  332. package/dist/src/execution/tools/agent-router.d.ts +1 -1
  333. package/dist/src/execution/tools/agent-router.js +1 -1
  334. package/dist/src/execution/tools/connection-approval.d.ts +25 -0
  335. package/dist/src/execution/tools/connection-approval.js +1 -0
  336. package/dist/src/execution/tools/connection-search-rank.d.ts +21 -0
  337. package/dist/src/execution/tools/connection-search-rank.js +1 -0
  338. package/dist/src/execution/tools/connection-target.d.ts +13 -0
  339. package/dist/src/execution/tools/connection-target.js +1 -0
  340. package/dist/src/execution/tools/connection-tools.d.ts +10 -0
  341. package/dist/src/execution/tools/connection-tools.js +2 -0
  342. package/dist/src/execution/tools/load-skill.js +1 -1
  343. package/dist/src/execution/tools/workflow/answer.d.ts +10 -4
  344. package/dist/src/execution/tools/workflow/answer.js +1 -1
  345. package/dist/src/execution/tools/workflow/ask.d.ts +73 -10
  346. package/dist/src/execution/tools/workflow/ask.js +1 -1
  347. package/dist/src/execution/tools/workflow/body.d.ts +60 -19
  348. package/dist/src/execution/tools/workflow/body.js +1 -1
  349. package/dist/src/execution/tools/workflow/cancel.d.ts +7 -2
  350. package/dist/src/execution/tools/workflow/cancel.js +1 -1
  351. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +10 -4
  352. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
  353. package/dist/src/execution/tools/workflow/{background.d.ts → harness-definition.d.ts} +6 -6
  354. package/dist/src/execution/tools/workflow/harness-definition.js +1 -0
  355. package/dist/src/execution/tools/workflow/interrupt.d.ts +6 -0
  356. package/dist/src/execution/tools/workflow/interrupt.js +1 -0
  357. package/dist/src/execution/tools/workflow/messages.d.ts +135 -10
  358. package/dist/src/execution/tools/workflow/messages.js +1 -1
  359. package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
  360. package/dist/src/execution/tools/workflow/owner.d.ts +15 -4
  361. package/dist/src/execution/tools/workflow/owner.js +1 -1
  362. package/dist/src/execution/tools/workflow/serve.d.ts +3 -0
  363. package/dist/src/execution/tools/workflow/serve.js +1 -0
  364. package/dist/src/execution/tools/workflow/start.d.ts +18 -11
  365. package/dist/src/execution/tools/workflow/start.js +1 -1
  366. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  367. package/dist/src/execution/tools/workflow/step.js +1 -1
  368. package/dist/src/execution/tools/workflow/types.d.ts +0 -10
  369. package/dist/src/execution/tools/workflow/withdraw-step.d.ts +31 -0
  370. package/dist/src/execution/tools/workflow/withdraw-step.js +1 -0
  371. package/dist/src/execution/tools/workflow/workflow-owner-blocking.d.ts +3 -5
  372. package/dist/src/execution/tools/workflow/workflow-owner-blocking.js +1 -1
  373. package/dist/src/execution/tools/workflow/workflow.d.ts +3 -3
  374. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  375. package/dist/src/execution/web-fetch/request.js +1 -1
  376. package/dist/src/execution/workflow-callback-url.d.ts +0 -5
  377. package/dist/src/execution/workflow-callback-url.js +1 -1
  378. package/dist/src/execution/workflow-runtime.d.ts +3 -5
  379. package/dist/src/execution/workflow-runtime.js +1 -1
  380. package/dist/src/execution/workflow-webhook-route.js +1 -1
  381. package/dist/src/extensions/code/extension/lib/connect-authentication.js +1 -1
  382. package/dist/src/extensions/code/extension/lib/github-shell.js +1 -1
  383. package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
  384. package/dist/src/extensions/code/extension/lib/sandbox.d.ts +3 -2
  385. package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
  386. package/dist/src/extensions/code/extension/lib/signed-commit.d.ts +1 -1
  387. package/dist/src/extensions/code/extension/lib/signed-commit.js +2 -2
  388. package/dist/src/extensions/code/tools.d.ts +2 -1
  389. package/dist/src/extensions/code/tools.js +1 -1
  390. package/dist/src/framework/sources/modules/agent.d.ts +1 -0
  391. package/dist/src/framework/sources/modules/agent.js +1 -1
  392. package/dist/src/framework/sources/registry.js +1 -1
  393. package/dist/src/harness/action-presentation.js +1 -1
  394. package/dist/src/harness/action-result-helpers.d.ts +1 -0
  395. package/dist/src/harness/action-result-helpers.js +1 -1
  396. package/dist/src/harness/advertised-tools.d.ts +1 -1
  397. package/dist/src/harness/advertised-tools.js +1 -1
  398. package/dist/src/harness/announcements.d.ts +22 -0
  399. package/dist/src/harness/announcements.js +1 -0
  400. package/dist/src/harness/approval-candidates.d.ts +10 -2
  401. package/dist/src/harness/approval-candidates.js +1 -1
  402. package/dist/src/harness/approval-delivery-coordinator.d.ts +4 -5
  403. package/dist/src/harness/approval-delivery-coordinator.js +1 -1
  404. package/dist/src/harness/approval-recheck.d.ts +7 -0
  405. package/dist/src/harness/approval-recheck.js +1 -0
  406. package/dist/src/harness/authorization-event-fields.d.ts +13 -0
  407. package/dist/src/harness/authorization-event-fields.js +1 -0
  408. package/dist/src/harness/authorization.d.ts +2 -1
  409. package/dist/src/harness/authorization.js +1 -1
  410. package/dist/src/harness/coordination.d.ts +31 -27
  411. package/dist/src/harness/coordination.js +1 -1
  412. package/dist/src/harness/current-messages.d.ts +6 -1
  413. package/dist/src/harness/current-messages.js +1 -1
  414. package/dist/src/harness/emission.d.ts +7 -1
  415. package/dist/src/harness/emission.js +1 -1
  416. package/dist/src/harness/execute-tool.d.ts +4 -15
  417. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +2 -0
  418. package/dist/src/harness/hitl/session-limit-input-requests.js +1 -1
  419. package/dist/src/harness/input-request-resolution.d.ts +5 -2
  420. package/dist/src/harness/input-request-resolution.js +1 -1
  421. package/dist/src/harness/input-requests.js +1 -1
  422. package/dist/src/harness/messages.d.ts +11 -3
  423. package/dist/src/harness/messages.js +1 -1
  424. package/dist/src/harness/nested-actions.d.ts +23 -0
  425. package/dist/src/harness/nested-actions.js +1 -0
  426. package/dist/src/harness/pending-input-batches.d.ts +8 -6
  427. package/dist/src/harness/pending-input-batches.js +1 -1
  428. package/dist/src/harness/provider-tool-history.d.ts +7 -2
  429. package/dist/src/harness/provider-tool-history.js +1 -1
  430. package/dist/src/harness/proxy-input-requests.d.ts +41 -36
  431. package/dist/src/harness/proxy-input-requests.js +1 -1
  432. package/dist/src/harness/session-limit-enforcement.js +1 -1
  433. package/dist/src/harness/stale-input-responses.js +1 -1
  434. package/dist/src/harness/step-hooks.js +1 -1
  435. package/dist/src/harness/tool-loop.js +2 -2
  436. package/dist/src/harness/tool-model-output.js +1 -1
  437. package/dist/src/harness/tool-presentation.js +1 -1
  438. package/dist/src/harness/tools.d.ts +1 -5
  439. package/dist/src/harness/tools.js +1 -1
  440. package/dist/src/harness/turn-tag-state.d.ts +6 -5
  441. package/dist/src/harness/types.d.ts +7 -15
  442. package/dist/src/harness/workflow-dispatch.d.ts +30 -0
  443. package/dist/src/harness/workflow-dispatch.js +1 -0
  444. package/dist/src/harness/workflow-tool-runs.d.ts +5 -65
  445. package/dist/src/harness/workflow-tool-runs.js +1 -1
  446. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  447. package/dist/src/instrumentation/lifecycle.d.ts +5 -2
  448. package/dist/src/instrumentation/lifecycle.js +1 -1
  449. package/dist/src/instrumentation/native-events.d.ts +0 -7
  450. package/dist/src/instrumentation/native-events.js +1 -1
  451. package/dist/src/instrumentation/runtime.d.ts +1 -4
  452. package/dist/src/instrumentation/runtime.js +1 -1
  453. package/dist/src/instrumentation/state.d.ts +0 -6
  454. package/dist/src/instrumentation/state.js +1 -1
  455. package/dist/src/internal/application/package.js +1 -1
  456. package/dist/src/internal/authored-definition/schema-backed.d.ts +10 -0
  457. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  458. package/dist/src/internal/authored-module-loader.d.ts +12 -6
  459. package/dist/src/internal/authored-module-loader.js +2 -2
  460. package/dist/src/internal/authored-module-map-loader.js +1 -1
  461. package/dist/src/internal/authored-package-boundary.d.ts +3 -0
  462. package/dist/src/internal/authored-package-boundary.js +1 -1
  463. package/dist/src/internal/bundler/extension-mount-plugin.d.ts +14 -0
  464. package/dist/src/internal/bundler/extension-mount-plugin.js +1 -0
  465. package/dist/src/internal/bundler/extension-scope-plugin.d.ts +8 -11
  466. package/dist/src/internal/bundler/extension-scope-plugin.js +2 -3
  467. package/dist/src/internal/invocation/workflow-execution.d.ts +2 -2
  468. package/dist/src/internal/invocation/workflow-execution.js +1 -1
  469. package/dist/src/internal/mount-state.d.ts +1 -0
  470. package/dist/src/internal/mount-state.js +1 -0
  471. package/dist/src/internal/nitro/dev-runtime-artifacts-retention.d.ts +2 -2
  472. package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
  473. package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +2 -4
  474. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  475. package/dist/src/internal/nitro/dev-runtime-generation-metadata.d.ts +13 -0
  476. package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -0
  477. package/dist/src/internal/nitro/development-generation.d.ts +2 -0
  478. package/dist/src/internal/nitro/development-generation.js +1 -1
  479. package/dist/src/internal/nitro/host/build-application.js +1 -1
  480. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  481. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +1 -0
  482. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  483. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  484. package/dist/src/internal/nitro/host/dev-workflow-world-setup.d.ts +1 -0
  485. package/dist/src/internal/nitro/host/dev-workflow-world-setup.js +1 -1
  486. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  487. package/dist/src/internal/nitro/host/start-development-server.js +1 -1
  488. package/dist/src/internal/nitro/host/types.d.ts +2 -0
  489. package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
  490. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
  491. package/dist/src/internal/node-esm-compat-banner.js +1 -1
  492. package/dist/src/internal/workflow/cancel-expired-development-run.d.ts +2 -0
  493. package/dist/src/internal/workflow/cancel-expired-development-run.js +1 -0
  494. package/dist/src/internal/workflow/development-runtime-compatibility.d.ts +12 -0
  495. package/dist/src/internal/workflow/development-runtime-compatibility.js +1 -0
  496. package/dist/src/internal/workflow/development-world-client.js +1 -1
  497. package/dist/src/internal/workflow/development-world-protocol.d.ts +9 -0
  498. package/dist/src/internal/workflow/development-world-server.d.ts +2 -0
  499. package/dist/src/internal/workflow/development-world-server.js +1 -1
  500. package/dist/src/internal/workflow/is-inactive-workflow-run-error.d.ts +2 -0
  501. package/dist/src/internal/workflow/is-inactive-workflow-run-error.js +1 -0
  502. package/dist/src/internal/workflow-bundle/authored-workflow-directives.d.ts +4 -3
  503. package/dist/src/internal/workflow-bundle/authored-workflow-directives.js +1 -1
  504. package/dist/src/internal/workflow-bundle/builder.js +1 -1
  505. package/dist/src/internal/workflow-bundle/dynamic-capability-transform-plugin.js +1 -1
  506. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  507. package/dist/src/models/auto.d.ts +6 -0
  508. package/dist/src/models/auto.js +2 -2
  509. package/dist/src/protocol/message-version.d.ts +1 -0
  510. package/dist/src/protocol/message-version.js +1 -1
  511. package/dist/src/protocol/message.d.ts +126 -67
  512. package/dist/src/protocol/message.js +2 -2
  513. package/dist/src/protocol/remote-agent-protocol.d.ts +16 -0
  514. package/dist/src/protocol/remote-agent-protocol.js +1 -0
  515. package/dist/src/protocol/routes.d.ts +0 -6
  516. package/dist/src/protocol/routes.js +1 -1
  517. package/dist/src/protocol/task-tools.d.ts +21 -0
  518. package/dist/src/protocol/task-tools.js +1 -0
  519. package/dist/src/public/channels/auth.js +1 -1
  520. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +25 -16
  521. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  522. package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
  523. package/dist/src/public/channels/chat-sdk/input-actions.d.ts +8 -0
  524. package/dist/src/public/channels/chat-sdk/input-actions.js +1 -0
  525. package/dist/src/public/channels/index.d.ts +1 -1
  526. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  527. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  528. package/dist/src/public/channels/slack/action-status.d.ts +11 -12
  529. package/dist/src/public/channels/slack/action-status.js +1 -1
  530. package/dist/src/public/channels/slack/api.js +1 -1
  531. package/dist/src/public/channels/slack/attachments.js +1 -1
  532. package/dist/src/public/channels/slack/auth.d.ts +3 -0
  533. package/dist/src/public/channels/slack/auth.js +1 -1
  534. package/dist/src/public/channels/slack/connections.d.ts +6 -6
  535. package/dist/src/public/channels/slack/connections.js +1 -1
  536. package/dist/src/public/channels/slack/defaults.d.ts +13 -19
  537. package/dist/src/public/channels/slack/defaults.js +4 -4
  538. package/dist/src/public/channels/slack/hitl.d.ts +22 -13
  539. package/dist/src/public/channels/slack/hitl.js +2 -2
  540. package/dist/src/public/channels/slack/index.d.ts +4 -3
  541. package/dist/src/public/channels/slack/index.js +1 -1
  542. package/dist/src/public/channels/slack/input-response.d.ts +1 -5
  543. package/dist/src/public/channels/slack/input-response.js +1 -1
  544. package/dist/src/public/channels/slack/interaction-cards.js +1 -1
  545. package/dist/src/public/channels/slack/interactions.js +1 -1
  546. package/dist/src/public/channels/slack/renderers.d.ts +76 -0
  547. package/dist/src/public/channels/slack/renderers.js +1 -0
  548. package/dist/src/public/channels/slack/session-operations.d.ts +6 -0
  549. package/dist/src/public/channels/slack/session-operations.js +1 -1
  550. package/dist/src/public/channels/slack/slackChannel.d.ts +47 -103
  551. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  552. package/dist/src/public/channels/slack/task-card.d.ts +24 -0
  553. package/dist/src/public/channels/slack/task-card.js +1 -0
  554. package/dist/src/public/channels/telegram/hitl.d.ts +7 -1
  555. package/dist/src/public/channels/telegram/hitl.js +2 -1
  556. package/dist/src/public/channels/telegram/state.js +1 -1
  557. package/dist/src/public/channels/telegram/telegramChannel.d.ts +5 -0
  558. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  559. package/dist/src/public/definitions/channel.d.ts +6 -1
  560. package/dist/src/public/definitions/channel.js +1 -1
  561. package/dist/src/public/definitions/connections/mcp.d.ts +4 -6
  562. package/dist/src/public/definitions/connections/openapi.d.ts +7 -8
  563. package/dist/src/public/definitions/extension.d.ts +2 -2
  564. package/dist/src/public/definitions/extension.js +1 -1
  565. package/dist/src/public/definitions/hook.d.ts +16 -4
  566. package/dist/src/public/definitions/state.d.ts +4 -2
  567. package/dist/src/public/definitions/state.js +1 -1
  568. package/dist/src/public/memory/index.d.ts +0 -1
  569. package/dist/src/public/models/openai/index.d.ts +1 -1
  570. package/dist/src/public/models/openai/index.js +1 -1
  571. package/dist/src/public/schedules/index.d.ts +1 -0
  572. package/dist/src/public/schedules/index.js +1 -1
  573. package/dist/src/public/server/index.d.ts +28 -0
  574. package/dist/src/public/server/index.js +1 -0
  575. package/dist/src/public/tools/index.d.ts +3 -2
  576. package/dist/src/public/tools/index.js +1 -1
  577. package/dist/src/public/tools/no-reply.d.ts +1 -0
  578. package/dist/src/public/tools/no-reply.js +1 -0
  579. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +6 -7
  580. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -1
  581. package/dist/src/runtime/agent/bootstrap.d.ts +0 -1
  582. package/dist/src/runtime/agent/bootstrap.js +1 -1
  583. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  584. package/dist/src/runtime/agent/mock-model-fixtures.d.ts +1 -1
  585. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  586. package/dist/src/runtime/channels/registry.js +1 -1
  587. package/dist/src/runtime/connections/mcp-client.d.ts +1 -2
  588. package/dist/src/runtime/connections/openapi-client.js +1 -1
  589. package/dist/src/runtime/connections/scoped-authorization.d.ts +1 -1
  590. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  591. package/dist/src/runtime/connections/tool-result.d.ts +27 -0
  592. package/dist/src/runtime/connections/tool-result.js +2 -0
  593. package/dist/src/runtime/connections/tool-signature.d.ts +14 -0
  594. package/dist/src/runtime/connections/tool-signature.js +1 -0
  595. package/dist/src/runtime/local-dev-capability.js +1 -1
  596. package/dist/src/runtime/prompt/compose.d.ts +1 -3
  597. package/dist/src/runtime/prompt/compose.js +3 -3
  598. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  599. package/dist/src/runtime/resolve-tool.js +1 -1
  600. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  601. package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
  602. package/dist/src/runtime/sessions/turn.d.ts +1 -16
  603. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  604. package/dist/src/runtime/subagents/registry.js +1 -1
  605. package/dist/src/runtime/subagents/workflow-reference.d.ts +6 -3
  606. package/dist/src/runtime/subagents/workflow-reference.js +1 -1
  607. package/dist/src/runtime/subagents/workflow.d.ts +12 -6
  608. package/dist/src/runtime/subagents/workflow.js +1 -1
  609. package/dist/src/runtime/tools/registry.js +1 -1
  610. package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -0
  611. package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
  612. package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
  613. package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
  614. package/dist/src/self-modification/extension/subagents/agent/instructions.js +7 -7
  615. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
  616. package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.d.ts +2 -0
  617. package/dist/src/self-modification/extension/subagents/agent/tools/search_registry.js +1 -1
  618. package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.js +1 -1
  619. package/dist/src/self-modification/scaffold.d.ts +2 -0
  620. package/dist/src/self-modification/scaffold.js +7 -0
  621. package/dist/src/self-modification/setup.js +1 -7
  622. package/dist/src/setup/boxes/model-capabilities.d.ts +2 -2
  623. package/dist/src/setup/boxes/model-capabilities.js +1 -1
  624. package/dist/src/setup/boxes/select-model.js +1 -1
  625. package/dist/src/setup/integrations/shopify/templates.d.ts +1 -1
  626. package/dist/src/setup/integrations/shopify/templates.js +31 -19
  627. package/dist/src/setup/integrations/web/setup.d.ts +0 -2
  628. package/dist/src/setup/integrations/web/setup.js +3 -3
  629. package/dist/src/setup/scaffold/create/agent-paths.d.ts +5 -0
  630. package/dist/src/setup/scaffold/create/agent-paths.js +1 -0
  631. package/dist/src/setup/scaffold/create/instructions-template.d.ts +1 -0
  632. package/dist/src/setup/scaffold/create/instructions-template.js +8 -0
  633. package/dist/src/setup/scaffold/create/project.js +3 -10
  634. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  635. package/dist/src/setup/scaffold/create/web-template.js +1 -1
  636. package/dist/src/shared/action-request-name.d.ts +3 -0
  637. package/dist/src/shared/action-request-name.js +1 -0
  638. package/dist/src/shared/action-types.d.ts +49 -21
  639. package/dist/src/shared/action-types.js +1 -1
  640. package/dist/src/shared/agent-definition.d.ts +0 -7
  641. package/dist/src/shared/chatgpt-model.d.ts +1 -1
  642. package/dist/src/shared/chatgpt-model.js +1 -1
  643. package/dist/src/shared/connection-types.d.ts +2 -3
  644. package/dist/src/shared/default-agent-model.d.ts +10 -1
  645. package/dist/src/shared/default-agent-model.js +1 -1
  646. package/dist/src/shared/extension-mount.d.ts +2 -0
  647. package/dist/src/shared/extension-mount.js +1 -0
  648. package/dist/src/shared/format-duration.d.ts +2 -0
  649. package/dist/src/shared/format-duration.js +1 -0
  650. package/dist/src/shared/gateway-model-catalog.d.ts +25 -2
  651. package/dist/src/shared/gateway-model-catalog.js +1 -1
  652. package/dist/src/shared/input.d.ts +1 -0
  653. package/dist/src/shared/memory-state.d.ts +1 -0
  654. package/dist/src/shared/memory-state.js +1 -1
  655. package/dist/src/shared/model-helper.d.ts +2 -2
  656. package/dist/src/shared/model-helper.js +1 -1
  657. package/dist/src/shared/model-summary.d.ts +2 -6
  658. package/dist/src/shared/model-summary.js +1 -1
  659. package/dist/src/shared/presentation-text.d.ts +5 -0
  660. package/dist/src/shared/presentation-text.js +1 -1
  661. package/dist/src/shared/serialized-observability-state.d.ts +0 -4
  662. package/dist/src/shared/serialized-observability-state.js +1 -1
  663. package/dist/src/shared/value-delta.d.ts +39 -0
  664. package/dist/src/shared/value-delta.js +1 -0
  665. package/dist/src/subagents/adapter-state.d.ts +0 -2
  666. package/dist/src/subagents/adapter-state.js +1 -1
  667. package/dist/src/subagents/adapter.js +1 -1
  668. package/dist/src/subagents/callback-route.js +1 -1
  669. package/dist/src/subagents/event-proxy-step.d.ts +16 -29
  670. package/dist/src/subagents/event-proxy-step.js +1 -1
  671. package/dist/src/subagents/hitl-proxy.d.ts +35 -17
  672. package/dist/src/subagents/hitl-proxy.js +1 -1
  673. package/dist/src/subagents/invocation.d.ts +1 -2
  674. package/dist/src/subagents/parent-notification.d.ts +2 -1
  675. package/dist/src/subagents/parent-notification.js +1 -1
  676. package/dist/src/subagents/token-budget.d.ts +8 -9
  677. package/dist/src/subagents/token-budget.js +1 -1
  678. package/dist/src/subagents/tool.d.ts +6 -12
  679. package/dist/src/subagents/tool.js +1 -1
  680. package/dist/src/svelte/index.js +1 -1
  681. package/dist/src/svelte/use-eve-agent.js +1 -1
  682. package/dist/src/tools/behavior.d.ts +5 -5
  683. package/dist/src/tools/definition.d.ts +58 -14
  684. package/dist/src/tools/definition.js +1 -1
  685. package/dist/src/tools/durable-callbacks.d.ts +1 -1
  686. package/dist/src/tools/dynamic.d.ts +6 -0
  687. package/dist/src/tools/framework/agent-contract.d.ts +2 -5
  688. package/dist/src/tools/framework/agent-contract.js +1 -1
  689. package/dist/src/tools/framework/agent.d.ts +2 -5
  690. package/dist/src/tools/framework/agent.js +1 -1
  691. package/dist/src/tools/framework/connection-tools.d.ts +3 -0
  692. package/dist/src/tools/framework/connection-tools.js +1 -0
  693. package/dist/src/tools/provided/agent-router.d.ts +6 -3
  694. package/dist/src/tools/provided/agent-router.js +1 -1
  695. package/dist/src/{execution/tools → tools/provided}/ask-question-workflow.d.ts +3 -4
  696. package/dist/src/tools/provided/ask-question-workflow.js +1 -0
  697. package/dist/src/tools/provided/ask-question.d.ts +20 -5
  698. package/dist/src/tools/provided/ask-question.js +2 -1
  699. package/dist/src/tools/provided/interrupted.d.ts +18 -0
  700. package/dist/src/tools/provided/interrupted.js +1 -0
  701. package/dist/src/tools/provided/no-reply.d.ts +19 -0
  702. package/dist/src/tools/provided/no-reply.js +1 -0
  703. package/dist/src/tools/provided/sleep-workflow.d.ts +4 -0
  704. package/dist/src/tools/provided/sleep-workflow.js +1 -0
  705. package/dist/src/tools/provided/sleep.d.ts +11 -5
  706. package/dist/src/tools/provided/sleep.js +1 -1
  707. package/dist/src/tools/provided/task-cancel.d.ts +6 -0
  708. package/dist/src/tools/provided/task-cancel.js +1 -0
  709. package/dist/src/tools/provided/task-wait.d.ts +9 -0
  710. package/dist/src/tools/provided/task-wait.js +1 -0
  711. package/dist/src/tools/provided/workflow.d.ts +2 -2
  712. package/dist/src/tools/provided/workflow.js +1 -1
  713. package/dist/src/tools/schema-emission.d.ts +23 -0
  714. package/dist/src/tools/schema-emission.js +1 -0
  715. package/dist/src/tools/schema.d.ts +22 -8
  716. package/dist/src/tools/schema.js +1 -1
  717. package/dist/src/tools/workflow-definition.d.ts +187 -85
  718. package/dist/src/tools/workflow-definition.js +1 -1
  719. package/dist/src/tools/workflow-entry-point.d.ts +3 -0
  720. package/dist/src/tools/workflow-entry-point.js +1 -0
  721. package/dist/src/tracing/agent-action-instrumentation.d.ts +1 -3
  722. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  723. package/dist/src/tracing/agent-invocation-coordinator.d.ts +9 -18
  724. package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
  725. package/dist/src/tracing/agent-otel-content.d.ts +0 -2
  726. package/dist/src/tracing/agent-otel-content.js +3 -3
  727. package/dist/src/tracing/agent-otel-provider.js +2 -2
  728. package/dist/src/tracing/agent-otel-runtime-context.d.ts +20 -0
  729. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  730. package/dist/src/tracing/agent-otel-usage.js +1 -1
  731. package/dist/src/tracing/agent-span-contract.d.ts +1 -1
  732. package/dist/src/tracing/agent-span-contract.js +1 -1
  733. package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
  734. package/dist/src/tracing/agent-span-id-generator.js +1 -1
  735. package/dist/src/tracing/agent-trace-context-codec.d.ts +1 -2
  736. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  737. package/dist/src/tracing/agent-trace-context-store.d.ts +2 -27
  738. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  739. package/dist/src/tracing/agent-trace-state.d.ts +1 -19
  740. package/dist/src/tracing/content-attributes.js +1 -1
  741. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  742. package/dist/src/vue/index.js +1 -1
  743. package/dist/src/vue/use-eve-agent.js +1 -1
  744. package/docs/agent-config.md +36 -13
  745. package/docs/channels/chat-sdk.mdx +15 -4
  746. package/docs/channels/custom.mdx +89 -17
  747. package/docs/channels/eve.mdx +1 -1
  748. package/docs/channels/mcp.mdx +1 -1
  749. package/docs/channels/overview.mdx +14 -56
  750. package/docs/channels/slack.mdx +230 -35
  751. package/docs/channels/telegram.mdx +2 -0
  752. package/docs/concepts/built-in-tools.md +36 -28
  753. package/docs/concepts/context-control.md +2 -2
  754. package/docs/concepts/execution-model-and-durability.mdx +10 -11
  755. package/docs/concepts/project-structure.mdx +1 -1
  756. package/docs/concepts/sessions-runs-and-streaming.md +67 -47
  757. package/docs/connections/mcp.mdx +4 -4
  758. package/docs/connections/openapi.mdx +2 -2
  759. package/docs/connections/overview.mdx +2 -2
  760. package/docs/evals/assertions.mdx +5 -5
  761. package/docs/evals/cases.mdx +1 -1
  762. package/docs/evals/reporters.mdx +6 -4
  763. package/docs/extensions.md +11 -2
  764. package/docs/guides/auth-and-route-protection.md +1 -1
  765. package/docs/guides/client/streaming.mdx +31 -11
  766. package/docs/guides/deployment/vercel.mdx +1 -1
  767. package/docs/guides/dev-tui.md +13 -3
  768. package/docs/guides/dynamic-capabilities.md +15 -10
  769. package/docs/guides/evaluate.md +29 -2
  770. package/docs/guides/frontend/overview.mdx +5 -7
  771. package/docs/guides/hooks.md +48 -12
  772. package/docs/guides/instrumentation/instrumentation.mdx +2 -0
  773. package/docs/guides/remote-agents.md +12 -14
  774. package/docs/guides/self-modification.md +10 -0
  775. package/docs/install-integrations.mdx +1 -1
  776. package/docs/instructions.mdx +1 -1
  777. package/docs/patterns/multi-tenant-approvals.md +1 -1
  778. package/docs/protocols/ucp.mdx +20 -16
  779. package/docs/reference/cli.md +96 -22
  780. package/docs/reference/typescript-api.md +43 -41
  781. package/docs/schedules.mdx +14 -34
  782. package/docs/subagents/index.mdx +24 -56
  783. package/docs/tools/human-in-the-loop.md +50 -13
  784. package/docs/tools/meta.json +1 -1
  785. package/docs/tools/overview.mdx +79 -59
  786. package/docs/tools/tasks-upgrade.md +201 -0
  787. package/docs/tools/tasks.md +315 -0
  788. package/docs/tools/workflows.mdx +368 -154
  789. package/package.json +41 -14
  790. package/dist/src/channel/activity-renderer.d.ts +0 -21
  791. package/dist/src/channel/activity-renderer.js +0 -1
  792. package/dist/src/channel/activity-sink.d.ts +0 -2
  793. package/dist/src/channel/activity-sink.js +0 -1
  794. package/dist/src/eve-channel/activity-observer-request.d.ts +0 -7
  795. package/dist/src/eve-channel/activity-observer-request.js +0 -1
  796. package/dist/src/eve-channel/delivery-policy-request.d.ts +0 -4
  797. package/dist/src/eve-channel/delivery-policy-request.js +0 -1
  798. package/dist/src/execution/activity-cohort.d.ts +0 -20
  799. package/dist/src/execution/activity-cohort.js +0 -1
  800. package/dist/src/execution/activity-collector.d.ts +0 -12
  801. package/dist/src/execution/activity-collector.js +0 -1
  802. package/dist/src/execution/activity-events.d.ts +0 -8
  803. package/dist/src/execution/activity-events.js +0 -1
  804. package/dist/src/execution/activity-route.d.ts +0 -2
  805. package/dist/src/execution/activity-route.js +0 -1
  806. package/dist/src/execution/activity-work-id.d.ts +0 -9
  807. package/dist/src/execution/activity-work-id.js +0 -1
  808. package/dist/src/execution/activity-work.d.ts +0 -30
  809. package/dist/src/execution/activity-work.js +0 -1
  810. package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +0 -7
  811. package/dist/src/execution/cancel-indexed-session-tasks-step.js +0 -1
  812. package/dist/src/execution/dispatch-action-failures.d.ts +0 -8
  813. package/dist/src/execution/dispatch-action-failures.js +0 -1
  814. package/dist/src/execution/dispatch-start-operation.d.ts +0 -15
  815. package/dist/src/execution/dispatch-start-operation.js +0 -1
  816. package/dist/src/execution/publish-channel-event.d.ts +0 -23
  817. package/dist/src/execution/publish-channel-event.js +0 -1
  818. package/dist/src/execution/scheduled-launch-delivery.d.ts +0 -7
  819. package/dist/src/execution/scheduled-launch-delivery.js +0 -1
  820. package/dist/src/execution/session/event-sink.d.ts +0 -26
  821. package/dist/src/execution/session/event-sink.js +0 -1
  822. package/dist/src/execution/session-activity-projection.d.ts +0 -16
  823. package/dist/src/execution/session-activity-projection.js +0 -1
  824. package/dist/src/execution/session-activity-renderer-step.d.ts +0 -15
  825. package/dist/src/execution/session-activity-renderer-step.js +0 -1
  826. package/dist/src/execution/session-activity.d.ts +0 -3
  827. package/dist/src/execution/session-activity.js +0 -1
  828. package/dist/src/execution/submit-activity.d.ts +0 -7
  829. package/dist/src/execution/submit-activity.js +0 -1
  830. package/dist/src/execution/task-event-callback.d.ts +0 -12
  831. package/dist/src/execution/task-event-callback.js +0 -1
  832. package/dist/src/execution/task-input-capability.d.ts +0 -4
  833. package/dist/src/execution/task-input-capability.js +0 -1
  834. package/dist/src/execution/task-input-response-route.d.ts +0 -2
  835. package/dist/src/execution/task-input-response-route.js +0 -1
  836. package/dist/src/execution/tasks/child/notify.d.ts +0 -44
  837. package/dist/src/execution/tasks/child/notify.js +0 -1
  838. package/dist/src/execution/tasks/parent/control-shared.d.ts +0 -23
  839. package/dist/src/execution/tasks/parent/control-shared.js +0 -1
  840. package/dist/src/execution/tasks/parent/delegate.d.ts +0 -35
  841. package/dist/src/execution/tasks/parent/delegate.js +0 -1
  842. package/dist/src/execution/tasks/parent/dispatch.d.ts +0 -22
  843. package/dist/src/execution/tasks/parent/dispatch.js +0 -1
  844. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +0 -27
  845. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +0 -1
  846. package/dist/src/execution/tasks/parent/run-parent.d.ts +0 -58
  847. package/dist/src/execution/tasks/parent/run-parent.js +0 -1
  848. package/dist/src/execution/tasks/parent/subagent-task-projection.d.ts +0 -26
  849. package/dist/src/execution/tasks/parent/subagent-task-projection.js +0 -1
  850. package/dist/src/execution/tasks/parent/task-cancel.d.ts +0 -12
  851. package/dist/src/execution/tasks/parent/task-cancel.js +0 -1
  852. package/dist/src/execution/tasks/parent/tool-execution.d.ts +0 -45
  853. package/dist/src/execution/tasks/parent/tool-execution.js +0 -1
  854. package/dist/src/execution/terminal-session-event.d.ts +0 -13
  855. package/dist/src/execution/terminal-session-event.js +0 -1
  856. package/dist/src/execution/tools/ask-question-workflow.js +0 -1
  857. package/dist/src/execution/tools/ask-question.d.ts +0 -19
  858. package/dist/src/execution/tools/ask-question.js +0 -2
  859. package/dist/src/execution/tools/connection-search.d.ts +0 -2
  860. package/dist/src/execution/tools/connection-search.js +0 -2
  861. package/dist/src/execution/tools/sleep-workflow.d.ts +0 -3
  862. package/dist/src/execution/tools/sleep-workflow.js +0 -1
  863. package/dist/src/execution/tools/sleep.d.ts +0 -10
  864. package/dist/src/execution/tools/sleep.js +0 -1
  865. package/dist/src/execution/tools/subagent/accept-event-step.d.ts +0 -7
  866. package/dist/src/execution/tools/subagent/accept-event-step.js +0 -1
  867. package/dist/src/execution/tools/subagent/emit-event-step.d.ts +0 -12
  868. package/dist/src/execution/tools/subagent/emit-event-step.js +0 -1
  869. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +0 -42
  870. package/dist/src/execution/tools/subagent/invoke-agent.js +0 -1
  871. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +0 -44
  872. package/dist/src/execution/tools/subagent/invoke-preparation.js +0 -1
  873. package/dist/src/execution/tools/subagent/invoke-step.d.ts +0 -64
  874. package/dist/src/execution/tools/subagent/invoke-step.js +0 -1
  875. package/dist/src/execution/tools/subagent/receipt-identity.d.ts +0 -11
  876. package/dist/src/execution/tools/subagent/receipt-identity.js +0 -1
  877. package/dist/src/execution/tools/subagent/start.d.ts +0 -51
  878. package/dist/src/execution/tools/subagent/start.js +0 -1
  879. package/dist/src/execution/tools/subagent/steer.d.ts +0 -13
  880. package/dist/src/execution/tools/subagent/steer.js +0 -1
  881. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +0 -24
  882. package/dist/src/execution/tools/subagent/task-agent-requests.js +0 -1
  883. package/dist/src/execution/tools/subagent/task-cancel.d.ts +0 -10
  884. package/dist/src/execution/tools/subagent/task-cancel.js +0 -1
  885. package/dist/src/execution/tools/tasks.d.ts +0 -3
  886. package/dist/src/execution/tools/tasks.js +0 -1
  887. package/dist/src/execution/tools/workflow/background.js +0 -1
  888. package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +0 -14
  889. package/dist/src/execution/tools/workflow/workflow-owner-background.js +0 -1
  890. package/dist/src/extensions/code/extension/tools/computer_use.js +0 -1
  891. package/dist/src/harness/background-tools.d.ts +0 -45
  892. package/dist/src/harness/background-tools.js +0 -1
  893. package/dist/src/instrumentation/background-task-runtime.d.ts +0 -18
  894. package/dist/src/instrumentation/background-task-runtime.js +0 -1
  895. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.3.0/node_modules/@vercel/cli-config/dist/index.js +0 -21
  896. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  897. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  898. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  899. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  900. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  901. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  902. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  903. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.1/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  904. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/authorization.js +0 -1
  905. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/connector.js +0 -1
  906. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/index.js +0 -1
  907. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/installation.js +0 -1
  908. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/base-url.js +0 -1
  909. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/default-scopes.js +0 -1
  910. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/env.js +0 -1
  911. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/internal/url-validation.js +0 -1
  912. package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/token.js +0 -1
  913. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  914. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  915. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  916. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  917. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
  918. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/index.js +0 -1
  919. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  920. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  921. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  922. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  923. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/token.js +0 -1
  924. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  925. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.9/node_modules/@vercel/oidc/dist/version.js +0 -1
  926. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  927. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  928. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  929. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  930. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  931. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  932. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  933. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  934. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  935. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  936. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  937. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  938. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  939. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  940. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  941. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  942. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  943. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  944. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  945. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  946. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  947. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  948. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  949. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  950. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  951. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  952. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  953. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  954. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  955. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  956. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  957. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  958. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  959. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  960. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  961. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  962. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  963. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  964. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  965. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  966. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  967. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  968. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  969. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  970. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  971. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  972. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  973. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  974. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  975. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  976. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  977. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  978. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  979. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  980. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  981. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  982. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  983. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  984. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  985. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  986. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  987. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  988. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  989. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  990. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  991. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  992. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  993. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  994. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  995. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  996. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  997. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  998. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  999. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  1000. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  1001. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  1002. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  1003. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  1004. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  1005. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  1006. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  1007. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  1008. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  1009. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  1010. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  1011. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  1012. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  1013. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  1014. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  1015. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  1016. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  1017. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  1018. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  1019. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  1020. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  1021. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  1022. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  1023. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  1024. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  1025. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  1026. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  1027. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  1028. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  1029. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  1030. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  1031. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  1032. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  1033. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  1034. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  1035. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  1036. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  1037. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  1038. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  1039. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  1040. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  1041. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  1042. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  1043. package/dist/src/protocol/activity.d.ts +0 -112
  1044. package/dist/src/protocol/activity.js +0 -1
  1045. package/dist/src/protocol/agent-handle-error.d.ts +0 -13
  1046. package/dist/src/protocol/agent-handle-error.js +0 -1
  1047. package/dist/src/public/channels/slack/activity-plan.d.ts +0 -5
  1048. package/dist/src/public/channels/slack/activity-plan.js +0 -1
  1049. package/dist/src/public/channels/slack/activity.d.ts +0 -63
  1050. package/dist/src/public/channels/slack/activity.js +0 -2
  1051. package/dist/src/public/tools/connection-search.d.ts +0 -1
  1052. package/dist/src/public/tools/connection-search.js +0 -1
  1053. package/dist/src/public/tools/task-cancel.d.ts +0 -1
  1054. package/dist/src/public/tools/task-cancel.js +0 -1
  1055. package/dist/src/runtime/prompt/connections.d.ts +0 -9
  1056. package/dist/src/runtime/prompt/connections.js +0 -2
  1057. package/dist/src/shared/boundary-hook-error.d.ts +0 -4
  1058. package/dist/src/shared/boundary-hook-error.js +0 -1
  1059. package/dist/src/shared/empty-delivery.d.ts +0 -3
  1060. package/dist/src/shared/empty-delivery.js +0 -1
  1061. package/dist/src/subagents/agent-handle-errors.d.ts +0 -25
  1062. package/dist/src/subagents/agent-handle-errors.js +0 -1
  1063. package/dist/src/subagents/callback-step.d.ts +0 -11
  1064. package/dist/src/subagents/callback-step.js +0 -1
  1065. package/dist/src/subagents/continuation-bundle.d.ts +0 -13
  1066. package/dist/src/subagents/continuation-bundle.js +0 -1
  1067. package/dist/src/subagents/handle-dispatch.d.ts +0 -65
  1068. package/dist/src/subagents/handle-dispatch.js +0 -1
  1069. package/dist/src/subagents/handles/operation-id.d.ts +0 -15
  1070. package/dist/src/subagents/handles/operation-id.js +0 -1
  1071. package/dist/src/subagents/handles/prompt.d.ts +0 -52
  1072. package/dist/src/subagents/handles/prompt.js +0 -3
  1073. package/dist/src/subagents/handles/query.d.ts +0 -41
  1074. package/dist/src/subagents/handles/query.js +0 -1
  1075. package/dist/src/subagents/handles/state-key.d.ts +0 -8
  1076. package/dist/src/subagents/handles/state-key.js +0 -1
  1077. package/dist/src/subagents/handles/store.d.ts +0 -217
  1078. package/dist/src/subagents/handles/store.js +0 -1
  1079. package/dist/src/subagents/handles/transitions.d.ts +0 -103
  1080. package/dist/src/subagents/handles/transitions.js +0 -1
  1081. package/dist/src/subagents/remote-dispatch.js +0 -1
  1082. package/dist/src/subagents/start-local.d.ts +0 -29
  1083. package/dist/src/subagents/start-local.js +0 -1
  1084. package/dist/src/subagents/start-remote.d.ts +0 -21
  1085. package/dist/src/subagents/start-remote.js +0 -1
  1086. package/dist/src/tasks/delivery-context.d.ts +0 -32
  1087. package/dist/src/tasks/delivery-context.js +0 -4
  1088. package/dist/src/tasks/delivery-policy.d.ts +0 -14
  1089. package/dist/src/tasks/delivery-policy.js +0 -1
  1090. package/dist/src/tasks/json.d.ts +0 -88
  1091. package/dist/src/tasks/json.js +0 -1
  1092. package/dist/src/tasks/notification.d.ts +0 -10
  1093. package/dist/src/tasks/notification.js +0 -1
  1094. package/dist/src/tasks/task-id.d.ts +0 -31
  1095. package/dist/src/tasks/task-id.js +0 -1
  1096. package/dist/src/tasks/task-inbox-token.d.ts +0 -2
  1097. package/dist/src/tasks/task-inbox-token.js +0 -1
  1098. package/dist/src/tasks/transitions.d.ts +0 -17
  1099. package/dist/src/tasks/transitions.js +0 -1
  1100. package/dist/src/tasks/types.d.ts +0 -136
  1101. package/dist/src/tasks/types.js +0 -1
  1102. package/dist/src/tools/framework/connection-search.d.ts +0 -3
  1103. package/dist/src/tools/framework/connection-search.js +0 -1
  1104. package/dist/src/tools/framework/task-cancel.d.ts +0 -4
  1105. package/dist/src/tools/framework/task-cancel.js +0 -1
  1106. package/dist/src/tools/framework/task-contract.d.ts +0 -19
  1107. package/dist/src/tools/framework/task-contract.js +0 -1
  1108. package/dist/src/tools/native-definition.d.ts +0 -7
  1109. package/dist/src/tools/native-definition.js +0 -1
  1110. package/dist/src/tracing/agent-invocation-terminal.d.ts +0 -18
  1111. package/dist/src/tracing/agent-invocation-terminal.js +0 -1
  1112. /package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-driver-source.d.ts +0 -0
  1113. /package/dist/src/{extensions/code → computer-use}/extension/lib/computer-use-driver-source.js +0 -0
  1114. /package/dist/src/{extensions/code → computer-use}/extension/tools/computer_use.d.ts +0 -0
  1115. /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.d.ts +0 -0
  1116. /package/dist/src/execution/{tools/subagent → agent-sessions}/metadata.js +0 -0
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import { type ConnectionAuthorizationChallenge } from "#connections/errors.js";
14
14
  import { type AuthorizationSignal } from "#harness/authorization.js";
15
- import type { SessionAuthContext } from "#context/keys.js";
15
+ import { type SessionAuthContext } from "#context/keys.js";
16
16
  import { type AuthorizationDefinition, type ConnectionAuthorizationContext, type TokenResult } from "#shared/connection-types.js";
17
17
  /**
18
18
  * Everything the scoped authorization helpers need to drive one
@@ -1 +1 @@
1
- import{contextStorage,loadContext}from"#context/container.js";import{consumeAuthorizationResult,createAuthorizationAttempt,requestAuthorization}from"#harness/authorization.js";import{ConnectionAuthorizationFailedError,ConnectionAuthorizationRequiredError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{evictCachedToken,readCachedToken,writeCachedToken}from"#runtime/connections/authorization-tokens.js";import{principalKey,resolveConnectionPrincipal,resolveConnectionPrincipalFromAuth}from"#runtime/connections/principal.js";const LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES=new Set([`127.0.0.1`,`[::1]`]);function createAuthorizationExecution(e={}){let t=new Set;async function complete(n){let r=n.instanceId??n.scope;!t.has(r)&&await(e.completeAuthorization??completeScopedAuthorization)(n)&&t.add(r)}function requireAuth(e,n){throw new ScopedAuthorizationRequiredError(e,t.has(e.instanceId??e.scope),n)}return{complete,async getToken(e){await complete(e);try{return await resolveScopedToken(e)}catch(t){if(!isConnectionAuthorizationRequiredError(t))throw t;return requireAuth(e,t)}},requireAuth,async handleError(e,n){return n!==void 0&&isConnectionAuthorizationRequiredError(e)?await handleAuthorizationError(new ScopedAuthorizationRequiredError(n,t.has(n.instanceId??n.scope),e),{evictToken:!1}):await handleAuthorizationError(e)},run:executeWithAuthorization}}var ScopedAuthorizationRequiredError=class extends Error{scoped;justAuthorized;constructor(e,t,n){super(`Authorization required.`,{cause:n}),this.name=`ScopedAuthorizationRequiredError`,this.scoped=e,this.justAuthorized=t}};function isScopedAuthorizationRequiredError(e){return e instanceof Error&&e.name===`ScopedAuthorizationRequiredError`}async function handleAuthorizationError(e,t={evictToken:!0}){if(!isScopedAuthorizationRequiredError(e))throw e;let{scoped:n}=e;if(e.justAuthorized)throw new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" failed: the service rejected the token immediately after authorization.`,reason:`token_rejected_after_authorization`,retryable:!1});t.evictToken&&await evictScopedToken(n);let r=await startScopedAuthorization(n);if(r!==void 0)return r;throw supportsInteractiveAuthorization(n.authorization)?new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" requires sign-in, but no authorization callback URL could be minted for this run (missing session context).`,reason:`authorization_callback_unavailable`,retryable:!1}):e.cause??new ConnectionAuthorizationRequiredError(n.scope)}function executeWithAuthorization(e){try{let t=e();return isAsyncIterable(t)?handleIterable(t):Promise.resolve(t).catch(handleAuthorizationError)}catch(e){return handleAuthorizationError(e)}}async function*handleIterable(e){try{for await(let t of e)yield t}catch(e){yield await handleAuthorizationError(e)}}async function resolveScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore(),o=resolveScopedPrincipal(e,a);if(a===void 0)return await n.getToken({connection:r,principal:o});let s=principalKey(o),c=readCachedToken(a,i,s);if(c!==void 0)return c;let l=await n.getToken({connection:r,principal:o});return writeCachedToken(a,i,s,l),l}async function evictScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore();if(a===void 0)return;let o;try{o=resolveScopedPrincipal(e,a),evictCachedToken(a,i,principalKey(o))}catch{return}try{await n.evict?.({connection:r,principal:o})}catch{}}async function completeScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return!1;let i=consumeAuthorizationResult(t,e.instanceId);if(i===void 0)return!1;let a=n,o=loadContext(),s=i.principal??resolveScopedPrincipal(e,o),c=await a.completeAuthorization({callbackUrl:i.hookUrl,connection:r,principal:s,resume:i.resume,callback:i.callback});return writeCachedToken(o,e.instanceId??t,principalKey(s),c),!0}async function startScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return;let i=createAuthorizationAttempt(t);if(i===void 0)return;let a=n,o=resolveScopedPrincipal(e),s=resolveAuthorizationCallbackUrl({authorization:n,callbackUrl:i.hookUrl}),{challenge:c,resume:l}=await a.startAuthorization({callbackUrl:s,connection:r,principal:o});return requestAuthorization([{attemptId:i.attemptId,challenge:stampChallengeDisplayName(c,n),hookUrl:s,instanceId:e.instanceId,name:t,principal:o,resume:l}])}function resolveScopedPrincipal(e,t){return e.boundResponder===void 0?resolveConnectionPrincipal(e.scope,e.authorization,t):resolveConnectionPrincipalFromAuth(e.scope,e.authorization,e.boundResponder,t)}function resolveAuthorizationCallbackUrl(e){if(e.authorization.vercelConnect===void 0)return e.callbackUrl;let t;try{t=new URL(e.callbackUrl)}catch{return e.callbackUrl}return t.protocol!==`http:`||!LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES.has(t.hostname)?e.callbackUrl:(t.hostname=`localhost`,t.toString())}function stampChallengeDisplayName(e,t){let n=t.displayName??e.displayName;return n===e.displayName?e:{...e,displayName:n}}export{completeScopedAuthorization,createAuthorizationExecution,evictScopedToken,handleAuthorizationError,resolveAuthorizationCallbackUrl,resolveScopedToken,stampChallengeDisplayName};
1
+ import{contextStorage,loadContext}from"#context/container.js";import{AuthKey}from"#context/keys.js";import{consumeAuthorizationResult,createAuthorizationAttempt,requestAuthorization}from"#harness/authorization.js";import{ConnectionAuthorizationFailedError,ConnectionAuthorizationRequiredError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{evictCachedToken,readCachedToken,writeCachedToken}from"#runtime/connections/authorization-tokens.js";import{principalKey,resolveConnectionPrincipal,resolveConnectionPrincipalFromAuth}from"#runtime/connections/principal.js";const LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES=new Set([`127.0.0.1`,`[::1]`]);function createAuthorizationExecution(e={}){let t=new Set;async function complete(n){let r=n.instanceId??n.scope;!t.has(r)&&await(e.completeAuthorization??completeScopedAuthorization)(n)&&t.add(r)}function requireAuth(e,n){throw new ScopedAuthorizationRequiredError(e,t.has(e.instanceId??e.scope),n)}return{complete,async getToken(e){await complete(e);try{return await resolveScopedToken(e)}catch(t){if(!isConnectionAuthorizationRequiredError(t))throw t;return requireAuth(e,t)}},requireAuth,async handleError(e,n){return n!==void 0&&isConnectionAuthorizationRequiredError(e)?await handleAuthorizationError(new ScopedAuthorizationRequiredError(n,t.has(n.instanceId??n.scope),e),{evictToken:!1}):await handleAuthorizationError(e)},run:executeWithAuthorization}}var ScopedAuthorizationRequiredError=class extends Error{scoped;justAuthorized;constructor(e,t,n){super(`Authorization required.`,{cause:n}),this.name=`ScopedAuthorizationRequiredError`,this.scoped=e,this.justAuthorized=t}};function isScopedAuthorizationRequiredError(e){return e instanceof Error&&e.name===`ScopedAuthorizationRequiredError`}async function handleAuthorizationError(e,t={evictToken:!0}){if(!isScopedAuthorizationRequiredError(e))throw e;let{scoped:n}=e;if(e.justAuthorized)throw new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" failed: the service rejected the token immediately after authorization.`,reason:`token_rejected_after_authorization`,retryable:!1});t.evictToken&&await evictScopedToken(n);let r=await startScopedAuthorization(n);if(r!==void 0)return r;throw supportsInteractiveAuthorization(n.authorization)?new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" requires sign-in, but no authorization callback URL could be minted for this run (missing session context).`,reason:`authorization_callback_unavailable`,retryable:!1}):e.cause??new ConnectionAuthorizationRequiredError(n.scope)}function executeWithAuthorization(e){try{let t=e();return isAsyncIterable(t)?handleIterable(t):Promise.resolve(t).catch(handleAuthorizationError)}catch(e){return handleAuthorizationError(e)}}async function*handleIterable(e){try{for await(let t of e)yield t}catch(e){yield await handleAuthorizationError(e)}}async function resolveScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore(),o=resolveScopedPrincipal(e,a);if(a===void 0)return await n.getToken({connection:r,principal:o});let s=principalKey(o),c=readCachedToken(a,i,s);if(c!==void 0)return c;let l=await n.getToken({connection:r,principal:o});return writeCachedToken(a,i,s,l),l}async function evictScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore();if(a===void 0)return;let o;try{o=resolveScopedPrincipal(e,a),evictCachedToken(a,i,principalKey(o))}catch{return}try{await n.evict?.({connection:r,principal:o})}catch{}}async function completeScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return!1;let i=consumeAuthorizationResult(t,e.instanceId);if(i===void 0)return!1;let a=n,o=loadContext(),s=i.principal??resolveScopedPrincipal(e,o),c=await a.completeAuthorization({callbackUrl:i.hookUrl,connection:r,principal:s,resume:i.resume,callback:i.callback});return writeCachedToken(o,e.instanceId??t,principalKey(s),c),!0}async function startScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return;let i=createAuthorizationAttempt(t);if(i===void 0)return;let a=n,o=resolveScopedPrincipal(e),s=(e.boundResponder??contextStorage.getStore()?.get(AuthKey))?.principalId,c=resolveAuthorizationCallbackUrl({authorization:n,callbackUrl:i.hookUrl}),{challenge:l,resume:u}=await a.startAuthorization({callbackUrl:c,connection:r,principal:o});return requestAuthorization([{attemptId:i.attemptId,challenge:stampChallengeDisplayName(l,n),hookUrl:c,instanceId:e.instanceId,name:t,principal:o,principalId:s,resume:u}])}function resolveScopedPrincipal(e,t){return e.boundResponder===void 0?resolveConnectionPrincipal(e.scope,e.authorization,t):resolveConnectionPrincipalFromAuth(e.scope,e.authorization,e.boundResponder,t)}function resolveAuthorizationCallbackUrl(e){if(e.authorization.vercelConnect===void 0)return e.callbackUrl;let t;try{t=new URL(e.callbackUrl)}catch{return e.callbackUrl}return t.protocol!==`http:`||!LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES.has(t.hostname)?e.callbackUrl:(t.hostname=`localhost`,t.toString())}function stampChallengeDisplayName(e,t){let n=t.displayName??e.displayName;return n===e.displayName?e:{...e,displayName:n}}export{completeScopedAuthorization,createAuthorizationExecution,evictScopedToken,handleAuthorizationError,resolveAuthorizationCallbackUrl,resolveScopedToken,stampChallengeDisplayName};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The value a connection tool call returns: what `connection_execute` hands
3
+ * the model today and what a code mode program receives later.
4
+ *
5
+ * - MCP results return `structuredContent` when present, otherwise their text,
6
+ * parsed as JSON when the tool declares no output schema. Results with image,
7
+ * audio, or resource content return their MCP `content` blocks, which
8
+ * {@link connectionToolModelOutput} turns into file parts.
9
+ * - MCP results with `isError: true` become an error carrying their text.
10
+ * - OpenAPI results pass through as `{ status, statusText, body }`.
11
+ */
12
+ import type { ToolModelOutput } from "#tools/model-output.js";
13
+ import type { ConnectionToolMetadata } from "#shared/connection-types.js";
14
+ export type ConnectionToolResult = {
15
+ readonly ok: true;
16
+ readonly value: unknown;
17
+ } | {
18
+ readonly ok: false;
19
+ readonly error: string;
20
+ };
21
+ export declare function toConnectionToolResult(protocol: "mcp" | "openapi", tool: ConnectionToolMetadata, raw: unknown): ConnectionToolResult;
22
+ /**
23
+ * Projects a {@link toConnectionToolResult} value for the model: MCP content
24
+ * blocks become text and file parts, strings stay text, and anything else is
25
+ * JSON.
26
+ */
27
+ export declare function connectionToolModelOutput(output: unknown): ToolModelOutput;
@@ -0,0 +1,2 @@
1
+ import{isObject}from"#shared/guards.js";const MCP_CONTENT_TYPES=new Set([`text`,`image`,`audio`,`resource`,`resource_link`]);function toConnectionToolResult(e,t,n){if(e===`openapi`||!isObject(n))return{ok:!0,value:n??null};let r=Array.isArray(n.content)?n.content.filter(isMcpContentBlock):[],i=r.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
2
+ `);return n.isError===!0?{ok:!1,error:i.length>0?i:n.structuredContent===void 0?`The tool reported an error.`:JSON.stringify(n.structuredContent)}:r.some(e=>e.type!==`text`)?{ok:!0,value:r}:n.structuredContent===void 0?t.outputSchema===void 0?{ok:!0,value:parseJsonText(i)}:{ok:!0,value:i}:{ok:!0,value:n.structuredContent}}function connectionToolModelOutput(e){return isMcpContentBlockList(e)?{type:`content`,value:e.flatMap(toModelOutputParts)}:typeof e==`string`?{type:`text`,value:e}:{type:`json`,value:e??null}}function parseJsonText(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function isMcpContentBlock(e){return isObject(e)&&typeof e.type==`string`&&MCP_CONTENT_TYPES.has(e.type)}function isMcpContentBlockList(e){return Array.isArray(e)&&e.length>0&&e.every(isMcpContentBlock)&&e.some(e=>e.type!==`text`)}function toModelOutputParts(e){switch(e.type){case`text`:return typeof e.text==`string`?[{type:`text`,text:e.text}]:[];case`image`:case`audio`:return typeof e.data==`string`&&typeof e.mimeType==`string`?[fileBlockPart(e.data,e.mimeType)]:[];case`resource`:{let t=isObject(e.resource)?e.resource:{},n=typeof t.uri==`string`?t.uri:void 0;if(typeof t.blob==`string`){let e=typeof t.mimeType==`string`?t.mimeType:`application/octet-stream`;return[fileBlockPart(t.blob,e,n)]}return typeof t.text==`string`?[{type:`text`,text:n===void 0?t.text:`${n}\n${t.text}`}]:[]}case`resource_link`:return[{type:`text`,text:`Resource link: ${typeof e.name==`string`?e.name:`resource`} ${typeof e.uri==`string`?e.uri:``}`.trim()}];default:return[]}}function fileBlockPart(e,t,n){let r={type:`file`,data:{type:`data`,data:e},mediaType:t};return n!==void 0&&(r.filename=n),r}export{connectionToolModelOutput,toConnectionToolResult};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Renders a connection tool's input and output JSON Schemas as a compact
3
+ * TypeScript signature, e.g.
4
+ * `list_issues(input: { teamId: string; first?: number /* maximum: 50 *\/ }): Promise<unknown>`.
5
+ *
6
+ * Constraints the model must respect (`minimum`, `maximum`, `pattern`, …) stay
7
+ * as comments. Rendering is deterministic, so the same schemas always produce
8
+ * the same text.
9
+ */
10
+ export declare function renderToolSignature(input: {
11
+ readonly name: string;
12
+ readonly inputSchema?: Record<string, unknown>;
13
+ readonly outputSchema?: Record<string, unknown>;
14
+ }): string;
@@ -0,0 +1 @@
1
+ import{isObject}from"#shared/guards.js";const CONSTRAINT_KEYS=[`format`,`pattern`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`minLength`,`maxLength`,`minItems`,`maxItems`,`default`],IDENTIFIER=/^[A-Za-z_$][\w$]*$/u;function renderToolSignature(e){let t=e.inputSchema===void 0?`{}`:renderRoot(e.inputSchema),n=e.outputSchema===void 0?`unknown`:renderRoot(e.outputSchema),r=`${e.name}(input: ${t}): Promise<${n}>`;return r.length>4e3?`${r.slice(0,3997)}...`:r}function renderRoot(e){return renderType(e,{budget:{remaining:1e3},depth:0,refs:new Set,root:e})}function renderType(e,t){if(e===!0||!isObject(e)||t.depth>6||t.budget.remaining<=0)return`unknown`;if(--t.budget.remaining,typeof e.$ref==`string`){let n=resolveRef(e.$ref,t);return n===void 0?`unknown`:renderType(n,{...t,refs:new Set([...t.refs,e.$ref])})}if(`const`in e)return literal(e.const);if(Array.isArray(e.enum))return union(e.enum.map(literal));let n=Array.isArray(e.anyOf)?e.anyOf:Array.isArray(e.oneOf)?e.oneOf:void 0;if(n!==void 0)return union(n.map(e=>renderType(e,next(t))));if(Array.isArray(e.allOf))return e.allOf.map(e=>wrap(renderType(e,next(t)))).join(` & `);let r=(Array.isArray(e.type)?e.type:[e.type]).filter(e=>typeof e==`string`).map(n=>renderPrimitive(n,e,t));return r.length>0?union(r):isObject(e.properties)||e.additionalProperties!==void 0?renderObject(e,t):e.items===void 0?`unknown`:renderPrimitive(`array`,e,t)}function renderPrimitive(e,t,n){switch(e){case`string`:return`string`;case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`null`:return`null`;case`array`:return`${wrap(renderType(t.items,next(n)))}[]`;case`object`:return renderObject(t,n);default:return`unknown`}}function renderObject(e,t){let n=isObject(e.properties)?e.properties:{},r=new Set(Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]),i=Object.entries(n).map(([e,n])=>{let i=IDENTIFIER.test(e)?e:JSON.stringify(e),a=r.has(e)?``:`?`,o=isObject(n)?propertyComment(n):``;return`${i}${a}: ${renderType(n,next(t))}${o}`}),a=e.additionalProperties;return isObject(a)&&i.push(`[key: string]: ${renderType(a,next(t))}`),i.length===0?a===!1?`{}`:`Record<string, unknown>`:`{ ${i.join(`; `)} }`}function propertyComment(e){let t=[],n=typeof e.description==`string`?e.description.replaceAll(/\s+/gu,` `).replace(/[\s.;,:]+$/u,``).trim():``;n.length>0&&t.push(truncate(n));for(let n of CONSTRAINT_KEYS)e[n]!==void 0&&t.push(`${n}: ${JSON.stringify(e[n])}`);return t.length===0?``:` /* ${t.join(`; `).replaceAll(`*/`,`* /`)} */`}function resolveRef(e,t){if(t.refs.has(e)||!e.startsWith(`#`))return;let n=t.root;for(let t of e.slice(1).split(`/`).filter(Boolean)){if(!isObject(n))return;n=n[t.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`)]}return n}function next(e){return{...e,depth:e.depth+1}}function literal(e){return e===void 0?`undefined`:JSON.stringify(e)}function union(e){let t=[...new Set(e)];return t.length===0?`never`:t.join(` | `)}function wrap(e){return e.includes(` | `)||e.includes(` & `)?`(${e})`:e}function truncate(e){return e.length>120?`${e.slice(0,117)}...`:e}export{renderToolSignature};
@@ -1 +1 @@
1
- import{randomUUID}from"node:crypto";import{isLoopbackHostname}from"#shared/network-address.js";import{ContextContainer,contextStorage}from"#context/container.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";import{DEVELOPMENT_WORKFLOW_SECRET_ENV}from"#internal/workflow/development-world-protocol.js";import{DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER,isTrustedDevelopmentClientAddress,readTrustedDevelopmentClientAddress}from"#internal/nitro/dev-client-address.js";const LOCAL_DEV_APP_ROOT_ENV=`EVE_DEV_APP_ROOT`,LOCAL_DEV_CONTROL_URL_ENV=`EVE_DEV_CONTROL_URL`,LOCAL_DEV_INTERACTIVE_CLIENT_HEADER=`x-eve-dev-interactive-client`;function installLocalDevCapabilityEnvironment(e){let t=process.env[LOCAL_DEV_APP_ROOT_ENV],n=process.env[LOCAL_DEV_CONTROL_URL_ENV];return process.env[LOCAL_DEV_APP_ROOT_ENV]=e.appRoot,process.env[LOCAL_DEV_CONTROL_URL_ENV]=new URL(e.serverUrl).origin,()=>{restore(LOCAL_DEV_APP_ROOT_ENV,t),restore(LOCAL_DEV_CONTROL_URL_ENV,n)}}async function withLocalDevRequestScope(e,t){let n=process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV],r=readTrustedDevelopmentClientAddress(e.headers,n),i=e.headers.get(DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER);return r===void 0||i===null||!isLoopbackHostname(r)?await contextStorage.run(new ContextContainer({localDevRequest:void 0}),t):await contextStorage.run(new ContextContainer({localDevRequest:{address:r,interactiveClient:e.headers.get(LOCAL_DEV_INTERACTIVE_CLIENT_HEADER)===`1`,signature:i}}),t)}function getLocalDevCapability(e=process.env){let t=e[LOCAL_DEV_APP_ROOT_ENV],n=e[LOCAL_DEV_CONTROL_URL_ENV];if(t===void 0||t===``||n===void 0||n===``)return;let r=contextStorage.getStore()?.localDevRequest;return{appRoot:t,interactiveClient:r!==void 0&&typeof r.address==`string`&&typeof r.signature==`string`&&typeof r.interactiveClient==`boolean`&&isLoopbackHostname(r.address)&&isTrustedDevelopmentClientAddress(r.address,r.signature,process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV])?r.interactiveClient:!1,async withSuspendedSource(e){let t=randomUUID();if(!await suspendDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n}))throw Error(`Could not pause the eve development server. Its authored-source watcher must be suspended before the authored tree is modified.`);let r;try{r={ok:!0,value:await e()}}catch(e){r={error:e,ok:!1}}if(await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0&&await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0)throw Error(`Could not resume the eve development server after modifying the authored tree. Restart eve dev before making further source changes.`,r.ok?void 0:{cause:r.error});if(!r.ok)throw r.error;return r.value}}}function restore(e,t){t===void 0?delete process.env[e]:process.env[e]=t}export{LOCAL_DEV_INTERACTIVE_CLIENT_HEADER,getLocalDevCapability,installLocalDevCapabilityEnvironment,withLocalDevRequestScope};
1
+ import{randomUUID}from"node:crypto";import{ContextContainer,contextStorage}from"#context/container.js";import{isLoopbackHostname}from"#shared/network-address.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";import{DEVELOPMENT_WORKFLOW_SECRET_ENV}from"#internal/workflow/development-world-protocol.js";import{DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER,isTrustedDevelopmentClientAddress,readTrustedDevelopmentClientAddress}from"#internal/nitro/dev-client-address.js";const LOCAL_DEV_APP_ROOT_ENV=`EVE_DEV_APP_ROOT`,LOCAL_DEV_CONTROL_URL_ENV=`EVE_DEV_CONTROL_URL`,LOCAL_DEV_INTERACTIVE_CLIENT_HEADER=`x-eve-dev-interactive-client`;function installLocalDevCapabilityEnvironment(e){let t=process.env[LOCAL_DEV_APP_ROOT_ENV],n=process.env[LOCAL_DEV_CONTROL_URL_ENV];return process.env[LOCAL_DEV_APP_ROOT_ENV]=e.appRoot,process.env[LOCAL_DEV_CONTROL_URL_ENV]=new URL(e.serverUrl).origin,()=>{restore(LOCAL_DEV_APP_ROOT_ENV,t),restore(LOCAL_DEV_CONTROL_URL_ENV,n)}}async function withLocalDevRequestScope(e,t){let n=process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV],r=readTrustedDevelopmentClientAddress(e.headers,n),i=e.headers.get(DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER);return r===void 0||i===null||!isLoopbackHostname(r)?await contextStorage.run(new ContextContainer({localDevRequest:void 0}),t):await contextStorage.run(new ContextContainer({localDevRequest:{address:r,interactiveClient:e.headers.get(LOCAL_DEV_INTERACTIVE_CLIENT_HEADER)===`1`,signature:i}}),t)}function getLocalDevCapability(e=process.env){let t=e[LOCAL_DEV_APP_ROOT_ENV],n=e[LOCAL_DEV_CONTROL_URL_ENV];if(t===void 0||t===``||n===void 0||n===``)return;let r=contextStorage.getStore()?.localDevRequest;return{appRoot:t,interactiveClient:r!==void 0&&typeof r.address==`string`&&typeof r.signature==`string`&&typeof r.interactiveClient==`boolean`&&isLoopbackHostname(r.address)&&isTrustedDevelopmentClientAddress(r.address,r.signature,process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV])?r.interactiveClient:!1,async withSuspendedSource(e){let t=randomUUID();if(!await suspendDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n}))throw Error(`Could not pause the eve development server. Its authored-source watcher must be suspended before the authored tree is modified.`);let r;try{r={ok:!0,value:await e()}}catch(e){r={error:e,ok:!1}}if(await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0&&await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0)throw Error(`Could not resume the eve development server after modifying the authored tree. Restart eve dev before making further source changes.`,r.ok?void 0:{cause:r.error});if(!r.ok)throw r.error;return r.value}}}function restore(e,t){t===void 0?delete process.env[e]:process.env[e]=t}export{LOCAL_DEV_INTERACTIVE_CLIENT_HEADER,getLocalDevCapability,installLocalDevCapabilityEnvironment,withLocalDevRequestScope};
@@ -1,14 +1,12 @@
1
- import type { ResolvedConnectionDefinition, ResolvedInstructionsDefinition, ResolvedSkillDefinition } from "#runtime/types.js";
1
+ import type { ResolvedInstructionsDefinition, ResolvedSkillDefinition } from "#runtime/types.js";
2
2
  import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
3
3
  /**
4
4
  * Input for composing the base authored instructions prompt for one
5
5
  * resolved agent.
6
6
  */
7
7
  interface ComposeRuntimeBasePromptInput {
8
- connections?: readonly ResolvedConnectionDefinition[];
9
8
  instructions?: readonly ResolvedInstructionsDefinition[];
10
9
  skills?: readonly ResolvedSkillDefinition[];
11
- subagentsAvailable?: boolean;
12
10
  toolsAvailable?: boolean;
13
11
  workspaceSpec?: WorkspaceRuntimeSpec;
14
12
  }
@@ -1,4 +1,4 @@
1
- import{formatAvailableSkillsSection}from"#execution/skills/instructions.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{formatConnectionsSection}from"#runtime/prompt/connections.js";function composeRuntimeBasePrompt(e){return[...createInstructionsPromptBlocks(e.instructions),...createWorkspacePromptBlocks(e.workspaceSpec),...e.toolsAvailable?[`Tool execution
2
- A single tool or subagent call runs as one serial action. If you call multiple independent tools or subagents in one response, eve treats that batch as parallel work. Only batch work that is independent and does not rely on another call in the same response.`]:[],...e.subagentsAvailable?["Agent messaging\nSubagent calls start durable background tasks and return immediately with a task receipt. After delegating, continue helping the user or end your turn. The task will notify you when it completes, fails, needs input, or sends an update; completion and failure notifications include the task's result. Agents you have already delegated to remain visible in the framework-authored `<agents>` conversation note. To steer delegated work, send the updated instruction to the original subagent tool with that agentId. If availability=busy, this steers its active turn at the next safe boundary, preserving the same taskId, child session, and pending approvals. Forward user steering to the affected child promptly; an acknowledgement alone does not update its work. Leave unrelated background work running. If availability=available, the same call continues the idle child. Calling a subagent without agentId starts a new agent session. Use task_cancel with its taskId to stop work without sending a replacement instruction."]:[],...createConnectionsPromptBlocks(e.connections),...createSkillsPromptBlocks(e.skills)]}function createInstructionsPromptBlocks(e){let t=(e??[]).filter(e=>e.role===`system`&&e.content.trim().length>0);if(t.length===0)return[];let n=t.length===1?t[0]:void 0;return[`Instructions (${n!==void 0&&n.owner.kind!==`extension`?n.name:`instructions`})\n${t.map(e=>e.content).join(`
1
+ import{formatAvailableSkillsSection}from"#execution/skills/instructions.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";function composeRuntimeBasePrompt(e){return[...createInstructionsPromptBlocks(e.instructions),...createWorkspacePromptBlocks(e.workspaceSpec),...e.toolsAvailable?[`Tool execution
2
+ Tool calls in one response run in parallel, so batch only calls that don't depend on each other.`]:[],...createSkillsPromptBlocks(e.skills)]}function createInstructionsPromptBlocks(e){let t=(e??[]).filter(e=>e.role===`system`&&e.content.trim().length>0);if(t.length===0)return[];let n=t.length===1?t[0]:void 0;return[`Instructions (${n!==void 0&&n.owner.kind!==`extension`?n.name:`instructions`})\n${t.map(e=>e.content).join(`
3
3
 
4
- `).trim()}`]}function createWorkspacePromptBlocks(e){if(e===void 0)return[];let t=createWorkspacePromptSection(e);return t===void 0?[]:[t]}function createConnectionsPromptBlocks(e){return!e||e.length===0?[]:[formatConnectionsSection(e)]}function createSkillsPromptBlocks(e){if(!e||e.length===0)return[];let t=formatAvailableSkillsSection(e);return t===null?[]:[t]}export{composeRuntimeBasePrompt};
4
+ `).trim()}`]}function createWorkspacePromptBlocks(e){if(e===void 0)return[];let t=createWorkspacePromptSection(e);return t===void 0?[]:[t]}function createSkillsPromptBlocks(e){if(!e||e.length===0)return[];let t=formatAvailableSkillsSection(e);return t===null?[]:[t]}export{composeRuntimeBasePrompt};
@@ -1 +1 @@
1
- import{expectObjectRecord}from"#internal/authored-module.js";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{validateCompiledModuleMap}from"#compiler/validate-artifact.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{resolveDynamicSubagentDefinition}from"#runtime/resolve-dynamic-subagent.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){validateCompiledModuleMap(e.manifest,e.moduleMap);let t=new Map,n=createChildNodeIdsByParentNodeId(e.manifest),r=new Map(e.manifest.subagents.map(e=>[e.nodeId,e])),i=await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:n,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:t,subagentNodesById:r});return attachInheritedSandboxWorkspaceResources({manifest:e.manifest,nodesByNodeId:t}),{nodesByNodeId:t,root:i}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let n=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),r=await createRuntimeToolRegistry({tools:n.tools},{nodeId:t}),i=createRuntimeSandboxRegistry({sandbox:n.sandbox,workspaceResourceRoot:n.workspaceResourceRoot}),a=createRuntimeSubagentRegistry({disabledToolNames:e.manifest.sourceComposition.entries.flatMap(e=>e.kind!==`disabled`||!e.source.logicalPath.startsWith(`tools/`)?[]:[stripLogicalPathExtension(e.source.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`)]),reservedToolNames:[LOAD_SKILL_TOOL_NAME,...r.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),o={agent:n,channels:n.channels,hookRegistry:createRuntimeHookRegistry(n.hooks),nodeId:t,sandboxRegistry:i,sourceId:e.sourceId,subagentRegistry:a,toolRegistry:r,turnAgent:createResolvedRuntimeTurnAgent({agent:n,dynamicSubagentsAvailable:a.dynamicResolvers.length>0,id:e.agentId,nodeId:t,tools:[...r.preparedTools,...a.preparedTools]})};return e.nodesByNodeId.set(t,o),o}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={...e.sourceRef.configResolver===void 0?{description:e.sourceRef.description,tool:e.sourceRef.agent.config.tool}:{dynamic:await resolveDynamicSubagentDefinition({definition:e.sourceRef.configResolver,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId})},kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({agentId:e.sourceRef.name,childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(e){let t=await loadResolvedModuleExport({definition:e.sourceRef,kindLabel:`remote agent`,moduleMap:e.moduleMap,nodeId:e.nodeScopeId}),n=expectObjectRecord(t,`Expected remote agent source "${e.sourceRef.logicalPath}" to export an object.`),r={description:e.sourceRef.description,kind:`remote`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),path:e.sourceRef.path,sourceId:e.sourceRef.sourceId,sourceKind:`module`,tool:e.sourceRef.tool,url:await resolveRemoteAgentUrl({bakedUrl:e.sourceRef.url,logicalPath:e.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth),n.forwardPrincipal===!0&&(r.forwardPrincipal=!0);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function attachInheritedSandboxWorkspaceResources(e){let t=new Map(e.manifest.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let[n,r]of e.nodesByNodeId){if(r.sandboxRegistry.sandbox.definition.kind!==`parent`)continue;if(r.agent.dynamicSkillResolvers.length>0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" defines dynamic skills. Remove the child dynamic skills or give the child its own sandbox.`,{nodeId:n});let i=t.get(n);if(i===void 0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" has no parent.`,{nodeId:n});let a=resolveSandboxOwnerNode({nodeId:i,nodesByNodeId:e.nodesByNodeId,parentNodeIdByChildNodeId:t});r.sandboxRegistry.sandbox.inheritance={definition:a.sandboxRegistry.sandbox.definition,nodeId:a.nodeId,workspaceResourceRoot:a.sandboxRegistry.sandbox.workspaceResourceRoot};let o=createWorkspacePromptSection(a.agent.workspaceSpec);o!==void 0&&(r.turnAgent.instructions=[...r.turnAgent.instructions,o])}}function resolveSandboxOwnerNode(e){let t=e.nodesByNodeId.get(toRuntimeNodeId(e.nodeId));if(t===void 0)throw new ResolveRuntimeAgentGraphError(`Missing parent runtime node "${e.nodeId}".`,{nodeId:e.nodeId});if(t.sandboxRegistry.sandbox.definition.kind!==`parent`)return t;let n=e.parentNodeIdByChildNodeId.get(e.nodeId);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Inherited sandbox node "${e.nodeId}" has no parent.`,{nodeId:e.nodeId});return resolveSandboxOwnerNode({...e,nodeId:n})}function createChildNodeIdsByParentNodeId(e){let t=new Map;for(let n of e.subagents){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.nodeId]);continue}e.push(n.nodeId)}return t}function toRuntimeNodeId(e){return e===ROOT_COMPILED_AGENT_NODE_ID?ROOT_RUNTIME_AGENT_NODE_ID:e}export{resolveRuntimeAgentGraph};
1
+ import{expectObjectRecord}from"#internal/authored-module.js";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{validateCompiledModuleMap}from"#compiler/validate-artifact.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{resolveDynamicSubagentDefinition}from"#runtime/resolve-dynamic-subagent.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){validateCompiledModuleMap(e.manifest,e.moduleMap);let t=new Map,n=createChildNodeIdsByParentNodeId(e.manifest),r=new Map(e.manifest.subagents.map(e=>[e.nodeId,e])),i=await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:n,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:t,subagentNodesById:r});return attachInheritedSandboxWorkspaceResources({manifest:e.manifest,nodesByNodeId:t}),{nodesByNodeId:t,root:i}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let n=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),r=await createRuntimeToolRegistry({tools:n.tools},{nodeId:t}),i=createRuntimeSandboxRegistry({sandbox:n.sandbox,workspaceResourceRoot:n.workspaceResourceRoot}),a=createRuntimeSubagentRegistry({disabledToolNames:e.manifest.sourceComposition.entries.flatMap(e=>e.kind!==`disabled`||!e.source.logicalPath.startsWith(`tools/`)?[]:[stripLogicalPathExtension(e.source.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`)]),reservedToolNames:[LOAD_SKILL_TOOL_NAME,...r.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),o={agent:n,channels:n.channels,hookRegistry:createRuntimeHookRegistry(n.hooks),nodeId:t,sandboxRegistry:i,sourceId:e.sourceId,subagentRegistry:a,toolRegistry:r,turnAgent:createResolvedRuntimeTurnAgent({agent:n,id:e.agentId,nodeId:t,tools:[...r.preparedTools,...a.preparedTools]})};return e.nodesByNodeId.set(t,o),o}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={...e.sourceRef.configResolver===void 0?{description:e.sourceRef.description,tool:e.sourceRef.agent.config.tool}:{dynamic:await resolveDynamicSubagentDefinition({definition:e.sourceRef.configResolver,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId})},kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({agentId:e.sourceRef.name,childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(e){let t=await loadResolvedModuleExport({definition:e.sourceRef,kindLabel:`remote agent`,moduleMap:e.moduleMap,nodeId:e.nodeScopeId}),n=expectObjectRecord(t,`Expected remote agent source "${e.sourceRef.logicalPath}" to export an object.`),r={description:e.sourceRef.description,kind:`remote`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),path:e.sourceRef.path,sourceId:e.sourceRef.sourceId,sourceKind:`module`,tool:e.sourceRef.tool,url:await resolveRemoteAgentUrl({bakedUrl:e.sourceRef.url,logicalPath:e.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth),n.forwardPrincipal===!0&&(r.forwardPrincipal=!0);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function attachInheritedSandboxWorkspaceResources(e){let t=new Map(e.manifest.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let[n,r]of e.nodesByNodeId){if(r.sandboxRegistry.sandbox.definition.kind!==`parent`)continue;if(r.agent.dynamicSkillResolvers.length>0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" defines dynamic skills. Remove the child dynamic skills or give the child its own sandbox.`,{nodeId:n});let i=t.get(n);if(i===void 0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" has no parent.`,{nodeId:n});let a=resolveSandboxOwnerNode({nodeId:i,nodesByNodeId:e.nodesByNodeId,parentNodeIdByChildNodeId:t});r.sandboxRegistry.sandbox.inheritance={definition:a.sandboxRegistry.sandbox.definition,nodeId:a.nodeId,workspaceResourceRoot:a.sandboxRegistry.sandbox.workspaceResourceRoot};let o=createWorkspacePromptSection(a.agent.workspaceSpec);o!==void 0&&(r.turnAgent.instructions=[...r.turnAgent.instructions,o])}}function resolveSandboxOwnerNode(e){let t=e.nodesByNodeId.get(toRuntimeNodeId(e.nodeId));if(t===void 0)throw new ResolveRuntimeAgentGraphError(`Missing parent runtime node "${e.nodeId}".`,{nodeId:e.nodeId});if(t.sandboxRegistry.sandbox.definition.kind!==`parent`)return t;let n=e.parentNodeIdByChildNodeId.get(e.nodeId);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Inherited sandbox node "${e.nodeId}" has no parent.`,{nodeId:e.nodeId});return resolveSandboxOwnerNode({...e,nodeId:n})}function createChildNodeIdsByParentNodeId(e){let t=new Map;for(let n of e.subagents){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.nodeId]);continue}e.push(n.nodeId)}return t}function toRuntimeNodeId(e){return e===ROOT_COMPILED_AGENT_NODE_ID?ROOT_RUNTIME_AGENT_NODE_ID:e}export{resolveRuntimeAgentGraph};
@@ -1 +1 @@
1
- import{expectFunction,expectObjectRecord}from"#internal/authored-module.js";import{toErrorMessage}from"#shared/errors.js";import{isToolSchema,toInputSchema,toOutputSchema}from"#tools/schema.js";import{registerDefinitionSource,stampDefinitionKey}from"#internal/authored-definition/source-identity.js";import{normalizeApproval}from"#internal/authored-definition/approval.js";import{createWorkflowProgramExecuteInput}from"#tools/workflow-program-input.js";import{ResolveAgentError,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";async function resolveToolDefinition(e,t,n,r){if(!e.hasExecute)return{availableInSubagents:e.availableInSubagents,behavior:e.behavior,description:e.description,inputSchema:toInputSchema(e.inputSchema),logicalPath:e.logicalPath,name:e.name,outputSchema:toOutputSchema(e.outputSchema),owner:r,sourceId:e.sourceId,sourceKind:`module`};try{let i=await loadResolvedModuleExport({definition:e,kindLabel:`tool`,moduleMap:t,nodeId:n}),a=expectObjectRecord(i,describe(e,`to return an object`)),o={kind:`tool`,logicalPath:e.logicalPath,name:e.name,owner:r},s=`tool-source:${e.sourceId}`;stampDefinitionKey(a,s),registerDefinitionSource(s,o),registerDefinitionSource(`tool:${a.description}`,o);let c=expectFunction(a.execute,describe(e,`to provide an execute function`)),l=isToolSchema(a.inputSchema)?a.inputSchema:toInputSchema(e.inputSchema),u=isToolSchema(a.outputSchema)?a.outputSchema:toOutputSchema(e.outputSchema),d=e.workflowProgram,f=d===void 0?void 0:e=>createWorkflowProgramExecuteInput(d,e);return{availableInSubagents:e.availableInSubagents,behavior:e.behavior,description:e.description,execute:c,executeInput:f,execution:e.execution,exportName:e.exportName,inputSchema:l,logicalPath:e.logicalPath,name:e.name,owner:r,outputSchema:u,sourceId:e.sourceId,sourceKind:`module`,...extractOptionalHooks(a,e)}}catch(t){throw t instanceof ResolveAgentError?t:new ResolveAgentError(`Failed to attach the tool execute function from "${e.logicalPath}": ${toErrorMessage(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function extractOptionalHooks(e,t){let n={};if(e.label!==void 0){let r=expectObjectRecord(e.label,describe(t,`to provide a valid label definition`));n.label={complete:r.complete===void 0?void 0:expectFunction(r.complete,describe(t,`to provide an label complete function`)),delta:r.delta===void 0?void 0:expectFunction(r.delta,describe(t,`to provide an label delta function`)),start:expectFunction(r.start,describe(t,`to provide a label start callback function`))}}return e.approval!==void 0&&(n.approval=normalizeApproval(e.approval,describe(t,`to provide a valid approval definition`))),e.approvalKey!==void 0&&(n.approvalKey=expectFunction(e.approvalKey,describe(t,`to provide an approvalKey function`))),e.toModelOutput!==void 0&&(n.toModelOutput=expectFunction(e.toModelOutput,describe(t,`to provide a toModelOutput function`))),n}function describe(e,t){return`Expected the tool export "${e.exportName??`default`}" from "${e.logicalPath}" ${t}.`}export{resolveToolDefinition};
1
+ import{expectFunction,expectObjectRecord}from"#internal/authored-module.js";import{toErrorMessage}from"#shared/errors.js";import{isToolSchema,toInputSchema,toOutputSchema}from"#tools/schema.js";import{registerDefinitionSource,stampDefinitionKey}from"#internal/authored-definition/source-identity.js";import{normalizeApproval}from"#internal/authored-definition/approval.js";import{createWorkflowProgramExecuteInput}from"#tools/workflow-program-input.js";import{ResolveAgentError,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";async function resolveToolDefinition(e,t,n,r){if(!e.hasExecute)return{availableInSubagents:e.availableInSubagents,behavior:e.behavior,description:e.description,inputSchema:toInputSchema(e.inputSchema),logicalPath:e.logicalPath,name:e.name,outputSchema:toOutputSchema(e.outputSchema),owner:r,sourceId:e.sourceId,sourceKind:`module`};try{let i=await loadResolvedModuleExport({definition:e,kindLabel:`tool`,moduleMap:t,nodeId:n}),a=expectObjectRecord(i,describe(e,`to return an object`)),o={kind:`tool`,logicalPath:e.logicalPath,name:e.name,owner:r},s=`tool-source:${e.sourceId}`;stampDefinitionKey(a,s),registerDefinitionSource(s,o),registerDefinitionSource(`tool:${a.description}`,o);let c=e.behavior?.handling?.kind===`workflow-tool`?void 0:expectFunction(a.execute,describe(e,`to provide an execute function`)),l=isToolSchema(a.inputSchema)?a.inputSchema:toInputSchema(e.inputSchema),u=isToolSchema(a.outputSchema)?a.outputSchema:toOutputSchema(e.outputSchema),d=e.workflowProgram,f=d===void 0?void 0:e=>createWorkflowProgramExecuteInput(d,e);return{availableInSubagents:e.availableInSubagents,behavior:e.behavior,description:e.description,execute:c,executeInput:f,exportName:e.exportName,inputSchema:l,logicalPath:e.logicalPath,name:e.name,owner:r,outputSchema:u,sourceId:e.sourceId,sourceKind:`module`,...extractOptionalHooks(a,e)}}catch(t){throw t instanceof ResolveAgentError?t:new ResolveAgentError(`Failed to attach the tool execute function from "${e.logicalPath}": ${toErrorMessage(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function extractOptionalHooks(e,t){let n={};if(e.label!==void 0){let r=expectObjectRecord(e.label,describe(t,`to provide a valid label definition`));n.label={complete:r.complete===void 0?void 0:expectFunction(r.complete,describe(t,`to provide an label complete function`)),delta:r.delta===void 0?void 0:expectFunction(r.delta,describe(t,`to provide an label delta function`)),start:expectFunction(r.start,describe(t,`to provide a label start callback function`))}}return e.approval!==void 0&&(n.approval=normalizeApproval(e.approval,describe(t,`to provide a valid approval definition`))),e.approvalKey!==void 0&&(n.approvalKey=expectFunction(e.approvalKey,describe(t,`to provide an approvalKey function`))),e.endsTurn!==void 0&&(n.endsTurn=typeof e.endsTurn==`boolean`?e.endsTurn:expectFunction(e.endsTurn,describe(t,`to provide endsTurn as a boolean or a function`))),e.toModelOutput!==void 0&&(n.toModelOutput=expectFunction(e.toModelOutput,describe(t,`to provide a toModelOutput function`))),n}function describe(e,t){return`Expected the tool export "${e.exportName??`default`}" from "${e.logicalPath}" ${t}.`}export{resolveToolDefinition};
@@ -1 +1 @@
1
- import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{pathToFileURL}from"node:url";import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{getResolvedRuntimeAgentNode}from"#runtime/graph.js";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{resolveRuntimeAgentGraph}from"#runtime/resolve-agent-graph.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{getActiveRuntimeSession}from"#runtime/sessions/runtime-session.js";import{createRuntimeAdapterRegistry}from"#runtime/channels/registry.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";const isCacheDisabled=process.env.EVE_DISABLE_AGENT_CACHE===`1`;function isDevelopmentRuntimeSnapshotRoot(e){return e.replaceAll(`\\`,`/`).includes(`/.eve/dev-runtime/snapshots/`)}function normalizeCompiledArtifactsSource(e){return e.kind!==`disk`||e.moduleMapLoaderPath!==void 0||!isDevelopmentRuntimeSnapshotRoot(e.appRoot)?e:{...e,moduleMapLoaderPath:resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`)}}async function loadFullBundle(e){let t=normalizeCompiledArtifactsSource(e),[n,r]=await Promise.all([loadCompiledManifest({compiledArtifactsSource:t}),loadRuntimeCompiledModuleMap(t)]),i=await resolveRuntimeAgentGraph({manifest:n,moduleMap:r}),a=i.root;return{adapterRegistry:createRuntimeAdapterRegistry({channels:collectResolvedChannels(i)}),compiledArtifactsSource:t,graph:i,hookRegistry:a.hookRegistry,moduleMap:r,resolvedAgent:a.agent,subagentRegistry:a.subagentRegistry,toolRegistry:a.toolRegistry,turnAgent:a.turnAgent}}async function loadRuntimeCompiledModuleMap(e){return e.kind===`disk`&&e.moduleMapLoaderPath!==void 0?await loadAuthoredSourceCompiledModuleMap(e):await loadCompiledModuleMap({compiledArtifactsSource:e})}async function loadAuthoredSourceCompiledModuleMap(e){if(e.moduleMapLoaderPath===void 0)throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`);return await(await import(pathToFileURL(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({compiledArtifactsSource:e})}async function getOrLoadFullBundle(e){let t=normalizeCompiledArtifactsSource(e);if(isCacheDisabled)return loadFullBundle(t);let n=getActiveRuntimeSession(),r=getRuntimeCompiledArtifactsCacheKey(t),i=await resolveRuntimeCompiledArtifactsVersionedCacheKey(t),a=n.bundleCacheKeyBySourceKey.get(r);a!==void 0&&a!==i&&n.bundleCache.delete(a),n.bundleCacheKeyBySourceKey.set(r,i);let o=n.bundleCache.get(i);if(o!==void 0)return o;let s=loadFullBundle(t).catch(e=>{throw n.bundleCache.delete(i),n.bundleCacheKeyBySourceKey.get(r)===i&&n.bundleCacheKeyBySourceKey.delete(r),e});return n.bundleCache.set(i,s),s}async function getCompiledRuntimeAgentBundle(e){let t=await getOrLoadFullBundle(e.compiledArtifactsSource);if(e.nodeId===void 0)return t;let n=getResolvedRuntimeAgentNode(t.graph,e.nodeId);return{adapterRegistry:t.adapterRegistry,compiledArtifactsSource:t.compiledArtifactsSource,graph:{nodesByNodeId:t.graph.nodesByNodeId,root:n},hookRegistry:n.hookRegistry,moduleMap:t.moduleMap,nodeId:e.nodeId,resolvedAgent:n.agent,subagentRegistry:n.subagentRegistry,toolRegistry:n.toolRegistry,turnAgent:n.turnAgent}}function clearCompiledRuntimeAgentBundleCache(){let e=getActiveRuntimeSession();e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()}function collectResolvedChannels(e){let t=new Map;for(let n of e.nodesByNodeId.values())for(let e of n.channels)t.set(`${e.sourceId}:${e.name}`,e);return[...t.values()]}export{clearCompiledRuntimeAgentBundleCache,getCompiledRuntimeAgentBundle};
1
+ import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{pathToFileURL}from"node:url";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{getResolvedRuntimeAgentNode}from"#runtime/graph.js";import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{resolveRuntimeAgentGraph}from"#runtime/resolve-agent-graph.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{getActiveRuntimeSession}from"#runtime/sessions/runtime-session.js";import{createRuntimeAdapterRegistry}from"#runtime/channels/registry.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";const isCacheDisabled=process.env.EVE_DISABLE_AGENT_CACHE===`1`;function isDevelopmentRuntimeSnapshotRoot(e){return e.replaceAll(`\\`,`/`).includes(`/.eve/dev-runtime/snapshots/`)}function normalizeCompiledArtifactsSource(e){return e.kind!==`disk`||e.moduleMapLoaderPath!==void 0||!isDevelopmentRuntimeSnapshotRoot(e.appRoot)?e:{...e,moduleMapLoaderPath:resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`)}}async function loadFullBundle(e){let t=normalizeCompiledArtifactsSource(e),[n,r]=await Promise.all([loadCompiledManifest({compiledArtifactsSource:t}),loadRuntimeCompiledModuleMap(t)]),i=await resolveRuntimeAgentGraph({manifest:n,moduleMap:r}),a=i.root;return{adapterRegistry:createRuntimeAdapterRegistry({channels:collectResolvedChannels(i)}),compiledArtifactsSource:t,graph:i,hookRegistry:a.hookRegistry,moduleMap:r,resolvedAgent:a.agent,subagentRegistry:a.subagentRegistry,toolRegistry:a.toolRegistry,turnAgent:a.turnAgent}}async function loadRuntimeCompiledModuleMap(e){return e.kind===`disk`&&e.moduleMapLoaderPath!==void 0?await loadAuthoredSourceCompiledModuleMap(e):await loadCompiledModuleMap({compiledArtifactsSource:e})}async function loadAuthoredSourceCompiledModuleMap(e){if(e.moduleMapLoaderPath===void 0)throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`);return await(await import(pathToFileURL(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({compiledArtifactsSource:e})}async function getOrLoadFullBundle(e){let t=normalizeCompiledArtifactsSource(e);if(isCacheDisabled)return loadFullBundle(t);let n=getActiveRuntimeSession(),r=getRuntimeCompiledArtifactsCacheKey(t),i=await resolveRuntimeCompiledArtifactsVersionedCacheKey(t),a=n.bundleCacheKeyBySourceKey.get(r);a!==void 0&&a!==i&&n.bundleCache.delete(a),n.bundleCacheKeyBySourceKey.set(r,i);let o=n.bundleCache.get(i);if(o!==void 0)return o;let s=loadFullBundle(t).catch(e=>{throw n.bundleCache.delete(i),n.bundleCacheKeyBySourceKey.get(r)===i&&n.bundleCacheKeyBySourceKey.delete(r),e});return n.bundleCache.set(i,s),s}async function getCompiledRuntimeAgentBundle(e){let t=await getOrLoadFullBundle(e.compiledArtifactsSource);if(e.nodeId===void 0)return t;let n=getResolvedRuntimeAgentNode(t.graph,e.nodeId);return{adapterRegistry:t.adapterRegistry,compiledArtifactsSource:t.compiledArtifactsSource,graph:{nodesByNodeId:t.graph.nodesByNodeId,root:n},hookRegistry:n.hookRegistry,moduleMap:t.moduleMap,nodeId:e.nodeId,resolvedAgent:n.agent,subagentRegistry:n.subagentRegistry,toolRegistry:n.toolRegistry,turnAgent:n.turnAgent}}function clearCompiledRuntimeAgentBundleCache(){let e=getActiveRuntimeSession();e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()}function collectResolvedChannels(e){let t=new Map;for(let n of e.nodesByNodeId.values())for(let e of n.channels)t.set(`${e.sourceId}:${e.name}`,e);return[...t.values()]}export{clearCompiledRuntimeAgentBundleCache,getCompiledRuntimeAgentBundle};
@@ -1 +1 @@
1
- import{getAdapterKind}from"#channel/adapter.js";import{ContextKey}from"#context/key.js";import{CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{resolveDurableCompiledArtifactsSource,serializeDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{deserializeRuntimeAdapter}from"#runtime/channels/registry.js";const ChannelKey=new ContextKey(CHANNEL_CONTEXT_KEY_NAME,{codec:{serialize(e){return{kind:getAdapterKind(e),state:e.state?{...e.state}:{}}},deserialize(e,t){let n=t.get(BundleKey);if(n===void 0)throw Error(`Cannot deserialize "eve.channel" before "eve.bundle". The runtime bundle must be present in context.`);return deserializeRuntimeAdapter(n.adapterRegistry,e)}}}),BundleKey=new ContextKey(`eve.bundle`,{codec:{serialize:e=>({nodeId:e.nodeId,source:serializeDurableCompiledArtifactsSource(e.compiledArtifactsSource)}),deserialize:e=>{let{source:t,nodeId:n}=e;return getCompiledRuntimeAgentBundle({compiledArtifactsSource:resolveDurableCompiledArtifactsSource(t),nodeId:n})}}});export{BundleKey,ChannelKey};
1
+ import{getAdapterKind}from"#channel/adapter.js";import{ContextKey}from"#context/key.js";import{CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{resolveDurableCompiledArtifactsSource,serializeDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{deserializeRuntimeAdapter}from"#runtime/channels/registry.js";const ChannelKey=new ContextKey(CHANNEL_CONTEXT_KEY_NAME,{codec:{serialize(e){return{kind:getAdapterKind(e),state:e.state?{...e.state}:{}}},deserialize(e,t){let n=t.get(BundleKey);if(n===void 0)throw Error(`Cannot deserialize "eve.channel" before "eve.bundle". The runtime bundle must be present in context.`);return deserializeRuntimeAdapter(n.adapterRegistry,e)}}}),BundleKey=new ContextKey(`eve.bundle`,{codec:{serialize:e=>({nodeId:e.nodeId,source:serializeDurableCompiledArtifactsSource(e.compiledArtifactsSource)}),deserialize:e=>{let{source:t,nodeId:n}=e;return getCompiledRuntimeAgentBundle({compiledArtifactsSource:resolveDurableCompiledArtifactsSource(t),nodeId:n})}}});export{BundleKey,ChannelKey};
@@ -3,18 +3,6 @@ import type { SourceRef } from "#shared/source-ref.js";
3
3
  import type { InternalToolDefinition } from "#tools/definition.js";
4
4
  import type { AgentSourceOwner } from "#compiler/source-graph.js";
5
5
  import type { PreparedToolBehavior } from "#tools/behavior.js";
6
- /** Grouped durable workflow metadata for one prepared harness tool. */
7
- export interface PreparedRuntimeWorkflowTask {
8
- /**
9
- * Runtime graph ID of the agent definition this tool delegates to, including
10
- * the root agent for the framework `agent` tool. Used for receipts and handle
11
- * reservations; `agentId` identifies the resulting agent instance.
12
- * Absent for authored workflow tools, even if their body calls `ctx.agent()`.
13
- */
14
- readonly nodeId?: string;
15
- /** Registered workflow definition to execute. */
16
- readonly workflowId: string;
17
- }
18
6
  /**
19
7
  * Serializable authored tool descriptor prepared by the runtime for one
20
8
  * harness turn.
@@ -24,14 +12,11 @@ export type PreparedRuntimeAuthoredTool = Readonly<InternalToolDefinition & Sour
24
12
  kind: "authored-tool";
25
13
  owner: AgentSourceOwner;
26
14
  rootOnly?: boolean;
27
- task?: PreparedRuntimeWorkflowTask;
28
15
  }>;
29
- type PreparedRuntimeDelegationToolBase<TKind extends "remote" | "subagent"> = Readonly<Omit<InternalToolDefinition, "execution"> & SourceRef & Node & {
16
+ type PreparedRuntimeDelegationToolBase<TKind extends "remote" | "subagent"> = Readonly<InternalToolDefinition & SourceRef & Node & {
30
17
  behavior: PreparedToolBehavior;
31
- execution: "background";
32
18
  kind: TKind;
33
19
  rootOnly?: boolean;
34
- task: PreparedRuntimeWorkflowTask;
35
20
  }>;
36
21
  /**
37
22
  * Serializable local subagent descriptor prepared by the runtime for one
@@ -1 +1 @@
1
- import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";async function normalizeDynamicRemoteAgentConfig(e){let t=`Dynamic subagent "${e.name}" must return defineAgent(...), defineRemoteAgent(...), or null.`,n=expectObjectRecord(e.value,t);if(expectOnlyKnownKeys(n,[`auth`,`description`,`forwardPrincipal`,`headers`,`kind`,`path`,`tool`,`url`],t),n.kind!==`remote`)throw Error(t);let r=await resolveUrl(n.url,t),i=readCredentialsStepId(n);if(validateCredentials(n,t),(n.auth!==void 0||n.headers!==void 0)&&i===void 0)throw Error(`${t} Dynamic remote auth and headers must be compiled by eve so credentials stay out of durable workflow state.`);let a={description:expectString(n.description,t),path:n.path===void 0?EVE_SESSION_ROUTE_PATH:expectString(n.path,t),url:r};return i!==void 0&&(a.credentialsStepId=i),n.forwardPrincipal!==void 0&&(a.forwardPrincipal=expectBoolean(n.forwardPrincipal,t)),n.tool!==void 0&&(a.tool=expectBoolean(n.tool,t)),a}async function resolveUrl(e,t){let n=typeof e==`function`?await expectFunction(e,t)():expectString(e,t);if(n.length===0)throw Error(`${t} The "url" field must resolve to a non-empty string.`);return n}function validateCredentials(e,t){e.auth!==void 0&&expectFunction(e.auth,t),e.headers!==void 0&&typeof e.headers!=`function`&&getOptionalStringRecordProperty(e,`headers`,t)}function readCredentialsStepId(e){let t=e.__eveResolveRemoteAgentCredentials;if(typeof t!=`function`)return;let n=t.stepId;return typeof n==`string`?n:void 0}export{normalizeDynamicRemoteAgentConfig};
1
+ import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";async function normalizeDynamicRemoteAgentConfig(e){let t=`Dynamic subagent "${e.name}" must return defineAgent(...), defineRemoteAgent(...), or null.`,n=expectObjectRecord(e.value,t);if(expectOnlyKnownKeys(n,[`auth`,`description`,`forwardPrincipal`,`headers`,`kind`,`path`,`tool`,`url`],t),n.kind!==`remote`)throw Error(t);let r=await resolveUrl(n.url,t),i=readCredentialsStepId(n);if(validateCredentials(n,t),(n.auth!==void 0||n.headers!==void 0)&&i===void 0)throw Error(`${t} Dynamic remote auth and headers must be compiled by eve so credentials stay out of durable workflow state.`);let a={description:expectString(n.description,t),path:n.path===void 0?EVE_SESSION_ROUTE_PATH:expectString(n.path,t),url:r};return i!==void 0&&(a.credentialsStepId=i),n.forwardPrincipal!==void 0&&(a.forwardPrincipal=expectBoolean(n.forwardPrincipal,t)),n.tool!==void 0&&(a.tool=expectBoolean(n.tool,t)),a}async function resolveUrl(e,t){let n=typeof e==`function`?await expectFunction(e,t)():expectString(e,t);if(n.length===0)throw Error(`${t} The "url" field must resolve to a non-empty string.`);return n}function validateCredentials(e,t){e.auth!==void 0&&expectFunction(e.auth,t),e.headers!==void 0&&typeof e.headers!=`function`&&getOptionalStringRecordProperty(e,`headers`,t)}function readCredentialsStepId(e){let t=e.__eveResolveRemoteAgentCredentials;if(typeof t!=`function`)return;let n=t.stepId;return typeof n==`string`?n:void 0}export{normalizeDynamicRemoteAgentConfig};
@@ -1 +1 @@
1
- import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA}from"#tools/framework/task-contract.js";import{SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{subagentToolExecuteWorkflowReference}from"#runtime/subagents/workflow-reference.js";import{RuntimeRegistry,RuntimeRegistryError}from"#internal/runtime-registry.js";const SUBAGENT_TOOL_INPUT_JSON_SCHEMA=serializeInputSchema(SUBAGENT_TOOL_INPUT_SCHEMA),SUBAGENT_TOOL_OUTPUT_JSON_SCHEMA=serializeOutputSchema(SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA);function createRuntimeSubagentRegistry(e){let t=[],n=new Set,r=[],i=new RuntimeRegistry(`subagent`),a=new Set(e.reservedToolNames??[]),o=new Set(e.disabledToolNames??[]),s=new Map;for(let c of e.subagents){let e={logicalPath:c.logicalPath,sourceId:c.sourceId};if(s.has(c.nodeId))throw new RuntimeRegistryError(`subagent`,`Found multiple runtime subagents mapped to node id "${c.nodeId}".`,{...e,entryName:c.name});let l,u=c.kind===`subagent`?c.dynamic:void 0;if(u===void 0){let n=createPreparedRuntimeSubagentTool(c,SUBAGENT_TOOL_INPUT_JSON_SCHEMA);l={definition:c,prepared:n},i.register(c.name,l,{location:e,duplicateMessage:`Found multiple subagents named "${c.name}". Subagent names must be unique at runtime.`});let r=c.tool!==!1&&!o.has(c.name);if(r&&a.has(c.name))throw new RuntimeRegistryError(`subagent`,`Subagent "${c.name}" collides with another runtime-visible tool name.`,{...e,entryName:c.name});r&&t.push(n)}else n.add(c.nodeId),r.push({...u,kind:`subagent`,logicalPath:c.logicalPath,name:c.name,nodeId:c.nodeId,sourceId:c.sourceId,sourceKind:`module`,tool:!o.has(c.name)&&void 0}),l={definition:c};s.set(c.nodeId,l)}return{dynamicNodeIds:n,dynamicResolvers:r,preparedTools:t,subagentsByName:i.asMap(),subagentsByNodeId:s}}function createPreparedRuntimeSubagentTool(e,t=SUBAGENT_TOOL_INPUT_JSON_SCHEMA){if(e.description===void 0)throw Error(`Static subagent "${e.name}" is missing a description.`);return{behavior:{availability:[],handling:{kind:`dispatch`,target:e.kind===`remote`?{kind:`remote-agent-call`,nodeId:e.nodeId,remoteAgentName:e.name}:{kind:`subagent-call`,nodeId:e.nodeId,subagentName:e.name}}},description:`${e.description}\n\nThis call starts a background task and returns a task receipt immediately.`,execution:`background`,inputSchema:t,kind:e.kind,logicalPath:e.logicalPath,name:e.name,nodeId:e.nodeId,outputSchema:SUBAGENT_TOOL_OUTPUT_JSON_SCHEMA,sourceId:e.sourceId,task:{nodeId:e.nodeId,workflowId:subagentToolExecuteWorkflowReference.workflowId}}}export{createPreparedRuntimeSubagentTool,createRuntimeSubagentRegistry};
1
+ import{serializeInputSchema}from"#tools/schema.js";import{SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{RuntimeRegistry,RuntimeRegistryError}from"#internal/runtime-registry.js";const SUBAGENT_TOOL_INPUT_JSON_SCHEMA=serializeInputSchema(SUBAGENT_TOOL_INPUT_SCHEMA);function createRuntimeSubagentRegistry(e){let t=[],n=new Set,r=[],i=new RuntimeRegistry(`subagent`),a=new Set(e.reservedToolNames??[]),o=new Set(e.disabledToolNames??[]),s=new Map;for(let c of e.subagents){let e={logicalPath:c.logicalPath,sourceId:c.sourceId};if(s.has(c.nodeId))throw new RuntimeRegistryError(`subagent`,`Found multiple runtime subagents mapped to node id "${c.nodeId}".`,{...e,entryName:c.name});let l,u=c.kind===`subagent`?c.dynamic:void 0;if(u===void 0){let n=createPreparedRuntimeSubagentTool(c,SUBAGENT_TOOL_INPUT_JSON_SCHEMA);l={definition:c,prepared:n},i.register(c.name,l,{location:e,duplicateMessage:`Found multiple subagents named "${c.name}". Subagent names must be unique at runtime.`});let r=c.tool!==!1&&!o.has(c.name);if(r&&a.has(c.name))throw new RuntimeRegistryError(`subagent`,`Subagent "${c.name}" collides with another runtime-visible tool name.`,{...e,entryName:c.name});r&&t.push(n)}else n.add(c.nodeId),r.push({...u,kind:`subagent`,logicalPath:c.logicalPath,name:c.name,nodeId:c.nodeId,sourceId:c.sourceId,sourceKind:`module`,tool:!o.has(c.name)&&void 0}),l={definition:c};s.set(c.nodeId,l)}return{dynamicNodeIds:n,dynamicResolvers:r,preparedTools:t,subagentsByName:i.asMap(),subagentsByNodeId:s}}function createPreparedRuntimeSubagentTool(e,t=SUBAGENT_TOOL_INPUT_JSON_SCHEMA){if(e.description===void 0)throw Error(`Static subagent "${e.name}" is missing a description.`);return{behavior:{availability:[],handling:{kind:`dispatch`,target:e.kind===`remote`?{kind:`remote-agent-call`,nodeId:e.nodeId,remoteAgentName:e.name}:{kind:`subagent-call`,nodeId:e.nodeId,subagentName:e.name}}},description:e.description,inputSchema:t,kind:e.kind,logicalPath:e.logicalPath,name:e.name,nodeId:e.nodeId,sourceId:e.sourceId}}export{createPreparedRuntimeSubagentTool,createRuntimeSubagentRegistry};
@@ -1,5 +1,8 @@
1
- export declare const SUBAGENT_TOOL_EXECUTE_WORKFLOW_NAME = "subagentToolExecuteWorkflow";
2
- /** Shared framework-owned execute body for local and remote subagent tools. */
3
- export declare const subagentToolExecuteWorkflowReference: {
1
+ import type { PreparedToolHandling } from "#tools/behavior.js";
2
+ export declare const AGENT_TOOL_SERVE_WORKFLOW_NAME = "agentToolServeWorkflow";
3
+ /** The framework-owned `serve` body of every agent tool. */
4
+ export declare const agentToolServeWorkflowReference: {
4
5
  workflowId: string;
5
6
  };
7
+ /** Registered workflow that runs a tool with this handling; absent for tools without one. */
8
+ export declare function workflowIdForHandling(handling: PreparedToolHandling | undefined): string | undefined;
@@ -1 +1 @@
1
- import{EVE_PACKAGE_NAME}from"#internal/package-name.js";const SUBAGENT_TOOL_EXECUTE_WORKFLOW_NAME=`subagentToolExecuteWorkflow`,subagentToolExecuteWorkflowReference={workflowId:`workflow//${EVE_PACKAGE_NAME}//${SUBAGENT_TOOL_EXECUTE_WORKFLOW_NAME}`};export{SUBAGENT_TOOL_EXECUTE_WORKFLOW_NAME,subagentToolExecuteWorkflowReference};
1
+ import{EVE_PACKAGE_NAME}from"#internal/package-name.js";const AGENT_TOOL_SERVE_WORKFLOW_NAME=`agentToolServeWorkflow`,agentToolServeWorkflowReference={workflowId:`workflow//${EVE_PACKAGE_NAME}//${AGENT_TOOL_SERVE_WORKFLOW_NAME}`};function workflowIdForHandling(e){if(e?.kind===`dispatch`)switch(e.target.kind){case`workflow-tool-call`:return e.target.workflowId;case`remote-agent-call`:case`self-agent-call`:case`subagent-call`:return agentToolServeWorkflowReference.workflowId}}export{AGENT_TOOL_SERVE_WORKFLOW_NAME,agentToolServeWorkflowReference,workflowIdForHandling};
@@ -1,8 +1,14 @@
1
- import { invokeAgent } from "#execution/tools/subagent/invoke-agent.js";
2
- export interface SubagentWorkflowInput {
3
- readonly agentId?: string | null;
1
+ import type { WorkflowServeContext, WorkflowServeReceive } from "#public/tools/index.js";
2
+ /** The model's input to an agent tool; eve adds the optional `taskId`. */
3
+ export interface AgentToolInput {
4
4
  readonly message: string;
5
- readonly outputSchema?: Record<string, unknown>;
6
5
  }
7
- /** Shared execute body for local, remote, dynamic, and self-agent tools. */
8
- export declare function subagentToolExecuteWorkflow(input: SubagentWorkflowInput, ctx: Parameters<typeof invokeAgent>[0]): Promise<unknown>;
6
+ type AgentToolReceive = WorkflowServeReceive<AgentToolInput>;
7
+ /**
8
+ * The `serve` body of every agent tool: local, remote, dynamic, and the
9
+ * `agent` copy of the root. Each task talks to one session with the agent. A
10
+ * call that arrives while the agent works joins its turn, and the turn's final
11
+ * response settles every call it answered.
12
+ */
13
+ export declare function agentToolServeWorkflow(receive: AgentToolReceive, ctx: WorkflowServeContext<string>): Promise<never>;
14
+ export {};
@@ -1 +1 @@
1
- import{invokeAgent}from"#execution/tools/subagent/invoke-agent.js";async function subagentToolExecuteWorkflow(e,t){"use workflow";let n={...typeof e.agentId==`string`&&e.agentId.trim()!==``?{agentId:e.agentId}:{},message:e.message,outputSchema:e.outputSchema,target:t.toolName};return await invokeAgent(t,n,{invocationId:t.callId})}subagentToolExecuteWorkflow.workflowId=`workflow//eve//subagentToolExecuteWorkflow`;export{subagentToolExecuteWorkflow};
1
+ async function agentToolServeWorkflow(e,t){"use workflow";let n=t.agent(t.toolName),r=sendToAgent(n,await e()),i=e();for(;;){let a=await nextCallOrResult(i,r);if(a.kind===`call`){r=await forwardCall(n,r,a.call),i=e();continue}if(!r.signal.aborted){if(a.result.status===`failed`)throw Error(`The agent's turn failed: ${a.result.error?.message??`no reason given`}\nThis task has ended; to retry, call ${t.toolName} without taskId.`);let o=e();if(o!==i){r=sendToAgent(n,await i),i=o;continue}t.reply(a.result.message??``)}r=sendToAgent(n,await i),i=e()}}function sendToAgent(e,t){return{result:e.send(t.input.message,{signal:t.abortSignal}).then(e=>e.result()),signal:t.abortSignal}}async function nextCallOrResult(e,t){return await Promise.race([t.result.then(e=>({kind:`result`,result:e})),e.then(e=>({call:e,kind:`call`}))])}async function forwardCall(e,t,n){return t.signal.aborted&&await t.result.catch(()=>void 0),sendToAgent(e,n)}agentToolServeWorkflow.workflowId=`workflow//eve//agentToolServeWorkflow`;export{agentToolServeWorkflow};
@@ -1 +1 @@
1
- import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{AGENT_TOOL_NAME}from"#tools/framework/agent-contract.js";import{subagentToolExecuteWorkflowReference}from"#runtime/subagents/workflow-reference.js";import{RuntimeRegistry}from"#internal/runtime-registry.js";async function createRuntimeToolRegistry(e,t={}){let n=[],r=new RuntimeRegistry(`tool`,t.reservedToolNames??[]);for(let i of e.tools){let e=await createPreparedRuntimeTool(i,t.nodeId);r.register(i.name,{definition:i,prepared:e},{location:{logicalPath:i.logicalPath,sourceId:i.sourceId},duplicateMessage:`Found multiple authored tools named "${i.name}". Tool names must be unique at runtime.`,reservedMessage:`Tool "${i.name}" collides with another runtime-visible tool name.`}),n.push(e)}return{preparedTools:n,toolsByName:r.asMap()}}function findRegisteredRuntimeTool(e,t){return e.toolsByName.get(t)??null}async function createPreparedRuntimeTool(e,t){let n=e.behavior?.handling?.kind===`dispatch`&&e.behavior.handling.action===`self-agent`,r=n?subagentToolExecuteWorkflowReference.workflowId:e.behavior?.handling?.kind===`workflow-tool`?e.behavior.handling.workflowId:void 0;return{availableInSubagents:e.availableInSubagents,behavior:prepareToolBehavior(e.behavior,t,n?subagentToolExecuteWorkflowReference.workflowId:void 0),description:e.description,execution:e.execution,inputSchema:serializeInputSchema(e.inputSchema),kind:`authored-tool`,logicalPath:e.logicalPath,name:e.name,owner:e.owner,outputSchema:serializeOutputSchema(e.outputSchema),rootOnly:n||void 0,sourceId:e.sourceId,task:r===void 0?void 0:n?{nodeId:ROOT_RUNTIME_AGENT_NODE_ID,workflowId:r}:{workflowId:r}}}function prepareToolBehavior(e,t,n){if(e===void 0)return;let r;if(n!==void 0&&t!==void 0)r={kind:`dispatch`,target:{kind:`self-agent-call`,nodeId:t,subagentName:AGENT_TOOL_NAME}};else if(e.handling?.kind===`dispatch`){if(e.handling.action===`self-agent`&&t===void 0)throw Error(`The self-agent tool requires a concrete runtime node id.`);r={kind:`dispatch`,target:e.handling.action===`self-agent`?{kind:`self-agent-call`,nodeId:t,subagentName:AGENT_TOOL_NAME}:{kind:e.handling.action}}}else r=e.handling?.kind===`workflow-tool`?{kind:`dispatch`,target:{kind:`workflow-tool-call`,workflowId:n??e.handling.workflowId}}:e.handling;return{availability:e.availability,handling:r,presentation:e.presentation}}export{createRuntimeToolRegistry,findRegisteredRuntimeTool};
1
+ import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{AGENT_TOOL_NAME}from"#tools/framework/agent-contract.js";import{RuntimeRegistry}from"#internal/runtime-registry.js";async function createRuntimeToolRegistry(e,t={}){let n=[],r=new RuntimeRegistry(`tool`,t.reservedToolNames??[]);for(let i of e.tools){let e=await createPreparedRuntimeTool(i,t.nodeId);r.register(i.name,{definition:i,prepared:e},{location:{logicalPath:i.logicalPath,sourceId:i.sourceId},duplicateMessage:`Found multiple authored tools named "${i.name}". Tool names must be unique at runtime.`,reservedMessage:`Tool "${i.name}" collides with another runtime-visible tool name.`}),n.push(e)}return{preparedTools:n,toolsByName:r.asMap()}}function findRegisteredRuntimeTool(e,t){return e.toolsByName.get(t)??null}async function createPreparedRuntimeTool(e,t){let n=e.behavior?.handling?.kind===`dispatch`&&e.behavior.handling.action===`self-agent`;return{availableInSubagents:e.availableInSubagents,behavior:prepareToolBehavior(e.behavior,t),description:e.description,inputSchema:serializeInputSchema(e.inputSchema),kind:`authored-tool`,logicalPath:e.logicalPath,name:e.name,owner:e.owner,outputSchema:serializeOutputSchema(e.outputSchema),rootOnly:n||void 0,sourceId:e.sourceId}}function prepareToolBehavior(e,t){if(e===void 0)return;let n;if(e.handling?.kind===`dispatch`){if(t===void 0)throw Error(`The self-agent tool requires a concrete runtime node id.`);n={kind:`dispatch`,target:{kind:`self-agent-call`,nodeId:t,subagentName:AGENT_TOOL_NAME}}}else n=e.handling?.kind===`workflow-tool`?{kind:`dispatch`,target:{entryPoint:e.handling.entryPoint,kind:`workflow-tool-call`,workflowId:e.handling.workflowId}}:e.handling;return{availability:e.availability,handling:n,presentation:e.presentation}}export{createRuntimeToolRegistry,findRegisteredRuntimeTool};
@@ -16,4 +16,7 @@ export declare function classifyCatalogEntry(entry: CatalogEntry): {
16
16
  } | {
17
17
  readonly kind: "needs-terminal";
18
18
  readonly reason: string;
19
+ } | {
20
+ readonly kind: "self-modification-mount";
21
+ readonly reason: string;
19
22
  };
@@ -1 +1 @@
1
- function classifyCatalogEntry(e){return e.declaresSetup===!0?{kind:`needs-terminal`,reason:`${e.address} declares a setup flow, which can ask for credentials or open a browser authorization. Neither can be answered from a chat turn.`}:{kind:`installable`}}export{classifyCatalogEntry};
1
+ function classifyCatalogEntry(e){return e.selfModificationMount===!0?{kind:`self-modification-mount`,reason:`Installing a registry item cannot replace the self-modification subagent's own mount. Edit its authored mount directly instead.`}:e.declaresSetup===!0?{kind:`needs-terminal`,reason:`${e.address} declares a setup flow, which can ask for credentials or open a browser authorization. Neither can be answered from a chat turn.`}:{kind:`installable`}}export{classifyCatalogEntry};
@@ -1,7 +1,7 @@
1
1
  import { type AgentReasoningDefinition, type AgentStaticModelDefinition, type DynamicSentinel, type DynamicSubagentDefinition } from "eve";
2
2
  import { type SelfModificationConfig } from "../../../config.js";
3
3
  /** Fallback model when neither the self-modification agent nor its parent configures one. */
4
- export declare const FALLBACK_SELF_MODIFICATION_MODEL = "spacexai/grok-4.7";
4
+ export declare const FALLBACK_SELF_MODIFICATION_MODEL = "openai/gpt-6-luna-fast";
5
5
  /** Configuration for the self-modification subagent. */
6
6
  export interface SelfModificationAgentOptions {
7
7
  /** Policy shared with the sandbox and extension mount. */
@@ -1 +1 @@
1
- import{resolveSelfModificationConfig}from"../../../config.js";import{hasGitHubCredential}from"../../../credentials.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{defineAgent,defineDynamic}from"eve";import{getLocalDevCapability}from"eve/local-dev";const FALLBACK_SELF_MODIFICATION_MODEL=DEFAULT_AGENT_MODEL_ID;function renderDescription(e){return e.filter(e=>e.length>0).join(` `)}function defineSelfModificationAgent(e={}){let resolve=async(t,n)=>{let r=extension_default.config,i=e.reasoning??r.reasoning,a=resolveSelfModificationConfig(e.config??r),o=resolveSelfModificationMode(a),s=e.model??r.model??n.model?.id??FALLBACK_SELF_MODIFICATION_MODEL,c=renderDescription([`Delegate here when the user asks to change this eve agent or its authored source.`,`If the requested change references a tool or skill, include the exact identifier. Do not infer source paths; let the child resolve the appropriate file under /source. Delegate the requested change and existing constraints without adding unrequested features, implementation steps, or reporting requirements.`,`Treat requests for persistent changes to future behavior or capabilities as source-modification requests, even when the requester does not mention files or source code. Infer persistence from the request and conversation rather than waiting for phrases such as “modify your source.” For example, asking the agent to stop always doing something, add a capability, or change future responses calls for inspecting and editing the authored source instead of providing a one-turn workaround.`,`Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.`,o===`local`?`Delegate questions about which integrations, channels, connections, or capabilities are available to add: the subagent searches the eve registry and reports exact item addresses instead of guessing them.`:`Delegate requests to add integrations, channels, connections, or capabilities: the subagent searches the official eve registry and can install source changes into the draft proposal. Setup may require non-secret answers or an external action, and secret binding remains separate.`,o===`local`?`Delegate requests to investigate, diagnose, or optimize the agent's behavior from local traces to this subagent: it can inspect the invoking session's trace and make persistent source changes when warranted.`:``,`Resolve short follow-ups such as “yes” or “do it” against the preceding conversation. If whether the requested change should persist is genuinely ambiguous, ask one concise clarifying question.`,`If a tool or capability created or changed by this subagent later fails or behaves incorrectly, explain the observed problem and offer to delegate a repair. Do not start the repair until the user confirms. Treat that confirmation as a source-modification request and delegate it immediately, including the exact identifier, failing behavior, expected behavior, and existing constraints.`,o===`local`?`Source edits do not affect the caller’s current turn. After this subagent reports changes, do not invoke edited tools or attempt runtime verification until a new user turn.`:`Source edits do not affect the caller’s current turn. The subagent can publish only a draft pull request, and changes become effective only after review, merge, and redeployment.`]);if(o===`local`)return getLocalDevCapability()===void 0?null:defineAgent({description:c,model:s,reasoning:i});if(o!==`deployed`||a.deployed===void 0||a.deployed.credentials.kind===`pat`&&!hasGitHubCredential())return null;try{if(!await a.deployed.authorize({channel:n.channel,principal:n.session.auth.current}))return null}catch{return null}return defineAgent({description:c,model:s,reasoning:i})};return defineDynamic({events:{"session.started":resolve,"turn.started":resolve}})}var agent_default=defineSelfModificationAgent();export{FALLBACK_SELF_MODIFICATION_MODEL,agent_default as default,defineSelfModificationAgent};
1
+ import{resolveSelfModificationConfig}from"../../../config.js";import{hasGitHubCredential}from"../../../credentials.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{DEFAULT_AGENT_MODEL_ID,DEFAULT_AGENT_REASONING}from"#shared/default-agent-model.js";import{defineAgent,defineDynamic}from"eve";import{getLocalDevCapability}from"eve/local-dev";const FALLBACK_SELF_MODIFICATION_MODEL=DEFAULT_AGENT_MODEL_ID;function renderDescription(e){return e.filter(e=>e.length>0).join(` `)}function defineSelfModificationAgent(e={}){let resolve=async(t,n)=>{let r=extension_default.config,i=e.model??r.model??n.model?.id,a=e.reasoning??r.reasoning??(i===void 0?DEFAULT_AGENT_REASONING:void 0),o=resolveSelfModificationConfig(e.config??r),s=resolveSelfModificationMode(o),c=i??FALLBACK_SELF_MODIFICATION_MODEL,l=renderDescription([`Delegate here immediately when the user asks to change the self-modification subagent's model, reasoning, or configuration. Also delegate when the user asks to change this eve agent or its authored source.`,`If the requested change references a tool or skill, include the exact identifier. Do not infer source paths; let the child resolve the appropriate file under /source. Delegate the requested change and existing constraints without adding unrequested features, implementation steps, or reporting requirements.`,`Treat requests for persistent changes to future behavior or capabilities as source-modification requests, even when the requester does not mention files or source code. Infer persistence from the request and conversation rather than waiting for phrases such as “modify your source.” For example, asking the agent to stop always doing something, add a capability, or change future responses calls for inspecting and editing the authored source instead of providing a one-turn workaround.`,`Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.`,s===`local`?`Delegate questions about which integrations, channels, connections, or capabilities are available to add: the subagent searches the eve registry and reports exact item addresses instead of guessing them.`:`Delegate requests to add integrations, channels, connections, or capabilities: the subagent searches the official eve registry and can install source changes into the draft proposal. Setup may require non-secret answers or an external action, and secret binding remains separate.`,s===`local`?`Delegate requests to investigate, diagnose, or optimize the agent's behavior from local traces to this subagent: it can inspect the invoking session's trace and make persistent source changes when warranted.`:``,`Resolve short follow-ups such as “yes” or “do it” against the preceding conversation. If whether the requested change should persist is genuinely ambiguous, ask one concise clarifying question.`,`If a tool or capability created or changed by this subagent later fails or behaves incorrectly, explain the observed problem and offer to delegate a repair. Do not start the repair until the user confirms. Treat that confirmation as a source-modification request and delegate it immediately, including the exact identifier, failing behavior, expected behavior, and existing constraints.`,s===`local`?`Source edits do not affect the caller’s current turn. After this subagent reports changes, do not invoke edited tools or attempt runtime verification until a new user turn.`:`Source edits do not affect the caller’s current turn. The subagent can publish only a draft pull request, and changes become effective only after review, merge, and redeployment.`]);if(s===`local`)return getLocalDevCapability()===void 0?null:defineAgent({description:l,model:c,reasoning:a});if(s!==`deployed`||o.deployed===void 0||o.deployed.credentials.kind===`pat`&&!hasGitHubCredential())return null;try{if(!await o.deployed.authorize({channel:n.channel,principal:n.session.auth.current}))return null}catch{return null}return defineAgent({description:l,model:c,reasoning:a})};return defineDynamic({events:{"session.started":resolve,"turn.started":resolve}})}var agent_default=defineSelfModificationAgent();export{FALLBACK_SELF_MODIFICATION_MODEL,agent_default as default,defineSelfModificationAgent};
@@ -1,4 +1,8 @@
1
- import{resolveSelfModificationConfig}from"../../../config.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{defineDynamic,defineInstructions}from"eve/instructions";function renderInstructions(e){return e.filter(e=>e.length>0).join(`
1
+ import{resolveSelfModificationConfig}from"../../../config.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{renderLocalSelfModificationExtension}from"../../../scaffold.js";import{defineDynamic,defineInstructions}from"eve/instructions";const selfModificationSubagentGuidance=`## Changing the self-modification subagent
2
+
3
+ Only when the requester explicitly names the self-modification subagent, edit whichever of /source/extensions/self-modification.ts or /source/extensions/self-modification/extension.ts exists. If neither exists, create /source/extensions/self-modification/extension.ts with write_file using this content, then make the requested model or reasoning change:
4
+ \`\`\`ts
5
+ ${renderLocalSelfModificationExtension()}\`\`\``;function renderInstructions(e){return e.filter(e=>e.length>0).join(`
2
6
 
3
7
  `)}var instructions_default=defineDynamic({events:{"session.started":()=>{let e=resolveSelfModificationMode(resolveSelfModificationConfig(extension_default.config));return e!==`local`&&e!==`deployed`?null:defineInstructions({markdown:renderInstructions([`## Role
4
8
 
@@ -6,11 +10,7 @@ You are an expert coding assistant operating inside of an eve agent. You help us
6
10
 
7
11
  The source code of the eve agent is mounted read-write at /source. /source is the authored agent directory. Locate source files with bash. Read source contents with read_file, not shell commands. Before generating an overwrite, ensure read_file has succeeded for that path. Shell reads do not satisfy write_file's read-before-write requirement. edit_file instead validates exact matches against current contents. Never modify source files with bash, sed, awk, redirection, or scripting.
8
12
 
9
- Resolve named tools by filename under /source/tools before searching contents. Tool identifiers derive from filenames and may not occur in the implementation.`,`## Changing this subagent
10
-
11
- When the user explicitly asks to change the self-modification subagent's model, reasoning, or policy, make edits only through its authored mount. For such requests, check /source/extensions/self-modification.ts and /source/extensions/self-modification/extension.ts; modify whichever exists. If neither file exists, this subagent is the bundled eve development default and is using the default settings: first call registry_add with the exact address eve/self-modification to scaffold the authored mount. This known scaffold does not require search_registry.
12
-
13
- After registry_add reports successful installation, try to read /source/extensions/self-modification.ts and /source/extensions/self-modification/extension.ts. If either is available, modify it. If neither is yet available, you may need to wait for the next turn, by asking the requester to confirm.`,`## Implement changes
13
+ Resolve named tools by filename under /source/tools before searching contents. Tool identifiers derive from filenames and may not occur in the implementation.`,`## Implement changes
14
14
 
15
15
  Use edit_file for localized changes; include only the unique matching text. For a complete rewrite, use read_file then write_file; do not encode the whole old file as one replacement. If tool arguments fail argument parsing, retry the same tool with corrected encoding.
16
16
 
@@ -30,7 +30,7 @@ The eve framework documentation is mounted read-only at /eve-docs. Prefer source
30
30
 
31
31
  Skip task lists for simple work - only use them for complex actions. Never spend a turn only reporting status or updating the task list - batch them with other calls.
32
32
 
33
- Treat a successful file-edit tool result as confirmation; do not reread a file solely to verify that the edit succeeded. Do not approximate unavailable build or test commands with broad source searches.`,e===`local`?`## Report results
33
+ Treat a successful file-edit tool result as confirmation; do not reread a file solely to verify that the edit succeeded. Do not approximate unavailable build or test commands with broad source searches.`,selfModificationSubagentGuidance,e===`local`?`## Report results
34
34
 
35
35
  For source-modification tasks, return a concise handoff to the caller. Use at most four short bullets covering changed paths and behavior, and any required setup or unresolved issues.
36
36
 
@@ -1 +1 @@
1
- import{resolveSelfModificationConfig}from"../../../../config.js";import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import extension_default from"../../../extension.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{assertOfficialRegistryAddress,installProductionRegistryItem}from"../../../production-registry-add.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,officialRegistryIndexUrl,resolveRegistryIndexUrl}from"./search_registry.js";import{defineDynamic,defineTool}from"eve/tools";import{once}from"eve/tools/approval";import{getLocalDevCapability}from"eve/local-dev";const localInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},localOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`]},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]},productionInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact official eve registry address, for example `channel/slack` or `extension/browserbase`."},answers:{type:`object`,additionalProperties:!0,description:`Non-secret answers to the setup question returned by the previous call.`},installed:{type:`boolean`,description:`Set to true with answers when the previous input-required result installed the source.`}},required:[`address`]},productionOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`completed`,`input-required`,`external-action-required`,`failed`,`cancelled`]},address:{type:`string`},changedPaths:{type:`array`,items:{type:`string`},description:`Repository-relative paths installed into the proposal.`},completedItems:{type:`array`,items:{type:`string`}},deploymentRequired:{type:`boolean`},installed:{type:`boolean`,description:`Whether source installation completed before setup paused.`},question:{type:`object`,additionalProperties:!0,description:`The current setup question. Supply only its non-secret answer on the next call.`},message:{type:`string`},url:{type:`string`,description:`External authorization URL the developer must open.`},userCode:{type:`string`}},required:[`status`,`address`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title} was not installed by this tool. ${e.reason} Continue in the setup panel that opens here; do not ask the developer to run another command.`};let t=`eve add ${e.address}`;return{message:`${e.title} was not installed. ${e.reason} Run \`${t}\` in a terminal to finish it.`,nextCommand:t}}async function addLocalRegistryItem(e,t={}){let n=(t.getCapability??getLocalDevCapability)();if(n===void 0)throw Error("Registry items can only be installed while `eve dev` is running. Report the item address to the developer instead of installing it.");let r=(await loadRegistryIndex({nowMs:Date.now(),signal:t.signal,url:resolveRegistryIndexUrl()})).find(t=>t.address===e);if(r===void 0)throw Error(`No item in the configured eve registry is published at "${e}". Check the address before trying again.`);let i=classifyCatalogEntry(r);if(i.kind===`needs-terminal`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:i.reason,title:r.title});return{address:e,reason:i.reason,status:`needs-terminal`,title:r.title,...t}}let a=await withSelfModificationWorkspaceLock(`local:${n.appRoot}`,async()=>n.withSuspendedSource(()=>runEveAdd({address:e,appRoot:n.appRoot,signal:t.signal,spawn:t.spawn})));if(a.kind===`blocked`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:a.message,title:r.title});return{address:e,reason:a.message,status:`needs-terminal`,title:r.title,...t}}if(a.kind===`failed`)return a.changed===void 0?{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message}:{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message,changed:a.changed};let o=unsetEnvVars(r);return{address:e,envVars:[...o],message:o.length===0?`Installed ${r.title}.`:`Installed ${r.title}. It will not work until ${o.join(`, `)} ${o.length===1?`is`:`are`} set.`,status:`installed`,title:r.title}}async function addProductionRegistryItem(e,t,n,r){if(assertOfficialRegistryAddress(e),(await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:officialRegistryIndexUrl()})).find(t=>t.address===e)===void 0)throw Error(`No official eve registry item is published at "${e}".`);let i=await t.getSandbox(),a=await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let a=await readPreparedSelfModificationWorkspace({...n,sandbox:i});return await installProductionRegistryItem({address:e,answers:r.answers,installed:r.installed,sandbox:i,signal:t.abortSignal,workspace:a})});return a.kind===`completed`?{address:e,...a,status:`completed`}:a.kind===`input-required`?{address:e,...a,status:`input-required`}:a.kind===`external-action-required`?{address:e,...a,status:`external-action-required`}:{address:e,...a,status:a.kind}}function localRegistryAddTool(){return defineTool({approval:once(),description:`Install an item from the configured eve registry into this project. Items that need setup are handed to the local setup flow instead. Search first, then call this with the exact item address.`,inputSchema:localInputSchema,outputSchema:localOutputSchema,async execute(e,t){let{address:n}=e;if(typeof n!=`string`||n.length===0)throw Error(`address must be an exact item address from the configured eve registry.`);return await addLocalRegistryItem(n,{signal:t.abortSignal})}})}function productionRegistryAddTool(e){return defineTool({approval:once(),description:`Install an exact item from the official eve registry into the current production change proposal. If setup pauses, call this tool again with the non-secret answers and the installed state from its result. External authorization and secret binding must be completed by the developer.`,inputSchema:productionInputSchema,outputSchema:productionOutputSchema,async execute(t,n){let{address:r}=t;if(typeof r!=`string`||r.length===0)throw Error(`address must be an exact item address from the official eve registry.`);return await addProductionRegistryItem(r,n,e,{answers:`answers`in t&&typeof t.answers==`object`&&t.answers!==null&&!Array.isArray(t.answers)?t.answers:void 0,installed:`installed`in t&&t.installed===!0})}})}function resolveRegistryAddTool(e){let t=resolveSelfModificationMode(e);return t===`local`?localRegistryAddTool():t===`deployed`&&e.deployed!==void 0?productionRegistryAddTool(e.deployed):null}var registry_add_default=defineDynamic({events:{"session.started":()=>resolveRegistryAddTool(resolveSelfModificationConfig(extension_default.config))}});export{addLocalRegistryItem,registry_add_default as default,handoffMessage,resolveRegistryAddTool,unsetEnvVars};
1
+ import{resolveSelfModificationConfig}from"../../../../config.js";import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import extension_default from"../../../extension.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{assertOfficialRegistryAddress,installProductionRegistryItem}from"../../../production-registry-add.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,officialRegistryIndexUrl,resolveRegistryIndexUrl}from"./search_registry.js";import{defineDynamic,defineTool}from"eve/tools";import{getLocalDevCapability}from"eve/local-dev";const localInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},localOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`]},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]},productionInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact official eve registry address, for example `channel/slack` or `extension/browserbase`."},answers:{type:`object`,additionalProperties:!0,description:`Non-secret answers to the setup question returned by the previous call.`},installed:{type:`boolean`,description:`Set to true with answers when the previous input-required result installed the source.`}},required:[`address`]},productionOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`completed`,`input-required`,`external-action-required`,`failed`,`cancelled`]},address:{type:`string`},changedPaths:{type:`array`,items:{type:`string`},description:`Repository-relative paths installed into the proposal.`},completedItems:{type:`array`,items:{type:`string`}},deploymentRequired:{type:`boolean`},installed:{type:`boolean`,description:`Whether source installation completed before setup paused.`},question:{type:`object`,additionalProperties:!0,description:`The current setup question. Supply only its non-secret answer on the next call.`},message:{type:`string`},url:{type:`string`,description:`External authorization URL the developer must open.`},userCode:{type:`string`}},required:[`status`,`address`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title} was not installed by this tool. ${e.reason} Continue in the setup panel that opens here; do not ask the developer to run another command.`};let t=`eve add ${e.address}`;return{message:`${e.title} was not installed. ${e.reason} Run \`${t}\` in a terminal to finish it.`,nextCommand:t}}async function addLocalRegistryItem(e,t={}){let n=(t.getCapability??getLocalDevCapability)();if(n===void 0)throw Error("Registry items can only be installed while `eve dev` is running. Report the item address to the developer instead of installing it.");let r=(await loadRegistryIndex({nowMs:Date.now(),signal:t.signal,url:resolveRegistryIndexUrl()})).find(t=>t.address===e);if(r===void 0)throw Error(`No item in the configured eve registry is published at "${e}". Check the address before trying again.`);let i=classifyCatalogEntry(r);if(i.kind===`self-modification-mount`)throw Error(i.reason);if(i.kind===`needs-terminal`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:i.reason,title:r.title});return{address:e,reason:i.reason,status:`needs-terminal`,title:r.title,...t}}let a=await withSelfModificationWorkspaceLock(`local:${n.appRoot}`,async()=>n.withSuspendedSource(()=>runEveAdd({address:e,appRoot:n.appRoot,signal:t.signal,spawn:t.spawn})));if(a.kind===`blocked`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:a.message,title:r.title});return{address:e,reason:a.message,status:`needs-terminal`,title:r.title,...t}}if(a.kind===`failed`)return a.changed===void 0?{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message}:{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message,changed:a.changed};let o=unsetEnvVars(r);return{address:e,envVars:[...o],message:o.length===0?`Installed ${r.title}.`:`Installed ${r.title}. It will not work until ${o.join(`, `)} ${o.length===1?`is`:`are`} set.`,status:`installed`,title:r.title}}async function addProductionRegistryItem(e,t,n,r){assertOfficialRegistryAddress(e);let i=(await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:officialRegistryIndexUrl()})).find(t=>t.address===e);if(i===void 0)throw Error(`No official eve registry item is published at "${e}".`);let a=classifyCatalogEntry(i);if(a.kind===`self-modification-mount`)throw Error(a.reason);let o=await t.getSandbox(),s=await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let i=await readPreparedSelfModificationWorkspace({...n,sandbox:o});return await installProductionRegistryItem({address:e,answers:r.answers,installed:r.installed,sandbox:o,signal:t.abortSignal,workspace:i})});return s.kind===`completed`?{address:e,...s,status:`completed`}:s.kind===`input-required`?{address:e,...s,status:`input-required`}:s.kind===`external-action-required`?{address:e,...s,status:`external-action-required`}:{address:e,...s,status:s.kind}}function localRegistryAddTool(){return defineTool({description:`Install an item from the configured eve registry into this project. Items that need setup are handed to the local setup flow instead. Search first, then call this with the exact item address.`,inputSchema:localInputSchema,outputSchema:localOutputSchema,async execute(e,t){let{address:n}=e;if(typeof n!=`string`||n.length===0)throw Error(`address must be an exact item address from the configured eve registry.`);return await addLocalRegistryItem(n,{signal:t.abortSignal})}})}function productionRegistryAddTool(e){return defineTool({description:`Install an exact item from the official eve registry into the current production change proposal. If setup pauses, call this tool again with the non-secret answers and the installed state from its result. External authorization and secret binding must be completed by the developer.`,inputSchema:productionInputSchema,outputSchema:productionOutputSchema,async execute(t,n){let{address:r}=t;if(typeof r!=`string`||r.length===0)throw Error(`address must be an exact item address from the official eve registry.`);return await addProductionRegistryItem(r,n,e,{answers:`answers`in t&&typeof t.answers==`object`&&t.answers!==null&&!Array.isArray(t.answers)?t.answers:void 0,installed:`installed`in t&&t.installed===!0})}})}function resolveRegistryAddTool(e){let t=resolveSelfModificationMode(e);return t===`local`?localRegistryAddTool():t===`deployed`&&e.deployed!==void 0?productionRegistryAddTool(e.deployed):null}var registry_add_default=defineDynamic({events:{"session.started":()=>resolveRegistryAddTool(resolveSelfModificationConfig(extension_default.config))}});export{addLocalRegistryItem,registry_add_default as default,handoffMessage,resolveRegistryAddTool,unsetEnvVars};
@@ -13,6 +13,8 @@ export interface CatalogEntry {
13
13
  readonly authoredTarget?: string;
14
14
  /** Whether `meta.eve.setup` declares one or more setup commands. */
15
15
  readonly declaresSetup?: boolean;
16
+ /** Whether any file would replace the self-modification extension mount. */
17
+ readonly selfModificationMount?: boolean;
16
18
  /** Names of environment variables the item declares. */
17
19
  readonly envVars?: readonly string[];
18
20
  }
@@ -1 +1 @@
1
- import{defineTool}from"eve/tools";const CATEGORIES=[`channel`,`connection`,`extension`,`instrumentation`,`memory`],INDEX_PATH=`/registry.json`,FETCH_TIMEOUT_MS=1e4,inputSchema={type:`object`,additionalProperties:!1,properties:{query:{type:`string`,maxLength:200,description:`Free-text match against integration names, titles, and descriptions.`},category:{type:`string`,enum:[...CATEGORIES],description:`Restrict results to one registry category.`},limit:{type:`integer`,minimum:1,maximum:25,description:`Maximum number of items to return (default 10, maximum 25).`},offset:{type:`integer`,minimum:0,description:`Number of matching items to skip. Use nextOffset from a prior result to retrieve the next page.`}}},outputSchema={type:`object`,additionalProperties:!1,properties:{items:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{address:{type:`string`},title:{type:`string`},description:{type:`string`},category:{type:`string`},requires:{type:`string`},installed:{type:`boolean`}},required:[`address`,`title`]}},errors:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{registry:{type:`string`},message:{type:`string`}},required:[`registry`,`message`]}},total:{type:`integer`},hasMore:{type:`boolean`},nextOffset:{type:`integer`}},required:[`items`,`errors`,`total`,`hasMore`]};function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function optionalString(e){return typeof e==`string`&&e.length>0?e:void 0}function isCategory(e){return CATEGORIES.includes(e)}function categoryOf(e){let t=e.split(`/`)[0];return t!==void 0&&e.includes(`/`)&&isCategory(t)?t:void 0}function titleFromAddress(e){return(e.split(`/`).at(-1)??e).split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function eveMetadata(e){let t=e.meta;if(!isRecord(t))return{};let n=t.eve;return isRecord(n)?n:{}}function authoredTargetOf(e){let t=e.files;if(Array.isArray(t))for(let e of t){if(!isRecord(e))continue;let t=optionalString(e.target);if(t?.startsWith(`agent/`)===!0)return t}}function declaredEnvVars(e){let t=e.envVars;return isRecord(t)?Object.keys(t):[]}function parseRegistryIndex(e){if(!isRecord(e)||!Array.isArray(e.items))return[];let t=[];for(let n of e.items){if(!isRecord(n))continue;let e=optionalString(n.name);if(e===void 0)continue;let r=eveMetadata(n);if(r.hidden===!0)continue;let i={address:e,title:optionalString(n.title)??titleFromAddress(e)},a=categoryOf(e);a!==void 0&&(i.category=a);let o=optionalString(n.description);o!==void 0&&(i.description=o);let s=optionalString(r.requires);s!==void 0&&(i.requires=s);let c=authoredTargetOf(n);c!==void 0&&(i.authoredTarget=c),r.setup!==void 0&&r.setup!==null&&(i.declaresSetup=!0);let l=declaredEnvVars(n);l.length>0&&(i.envVars=l),t.push(i)}return t}function selectIntegrations(e){return selectIntegrationPage(e).items}function selectIntegrationPage(e){let t=Math.min(Math.max(e.limit??10,1),25),n=Math.max(e.offset??0,0),r=(e.query??``).toLowerCase().split(/\s+/u).filter(e=>e.length>0),i=e.entries.map((e,t)=>{let n=`${e.address} ${e.title}`.toLowerCase();return{entry:e,haystack:[n,e.description??``].join(` `).toLowerCase(),index:t,primaryTerms:n}}),a=new Map(r.map(e=>{let t=i.filter(({haystack:t})=>t.includes(e)).length;return[e,Math.log((i.length+1)/(t+1))+1]})),o=i.map(({entry:t,haystack:n,index:i,primaryTerms:o})=>{if(e.category!==void 0&&!matchesCategory(t,e.category))return;if(r.length===0)return{entry:t,index:i,score:0};let s=r.reduce((e,t)=>{let r=a.get(t)??0;return o.includes(t)?e+2*r:n.includes(t)?e+r:e},0);return s>0?{entry:t,index:i,score:s}:void 0}).filter(e=>e!==void 0).sort((e,t)=>t.score-e.score||e.index-t.index),s=(o[0]?.score??0)*.4,c=o.filter(({score:e})=>e>=s),l=c.slice(n,n+t).map(({entry:e})=>{let t={address:e.address,title:e.title};return e.category!==void 0&&(t.category=e.category),e.description!==void 0&&(t.description=e.description),e.requires!==void 0&&(t.requires=e.requires),t}),u=n+l.length,d={hasMore:u<c.length,items:l,total:c.length};return u<c.length&&(d.nextOffset=u),d}function matchesCategory(e,t){return e.category===t}function officialRegistryIndexUrl(){return`https://eve.dev/r${INDEX_PATH}`}function resolveRegistryIndexUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return officialRegistryIndexUrl();let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=`${t.pathname.replace(/\/+$/u,``)}${INDEX_PATH}`,t.toString()}let cache;function clearRegistryIndexCache(){cache=void 0}async function loadRegistryIndex(e){if(cache!==void 0&&cache.url===e.url&&e.nowMs-cache.fetchedAtMs<3e5)return cache.entries;let t=await fetch(e.url,{headers:{accept:`application/json`},signal:AbortSignal.any(e.signal===void 0?[AbortSignal.timeout(FETCH_TIMEOUT_MS)]:[e.signal,AbortSignal.timeout(FETCH_TIMEOUT_MS)])});if(!t.ok)throw Error(`Could not read the eve registry (${t.status}).`);let n=parseRegistryIndex(await t.json());return cache={entries:n,fetchedAtMs:e.nowMs,url:e.url},n}async function annotateInstalled(e){let t=new Map(e.entries.flatMap(e=>e.authoredTarget===void 0?[]:[[e.address,e.authoredTarget]]));if(e.rows.every(e=>t.get(e.address)===void 0))return e.rows;let n;try{n=await e.ctx.getSandbox()}catch{return e.rows}return await Promise.all(e.rows.map(async e=>{let r=t.get(e.address);if(r===void 0)return e;let i=`/source/${r.slice(6)}`;try{let t=await n.readTextFile({path:i});return{...e,installed:t!==null}}catch{return e}}))}var search_registry_default=defineTool({description:"Search the eve registry for integrations this project can add: channels, MCP connections, extensions, memory providers, and observability. Read-only — it installs nothing. Call it before writing an integration by hand, then pass an exact item address (for example `channel/slack`) to registry_add.",inputSchema,outputSchema,async execute(e,t){let n=[],r;try{r=resolveRegistryIndexUrl()}catch(e){return{errors:[{message:errorMessage(e),registry:`eve`}],hasMore:!1,items:[],total:0}}let i=[];try{i=await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:r})}catch(e){n.push({message:errorMessage(e),registry:r})}let a={entries:i},o=typeof e.category==`string`?e.category:void 0;o!==void 0&&isCategory(o)&&(a.category=o),typeof e.limit==`number`&&(a.limit=e.limit),typeof e.offset==`number`&&(a.offset=e.offset),typeof e.query==`string`&&(a.query=e.query);let s=selectIntegrationPage(a),c={errors:n,hasMore:s.hasMore,items:await annotateInstalled({ctx:t,entries:i,rows:s.items}),total:s.total};return s.nextOffset!==void 0&&(c.nextOffset=s.nextOffset),c}});function errorMessage(e){return e instanceof Error?e.message:String(e)}export{clearRegistryIndexCache,search_registry_default as default,loadRegistryIndex,officialRegistryIndexUrl,parseRegistryIndex,resolveRegistryIndexUrl,selectIntegrationPage,selectIntegrations};
1
+ import{defineTool}from"eve/tools";const CATEGORIES=[`channel`,`connection`,`extension`,`instrumentation`,`memory`],INDEX_PATH=`/registry.json`,FETCH_TIMEOUT_MS=1e4,SELF_MODIFICATION_MOUNT=`agent/extensions/self-modification`,inputSchema={type:`object`,additionalProperties:!1,properties:{query:{type:`string`,maxLength:200,description:`Free-text match against integration names, titles, and descriptions.`},category:{type:`string`,enum:[...CATEGORIES],description:`Restrict results to one registry category.`},limit:{type:`integer`,minimum:1,maximum:25,description:`Maximum number of items to return (default 10, maximum 25).`},offset:{type:`integer`,minimum:0,description:`Number of matching items to skip. Use nextOffset from a prior result to retrieve the next page.`}}},outputSchema={type:`object`,additionalProperties:!1,properties:{items:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{address:{type:`string`},title:{type:`string`},description:{type:`string`},category:{type:`string`},requires:{type:`string`},installed:{type:`boolean`}},required:[`address`,`title`]}},errors:{type:`array`,items:{type:`object`,additionalProperties:!1,properties:{registry:{type:`string`},message:{type:`string`}},required:[`registry`,`message`]}},total:{type:`integer`},hasMore:{type:`boolean`},nextOffset:{type:`integer`}},required:[`items`,`errors`,`total`,`hasMore`]};function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function optionalString(e){return typeof e==`string`&&e.length>0?e:void 0}function isCategory(e){return CATEGORIES.includes(e)}function categoryOf(e){let t=e.split(`/`)[0];return t!==void 0&&e.includes(`/`)&&isCategory(t)?t:void 0}function titleFromAddress(e){return(e.split(`/`).at(-1)??e).split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function eveMetadata(e){let t=e.meta;if(!isRecord(t))return{};let n=t.eve;return isRecord(n)?n:{}}function targetsSelfModificationMount(e){return e===`${SELF_MODIFICATION_MOUNT}.ts`||e.startsWith(`${SELF_MODIFICATION_MOUNT}/`)}function authoredTargetOf(e){let t=e.files;if(Array.isArray(t))for(let e of t){if(!isRecord(e))continue;let t=optionalString(e.target);if(t?.startsWith(`agent/`)===!0)return t}}function targetsSelfModificationMountOf(e){let t=e.files;return Array.isArray(t)&&t.some(e=>isRecord(e)&&targetsSelfModificationMount(optionalString(e.target)??``))}function declaredEnvVars(e){let t=e.envVars;return isRecord(t)?Object.keys(t):[]}function parseRegistryIndex(e){if(!isRecord(e)||!Array.isArray(e.items))return[];let t=[];for(let n of e.items){if(!isRecord(n))continue;let e=optionalString(n.name);if(e===void 0)continue;let r=eveMetadata(n);if(r.hidden===!0)continue;let i=authoredTargetOf(n),a={address:e,title:optionalString(n.title)??titleFromAddress(e)},o=categoryOf(e);o!==void 0&&(a.category=o);let s=optionalString(n.description);s!==void 0&&(a.description=s);let c=optionalString(r.requires);c!==void 0&&(a.requires=c),i!==void 0&&(a.authoredTarget=i),r.setup!==void 0&&r.setup!==null&&(a.declaresSetup=!0),targetsSelfModificationMountOf(n)&&(a.selfModificationMount=!0);let l=declaredEnvVars(n);l.length>0&&(a.envVars=l),t.push(a)}return t}function selectIntegrations(e){return selectIntegrationPage(e).items}function selectIntegrationPage(e){let t=Math.min(Math.max(e.limit??10,1),25),n=Math.max(e.offset??0,0),r=(e.query??``).toLowerCase().split(/\s+/u).filter(e=>e.length>0),i=e.entries.map((e,t)=>{let n=`${e.address} ${e.title}`.toLowerCase();return{entry:e,haystack:[n,e.description??``].join(` `).toLowerCase(),index:t,primaryTerms:n}}),a=new Map(r.map(e=>{let t=i.filter(({haystack:t})=>t.includes(e)).length;return[e,Math.log((i.length+1)/(t+1))+1]})),o=i.map(({entry:t,haystack:n,index:i,primaryTerms:o})=>{if(e.category!==void 0&&!matchesCategory(t,e.category))return;if(r.length===0)return{entry:t,index:i,score:0};let s=r.reduce((e,t)=>{let r=a.get(t)??0;return o.includes(t)?e+2*r:n.includes(t)?e+r:e},0);return s>0?{entry:t,index:i,score:s}:void 0}).filter(e=>e!==void 0).sort((e,t)=>t.score-e.score||e.index-t.index),s=(o[0]?.score??0)*.4,c=o.filter(({score:e})=>e>=s),l=c.slice(n,n+t).map(({entry:e})=>{let t={address:e.address,title:e.title};return e.category!==void 0&&(t.category=e.category),e.description!==void 0&&(t.description=e.description),e.requires!==void 0&&(t.requires=e.requires),t}),u=n+l.length,d={hasMore:u<c.length,items:l,total:c.length};return u<c.length&&(d.nextOffset=u),d}function matchesCategory(e,t){return e.category===t}function officialRegistryIndexUrl(){return`https://eve.dev/r${INDEX_PATH}`}function resolveRegistryIndexUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return officialRegistryIndexUrl();let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=`${t.pathname.replace(/\/+$/u,``)}${INDEX_PATH}`,t.toString()}let cache;function clearRegistryIndexCache(){cache=void 0}async function loadRegistryIndex(e){if(cache!==void 0&&cache.url===e.url&&e.nowMs-cache.fetchedAtMs<3e5)return cache.entries;let t=await fetch(e.url,{headers:{accept:`application/json`},signal:AbortSignal.any(e.signal===void 0?[AbortSignal.timeout(FETCH_TIMEOUT_MS)]:[e.signal,AbortSignal.timeout(FETCH_TIMEOUT_MS)])});if(!t.ok)throw Error(`Could not read the eve registry (${t.status}).`);let n=parseRegistryIndex(await t.json());return cache={entries:n,fetchedAtMs:e.nowMs,url:e.url},n}async function annotateInstalled(e){let t=new Map(e.entries.flatMap(e=>e.authoredTarget===void 0?[]:[[e.address,e.authoredTarget]]));if(e.rows.every(e=>t.get(e.address)===void 0))return e.rows;let n;try{n=await e.ctx.getSandbox()}catch{return e.rows}return await Promise.all(e.rows.map(async e=>{let r=t.get(e.address);if(r===void 0)return e;let i=`/source/${r.slice(6)}`;try{let t=await n.readTextFile({path:i});return{...e,installed:t!==null}}catch{return e}}))}var search_registry_default=defineTool({description:"Search the eve registry for integrations this project can add: channels, MCP connections, extensions, memory providers, and observability. Read-only — it installs nothing. Call it before writing an integration by hand, then pass an exact item address (for example `channel/slack`) to registry_add.",inputSchema,outputSchema,async execute(e,t){let n=[],r;try{r=resolveRegistryIndexUrl()}catch(e){return{errors:[{message:errorMessage(e),registry:`eve`}],hasMore:!1,items:[],total:0}}let i=[];try{i=await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:r})}catch(e){n.push({message:errorMessage(e),registry:r})}let a={entries:i.filter(e=>e.selfModificationMount!==!0)},o=typeof e.category==`string`?e.category:void 0;o!==void 0&&isCategory(o)&&(a.category=o),typeof e.limit==`number`&&(a.limit=e.limit),typeof e.offset==`number`&&(a.offset=e.offset),typeof e.query==`string`&&(a.query=e.query);let s=selectIntegrationPage(a),c={errors:n,hasMore:s.hasMore,items:await annotateInstalled({ctx:t,entries:i,rows:s.items}),total:s.total};return s.nextOffset!==void 0&&(c.nextOffset=s.nextOffset),c}});function errorMessage(e){return e instanceof Error?e.message:String(e)}export{clearRegistryIndexCache,search_registry_default as default,loadRegistryIndex,officialRegistryIndexUrl,parseRegistryIndex,resolveRegistryIndexUrl,selectIntegrationPage,selectIntegrations};
@@ -1 +1 @@
1
- import{defineLocalOnlyDynamic,resolveLocalOnly}from"../../../local-only.js";import{TRACE_ID,readTraceSources}from"../../../trace-inspection.js";import{summarizeLocalTrace}from"#tracing/local-trace-summary.js";import{resolveConversationId}from"#shared/conversation-identity.js";import{context,trace}from"#compiled/@opentelemetry/api/index.js";import{defineTool}from"eve/tools";import{queryLocalTraceSummaries}from"#tracing/local-trace-query.js";import{localTraceConversationMarker,localTraceIndexedMarker}from"#tracing/local-trace-discovery-index.js";const DEFAULT_SORT_BY=`latest`,searchTracesTool=defineTool({description:`Search summaries for traces in the invoking conversation.`,inputSchema:{type:`object`,additionalProperties:!1,properties:{limit:{type:`integer`,minimum:1,maximum:50,default:50},sortBy:{enum:[`duration`,`failures`,`inputTokens`,`latest`],type:`string`,default:DEFAULT_SORT_BY,description:`Rank examined traces by elapsed time, error-span count, summed step input tokens, or start time. Defaults to latest.`}}},outputSchema:{type:`object`,additionalProperties:!0},async execute(e,t){let n=parseInput(e),r=trace.getSpan(context.active())?.spanContext().traceId,i=resolveConversationId(t.session.parent?.rootSessionId??t.session.id),a=await t.getSandbox(),[o,s,c]=await Promise.all([a.run({command:`ls -1dt /traces/*`}),a.run({command:`ls -1 /traces/*/${localTraceIndexedMarker()}`}),a.run({command:`ls -1 /traces/*/${localTraceConversationMarker(i)}`})]);if(o.exitCode!==0&&!isEmptyTraceListing(o))throw Error(`Could not list local traces: ${o.stderr}`);let l=[...traceIds(o.stdout)],u=l.filter(e=>e!==r),d=traceIds(s.stdout),f=new Set(traceIds(c.stdout)),p=u.filter(e=>!d.has(e)),m=p.slice(0,100),h=new Map,g=0,read=async e=>{try{return await readTraceSources(e,t)}catch(e){if(t.abortSignal.aborted)throw e;g+=1;return}};for(let e of m){if(t.abortSignal.aborted)throw Error(`Trace search was cancelled.`);let n=await read(e);n!==void 0&&contains(n,`gen_ai.conversation.id`,i)&&(f.add(e),h.set(e,summarizeLocalTrace(e,n.map(({span:e})=>e))))}let _=u.filter(e=>f.has(e)),v=_.slice(0,200),y=[];for(let e of v){if(t.abortSignal.aborted)throw Error(`Trace search was cancelled.`);let n=h.get(e);if(n!==void 0){y.push(n);continue}let r=await read(e);r!==void 0&&y.push(summarizeLocalTrace(e,r.map(({span:e})=>e)))}let b=queryLocalTraceSummaries(y,n),x=p.length-m.length+_.length-v.length,S={complete:x===0&&g===0,considered:v.length,matched:_.length,stored:l.length},C=[];return x!==0&&C.push(`Some older traces could not be included.`),g!==0&&C.push(`Some traces could not be read.`),C.length>0&&(S.warning=C.join(` `)),{conversationId:i,coverage:S,matches:b.matches,truncated:b.truncated}}});function parseInput(e){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Trace search input must be an object.`);let t=e,n=t.limit===void 0?50:t.limit;if(typeof n!=`number`||!Number.isInteger(n)||n<1||n>50)throw Error(`limit must be an integer between 1 and 50.`);if(t.sortBy!==void 0&&t.sortBy!==`latest`&&t.sortBy!==`duration`&&t.sortBy!==`failures`&&t.sortBy!==`inputTokens`)throw Error(`sortBy must be latest, duration, failures, or inputTokens.`);return{limit:n,sortBy:t.sortBy??DEFAULT_SORT_BY}}function traceIds(e){let t=new Set;for(let n of e.split(/\r?\n/u)){let e=n.split(`/`).filter(Boolean).find(e=>TRACE_ID.test(e));e!==void 0&&t.add(e)}return t}function isEmptyTraceListing(e){return e.stdout.trim()===``&&e.stderr.includes(`/traces/*`)&&/no such file or directory/iu.test(e.stderr)}function contains(e,t,n){return e.some(({span:e})=>e.attributes[t]===n)}function resolveSearchTracesTool(e){return resolveLocalOnly(e,searchTracesTool)}var search_traces_default=defineLocalOnlyDynamic(searchTracesTool);export{search_traces_default as default,resolveSearchTracesTool};
1
+ import{defineLocalOnlyDynamic,resolveLocalOnly}from"../../../local-only.js";import{TRACE_ID,readTraceSources}from"../../../trace-inspection.js";import{summarizeLocalTrace}from"#tracing/local-trace-summary.js";import{defineTool}from"eve/tools";import{resolveConversationId}from"#shared/conversation-identity.js";import{context,trace}from"#compiled/@opentelemetry/api/index.js";import{queryLocalTraceSummaries}from"#tracing/local-trace-query.js";import{localTraceConversationMarker,localTraceIndexedMarker}from"#tracing/local-trace-discovery-index.js";const DEFAULT_SORT_BY=`latest`,searchTracesTool=defineTool({description:`Search summaries for traces in the invoking conversation.`,inputSchema:{type:`object`,additionalProperties:!1,properties:{limit:{type:`integer`,minimum:1,maximum:50,default:50},sortBy:{enum:[`duration`,`failures`,`inputTokens`,`latest`],type:`string`,default:DEFAULT_SORT_BY,description:`Rank examined traces by elapsed time, error-span count, summed step input tokens, or start time. Defaults to latest.`}}},outputSchema:{type:`object`,additionalProperties:!0},async execute(e,t){let n=parseInput(e),r=trace.getSpan(context.active())?.spanContext().traceId,i=resolveConversationId(t.session.parent?.rootSessionId??t.session.id),a=await t.getSandbox(),[o,s,c]=await Promise.all([a.run({command:`ls -1dt /traces/*`}),a.run({command:`ls -1 /traces/*/${localTraceIndexedMarker()}`}),a.run({command:`ls -1 /traces/*/${localTraceConversationMarker(i)}`})]);if(o.exitCode!==0&&!isEmptyTraceListing(o))throw Error(`Could not list local traces: ${o.stderr}`);let l=[...traceIds(o.stdout)],u=l.filter(e=>e!==r),d=traceIds(s.stdout),f=new Set(traceIds(c.stdout)),p=u.filter(e=>!d.has(e)),m=p.slice(0,100),h=new Map,g=0,read=async e=>{try{return await readTraceSources(e,t)}catch(e){if(t.abortSignal.aborted)throw e;g+=1;return}};for(let e of m){if(t.abortSignal.aborted)throw Error(`Trace search was cancelled.`);let n=await read(e);n!==void 0&&contains(n,`gen_ai.conversation.id`,i)&&(f.add(e),h.set(e,summarizeLocalTrace(e,n.map(({span:e})=>e))))}let _=u.filter(e=>f.has(e)),v=_.slice(0,200),y=[];for(let e of v){if(t.abortSignal.aborted)throw Error(`Trace search was cancelled.`);let n=h.get(e);if(n!==void 0){y.push(n);continue}let r=await read(e);r!==void 0&&y.push(summarizeLocalTrace(e,r.map(({span:e})=>e)))}let b=queryLocalTraceSummaries(y,n),x=p.length-m.length+_.length-v.length,S={complete:x===0&&g===0,considered:v.length,matched:_.length,stored:l.length},C=[];return x!==0&&C.push(`Some older traces could not be included.`),g!==0&&C.push(`Some traces could not be read.`),C.length>0&&(S.warning=C.join(` `)),{conversationId:i,coverage:S,matches:b.matches,truncated:b.truncated}}});function parseInput(e){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`Trace search input must be an object.`);let t=e,n=t.limit===void 0?50:t.limit;if(typeof n!=`number`||!Number.isInteger(n)||n<1||n>50)throw Error(`limit must be an integer between 1 and 50.`);if(t.sortBy!==void 0&&t.sortBy!==`latest`&&t.sortBy!==`duration`&&t.sortBy!==`failures`&&t.sortBy!==`inputTokens`)throw Error(`sortBy must be latest, duration, failures, or inputTokens.`);return{limit:n,sortBy:t.sortBy??DEFAULT_SORT_BY}}function traceIds(e){let t=new Set;for(let n of e.split(/\r?\n/u)){let e=n.split(`/`).filter(Boolean).find(e=>TRACE_ID.test(e));e!==void 0&&t.add(e)}return t}function isEmptyTraceListing(e){return e.stdout.trim()===``&&e.stderr.includes(`/traces/*`)&&/no such file or directory/iu.test(e.stderr)}function contains(e,t,n){return e.some(({span:e})=>e.attributes[t]===n)}function resolveSearchTracesTool(e){return resolveLocalOnly(e,searchTracesTool)}var search_traces_default=defineLocalOnlyDynamic(searchTracesTool);export{search_traces_default as default,resolveSearchTracesTool};
@@ -0,0 +1,2 @@
1
+ /** Default authored mount for locally configured self-modification. */
2
+ export declare function renderLocalSelfModificationExtension(): string;
@@ -0,0 +1,7 @@
1
+ function renderLocalSelfModificationExtension(){return`import selfModification from "eve/self-modification";
2
+
3
+ export default selfModification({
4
+ // model: "provider/model",
5
+ // reasoning: "high",
6
+ });
7
+ `}export{renderLocalSelfModificationExtension};