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
@@ -1 +1,2 @@
1
- import{parseInputResponse,parseInputResponses}from"#shared/input.js";const TELEGRAM_HITL_CALLBACK_PREFIX=`eve:`,TELEGRAM_CALLBACK_RESPONSE_PREFIX=`telegram_callback:`,TELEGRAM_REPLY_RESPONSE_PREFIX=`telegram_reply:`,TELEGRAM_PROMPT_MAX_LENGTH=4e3;function renderTelegramInputRequest(e,t){let n=e.options;return n&&n.length>0?{replyMarkup:{inline_keyboard:chunk(n.map(n=>({callback_data:registerTelegramCallback(t,{optionId:n.id,requestId:e.requestId}),text:truncate(n.label,64)})),2)},text:truncate(e.prompt,TELEGRAM_PROMPT_MAX_LENGTH)}:{freeformRequestId:e.requestId,replyMarkup:{force_reply:!0,input_field_placeholder:truncate(`Type your answer`,64),selective:!0},text:truncate(e.prompt,TELEGRAM_PROMPT_MAX_LENGTH)}}function registerTelegramFreeformPrompt(e,t){e.pendingFreeformReplies={...e.pendingFreeformReplies,[t.messageId]:t.requestId}}function telegramCallbackInputResponse(e){return parseInputResponse({optionId:`selected`,requestId:`${TELEGRAM_CALLBACK_RESPONSE_PREFIX}${e}`})}function telegramReplyInputResponse(e){return parseInputResponse({requestId:`${TELEGRAM_REPLY_RESPONSE_PREFIX}${e.messageId}`,text:e.text})}function isTelegramSyntheticResponse(e){return e.requestId.startsWith(`telegram_callback:`)||e.requestId.startsWith(`telegram_reply:`)}function resolveTelegramInputResponses(e,t){let n=[];for(let r of t){if(r.requestId.startsWith(`telegram_callback:`)){let t=r.requestId.slice(18),i=e.hitlCallbacks?.[t];i!==void 0&&(n.push(i),delete e.hitlCallbacks?.[t]);continue}if(r.requestId.startsWith(`telegram_reply:`)){let t=r.requestId.slice(15),i=e.pendingFreeformReplies?.[t];i!==void 0&&r.text!==void 0&&(n.push({requestId:i,text:r.text}),delete e.pendingFreeformReplies?.[t]);continue}n.push(r)}return[...parseInputResponses(n)]}function registerTelegramCallback(e,t){let n=e.nextHitlCallbackId??0;e.nextHitlCallbackId=n+1;let r=`${TELEGRAM_HITL_CALLBACK_PREFIX}${n.toString(36)}`;return e.hitlCallbacks={...e.hitlCallbacks,[r]:t},r}function truncate(e,t){if(e.length<=t)return e;let n=Math.max(0,t-3);return`${e.slice(0,n).trimEnd()}...`}function chunk(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}export{TELEGRAM_CALLBACK_RESPONSE_PREFIX,TELEGRAM_HITL_CALLBACK_PREFIX,TELEGRAM_REPLY_RESPONSE_PREFIX,isTelegramSyntheticResponse,registerTelegramFreeformPrompt,renderTelegramInputRequest,resolveTelegramInputResponses,telegramCallbackInputResponse,telegramReplyInputResponse};
1
+ import{parseInputResponse,parseInputResponses}from"#shared/input.js";const TELEGRAM_HITL_CALLBACK_PREFIX=`eve:`,TELEGRAM_CALLBACK_RESPONSE_PREFIX=`telegram_callback:`,TELEGRAM_REPLY_RESPONSE_PREFIX=`telegram_reply:`,TELEGRAM_PROMPT_MAX_LENGTH=4e3;function renderTelegramInputRequest(e,t){let n=e.options;return n&&n.length>0?{replyMarkup:{inline_keyboard:chunk(n.map(n=>({callback_data:registerTelegramCallback(t,{optionId:n.id,requestId:e.requestId}),text:truncate(n.label,64)})),2)},text:truncate(e.prompt,TELEGRAM_PROMPT_MAX_LENGTH)}:{freeformRequestId:e.requestId,replyMarkup:{force_reply:!0,input_field_placeholder:truncate(`Type your answer`,64),selective:!0},text:truncate(e.prompt,TELEGRAM_PROMPT_MAX_LENGTH)}}function registerTelegramFreeformPrompt(e,t){e.pendingFreeformReplies={...e.pendingFreeformReplies,[t.messageId]:t.requestId}}function telegramCallbackInputResponse(e){return parseInputResponse({optionId:`selected`,requestId:`${TELEGRAM_CALLBACK_RESPONSE_PREFIX}${e}`})}function telegramReplyInputResponse(e){return parseInputResponse({requestId:`${TELEGRAM_REPLY_RESPONSE_PREFIX}${e.messageId}`,text:e.text})}function telegramReplyInputResponses(e,t){if(typeof e!=`string`)return[];let n=typeof t==`string`?t:(t??[]).flatMap(e=>e.type===`text`?[e.text]:[]).join(`
2
+ `);return n.trim().length===0?[]:[telegramReplyInputResponse({messageId:e,text:n})]}function isTelegramSyntheticResponse(e){return e.requestId.startsWith(`telegram_callback:`)||e.requestId.startsWith(`telegram_reply:`)}function resolveTelegramInputResponses(e,t){let n=[];for(let r of t){if(r.requestId.startsWith(`telegram_callback:`)){let t=r.requestId.slice(18),i=e.hitlCallbacks?.[t];i!==void 0&&(n.push(i),delete e.hitlCallbacks?.[t]);continue}if(r.requestId.startsWith(`telegram_reply:`)){let t=r.requestId.slice(15),i=e.pendingFreeformReplies?.[t];i!==void 0&&r.text!==void 0&&(n.push({requestId:i,text:r.text}),delete e.pendingFreeformReplies?.[t]);continue}n.push(r)}return[...parseInputResponses(n)]}function registerTelegramCallback(e,t){let n=e.nextHitlCallbackId??0;e.nextHitlCallbackId=n+1;let r=`${TELEGRAM_HITL_CALLBACK_PREFIX}${n.toString(36)}`;return e.hitlCallbacks={...e.hitlCallbacks,[r]:t},r}function truncate(e,t){if(e.length<=t)return e;let n=Math.max(0,t-3);return`${e.slice(0,n).trimEnd()}...`}function chunk(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}export{TELEGRAM_CALLBACK_RESPONSE_PREFIX,TELEGRAM_HITL_CALLBACK_PREFIX,TELEGRAM_REPLY_RESPONSE_PREFIX,isTelegramSyntheticResponse,registerTelegramFreeformPrompt,renderTelegramInputRequest,resolveTelegramInputResponses,telegramCallbackInputResponse,telegramReplyInputResponse,telegramReplyInputResponses};
@@ -1 +1 @@
1
- import{telegramContinuationToken}from"#public/channels/telegram/api.js";function stateFromTelegramMessage(e,t){let n=e.chat.type===`private`;return{...initialTelegramState(t),chatId:e.chat.id,chatType:e.chat.type,conversationId:n?null:conversationIdForMessage(e),messageThreadId:e.messageThreadId??null,triggeringUserId:e.from?.id??null}}function stateFromTelegramCallbackQuery(e,t){let n=e.message;if(!n)return{...initialTelegramState(t),triggeringUserId:e.from.id};let r=n.chat.type===`private`;return{...initialTelegramState(t),chatId:n.chat.id,chatType:n.chat.type,conversationId:r?null:n.messageId,messageThreadId:n.messageThreadId??null,triggeringUserId:e.from.id}}function telegramContinuationTokenFromState(e){return telegramContinuationToken({chatId:e.chatId??``,conversationId:e.chatType===`private`?void 0:e.conversationId??void 0,messageThreadId:e.messageThreadId??void 0})}function initialTelegramState(e){return{botUsername:e??null,chatId:null,chatType:null,conversationId:null,hitlCallbacks:{},messageThreadId:null,nextHitlCallbackId:0,pendingAuthMessageIds:{},pendingFreeformReplies:{},triggeringUserId:null}}function conversationIdForMessage(e){return e.replyToMessage?.from?.isBot===!0?e.replyToMessage.messageId:e.messageId}export{initialTelegramState,stateFromTelegramCallbackQuery,stateFromTelegramMessage,telegramContinuationTokenFromState};
1
+ import{telegramContinuationToken}from"#public/channels/telegram/api.js";function stateFromTelegramMessage(e,t){let n=e.chat.type===`private`;return{...initialTelegramState(t),chatId:e.chat.id,chatType:e.chat.type,conversationId:n?null:conversationIdForMessage(e),messageThreadId:e.messageThreadId??null,replyToBotMessageId:e.replyToMessage?.from?.isBot===!0?e.replyToMessage.messageId:null,triggeringUserId:e.from?.id??null}}function stateFromTelegramCallbackQuery(e,t){let n=e.message;if(!n)return{...initialTelegramState(t),triggeringUserId:e.from.id};let r=n.chat.type===`private`;return{...initialTelegramState(t),chatId:n.chat.id,chatType:n.chat.type,conversationId:r?null:n.messageId,messageThreadId:n.messageThreadId??null,triggeringUserId:e.from.id}}function telegramContinuationTokenFromState(e){return telegramContinuationToken({chatId:e.chatId??``,conversationId:e.chatType===`private`?void 0:e.conversationId??void 0,messageThreadId:e.messageThreadId??void 0})}function initialTelegramState(e){return{botUsername:e??null,chatId:null,chatType:null,conversationId:null,hitlCallbacks:{},messageThreadId:null,nextHitlCallbackId:0,pendingAuthMessageIds:{},pendingFreeformReplies:{},triggeringUserId:null}}function conversationIdForMessage(e){return e.replyToMessage?.from?.isBot===!0?e.replyToMessage.messageId:e.messageId}export{initialTelegramState,stateFromTelegramCallbackQuery,stateFromTelegramMessage,telegramContinuationTokenFromState};
@@ -40,6 +40,11 @@ export interface TelegramChannelState extends TelegramHitlState {
40
40
  messageThreadId: number | null;
41
41
  /** Telegram user id that triggered the current session/turn. */
42
42
  triggeringUserId?: string | null;
43
+ /**
44
+ * Bot message id that the triggering message replied to. The deliver hook
45
+ * reads it from delivery state to answer a pending ForceReply prompt.
46
+ */
47
+ replyToBotMessageId?: string | null;
43
48
  /** Public authorization status messages, keyed by connection name. */
44
49
  pendingAuthMessageIds?: Record<string, string>;
45
50
  }
@@ -1 +1 @@
1
- import{createLogger,logError}from"#internal/logging.js";import{INTERNAL_CHANNEL_DELIVER}from"#channel/channel-operations.js";import{isCompiledChannel}from"#channel/compiled-channel.js";import{defaultDeliverResult}from"#channel/adapter.js";import{parseJsonObject}from"#shared/json.js";import{POST,defineChannel}from"#public/definitions/channel.js";import{mergeUploadPolicy}from"#public/channels/upload-policy.js";import{formatTelegramContextBlock,parseTelegramUpdate}from"#public/channels/telegram/inbound.js";import{answerTelegramCallbackQuery,callTelegramApi,editTelegramMessageReplyMarkup,editTelegramMessageText,sendTelegramChatAction,sendTelegramMessage,splitTelegramMessageText,telegramContinuationToken}from"#public/channels/telegram/api.js";import{TELEGRAM_AUTHORIZATION_CALLBACK_PREFIX}from"#public/channels/telegram/authorization.js";import{TELEGRAM_HITL_CALLBACK_PREFIX,isTelegramSyntheticResponse,resolveTelegramInputResponses,telegramCallbackInputResponse,telegramReplyInputResponse}from"#public/channels/telegram/hitl.js";import{buildTelegramTurnMessage,collectTelegramFileParts,createTelegramFetchFile}from"#public/channels/telegram/attachments.js";import{defaultEvents,defaultOnMessage,isTelegramBotMentioned}from"#public/channels/telegram/defaults.js";import{verifyTelegramRequest}from"#public/channels/telegram/verify.js";import{dispatchTelegramAuthorizationCallback}from"#public/channels/telegram/authorization-callback.js";import{initialTelegramState,stateFromTelegramCallbackQuery,stateFromTelegramMessage,telegramContinuationTokenFromState}from"#public/channels/telegram/state.js";import{telegramInstrumentation}from"#public/channels/telegram/audience.js";const log=createLogger(`telegram.channel`);function telegramChannel(e={}){let t=mergeUploadPolicy(e.uploadPolicy),n=e.onMessage??defaultOnMessage,r={...defaultEvents,...e.events},i=defineChannel({kindHint:`telegram`,turnPolicy:e.turnPolicy,state:initialTelegramState(e.botUsername),...telegramInstrumentation,fetchFile:createTelegramFetchFile({api:e.api,credentials:e.credentials,policy:t}),context(t,n){return rebuildTelegramContext(t,n,e)},routes:[POST(e.route??`/eve/v1/telegram`,async(r,{from:i,resolveSession:a,waitUntil:o})=>{let s=await verifyInbound(r,e.credentials);if(s===null)return new Response(`unauthorized`,{status:401});let c;try{c=parseJsonObject(JSON.parse(s))}catch(e){return log.warn(`inbound Telegram body is not valid JSON`,{error:e}),new Response(`ok`)}let l=parseTelegramUpdate(c);return l===null?new Response(`ok`):l.kind===`message`?(o(dispatchMessage({config:e,message:l.message,onMessage:n,uploadPolicy:t,from:i})),new Response(`ok`)):(o(dispatchCallbackQuery({config:e,query:l.callbackQuery,from:i,resolveSession:a})),new Response(`ok`))})],async receive(t,{from:n}){let r=t.target,i=readChatId(r.chatId);if(i===void 0)throw Error(`telegramChannel().receive requires target.chatId.`);let a=typeof r.messageThreadId==`number`?r.messageThreadId:void 0,o=readChatId(r.conversationId),s=r.initialMessage;if(s!==void 0&&o!==void 0)throw Error("telegramChannel().receive: `conversationId` and `initialMessage` are mutually exclusive.");let c={...initialTelegramState(e.botUsername),chatId:i,conversationId:o??null,messageThreadId:a??null};return s!==void 0&&await buildTelegramHandle({config:e,state:c}).sendMessage(s),n(telegramContinuationTokenFromState(c)).send(t.message,{auth:t.auth,state:c})},events:r});return attachTelegramDeliver(i),i}function rebuildTelegramContext(e,t,n){return{state:e,telegram:buildTelegramHandle({config:n,session:t,state:e})}}function buildTelegramHandle(e){let t=e.config.api,n=e.state,r=e.config.credentials;function anchor(t){let r=n.chatType??t.chatType??null;n.chatType===null&&t.chatType!==void 0&&(n.chatType=t.chatType),t.id&&shouldAnchorTelegramConversation(r)&&(n.conversationId=t.id,n.chatId&&e.session?.continuation?.alias(telegramContinuationToken({chatId:n.chatId,conversationId:t.id,messageThreadId:n.messageThreadId??void 0})))}async function sendOne(e){let t=await sendMessage(e);return anchor(t),t}async function sendMessage(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for outbound message.`);return sendTelegramMessage({apiBaseUrl:t?.apiBaseUrl,body:{...e,message_thread_id:e.message_thread_id??n.messageThreadId??void 0},credentials:r,fetch:t?.fetch,fileBaseUrl:t?.fileBaseUrl,chatId:i})}return{botUsername:n.botUsername??e.config.botUsername,chatId:n.chatId??``,chatType:n.chatType??void 0,conversationId:n.conversationId??void 0,messageThreadId:n.messageThreadId??void 0,answerCallbackQuery(e){return answerTelegramCallbackQuery({apiBaseUrl:t?.apiBaseUrl,callbackQueryId:e.callbackQueryId,credentials:r,fetch:t?.fetch,showAlert:e.showAlert,text:e.text})},editMessageReplyMarkup(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for reply-markup edit.`);return editTelegramMessageReplyMarkup({apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageId:e.messageId,replyMarkup:e.replyMarkup})},editMessageText(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for text edit.`);return editTelegramMessageText({apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageId:e.messageId,replyMarkup:e.replyMarkup,text:e.text})},post(e){return postTelegramMessage(e,sendOne)},postEphemeral(e,t,n){return postTelegramMessage({...typeof t==`string`?{text:t}:t,ephemeral_message_parameters:{...n?.callbackQueryId===void 0?{}:{callback_query_id:n.callbackQueryId},receiver_user_id:e}},sendMessage)},request(e,n){return callTelegramApi({apiBaseUrl:t?.apiBaseUrl,body:n,botToken:r?.botToken,fetch:t?.fetch,method:e})},sendMessage(e){return postTelegramMessage(e,sendOne)},async startTyping(e=`typing`){let i=n.chatId??``;if(i)try{await sendTelegramChatAction({action:e,apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageThreadId:n.messageThreadId??void 0})}catch(e){logError(log,`Telegram typing indicator failed — swallowed`,e,{chatId:i})}}}}function shouldAnchorTelegramConversation(e){return e===`group`||e===`supergroup`}async function postTelegramMessage(e,t){let n=typeof e==`string`?{text:e}:e,r=splitTelegramMessageText(n.text),i;for(let[e,a]of r.entries()){let r=await t(e===0?{...n,text:a}:{...n.ephemeral_message_parameters===void 0?{}:{ephemeral_message_parameters:n.ephemeral_message_parameters},text:a});i===void 0&&(i=r)}return i??{id:``,raw:null}}async function verifyInbound(e,t){try{return await verifyTelegramRequest(e,{secretToken:t?.webhookVerifier?void 0:t?.webhookSecretToken,webhookVerifier:t?.webhookVerifier})}catch(e){return log.warn(`telegram inbound verification failed`,{error:e}),null}}async function dispatchMessage(e){if(e.message.from?.isBot===!0)return;let t=stateFromTelegramMessage(e.message,e.config.botUsername),n={telegram:buildTelegramHandle({config:e.config,state:t})},r;try{r=await e.onMessage(n,e.message)}catch(e){log.error(`message handler failed`,{error:e});return}if(r==null)return;let i=collectTelegramFileParts(e.message.attachments,e.uploadPolicy),a=buildTelegramTurnMessage(e.message,i),o=formatTelegramContextBlock({botUsername:e.config.botUsername,chatId:e.message.chat.id,chatTitle:e.message.chat.title,chatType:e.message.chat.type,isMentioned:isTelegramBotMentioned(e.message,e.config.botUsername),messageId:e.message.messageId,messageThreadId:e.message.messageThreadId,userId:e.message.from?.id,username:e.message.from?.username}),s=r.context??[],c=e.message.text||e.message.caption,l=e.message.replyToMessage?.from?.isBot===!0&&c.trim().length>0?[telegramReplyInputResponse({messageId:e.message.replyToMessage.messageId,text:c})]:void 0;try{await e.from(telegramContinuationTokenFromState(t))[INTERNAL_CHANNEL_DELIVER]({context:[o,...s],inputResponses:l,message:a},{auth:r.auth,state:t,title:r.title})}catch(e){log.error(`message delivery failed`,{error:e})}}async function dispatchCallbackQuery(e){let t=stateFromTelegramCallbackQuery(e.query,e.config.botUsername),n={telegram:buildTelegramHandle({config:e.config,state:t})};if(e.query.data?.startsWith(TELEGRAM_AUTHORIZATION_CALLBACK_PREFIX)===!0){await dispatchTelegramAuthorizationCallback({continuationToken:telegramContinuationTokenFromState(t),query:e.query,resolveSession:e.resolveSession,state:t,telegram:n});return}if(e.query.data?.startsWith(TELEGRAM_HITL_CALLBACK_PREFIX)===!0){try{await n.telegram.answerCallbackQuery({callbackQueryId:e.query.id,text:`Answer received.`})}catch(e){log.warn(`Telegram callback-query acknowledgement failed`,{error:e})}if(!e.query.message||!t.chatId)return;try{await e.from(telegramContinuationTokenFromState(t)).respond([telegramCallbackInputResponse(e.query.data)],{auth:null})}catch(e){log.error(`callback query delivery failed`,{error:e})}return}if(e.config.onCallbackQuery!==void 0){try{await e.config.onCallbackQuery(n,e.query)}catch(e){log.error(`custom callback-query handler failed`,{error:e})}return}try{await n.telegram.answerCallbackQuery({callbackQueryId:e.query.id,text:`Unsupported action.`})}catch(e){log.warn(`Telegram unsupported callback-query acknowledgement failed`,{error:e})}}function attachTelegramDeliver(e){if(!isCompiledChannel(e))return;let t=e.adapter;t.deliver=(e,t)=>{let n=e.inputResponses??[];if(n.some(isTelegramSyntheticResponse)){let r=resolveTelegramInputResponses(t.state,n);return r.length>0?{inputResponses:r,context:e.context}:e.message===void 0?void 0:{message:e.message,context:e.context}}return defaultDeliverResult(e)}}function readChatId(e){if(typeof e==`string`&&e.length>0)return e;if(typeof e==`number`&&Number.isFinite(e))return String(e)}export{telegramChannel};
1
+ import{createLogger,logError}from"#internal/logging.js";import{isCompiledChannel}from"#channel/compiled-channel.js";import{defaultDeliverResult}from"#channel/adapter.js";import{parseJsonObject}from"#shared/json.js";import{POST,defineChannel}from"#public/definitions/channel.js";import{mergeUploadPolicy}from"#public/channels/upload-policy.js";import{formatTelegramContextBlock,parseTelegramUpdate}from"#public/channels/telegram/inbound.js";import{answerTelegramCallbackQuery,callTelegramApi,editTelegramMessageReplyMarkup,editTelegramMessageText,sendTelegramChatAction,sendTelegramMessage,splitTelegramMessageText,telegramContinuationToken}from"#public/channels/telegram/api.js";import{TELEGRAM_AUTHORIZATION_CALLBACK_PREFIX}from"#public/channels/telegram/authorization.js";import{TELEGRAM_HITL_CALLBACK_PREFIX,isTelegramSyntheticResponse,resolveTelegramInputResponses,telegramCallbackInputResponse,telegramReplyInputResponses}from"#public/channels/telegram/hitl.js";import{buildTelegramTurnMessage,collectTelegramFileParts,createTelegramFetchFile}from"#public/channels/telegram/attachments.js";import{defaultEvents,defaultOnMessage,isTelegramBotMentioned}from"#public/channels/telegram/defaults.js";import{verifyTelegramRequest}from"#public/channels/telegram/verify.js";import{dispatchTelegramAuthorizationCallback}from"#public/channels/telegram/authorization-callback.js";import{initialTelegramState,stateFromTelegramCallbackQuery,stateFromTelegramMessage,telegramContinuationTokenFromState}from"#public/channels/telegram/state.js";import{telegramInstrumentation}from"#public/channels/telegram/audience.js";const log=createLogger(`telegram.channel`);function telegramChannel(e={}){let t=mergeUploadPolicy(e.uploadPolicy),n=e.onMessage??defaultOnMessage,r={...defaultEvents,...e.events},i=defineChannel({kindHint:`telegram`,turnPolicy:e.turnPolicy,state:initialTelegramState(e.botUsername),...telegramInstrumentation,fetchFile:createTelegramFetchFile({api:e.api,credentials:e.credentials,policy:t}),context(t,n){return rebuildTelegramContext(t,n,e)},routes:[POST(e.route??`/eve/v1/telegram`,async(r,{from:i,resolveSession:a,waitUntil:o})=>{let s=await verifyInbound(r,e.credentials);if(s===null)return new Response(`unauthorized`,{status:401});let c;try{c=parseJsonObject(JSON.parse(s))}catch(e){return log.warn(`inbound Telegram body is not valid JSON`,{error:e}),new Response(`ok`)}let l=parseTelegramUpdate(c);return l===null?new Response(`ok`):l.kind===`message`?(o(dispatchMessage({config:e,message:l.message,onMessage:n,uploadPolicy:t,from:i})),new Response(`ok`)):(o(dispatchCallbackQuery({config:e,query:l.callbackQuery,from:i,resolveSession:a})),new Response(`ok`))})],async receive(t,{from:n}){let r=t.target,i=readChatId(r.chatId);if(i===void 0)throw Error(`telegramChannel().receive requires target.chatId.`);let a=typeof r.messageThreadId==`number`?r.messageThreadId:void 0,o=readChatId(r.conversationId),s=r.initialMessage;if(s!==void 0&&o!==void 0)throw Error("telegramChannel().receive: `conversationId` and `initialMessage` are mutually exclusive.");let c={...initialTelegramState(e.botUsername),chatId:i,conversationId:o??null,messageThreadId:a??null};return s!==void 0&&await buildTelegramHandle({config:e,state:c}).sendMessage(s),n(telegramContinuationTokenFromState(c)).send(t.message,{auth:t.auth,state:c})},events:r});return attachTelegramDeliver(i),i}function rebuildTelegramContext(e,t,n){return{state:e,telegram:buildTelegramHandle({config:n,session:t,state:e})}}function buildTelegramHandle(e){let t=e.config.api,n=e.state,r=e.config.credentials;function anchor(t){let r=n.chatType??t.chatType??null;n.chatType===null&&t.chatType!==void 0&&(n.chatType=t.chatType),t.id&&shouldAnchorTelegramConversation(r)&&(n.conversationId=t.id,n.chatId&&e.session?.continuation?.alias(telegramContinuationToken({chatId:n.chatId,conversationId:t.id,messageThreadId:n.messageThreadId??void 0})))}async function sendOne(e){let t=await sendMessage(e);return anchor(t),t}async function sendMessage(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for outbound message.`);return sendTelegramMessage({apiBaseUrl:t?.apiBaseUrl,body:{...e,message_thread_id:e.message_thread_id??n.messageThreadId??void 0},credentials:r,fetch:t?.fetch,fileBaseUrl:t?.fileBaseUrl,chatId:i})}return{botUsername:n.botUsername??e.config.botUsername,chatId:n.chatId??``,chatType:n.chatType??void 0,conversationId:n.conversationId??void 0,messageThreadId:n.messageThreadId??void 0,answerCallbackQuery(e){return answerTelegramCallbackQuery({apiBaseUrl:t?.apiBaseUrl,callbackQueryId:e.callbackQueryId,credentials:r,fetch:t?.fetch,showAlert:e.showAlert,text:e.text})},editMessageReplyMarkup(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for reply-markup edit.`);return editTelegramMessageReplyMarkup({apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageId:e.messageId,replyMarkup:e.replyMarkup})},editMessageText(e){let i=n.chatId??``;if(!i)throw Error(`telegramChannel: missing chat id for text edit.`);return editTelegramMessageText({apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageId:e.messageId,replyMarkup:e.replyMarkup,text:e.text})},post(e){return postTelegramMessage(e,sendOne)},postEphemeral(e,t,n){return postTelegramMessage({...typeof t==`string`?{text:t}:t,ephemeral_message_parameters:{...n?.callbackQueryId===void 0?{}:{callback_query_id:n.callbackQueryId},receiver_user_id:e}},sendMessage)},request(e,n){return callTelegramApi({apiBaseUrl:t?.apiBaseUrl,body:n,botToken:r?.botToken,fetch:t?.fetch,method:e})},sendMessage(e){return postTelegramMessage(e,sendOne)},async startTyping(e=`typing`){let i=n.chatId??``;if(i)try{await sendTelegramChatAction({action:e,apiBaseUrl:t?.apiBaseUrl,chatId:i,credentials:r,fetch:t?.fetch,messageThreadId:n.messageThreadId??void 0})}catch(e){logError(log,`Telegram typing indicator failed — swallowed`,e,{chatId:i})}}}}function shouldAnchorTelegramConversation(e){return e===`group`||e===`supergroup`}async function postTelegramMessage(e,t){let n=typeof e==`string`?{text:e}:e,r=splitTelegramMessageText(n.text),i;for(let[e,a]of r.entries()){let r=await t(e===0?{...n,text:a}:{...n.ephemeral_message_parameters===void 0?{}:{ephemeral_message_parameters:n.ephemeral_message_parameters},text:a});i===void 0&&(i=r)}return i??{id:``,raw:null}}async function verifyInbound(e,t){try{return await verifyTelegramRequest(e,{secretToken:t?.webhookVerifier?void 0:t?.webhookSecretToken,webhookVerifier:t?.webhookVerifier})}catch(e){return log.warn(`telegram inbound verification failed`,{error:e}),null}}async function dispatchMessage(e){if(e.message.from?.isBot===!0)return;let t=stateFromTelegramMessage(e.message,e.config.botUsername),n={telegram:buildTelegramHandle({config:e.config,state:t})},r;try{r=await e.onMessage(n,e.message)}catch(e){log.error(`message handler failed`,{error:e});return}if(r==null)return;let i=collectTelegramFileParts(e.message.attachments,e.uploadPolicy),a=buildTelegramTurnMessage(e.message,i),o=formatTelegramContextBlock({botUsername:e.config.botUsername,chatId:e.message.chat.id,chatTitle:e.message.chat.title,chatType:e.message.chat.type,isMentioned:isTelegramBotMentioned(e.message,e.config.botUsername),messageId:e.message.messageId,messageThreadId:e.message.messageThreadId,userId:e.message.from?.id,username:e.message.from?.username}),s=r.context??[];try{await e.from(telegramContinuationTokenFromState(t)).send(a,{auth:r.auth,context:[o,...s],state:t,title:r.title})}catch(e){log.error(`message delivery failed`,{error:e})}}async function dispatchCallbackQuery(e){let t=stateFromTelegramCallbackQuery(e.query,e.config.botUsername),n={telegram:buildTelegramHandle({config:e.config,state:t})};if(e.query.data?.startsWith(TELEGRAM_AUTHORIZATION_CALLBACK_PREFIX)===!0){await dispatchTelegramAuthorizationCallback({continuationToken:telegramContinuationTokenFromState(t),query:e.query,resolveSession:e.resolveSession,state:t,telegram:n});return}if(e.query.data?.startsWith(TELEGRAM_HITL_CALLBACK_PREFIX)===!0){try{await n.telegram.answerCallbackQuery({callbackQueryId:e.query.id,text:`Answer received.`})}catch(e){log.warn(`Telegram callback-query acknowledgement failed`,{error:e})}if(!e.query.message||!t.chatId)return;try{await e.from(telegramContinuationTokenFromState(t)).respond([telegramCallbackInputResponse(e.query.data)],{auth:null})}catch(e){log.error(`callback query delivery failed`,{error:e})}return}if(e.config.onCallbackQuery!==void 0){try{await e.config.onCallbackQuery(n,e.query)}catch(e){log.error(`custom callback-query handler failed`,{error:e})}return}try{await n.telegram.answerCallbackQuery({callbackQueryId:e.query.id,text:`Unsupported action.`})}catch(e){log.warn(`Telegram unsupported callback-query acknowledgement failed`,{error:e})}}function attachTelegramDeliver(e){if(!isCompiledChannel(e))return;let t=e.adapter;t.deliver=(e,t)=>{let n=e.state,r=[...e.inputResponses??[],...telegramReplyInputResponses(n?.replyToBotMessageId,e.message)];if(r.some(isTelegramSyntheticResponse)){let n=resolveTelegramInputResponses(t.state,r);return n.length>0?{inputResponses:n,context:e.context}:e.message===void 0?void 0:{message:e.message,context:e.context}}return defaultDeliverResult(e)}}function readChatId(e){if(typeof e==`string`&&e.length>0)return e;if(typeof e==`number`&&Number.isFinite(e))return String(e)}export{telegramChannel};
@@ -8,7 +8,7 @@ import type { UnstampedMessageStreamEvent } from "#protocol/message.js";
8
8
  import type { SessionContext } from "#public/definitions/callback-context.js";
9
9
  import type { GenericChannelDefinition, GenericReceiveInput } from "#shared/channel-definition.js";
10
10
  declare const CHANNEL_METADATA_TYPE: unique symbol;
11
- export type { CancelTurnResult, ClearSessionResult, CompactSessionResult, GetEventStreamOptions, ResetSessionResult, SessionCallback, TurnPolicy, TaskDeliveryPolicy, } from "#channel/types.js";
11
+ export type { CancelTurnResult, ClearSessionResult, CompactSessionResult, GetEventStreamOptions, ResetSessionResult, SessionCallback, TurnPolicy, } from "#channel/types.js";
12
12
  export type { Session, SessionHandle } from "#channel/session.js";
13
13
  export type { ChannelAudience } from "#shared/channel-audience.js";
14
14
  export type { AudienceCaller, AudienceContext, AudienceInput, AudiencePrincipal, ConversationEnvironment, } from "#shared/conversation-context.js";
@@ -126,7 +126,12 @@ export interface ChannelEvents<TCtx = void> {
126
126
  readonly "message.appended"?: ChannelEventHandler<"message.appended", TCtx>;
127
127
  readonly "reasoning.appended"?: ChannelEventHandler<"reasoning.appended", TCtx>;
128
128
  readonly "reasoning.completed"?: ChannelEventHandler<"reasoning.completed", TCtx>;
129
+ readonly "step.completed"?: ChannelEventHandler<"step.completed", TCtx>;
129
130
  readonly "input.requested"?: ChannelEventHandler<"input.requested", TCtx>;
131
+ readonly "input.resolved"?: ChannelEventHandler<"input.resolved", TCtx>;
132
+ readonly "task.started"?: ChannelEventHandler<"task.started", TCtx>;
133
+ readonly "task.settled"?: ChannelEventHandler<"task.settled", TCtx>;
134
+ readonly "turn.waiting"?: ChannelEventHandler<"turn.waiting", TCtx>;
130
135
  readonly "turn.failed"?: ChannelEventHandler<"turn.failed", TCtx>;
131
136
  readonly "turn.completed"?: ChannelEventHandler<"turn.completed", TCtx>;
132
137
  readonly "turn.cancelled"?: ChannelEventHandler<"turn.cancelled", TCtx>;
@@ -1 +1 @@
1
- import{createMetadataAudienceProjector}from"#channel/audience.js";import{CHANNEL_SENTINEL}from"#channel/compiled-channel.js";import{defaultDeliverResult}from"#channel/adapter.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{normalizeChannelCors}from"#channel/cors.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";import{DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,WS}from"#channel/routes.js";const DISABLED_ROUTE_SENTINEL_KIND=`eve:disabled-channel`;function disableRoute(){return{kind:DISABLED_ROUTE_SENTINEL_KIND}}function isDisabledRouteSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_ROUTE_SENTINEL_KIND}function defineChannel(e){let t=buildAdapter(e),n=normalizeChannelCors(e.cors);return{__kind:CHANNEL_SENTINEL,routes:e.routes,adapter:t,cors:n,receive:e.receive,turnPolicy:e.turnPolicy}}const eventTypes=Object.keys({"approval.candidate":null,"approval.settled":null,"context.cleared":null,"compaction.requested":null,"compaction.completed":null,"turn.started":null,"actions.requested":null,"action.partial":null,"action.result":null,"message.completed":null,"message.appended":null,"reasoning.appended":null,"reasoning.completed":null,"input.requested":null,"turn.failed":null,"turn.completed":null,"turn.cancelled":null,"session.failed":null,"session.completed":null,"session.waiting":null,"authorization.required":null,"authorization.completed":null});function buildAdapter(e){let t=e.state!=null,n=e.context!=null,r=e.fetchFile!==void 0,i=e.metadata,a=i!==void 0,o=e.audience,s=t||n||a,c={},l=!1,u={kind:e.kindHint??`defineChannel`},d=e.events;for(let e of eventTypes){let t=d?.[e];t&&(l=!0,c[e]=(n,r)=>{let{session:i,...a}=r,o={...a,continuation:i?.continuation===void 0?void 0:{token:i.continuation.token,alias:e=>i.continuation?.alias(e)}};if(e===`session.failed`)return t(n,o);let s=buildCallbackContext();return t(n,o,s)})}return!s&&!l&&!r?{kind:e.kindHint??HTTP_ADAPTER_KIND,...o===void 0?void 0:{instrumentation:{audience:o}}}:{kind:e.kindHint??`defineChannel`,state:t?{...e.state}:{},fetchFile:e.fetchFile,instrumentation:i===void 0&&o===void 0?void 0:{...i===void 0?void 0:{metadata(e){let{audience:t,...n}=i(e);return n}},...o===void 0?i===void 0?void 0:{audience:createMetadataAudienceProjector(u,i)}:{audience:o}},createAdapterContext(t){let r=t.state,i=t.session;return{...n?e.context(r,i):{},state:r,ctx:t.ctx,session:i}},deliver(t,n){return e.deliver===void 0?defaultDeliverResult(t):e.deliver(t,n)},...c}}export{DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,WS,defineChannel,disableRoute,isDisabledRouteSentinel};
1
+ import{createMetadataAudienceProjector}from"#channel/audience.js";import{CHANNEL_SENTINEL}from"#channel/compiled-channel.js";import{defaultDeliverResult}from"#channel/adapter.js";import{buildCallbackContext}from"#context/build-callback-context.js";import{normalizeChannelCors}from"#channel/cors.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";import{DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,WS}from"#channel/routes.js";const DISABLED_ROUTE_SENTINEL_KIND=`eve:disabled-channel`;function disableRoute(){return{kind:DISABLED_ROUTE_SENTINEL_KIND}}function isDisabledRouteSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_ROUTE_SENTINEL_KIND}function defineChannel(e){let t=buildAdapter(e),n=normalizeChannelCors(e.cors);return{__kind:CHANNEL_SENTINEL,routes:e.routes,adapter:t,cors:n,receive:e.receive,turnPolicy:e.turnPolicy}}const eventTypes=Object.keys({"approval.candidate":null,"approval.settled":null,"context.cleared":null,"compaction.requested":null,"compaction.completed":null,"turn.started":null,"actions.requested":null,"action.partial":null,"action.result":null,"message.completed":null,"message.appended":null,"reasoning.appended":null,"reasoning.completed":null,"step.completed":null,"input.requested":null,"input.resolved":null,"task.started":null,"task.settled":null,"turn.waiting":null,"turn.failed":null,"turn.completed":null,"turn.cancelled":null,"session.failed":null,"session.completed":null,"session.waiting":null,"authorization.required":null,"authorization.completed":null});function buildAdapter(e){let t=e.state!=null,n=e.context!=null,r=e.fetchFile!==void 0,i=e.metadata,a=i!==void 0,o=e.audience,s=t||n||a,c={},l=!1,u={kind:e.kindHint??`defineChannel`},d=e.events;for(let e of eventTypes){let t=d?.[e];t&&(l=!0,c[e]=(n,r)=>{let{session:i,...a}=r,o={...a,continuation:i?.continuation===void 0?void 0:{token:i.continuation.token,alias:e=>i.continuation?.alias(e)}};if(e===`session.failed`)return t(n,o);let s=buildCallbackContext();return t(n,o,s)})}return!s&&!l&&!r?{kind:e.kindHint??HTTP_ADAPTER_KIND,...o===void 0?void 0:{instrumentation:{audience:o}}}:{kind:e.kindHint??`defineChannel`,state:t?{...e.state}:{},fetchFile:e.fetchFile,instrumentation:i===void 0&&o===void 0?void 0:{...i===void 0?void 0:{metadata(e){let{audience:t,...n}=i(e);return n}},...o===void 0?i===void 0?void 0:{audience:createMetadataAudienceProjector(u,i)}:{audience:o}},createAdapterContext(t){let r=t.state,i=t.session;return{...n?e.context(r,i):{},state:r,ctx:t.ctx,session:i}},deliver(t,n){return e.deliver===void 0?defaultDeliverResult(t):e.deliver(t,n)},...c}}export{DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT,WS,defineChannel,disableRoute,isDisabledRouteSentinel};
@@ -29,9 +29,8 @@ export interface McpClientConnectionDefinition {
29
29
  /**
30
30
  * Human-readable summary of the connection and its tools.
31
31
  *
32
- * The system prompt layer uses it to describe the connection to
33
- * the model, and `connection_search` results use it so the model
34
- * can choose which connection to query.
32
+ * The model sees it in the connection listing eve announces, so it
33
+ * can choose which connection to search with `connection_search`.
35
34
  */
36
35
  readonly description: string;
37
36
  /**
@@ -89,9 +88,8 @@ export interface McpClientConnectionDefinition {
89
88
  */
90
89
  toolCall?: ConnectionToolCallDefinition;
91
90
  /**
92
- * Client-side tool filter. When set, the model sees only tools
93
- * whose names pass the filter; `connection_search` drops all
94
- * others.
91
+ * Client-side tool filter. When set, `connection_search` returns and
92
+ * `connection_execute` calls only tools whose names pass the filter.
95
93
  *
96
94
  * Specify exactly one of `allow` or `block`.
97
95
  */
@@ -17,8 +17,8 @@ export type OpenAPISpecSource = string | Record<string, unknown>;
17
17
  * `"vercel"`.
18
18
  *
19
19
  * Each operation in the document becomes a connection tool the model can
20
- * discover via `connection_search` and call by its qualified name (e.g.
21
- * `vercel__getProjects`). The tool name is the operation's
20
+ * find with `connection_search` and call with `connection_execute`; events
21
+ * report the call as `vercel__getProjects`. The tool name is the operation's
22
22
  * `operationId`; operations without one get a deterministic synthesized
23
23
  * name (`<method>_<sanitized-path>`).
24
24
  *
@@ -46,9 +46,8 @@ export interface OpenAPIConnectionDefinition {
46
46
  /**
47
47
  * Human-readable summary of the connection and its operations.
48
48
  *
49
- * The system prompt layer uses it to describe the connection to the
50
- * model, and `connection_search` results use it so the model can
51
- * choose which connection to query.
49
+ * The model sees it in the connection listing eve announces, so it
50
+ * can choose which connection to search with `connection_search`.
52
51
  */
53
52
  readonly description: string;
54
53
  /**
@@ -101,9 +100,9 @@ export interface OpenAPIConnectionDefinition {
101
100
  */
102
101
  toolCall?: ConnectionToolCallDefinition;
103
102
  /**
104
- * Operation filter keyed on `operationId`. When set, the model sees
105
- * only operations whose id passes the filter; `connection_search`
106
- * drops all others.
103
+ * Operation filter keyed on `operationId`. When set,
104
+ * `connection_search` returns and `connection_execute` calls only
105
+ * operations whose id passes the filter.
107
106
  *
108
107
  * Specify exactly one of `allow` or `block`. Mirrors `tools` on MCP
109
108
  * connections, but names operations rather than tools.
@@ -56,8 +56,8 @@ export interface NoConfigExtensionHandle {
56
56
  * const { apiKey } = extension.config;
57
57
  * ```
58
58
  *
59
- * The `namespace` argument is supplied by the bundler shim and is not part of the
60
- * authoring surface.
59
+ * The second argument is retained for source compatibility with compiled extension
60
+ * declarations; instance bindings come from the loaded module graph, not its value.
61
61
  */
62
62
  export declare function defineExtension<const S extends StandardSchemaV1>(options: {
63
63
  readonly config: S;
@@ -1 +1 @@
1
- const MOUNTED_EXTENSION=Symbol.for(`eve.mounted-extension`),CONFIG_REGISTRY=Symbol.for(`eve.extension-config-registry`),EXT_CONFIG_SCOPE=Symbol.for(`eve.ext-config-scope`);function ambientConfigScope(){let e=globalThis[EXT_CONFIG_SCOPE];return typeof e==`string`&&e.length>0?e:void 0}function configRegistry(){let e=globalThis,t=e[CONFIG_REGISTRY];return t===void 0&&(t=new Map,e[CONFIG_REGISTRY]=t),t}function validateConfig(e,t){if(e===void 0)return{};let n=e[`~standard`].validate(t??{});if(n instanceof Promise)throw Error(`Extension config must validate synchronously; the config schema uses async validation, which is not supported at mount.`);if(n.issues!==void 0){let e=n.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`?e.key:e)).join(`.`);return t!==void 0&&t.length>0?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(`Invalid extension config: ${e}`)}return n.value}function defineExtension(e,t){let n=e?.config,r=t??ambientConfigScope(),handle=(e=>{let t=validateConfig(n,e);return r!==void 0&&r.length>0&&configRegistry().set(r,t),{[MOUNTED_EXTENSION]:!0}});return Object.defineProperty(handle,"schema",{value:n,enumerable:!0}),Object.defineProperty(handle,"config",{enumerable:!0,get(){return(r===void 0?void 0:configRegistry().get(r))??validateConfig(n,{})}}),handle}export{defineExtension};
1
+ const MOUNTED_EXTENSION=Symbol.for(`eve.mounted-extension`);function validateConfig(e,t){if(e===void 0)return{};let n=e[`~standard`].validate(t??{});if(n instanceof Promise)throw Error(`Extension config must validate synchronously; the config schema uses async validation, which is not supported at mount.`);if(n.issues!==void 0){let e=n.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`?e.key:e)).join(`.`);return t!==void 0&&t.length>0?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(`Invalid extension config: ${e}`)}return n.value}function defineExtension(e,t){let n=e?.config,r,handle=(e=>(r=validateConfig(n,e),{[MOUNTED_EXTENSION]:!0}));return Object.defineProperty(handle,"schema",{value:n,enumerable:!0}),Object.defineProperty(handle,"config",{enumerable:!0,get(){return r??validateConfig(n,{})}}),handle}export{defineExtension};
@@ -18,6 +18,7 @@ export interface HookEventMap {
18
18
  readonly "approval.candidate": ProtocolEvent<"approval.candidate">;
19
19
  readonly "approval.settled": ProtocolEvent<"approval.settled">;
20
20
  readonly "actions.requested": ProtocolEvent<"actions.requested">;
21
+ readonly "agent.started": ProtocolEvent<"agent.started">;
21
22
  readonly "authorization.completed": ProtocolEvent<"authorization.completed">;
22
23
  readonly "authorization.required": ProtocolEvent<"authorization.required">;
23
24
  readonly "compaction.completed": ProtocolEvent<"compaction.completed">;
@@ -38,14 +39,13 @@ export interface HookEventMap {
38
39
  readonly "step.completed": ProtocolEvent<"step.completed">;
39
40
  readonly "step.failed": ProtocolEvent<"step.failed">;
40
41
  readonly "step.started": ProtocolEvent<"step.started">;
41
- readonly "subagent.called": ProtocolEvent<"subagent.called">;
42
- readonly "subagent.completed": ProtocolEvent<"subagent.completed">;
43
- readonly "subagent.event": ProtocolEvent<"subagent.event">;
44
- readonly "subagent.started": ProtocolEvent<"subagent.started">;
42
+ readonly "task.settled": ProtocolEvent<"task.settled">;
43
+ readonly "task.started": ProtocolEvent<"task.started">;
45
44
  readonly "turn.cancelled": ProtocolEvent<"turn.cancelled">;
46
45
  readonly "turn.completed": ProtocolEvent<"turn.completed">;
47
46
  readonly "turn.failed": ProtocolEvent<"turn.failed">;
48
47
  readonly "turn.started": ProtocolEvent<"turn.started">;
48
+ readonly "turn.waiting": ProtocolEvent<"turn.waiting">;
49
49
  }
50
50
  /** Event type discriminators available to authored hooks. */
51
51
  export type HookEventType = keyof HookEventMap;
@@ -68,6 +68,18 @@ export interface HookContext extends SessionContext {
68
68
  readonly kind?: string;
69
69
  readonly continuationToken?: string;
70
70
  };
71
+ /**
72
+ * Cancels the running turn. The event's remaining subscribers still run,
73
+ * then the turn settles like `session.cancel()`: `turn.cancelled`, then
74
+ * `session.waiting`. Returns `void` because the turn stops after the hook
75
+ * returns; call it before the handler's promise settles.
76
+ *
77
+ * eve logs a warning and ignores the call when the event cannot stop a
78
+ * running turn (`step.failed`, turn and session terminal events,
79
+ * `context.cleared`, `subagent.*`, and clear or compact requests) or when
80
+ * it arrives after the event's hooks returned.
81
+ */
82
+ cancel(): void;
71
83
  }
72
84
  /**
73
85
  * Side-effect-only handler for one accepted runtime stream event.
@@ -15,8 +15,8 @@ export interface StateHandle<T> {
15
15
  * Creates a typed, named state slot backed by a durable `ContextKey`.
16
16
  * `initial()` produces the value on first access within a context.
17
17
  *
18
- * The name must not start with the reserved `"eve."` prefix (reserved
19
- * for framework context keys); doing so throws.
18
+ * Names starting with `"eve."` or `"eve:mount."` are reserved for framework
19
+ * context keys; using either prefix throws.
20
20
  *
21
21
  * All operations require an active eve context. Calling `get()` or
22
22
  * `update()` outside of tools, hooks, or other framework-managed code
@@ -35,3 +35,5 @@ export interface StateHandle<T> {
35
35
  * ```
36
36
  */
37
37
  export declare function defineState<T>(name: string, initial: () => T): StateHandle<T>;
38
+ /** Internal registration of generated, mount-owned keys. */
39
+ export declare function defineMountedState<T>(mountId: string, name: string, initial: () => T): StateHandle<T>;
@@ -1 +1 @@
1
- import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const RESERVED_STATE_NAME_PREFIX=`eve.`;function defineState(e,t){if(e.startsWith(RESERVED_STATE_NAME_PREFIX))throw Error(`defineState() name "${e}" uses the reserved "${RESERVED_STATE_NAME_PREFIX}" prefix, which eve reserves for its own framework context keys (e.g. "eve.channel", "eve.bundle"). Colliding with one silently corrupts context serialization. Use your own namespace, e.g. "my-agent.${e.slice(4)}".`);let n=new ContextKey(e);return{get(){return loadContext().ensure(n,t)},update(e){let r=loadContext(),i=r.ensure(n,t);r.set(n,e(i))}}}export{defineState};
1
+ import{loadContext}from"#context/container.js";import{ContextKey}from"#context/key.js";const RESERVED_STATE_NAME_PREFIXES=[`eve.`,`eve:mount.`];function defineState(e,t){let n=RESERVED_STATE_NAME_PREFIXES.find(t=>e.startsWith(t));if(n!==void 0)throw Error(`defineState() name "${e}" uses the reserved "${n}" prefix. Use an application-owned namespace instead.`);return createStateHandle(e,t)}function defineMountedState(e,t,n){return createStateHandle(`eve:mount.v1:${encodeURIComponent(e)}:${encodeURIComponent(t)}`,n)}function createStateHandle(e,t){let n=new ContextKey(e);return{get(){return loadContext().ensure(n,t)},update(e){let r=loadContext(),i=r.ensure(n,t);r.set(n,e(i))}}}export{defineMountedState,defineState};
@@ -83,7 +83,6 @@ export interface MemoryToolsContext extends DynamicResolveContext {
83
83
  export interface MemoryToolDefinition {
84
84
  readonly approval?: Approval<never>;
85
85
  readonly description: string;
86
- readonly execution?: never;
87
86
  execute(input: never, context: ToolContext): unknown | Promise<unknown> | AsyncIterable<unknown>;
88
87
  readonly inputSchema: unknown;
89
88
  readonly outputSchema?: unknown;
@@ -3,7 +3,7 @@ import type { LanguageModel } from "ai";
3
3
  * Creates a language model billed to the local ChatGPT subscription instead
4
4
  * of an API key. Sign in through `/login` in `eve dev`.
5
5
  *
6
- * Defaults to `gpt-5.6-luna-fast`. Pass a bare OpenAI model slug or an
6
+ * Defaults to `gpt-6-luna-fast`. Pass a bare OpenAI model slug or an
7
7
  * `openai/`-prefixed id to override it; the Codex backend serves OpenAI models
8
8
  * only, so any other provider-qualified id is rejected. Model availability is
9
9
  * enforced by the Codex backend per account at call time, not at compile time.
@@ -1 +1 @@
1
- import{createCodexSubscriptionModel}from"./chatgpt/model.js";import{createDirectModelFetch}from"#internal/model-auth/transport.js";import{DEFAULT_CHATGPT_MODEL_ID,normalizeChatGptModelId}from"#shared/chatgpt-model.js";import{createOpenAI}from"#compiled/@ai-sdk/openai/index.js";function chatgpt(e=DEFAULT_CHATGPT_MODEL_ID){let t=normalizeChatGptModelId(e);if(t===void 0&&e.trim().replace(/^openai\//u,``).length===0)throw Error(`Expected chatgpt "model" to name an OpenAI model, for example "gpt-5.6-sol".`);if(t===void 0)throw Error(`chatgpt serves OpenAI models through the local ChatGPT login; received "${e}".`);return createCodexSubscriptionModel({model:t})}const experimental_chatgpt=chatgpt;function openai(e=`gpt-5.6-luna-fast`){let t=e.trim().replace(/^openai\//u,``);if(!t||t.includes(`/`))throw Error(`Expected an OpenAI model ID.`);return createOpenAI({apiKey:`eve-local-credential`,fetch:createDirectModelFetch(`openai`)}).responses(t)}export{chatgpt,experimental_chatgpt,openai};
1
+ import{createCodexSubscriptionModel}from"./chatgpt/model.js";import{createDirectModelFetch}from"#internal/model-auth/transport.js";import{MODEL_HELPERS}from"#shared/model-helper.js";import{DEFAULT_CHATGPT_MODEL_ID,normalizeChatGptModelId}from"#shared/chatgpt-model.js";import{createOpenAI}from"#compiled/@ai-sdk/openai/index.js";function chatgpt(e=DEFAULT_CHATGPT_MODEL_ID){let t=normalizeChatGptModelId(e);if(t===void 0&&e.trim().replace(/^openai\//u,``).length===0)throw Error(`Expected chatgpt "model" to name an OpenAI model, for example "gpt-5.6-sol".`);if(t===void 0)throw Error(`chatgpt serves OpenAI models through the local ChatGPT login; received "${e}".`);return createCodexSubscriptionModel({model:t})}const experimental_chatgpt=chatgpt;function openai(e=MODEL_HELPERS.openai.defaultModel){let t=e.trim().replace(/^openai\//u,``);if(!t||t.includes(`/`))throw Error(`Expected an OpenAI model ID.`);return createOpenAI({apiKey:`eve-local-credential`,fetch:createDirectModelFetch(`openai`)}).responses(t)}export{chatgpt,experimental_chatgpt,openai};
@@ -2,3 +2,4 @@
2
2
  * Schedule authoring helpers for `agent/schedules/*` files.
3
3
  */
4
4
  export { defineSchedule, type ScheduleDefinition, type ScheduleHandlerArgs, type ScheduleRunHandler, type ScheduleToFn, type TypedReceiveTarget, } from "#public/definitions/schedule.js";
5
+ export { isScheduleAuth } from "#channel/schedule-auth.js";
@@ -1 +1 @@
1
- import{defineSchedule}from"#public/definitions/schedule.js";export{defineSchedule};
1
+ import{isScheduleAuth}from"#channel/schedule-auth.js";import{defineSchedule}from"#public/definitions/schedule.js";export{defineSchedule,isScheduleAuth};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Server-side session access for code running inside an eve deployment,
3
+ * such as hooks, tools, schedules, and channel routes.
4
+ */
5
+ import { type SessionEventStreamOptions } from "#execution/session-event-stream.js";
6
+ import type { MessageStreamEvent } from "#protocol/message.js";
7
+ /** Options for {@link ServerSession.stream}. */
8
+ export type ServerSessionStreamOptions = SessionEventStreamOptions;
9
+ /** A handle to one session's durable event stream, read in process. */
10
+ export interface ServerSession {
11
+ readonly sessionId: string;
12
+ /**
13
+ * Reads the session's events in stream order. With `follow: false`, the read
14
+ * ends at the durable tail observed when it opens.
15
+ */
16
+ stream(options?: ServerSessionStreamOptions): AsyncIterable<MessageStreamEvent>;
17
+ }
18
+ /**
19
+ * Reads session streams in process, without calling the deployment's own
20
+ * HTTP stream route.
21
+ *
22
+ * Available only in code running inside the eve server, where the session
23
+ * store is configured. It reads any session ID without channel auth, so check
24
+ * that the caller may read a session before passing an ID from a request.
25
+ */
26
+ export declare const sessions: {
27
+ attach(sessionId: string): ServerSession;
28
+ };
@@ -0,0 +1 @@
1
+ import{streamSessionEvents}from"#execution/session-event-stream.js";const sessions={attach(e){return{sessionId:e,stream:t=>streamSessionEvents(e,t)}}};export{sessions};
@@ -4,11 +4,12 @@
4
4
  export { type DisabledToolSentinel, defineTool, disableTool, isDisabledToolSentinel, type ToolLabelDefinition, type ToolAuthOptions, type ToolAuthProvider, type ToolDefinition, type ToolContext, type ToolModelOutput, type ToolModelOutputPart, } from "#tools/definition.js";
5
5
  export { defineDynamic } from "#dynamic/definition.js";
6
6
  export { defineDurableSchema } from "#tools/durable-schema.js";
7
+ export { serializeModelInputSchema } from "#tools/schema.js";
7
8
  export { defineDurableCallback } from "#tools/durable-callbacks.js";
8
9
  export { toolOutput, toolOutputPart } from "#tools/model-output.js";
9
10
  export type { DynamicEvents, DynamicResolveContext, DynamicSentinel } from "#dynamic/definition.js";
10
11
  export type { DynamicToolEntry, DynamicToolEvents, DynamicToolSet, DynamicToolResult, } from "#tools/dynamic.js";
11
12
  export { type SessionContext } from "#public/definitions/callback-context.js";
12
13
  export { toolResultFrom, type MatchedConnectionResult, type MatchedToolResult, type ToolResultFromFn, } from "#public/tools/result.js";
13
- export { defineWorkflowTool, type WorkflowStepToolContext, type TaskReceipt, type WorkflowToolContext, type WorkflowToolDefinition, type AgentInput, type WorkflowAgentMetadata, } from "#tools/workflow-definition.js";
14
- export type { ToolInputRequest, ToolInputResponse } from "#tools/definition.js";
14
+ export { defineWorkflowTool, type WorkflowExecuteToolDefinition, type WorkflowServeCall, type WorkflowServeContext, type WorkflowServeReceive, type WorkflowServeToolDefinition, type WorkflowStepToolContext, type WorkflowTaskToolDefinition, type WorkflowToolContext, type WorkflowToolDefinition, type AgentMessageResult, type AgentResponse, type AgentSendOptions, type AgentSession, type WorkflowAgentMetadata, } from "#tools/workflow-definition.js";
15
+ export type { ToolInputRequest, ToolInputRequestOptions, ToolInputResponse, } from "#tools/definition.js";
@@ -1 +1 @@
1
- import{defineDynamic}from"#dynamic/definition.js";import{defineDurableCallback}from"#tools/durable-callbacks.js";import{defineDurableSchema}from"#tools/durable-schema.js";import{defineWorkflowTool}from"#tools/workflow-definition.js";import{defineTool,disableTool,isDisabledToolSentinel}from"#tools/definition.js";import{toolOutput,toolOutputPart}from"#tools/model-output.js";import{toolResultFrom}from"#public/tools/result.js";export{defineDurableCallback,defineDurableSchema,defineDynamic,defineTool,defineWorkflowTool,disableTool,isDisabledToolSentinel,toolOutput,toolOutputPart,toolResultFrom};
1
+ import{serializeModelInputSchema}from"#tools/schema.js";import{defineDynamic}from"#dynamic/definition.js";import{defineDurableCallback}from"#tools/durable-callbacks.js";import{defineDurableSchema}from"#tools/durable-schema.js";import{defineWorkflowTool}from"#tools/workflow-definition.js";import{defineTool,disableTool,isDisabledToolSentinel}from"#tools/definition.js";import{toolOutput,toolOutputPart}from"#tools/model-output.js";import{toolResultFrom}from"#public/tools/result.js";export{defineDurableCallback,defineDurableSchema,defineDynamic,defineTool,defineWorkflowTool,disableTool,isDisabledToolSentinel,serializeModelInputSchema,toolOutput,toolOutputPart,toolResultFrom};
@@ -0,0 +1 @@
1
+ export { type NoReplyToolInput, noReply } from "#tools/provided/no-reply.js";
@@ -0,0 +1 @@
1
+ import{noReply}from"#tools/provided/no-reply.js";export{noReply};
@@ -29,18 +29,17 @@ export declare function getPromptContentText(content: BootstrapPrompt[number]["c
29
29
  /**
30
30
  * Returns the text from the last user message in the prompt, or `null`.
31
31
  *
32
- * Skips framework-injected `[Agents]` announcements: they ride the user
33
- * role in conversation history, but they are not authored input and must
32
+ * Skips framework-injected `[Tasks]` notes and task results: they ride the
33
+ * user role in conversation history, but they are not authored input and must
34
34
  * not drive mock directive parsing.
35
35
  */
36
36
  export declare function getLastUserPromptText(prompt: BootstrapPrompt): string | null;
37
37
  /**
38
- * True when the text is a framework-injected `[Agents]` announcement.
39
- * Announcements are user-role scaffolding, not authored input: mock model
40
- * heuristics must scan past them instead of treating them as the turn's
41
- * message or as a turn boundary.
38
+ * True when the text is a framework-injected `[Tasks]` note or task result:
39
+ * user-role scaffolding, not authored input. Mock model heuristics must scan
40
+ * past it instead of treating it as the turn's message or as a turn boundary.
42
41
  */
43
- export declare function isAgentsAnnouncementText(text: string): boolean;
42
+ export declare function isFrameworkAnnouncementText(text: string): boolean;
44
43
  /**
45
44
  * Joins all message content in the prompt into a single string.
46
45
  */
@@ -1 +1 @@
1
- import{AGENTS_SNIPPET_LABEL}from"#subagents/handles/prompt.js";const BOOTSTRAP_RESPONSE_TIMESTAMP=new Date(`2026-03-16T00:00:00.000Z`);function createBootstrapGenerateResult(e){return{content:[{text:e.text,type:`text`}],finishReason:{raw:void 0,unified:`stop`},response:{id:`bootstrap-response`,modelId:e.modelId,timestamp:BOOTSTRAP_RESPONSE_TIMESTAMP},usage:{inputTokens:{cacheRead:0,cacheWrite:0,noCache:e.inputTokens,total:e.inputTokens},outputTokens:{reasoning:0,text:e.outputTokens,total:e.outputTokens}},warnings:[]}}function createBootstrapStreamResult(e){let t=[{type:`stream-start`,warnings:e.warnings}];e.response!==void 0&&t.push({...e.response,type:`response-metadata`});let n=0;for(let r of e.content)switch(r.type){case`text`:{let e=`text_${n}`;n+=1,t.push({id:e,type:`text-start`}),r.text.length>0&&t.push({delta:r.text,id:e,type:`text-delta`}),t.push({id:e,type:`text-end`});break}case`tool-call`:t.push(r)}return t.push({finishReason:e.finishReason,type:`finish`,usage:e.usage}),{stream:new ReadableStream({start(e){for(let n of t)e.enqueue(n);e.close()}})}}function estimateTokenCount(e){return Math.max(1,Math.ceil(e.trim().length/4))}function getPromptContentText(e){return typeof e==`string`?e:e.flatMap(e=>{if(typeof e==`string`)return[e];switch(e.type){case`text`:return[e.text];default:return[]}}).join(``)}function getLastUserPromptText(e){for(let t of[...e].reverse()){if(t.role!==`user`)continue;let e=getPromptContentText(t.content).trim();if(!isAgentsAnnouncementText(e)&&e.length>0)return e}return null}function isAgentsAnnouncementText(e){return e.startsWith(AGENTS_SNIPPET_LABEL)}function getPromptText(e){return e.map(e=>getPromptContentText(e.content)).join(` `)}export{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText,isAgentsAnnouncementText};
1
+ import{TASKS_NOTE_LABEL,TASK_RESULT_TAG}from"#execution/tasks/render.js";const BOOTSTRAP_RESPONSE_TIMESTAMP=new Date(`2026-03-16T00:00:00.000Z`);function createBootstrapGenerateResult(e){return{content:[{text:e.text,type:`text`}],finishReason:{raw:void 0,unified:`stop`},response:{id:`bootstrap-response`,modelId:e.modelId,timestamp:BOOTSTRAP_RESPONSE_TIMESTAMP},usage:{inputTokens:{cacheRead:0,cacheWrite:0,noCache:e.inputTokens,total:e.inputTokens},outputTokens:{reasoning:0,text:e.outputTokens,total:e.outputTokens}},warnings:[]}}function createBootstrapStreamResult(e){let t=[{type:`stream-start`,warnings:e.warnings}];e.response!==void 0&&t.push({...e.response,type:`response-metadata`});let n=0;for(let r of e.content)switch(r.type){case`text`:{let e=`text_${n}`;n+=1,t.push({id:e,type:`text-start`}),r.text.length>0&&t.push({delta:r.text,id:e,type:`text-delta`}),t.push({id:e,type:`text-end`});break}case`tool-call`:t.push(r)}return t.push({finishReason:e.finishReason,type:`finish`,usage:e.usage}),{stream:new ReadableStream({start(e){for(let n of t)e.enqueue(n);e.close()}})}}function estimateTokenCount(e){return Math.max(1,Math.ceil(e.trim().length/4))}function getPromptContentText(e){return typeof e==`string`?e:e.flatMap(e=>{if(typeof e==`string`)return[e];switch(e.type){case`text`:return[e.text];default:return[]}}).join(``)}function getLastUserPromptText(e){for(let t of[...e].reverse()){if(t.role!==`user`)continue;let e=getPromptContentText(t.content).trim();if(!isFrameworkAnnouncementText(e)&&e.length>0)return e}return null}function isFrameworkAnnouncementText(e){return e.startsWith(TASKS_NOTE_LABEL)||e.startsWith(TASK_RESULT_TAG)}function getPromptText(e){return e.map(e=>getPromptContentText(e.content)).join(` `)}export{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText,isFrameworkAnnouncementText};
@@ -64,7 +64,6 @@ export declare const BOOTSTRAP_RUNTIME_SYSTEM_PROMPT = "You are the eve bootstra
64
64
  */
65
65
  export declare function createResolvedRuntimeTurnAgent(input: {
66
66
  readonly agent: ResolvedAgent;
67
- readonly dynamicSubagentsAvailable?: boolean;
68
67
  readonly id?: string;
69
68
  readonly nodeId?: string;
70
69
  readonly tools: readonly PreparedRuntimeTool[];
@@ -1 +1 @@
1
- import{createFrameworkUserMessage}from"#harness/messages.js";import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(e){let t=e.agent,n=t.config,r=e.id??n?.name;if(r===void 0)throw Error(`Expected a path-derived agent id while resolving agent resources.`);let i=e.tools.some(e=>e.kind===`subagent`||e.kind===`remote`),a=e.tools.some(e=>e.behavior?.handling?.kind===`dispatch`&&e.behavior.handling.target.kind===`self-agent-call`),o={availableSkills:t.skills.map(e=>({description:e.description,name:e.name})),id:r,initialMessages:t.instructions.filter(e=>e.role===`user`&&e.content.trim().length>0).map(e=>createFrameworkUserMessage(`context.instruction`,e.content.trim())),instructions:composeRuntimeBasePrompt({connections:t.connections,instructions:t.instructions,subagentsAvailable:e.dynamicSubagentsAvailable===!0||i||a,toolsAvailable:e.tools.length>0,workspaceSpec:t.workspaceSpec}),compactionModel:n?.compaction?.model,nodeId:e.nodeId,reasoning:n?.reasoning,tools:[...e.tools],workspaceSpec:t.workspaceSpec};return n===void 0?{...o,configResolver:!0}:n.dynamicModel===void 0?{...o,model:n.model}:{...o,dynamicModel:n.dynamicModel}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};
1
+ import{createFrameworkUserMessage}from"#harness/messages.js";import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(e){let t=e.agent,n=t.config,r=e.id??n?.name;if(r===void 0)throw Error(`Expected a path-derived agent id while resolving agent resources.`);let i={availableSkills:t.skills.map(e=>({description:e.description,name:e.name})),id:r,initialMessages:t.instructions.filter(e=>e.role===`user`&&e.content.trim().length>0).map(e=>createFrameworkUserMessage(`context.instruction`,e.content.trim())),instructions:composeRuntimeBasePrompt({instructions:t.instructions,toolsAvailable:e.tools.length>0,workspaceSpec:t.workspaceSpec}),compactionModel:n?.compaction?.model,nodeId:e.nodeId,reasoning:n?.reasoning,tools:[...e.tools],workspaceSpec:t.workspaceSpec};return n===void 0?{...i,configResolver:!0}:n.dynamicModel===void 0?{...i,model:n.model}:{...i,dynamicModel:n.dynamicModel}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};
@@ -1,4 +1,4 @@
1
- import{z}from"#compiled/zod/index.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{MockLanguageModelV3}from"ai/test";import{FINAL_OUTPUT_TOOL_NAME}from"#harness/final-output.js";import{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText,isAgentsAnnouncementText}from"#runtime/agent/bootstrap-model-utils.js";import{createMockAuthoredToolInput,formatToolOutput,resolveMockFixtureToken,resolveWeatherCity}from"#runtime/agent/mock-model-fixtures.js";import{findRelevantSkill,getActivatedSkillIds,getAvailableSkills}from"#runtime/agent/mock-model-skill-selection.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";const authoredRuntimeModelMocks=new Map,bootstrapWeatherPayloadSchema=z.object({city:z.string(),condition:z.string(),summary:z.string(),temperatureF:z.number().finite()}).strict();function shouldMockAuthoredRuntimeModels(){return process.env.NODE_ENV===`test`||process.env.EVE_MOCK_AUTHORED_MODELS===`1`}function createMockAuthoredRuntimeModel(e){let t=authoredRuntimeModelMocks.get(e.id);if(t!==void 0)return t;let n=new MockLanguageModelV3({modelId:e.id,provider:`eve-runtime-mock`,doGenerate:async t=>createMockModelResult(t,e.id),doStream:async t=>createBootstrapStreamResult(createMockModelResult(t,e.id))});return authoredRuntimeModelMocks.set(e.id,n),n}function createMockModelResult(e,t){let n=getLastAuthoredToolResult(e.prompt);if(n!==null){let r=createFollowUpToolCallResult({modelId:t,options:e,result:n});if(r!==null)return r}else{let n=createParallelAuthoredToolCallsResult(e,t)??createSubagentDelegationResult(e,t)??createSkillLoadResult(e.prompt,t)??createAuthoredToolCallResult(e,t);if(n!==null)return n}let r=createFinalOutputResult(e,t);if(r!==null)return r;let i=n===null?createAssistantMessage(e.prompt):formatToolResultReply(n,e.prompt);return createBootstrapGenerateResult({inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(i),text:i})}function createFinalOutputResult(e,t){let n=getAvailableTools(e).find(e=>e.name===FINAL_OUTPUT_TOOL_NAME);if(n===void 0)return null;let r=createJsonSchemaSample(n.inputSchema);return createToolCallGenerateResult({input:r,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(JSON.stringify(r)),toolCallId:createToolCallId(FINAL_OUTPUT_TOOL_NAME),toolName:FINAL_OUTPUT_TOOL_NAME})}function resolveMockAuthoredRuntimeModel(e){return!shouldMockAuthoredRuntimeModels()||e.id===BOOTSTRAP_RUNTIME_MODEL_ID?null:createMockAuthoredRuntimeModel(e)}function createSkillLoadResult(e,t){let n=getLastUserPromptText(e);if(n===null||getActivatedSkillIds(e).length>0)return null;let r=findRelevantSkill(getAvailableSkills(e),n);return r===null?null:createToolCallGenerateResult({input:{skill:r.name},inputTokens:estimateTokenCount(getPromptText(e)),modelId:t,outputTokens:estimateTokenCount(r.name),toolCallId:`call_load_skill`,toolName:LOAD_SKILL_TOOL_NAME})}const SUBAGENT_DELEGATION_DIRECTIVE=/\bdelegate\s+to\s+a\s+subagent\s*:\s*(.+)$/iu,PARALLEL_AUTHORED_TOOLS_DIRECTIVE=/^call tools in parallel:\s*(.+)$/imu;function createParallelAuthoredToolCallsResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null)return null;let r=PARALLEL_AUTHORED_TOOLS_DIRECTIVE.exec(n)?.[1]?.split(`,`).map(e=>e.trim()).filter(Boolean);if(r===void 0||r.length<2||new Set(r).size!==r.length)return null;let i=new Map(getAvailableTools(e).map(e=>[e.name,e])),a=[];for(let e of r){let t=i.get(e);if(t===void 0)return null;a.push(t)}let o=resolveWeatherCity(n);return createToolCallsGenerateResult({calls:a.map(e=>({input:createMockAuthoredToolInput(e,n,o),toolCallId:createToolCallId(e.name),toolName:e.name})),inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(n)})}function createSubagentDelegationResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null)return null;let r=SUBAGENT_DELEGATION_DIRECTIVE.exec(n);if(r?.[1]===void 0)return null;let i=`agent`;if(getAvailableTools(e).find(e=>e.name===i)===void 0)return null;let a=r[1].trim();return createToolCallGenerateResult({input:{message:a},inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(a),toolCallId:createToolCallId(i),toolName:i})}function createAuthoredToolCallResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null||/^Background task task_[a-z0-9]+\b/iu.test(n))return null;let r=findRelevantTool(getAvailableTools(e),n);if(r===null)return null;let i=resolveWeatherCity(n),a=createMockAuthoredToolInput(r,n,i);return createToolCallGenerateResult({input:a,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(Object.values(a).join(` `)),toolCallId:createToolCallId(r.name),toolName:r.name})}function createFollowUpToolCallResult(e){let t=findNextExplicitToolAfterResult({previousToolName:e.result.toolName,prompt:e.options.prompt,tools:getAvailableTools(e.options)});if(t===null)return null;let n=createFollowUpToolInput(e.result.output);return n===null?null:createToolCallGenerateResult({input:n,inputTokens:estimateTokenCount(getPromptText(e.options.prompt)),modelId:e.modelId,outputTokens:estimateTokenCount(Object.values(n).join(` `)),toolCallId:createToolCallId(t.name),toolName:t.name})}function createAssistantMessage(e){let t=getLastUserPromptText(e)??`Hello from eve`,n=getSystemPromptLabels(e),r=resolveSystemProbe(e),i=resolveMockFixtureToken(e);return i===null?n.length>0?r===null?`Bootstrap reply [${n.join(`, `)}]: ${t}`:`Bootstrap reply [${n.join(`, `)}; probe=${r}]: ${t}`:r===null?`Bootstrap reply: ${t}`:`Bootstrap reply [probe=${r}]: ${t}`:i}function formatToolResultReply(e,t){if(e.isError)return`Local weather tool failed: ${formatToolOutput(e.output)}`;if(isWeatherPayload(e.output))return`Used local weather tool for ${e.output.city}: ${e.output.condition}, ${e.output.temperatureF}F. ${e.output.summary}`;let n=getLastUserPromptText(t)??`Hello from eve`;return`Used ${e.toolName} for "${n}": ${formatToolOutput(e.output)}`}function createToolCallGenerateResult(e){return createToolCallsGenerateResult({calls:[{input:e.input,toolCallId:e.toolCallId,toolName:e.toolName}],inputTokens:e.inputTokens,modelId:e.modelId,outputTokens:e.outputTokens})}function createToolCallsGenerateResult(e){return{content:e.calls.map(e=>({input:JSON.stringify(e.input),toolCallId:e.toolCallId,toolName:e.toolName,type:`tool-call`})),finishReason:{raw:void 0,unified:`tool-calls`},response:{id:`bootstrap-response`,modelId:e.modelId,timestamp:new Date(`2026-03-16T00:00:00.000Z`)},usage:{inputTokens:{cacheRead:0,cacheWrite:0,noCache:e.inputTokens,total:e.inputTokens},outputTokens:{reasoning:0,text:e.outputTokens,total:e.outputTokens}},warnings:[]}}function getAvailableTools(e){return(e.tools??[]).flatMap(e=>e.type===`function`?[{description:e.description,inputSchema:`inputSchema`in e?e.inputSchema:void 0,name:e.name,outputSchema:`outputSchema`in e?e.outputSchema:void 0}]:[])}function getLastAuthoredToolResult(e){for(let t of[...e].reverse()){if(t.role===`user`){if(isAgentsAnnouncementText(getPromptContentText(t.content).trim()))continue;return null}if(t.role===`tool`||t.role===`assistant`){for(let e of[...t.content].reverse())if(typeof e!=`string`&&e.type===`tool-result`&&e.toolName!==LOAD_SKILL_TOOL_NAME)return{isError:e.output.type===`error-json`||e.output.type===`error-text`||e.output.type===`execution-denied`,output:e.output.type===`execution-denied`?{reason:e.output.reason??null,type:e.output.type}:e.output.value,toolCallId:e.toolCallId,toolName:e.toolName}}}return null}function findNextExplicitToolAfterResult(e){let t=getLastUserPromptText(e.prompt);if(t===null)return null;let n=normalizeText(t),r=n.indexOf(normalizeText(e.previousToolName));return r<0?null:e.tools.filter(t=>t.name!==e.previousToolName).flatMap(e=>{let t=n.indexOf(normalizeText(e.name),r+1);return t<0?[]:[{index:t,tool:e}]}).sort((e,t)=>e.index-t.index)[0]?.tool??null}function createFollowUpToolInput(e){return isRecord(e)&&typeof e.stepKey==`string`?{stepKey:e.stepKey}:null}function getSystemPromptLabels(e){let t=e.filter(e=>e.role===`system`);if(t.length===0)return[];let n=t.flatMap(e=>{let t=getPromptContentText(e.content);if(t.startsWith(`Available skills
1
+ import{z}from"#compiled/zod/index.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{MockLanguageModelV3}from"ai/test";import{readTaskResults}from"#execution/tasks/render.js";import{FINAL_OUTPUT_TOOL_NAME}from"#harness/final-output.js";import{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText,isFrameworkAnnouncementText}from"#runtime/agent/bootstrap-model-utils.js";import{createMockAuthoredToolInput,formatToolOutput,resolveMockFixtureToken,resolveWeatherCity}from"#runtime/agent/mock-model-fixtures.js";import{findRelevantSkill,getActivatedSkillIds,getAvailableSkills}from"#runtime/agent/mock-model-skill-selection.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";const authoredRuntimeModelMocks=new Map,bootstrapWeatherPayloadSchema=z.object({city:z.string(),condition:z.string(),summary:z.string(),temperatureF:z.number().finite()}).strict();function shouldMockAuthoredRuntimeModels(){return process.env.NODE_ENV===`test`||process.env.EVE_MOCK_AUTHORED_MODELS===`1`}function createMockAuthoredRuntimeModel(e){let t=authoredRuntimeModelMocks.get(e.id);if(t!==void 0)return t;let n=new MockLanguageModelV3({modelId:e.id,provider:`eve-runtime-mock`,doGenerate:async t=>createMockModelResult(t,e.id),doStream:async t=>createBootstrapStreamResult(createMockModelResult(t,e.id))});return authoredRuntimeModelMocks.set(e.id,n),n}function createMockModelResult(e,t){let n=getLastAuthoredToolResult(e.prompt);if(n!==null){let r=createFollowUpToolCallResult({modelId:t,options:e,result:n});if(r!==null)return r}else{let n=createParallelAuthoredToolCallsResult(e,t)??createSubagentDelegationResult(e,t)??createSkillLoadResult(e.prompt,t)??createAuthoredToolCallResult(e,t);if(n!==null)return n}let r=createFinalOutputResult(e,t);if(r!==null)return r;let i=n===null?createAssistantMessage(e.prompt):formatToolResultReply(n,e.prompt);return createBootstrapGenerateResult({inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(i),text:i})}function createFinalOutputResult(e,t){let n=getAvailableTools(e).find(e=>e.name===FINAL_OUTPUT_TOOL_NAME);if(n===void 0)return null;let r=createJsonSchemaSample(n.inputSchema);return createToolCallGenerateResult({input:r,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(JSON.stringify(r)),toolCallId:createToolCallId(FINAL_OUTPUT_TOOL_NAME),toolName:FINAL_OUTPUT_TOOL_NAME})}function resolveMockAuthoredRuntimeModel(e){return!shouldMockAuthoredRuntimeModels()||e.id===BOOTSTRAP_RUNTIME_MODEL_ID?null:createMockAuthoredRuntimeModel(e)}function createSkillLoadResult(e,t){let n=getLastUserPromptText(e);if(n===null||getActivatedSkillIds(e).length>0)return null;let r=findRelevantSkill(getAvailableSkills(e),n);return r===null?null:createToolCallGenerateResult({input:{skill:r.name},inputTokens:estimateTokenCount(getPromptText(e)),modelId:t,outputTokens:estimateTokenCount(r.name),toolCallId:`call_load_skill`,toolName:LOAD_SKILL_TOOL_NAME})}const SUBAGENT_DELEGATION_DIRECTIVE=/\bdelegate\s+to\s+a\s+subagent\s*:\s*(.+)$/iu,PARALLEL_AUTHORED_TOOLS_DIRECTIVE=/^call tools in parallel:\s*(.+)$/imu;function createParallelAuthoredToolCallsResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null)return null;let r=PARALLEL_AUTHORED_TOOLS_DIRECTIVE.exec(n)?.[1]?.split(`,`).map(e=>e.trim()).filter(Boolean);if(r===void 0||r.length<2||new Set(r).size!==r.length)return null;let i=new Map(getAvailableTools(e).map(e=>[e.name,e])),a=[];for(let e of r){let t=i.get(e);if(t===void 0)return null;a.push(t)}let o=resolveWeatherCity(n);return createToolCallsGenerateResult({calls:a.map(e=>({input:createMockAuthoredToolInput(e,n,o),toolCallId:createToolCallId(e.name),toolName:e.name})),inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(n)})}function createSubagentDelegationResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null)return null;let r=SUBAGENT_DELEGATION_DIRECTIVE.exec(n);if(r?.[1]===void 0)return null;let i=`agent`;if(getAvailableTools(e).find(e=>e.name===i)===void 0)return null;let a=r[1].trim();return createToolCallGenerateResult({input:{message:a},inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(a),toolCallId:createToolCallId(i),toolName:i})}function createAuthoredToolCallResult(e,t){let n=getLastUserPromptText(e.prompt);if(n===null)return null;let r=findRelevantTool(getAvailableTools(e),n);if(r===null)return null;let i=resolveWeatherCity(n),a=createMockAuthoredToolInput(r,n,i);return createToolCallGenerateResult({input:a,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(Object.values(a).join(` `)),toolCallId:createToolCallId(r.name),toolName:r.name})}function createFollowUpToolCallResult(e){let t=findNextExplicitToolAfterResult({previousToolName:e.result.toolName,prompt:e.options.prompt,tools:getAvailableTools(e.options)});if(t===null)return null;let n=createFollowUpToolInput(e.result.output);return n===null?null:createToolCallGenerateResult({input:n,inputTokens:estimateTokenCount(getPromptText(e.options.prompt)),modelId:e.modelId,outputTokens:estimateTokenCount(Object.values(n).join(` `)),toolCallId:createToolCallId(t.name),toolName:t.name})}function createAssistantMessage(e){let t=getLastUserPromptText(e)??`Hello from eve`,n=getSystemPromptLabels(e),r=resolveSystemProbe(e),i=resolveMockFixtureToken(e);return i===null?n.length>0?r===null?`Bootstrap reply [${n.join(`, `)}]: ${t}`:`Bootstrap reply [${n.join(`, `)}; probe=${r}]: ${t}`:r===null?`Bootstrap reply: ${t}`:`Bootstrap reply [probe=${r}]: ${t}`:i}function formatToolResultReply(e,t){if(e.isError)return`Local weather tool failed: ${formatToolOutput(e.output)}`;if(isWeatherPayload(e.output))return`Used local weather tool for ${e.output.city}: ${e.output.condition}, ${e.output.temperatureF}F. ${e.output.summary}`;let n=getLastUserPromptText(t)??`Hello from eve`;return`Used ${e.toolName} for "${n}": ${formatToolOutput(e.output)}`}function createToolCallGenerateResult(e){return createToolCallsGenerateResult({calls:[{input:e.input,toolCallId:e.toolCallId,toolName:e.toolName}],inputTokens:e.inputTokens,modelId:e.modelId,outputTokens:e.outputTokens})}function createToolCallsGenerateResult(e){return{content:e.calls.map(e=>({input:JSON.stringify(e.input),toolCallId:e.toolCallId,toolName:e.toolName,type:`tool-call`})),finishReason:{raw:void 0,unified:`tool-calls`},response:{id:`bootstrap-response`,modelId:e.modelId,timestamp:new Date(`2026-03-16T00:00:00.000Z`)},usage:{inputTokens:{cacheRead:0,cacheWrite:0,noCache:e.inputTokens,total:e.inputTokens},outputTokens:{reasoning:0,text:e.outputTokens,total:e.outputTokens}},warnings:[]}}function getAvailableTools(e){return(e.tools??[]).flatMap(e=>e.type===`function`?[{description:e.description,inputSchema:`inputSchema`in e?e.inputSchema:void 0,name:e.name,outputSchema:`outputSchema`in e?e.outputSchema:void 0}]:[])}function getLastAuthoredToolResult(e){for(let t of[...e].reverse()){if(t.role===`user`){let e=getPromptContentText(t.content).trim(),n=readTaskResults(e).at(-1);if(n!==void 0){let{body:e,taskId:t,tool:r}=n;return{isError:n.status===`failed`,output:e,toolCallId:t,toolName:r}}if(isFrameworkAnnouncementText(e))continue;return null}if(t.role===`tool`||t.role===`assistant`){for(let e of[...t.content].reverse())if(typeof e!=`string`&&e.type===`tool-result`&&e.toolName!==LOAD_SKILL_TOOL_NAME)return{isError:e.output.type===`error-json`||e.output.type===`error-text`||e.output.type===`execution-denied`,output:e.output.type===`execution-denied`?{reason:e.output.reason??null,type:e.output.type}:e.output.value,toolCallId:e.toolCallId,toolName:e.toolName}}}return null}function findNextExplicitToolAfterResult(e){let t=getLastUserPromptText(e.prompt);if(t===null)return null;let n=normalizeText(t),r=n.indexOf(normalizeText(e.previousToolName));return r<0?null:e.tools.filter(t=>t.name!==e.previousToolName).flatMap(e=>{let t=n.indexOf(normalizeText(e.name),r+1);return t<0?[]:[{index:t,tool:e}]}).sort((e,t)=>e.index-t.index)[0]?.tool??null}function createFollowUpToolInput(e){return isRecord(e)&&typeof e.stepKey==`string`?{stepKey:e.stepKey}:null}function getSystemPromptLabels(e){let t=e.filter(e=>e.role===`system`);if(t.length===0)return[];let n=t.flatMap(e=>{let t=getPromptContentText(e.content);if(t.startsWith(`Available skills
2
2
  `))return[];let n=t.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0),r=[];for(let e of n){if(e===BOOTSTRAP_RUNTIME_SYSTEM_PROMPT||e===`Available skills`)continue;let t=/^System \((.+)\)$/.exec(e);if(t?.[1]){r.push(t[1]);continue}let n=/^Skill \((.+)\)$/.exec(e);n?.[1]&&r.push(n[1])}if(r.length>0)return r;let i=n.find(e=>e!==BOOTSTRAP_RUNTIME_SYSTEM_PROMPT&&e!==`Available skills`);return i===void 0?[]:[i]});return[...new Set(n)]}function findRelevantTool(e,t){let n=normalizeText(t),r=e.find(e=>e.name!==`agent`&&e.name!==LOAD_SKILL_TOOL_NAME&&n.includes(normalizeText(e.name)));return r===void 0?/\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(n)?e.find(e=>/\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(normalizeText(`${e.name} ${e.description??``}`)))??null:null:r}function normalizeText(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,` `).trim()}function createToolCallId(e){return`call_${e.toLowerCase().replace(/[^a-z0-9]+/gu,`_`).replace(/^_+|_+$/gu,``)||`tool`}`}function resolveSystemProbe(e){let t=e.filter(e=>e.role===`system`).map(e=>getPromptContentText(e.content)).join(`
4
4
  `);return/hmr-probe:\s*([^\n]+)/iu.exec(t)?.[1]?.trim()||null}function isWeatherPayload(e){return z.validate(bootstrapWeatherPayloadSchema,e)}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{createMockAuthoredRuntimeModel,resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels};
@@ -5,7 +5,7 @@ export interface AvailableBootstrapTool {
5
5
  readonly name: string;
6
6
  readonly outputSchema?: unknown;
7
7
  }
8
- export declare function createMockAuthoredToolInput(tool: AvailableBootstrapTool, message: string, city: string): Record<string, unknown>;
8
+ export declare function createMockAuthoredToolInput(offered: AvailableBootstrapTool, message: string, city: string): Record<string, unknown>;
9
9
  export declare function resolveMockFixtureToken(prompt: BootstrapPrompt): string | null;
10
10
  export declare function resolveWeatherCity(message: string): string;
11
11
  export declare function formatToolOutput(output: unknown): string;
@@ -1,3 +1,3 @@
1
- import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{getPromptContentText,isAgentsAnnouncementText}from"#runtime/agent/bootstrap-model-utils.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";function createMockAuthoredToolInput(e,t,n){let r=getToolInputPropertyNames(e.inputSchema);if(r.includes(`question`))return createQuestionInput(t);if(r.includes(`command`))return{command:resolveShellCommand(t)};if(r.includes(`topic`)||!hasDeclaredInputProperties(e.inputSchema)&&/\btopic\b/u.test(normalizeText(t)))return{topic:resolveLookupTopic(t)};let i=extractAnchoredInputs(r,t);if(Object.keys(i).length>0)return i;if(r.length===1&&r[0]===`message`)return{message:t};if(r.includes(`city`)||!hasDeclaredInputProperties(e.inputSchema))return{city:n};let a=createJsonSchemaSample(e.inputSchema);return isRecord(a)?a:{}}function extractAnchoredInputs(e,t){let n={};for(let r of e){let e=RegExp(`\\b${escapeRegExp(r)}\\b\\s*(?:to|=|:)?\\s*(?:\`([^\`]+)\`|"([^"]+)"|'([^']+)')`,`iu`).exec(t),i=e?.[1]??e?.[2]??e?.[3];i!==void 0&&(n[r]=i.trim())}return n}function escapeRegExp(e){return e.replace(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`)}function resolveMockFixtureToken(e){let t=e.filter(e=>e.role===`system`).map(e=>getPromptContentText(e.content)).join(`
2
- `),n=[...getLoadedSkillResultTexts(e),t,getTrailingUserText(e)];for(let e of n){let t=resolveExactFixtureReply(e);if(t!==null)return t}return null}function resolveWeatherCity(e){let t=/"city"\s*:\s*"([^"]+)"/u.exec(e);return t?.[1]?t[1].trim():(/\b(?:in|for)\s+([A-Za-z][A-Za-z\s.-]*?)(?:[?.!,]|$)/u.exec(e)??/\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b/u.exec(e))?.[1]?.trim()||`Brooklyn`}function formatToolOutput(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function getTrailingUserText(e){let t=[];for(let n of[...e].reverse()){if(n.role===`system`)continue;if(n.role!==`user`)break;let e=getPromptContentText(n.content);isAgentsAnnouncementText(e.trim())||t.unshift(e)}return t.join(`
1
+ import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{TASK_ID_INPUT}from"#execution/tasks/task-id-input.js";import{getPromptContentText,isFrameworkAnnouncementText}from"#runtime/agent/bootstrap-model-utils.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";function createMockAuthoredToolInput(e,t,n){let r={...e,inputSchema:withoutTaskIdInput(e.inputSchema)},i=getToolInputPropertyNames(r.inputSchema);if(i.includes(`question`))return createQuestionInput(t);if(i.includes(`command`))return{command:resolveShellCommand(t)};if(i.includes(`topic`)||!hasDeclaredInputProperties(r.inputSchema)&&/\btopic\b/u.test(normalizeText(t)))return{topic:resolveLookupTopic(t)};let a=extractAnchoredInputs(i,t);if(Object.keys(a).length>0)return a;if(i.length===1&&i[0]===`message`)return{message:t};if(i.includes(`city`)||!hasDeclaredInputProperties(r.inputSchema))return{city:n};let o=createJsonSchemaSample(r.inputSchema);return isRecord(o)?o:{}}function withoutTaskIdInput(e){if(!isRecord(e)||!isRecord(e.properties))return e;let{[TASK_ID_INPUT]:t,...n}=e.properties;return{...e,properties:n}}function extractAnchoredInputs(e,t){let n={};for(let r of e){let e=RegExp(`\\b${escapeRegExp(r)}\\b\\s*(?:to|=|:)?\\s*(?:\`([^\`]+)\`|"([^"]+)"|'([^']+)')`,`iu`).exec(t),i=e?.[1]??e?.[2]??e?.[3];i!==void 0&&(n[r]=i.trim())}return n}function escapeRegExp(e){return e.replace(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`)}function resolveMockFixtureToken(e){let t=e.filter(e=>e.role===`system`).map(e=>getPromptContentText(e.content)).join(`
2
+ `),n=[...getLoadedSkillResultTexts(e),t,getTrailingUserText(e)];for(let e of n){let t=resolveExactFixtureReply(e);if(t!==null)return t}return null}function resolveWeatherCity(e){let t=/"city"\s*:\s*"([^"]+)"/u.exec(e);return t?.[1]?t[1].trim():(/\b(?:in|for)\s+([A-Za-z][A-Za-z\s.-]*?)(?:[?.!,]|$)/u.exec(e)??/\b([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\b/u.exec(e))?.[1]?.trim()||`Brooklyn`}function formatToolOutput(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function getTrailingUserText(e){let t=[];for(let n of[...e].reverse()){if(n.role===`system`)continue;if(n.role!==`user`)break;let e=getPromptContentText(n.content);isFrameworkAnnouncementText(e.trim())||t.unshift(e)}return t.join(`
3
3
  `)}function getLoadedSkillResultTexts(e){return e.flatMap(e=>e.role!==`tool`&&e.role!==`assistant`?[]:(typeof e.content==`string`?[e.content]:e.content).flatMap(e=>typeof e==`string`||e.type!==`tool-result`||e.toolName!==LOAD_SKILL_TOOL_NAME||e.output.type===`execution-denied`?[]:[formatToolOutput(e.output.value)]))}function resolveExactFixtureReply(e){let t=matchExactValue(/\breply\s+with\s+the\s+exact\s+string\s+(`([^`]+)`|"([^"]+)"|'([^']+)'|([^\s.]+))\s+and\s+nothing\s+else\b/iu,e);if(t!==null)return t;let n=e.split(/\r?\n/u);for(let e=0;e<n.length;e+=1){let t=n[e]?.trim()??``,r=/\breply\s+with\s+exactly(?:\s+the\s+following\s+text\s+and\s+nothing\s+else)?:\s*(.+)$/iu.exec(t);if(r?.[1])return cleanExactValue(r[1]);if(/\breply\s+with\s+exactly\s+the\s+following\s+text\s+and\s+nothing\s+else:\s*$/iu.test(t)||/\breply\s+with\s+exactly:\s*$/iu.test(t)){let t=n.slice(e+1).map(e=>e.trim()).find(e=>e.length>0);if(t!==void 0)return cleanExactValue(t)}}return matchExactValue(/\binclude\s+the\s+exact\s+token\s+(`([^`]+)`|"([^"]+)"|'([^']+)'|([^\s.]+))\s+verbatim\b/iu,e)}function matchExactValue(e,t){let n=e.exec(t);return n===null?null:cleanExactValue(n[2]??n[3]??n[4]??n[5]??n[1]??``)}function cleanExactValue(e){return e.trim()}function getToolInputPropertyNames(e){return!isRecord(e)||!isRecord(e.properties)?[]:Object.keys(e.properties)}function hasDeclaredInputProperties(e){return isRecord(e)&&isRecord(e.properties)}function createQuestionInput(e){let t=parseOptionLabels(e);return{question:resolveQuestionPrompt(e),...t.length>=2&&{options:t.map(e=>({description:`Choose ${e}.`,label:e}))}}}function parseOptionLabels(e){return[...e.matchAll(/\blabel\b\s*:?\s*"([^"]+)"/giu)].map(e=>e[1]??``)}function resolveQuestionPrompt(e){let t=/\b(?:set\s+)?question\s+to:\s*'([^']+)'/iu.exec(e)??/\b(?:set\s+)?question\s+to:\s*"([^"]+)"/iu.exec(e);return t?.[1]?t[1].trim():/\bask(?:\s+me)?\s+(?:to\s+)?(.+?)(?:\.|$)/iu.exec(e)?.[1]?.trim()||`Please choose an option.`}function resolveShellCommand(e){let t=/`([^`]+)`/u.exec(e);return t?.[1]?t[1].trim():(/\b(?:run|command)\s+["']([^"']+)["']/iu.exec(e)??/\bcommand\s+(.+?)(?:\.|$)/iu.exec(e))?.[1]?.trim()||`pwd`}function resolveLookupTopic(e){return/\btopic\s+['"]?([A-Za-z0-9_.-]+)['"]?/u.exec(e)?.[1]??`demo`}function normalizeText(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,` `).trim()}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{createMockAuthoredToolInput,formatToolOutput,resolveMockFixtureToken,resolveWeatherCity};
@@ -1 +1 @@
1
- import{copyChannelActivityPresentation,getChannelActivityPresentation}from"#channel/activity-renderer.js";import{getAdapterKind}from"#channel/adapter.js";import{SCHEDULE_ADAPTER}from"#channel/schedule.js";import{HTTP_ADAPTER}from"#channel/http.js";import{SUBAGENT_ADAPTER}from"#subagents/adapter.js";import{RuntimeRegistryError}from"#internal/runtime-registry.js";const FRAMEWORK_ADAPTERS=[HTTP_ADAPTER,SUBAGENT_ADAPTER,SCHEDULE_ADAPTER],ADAPTER_NON_EVENT_FIELDS=new Set([`kind`,`state`,`deliver`,`createAdapterContext`,`fetchFile`,`instrumentation`]);function createRuntimeAdapterRegistry(e){let t=new Map,n=new Set;for(let e of FRAMEWORK_ADAPTERS){let r=requireAdapterKind(e);n.add(r),t.set(r,e)}for(let r of e.channels){if(r.adapter===void 0)continue;let e={logicalPath:r.logicalPath,sourceId:r.sourceId},i=r.adapter,a=requireAdapterKind(i,e);if(n.has(a)){if(carriesAdapterBehavior(i))throw new RuntimeRegistryError(`adapter`,`Channel adapter kind "${a}" is reserved by the framework. A route-declared adapter may share a framework kind only as a pass-through with no \`deliver\` hook, event handlers, \`attachments\` resolver, or \`createAdapterContext\` factory. Use a custom \`kind\` to add channel-specific behavior.`,{...e,entryName:a});continue}t.set(a,i)}return{adaptersByKind:t}}function deserializeRuntimeAdapter(e,t){let n=t,r=e.adaptersByKind.get(n.kind);if(r===void 0)throw Error(`Unknown adapter kind: "${n.kind}". Declare the adapter on the route that starts this session so the runtime can rehydrate it.`);let i={...r,state:n.state};return copyChannelActivityPresentation(r,i),i}function requireAdapterKind(e,t){let n=getAdapterKind(e);if(typeof n!=`string`||n.length===0)throw new RuntimeRegistryError(`adapter`,"Adapters must declare a non-empty `kind` field.",{entryName:`unknown`,logicalPath:t?.logicalPath,sourceId:t?.sourceId});return n}function carriesAdapterBehavior(e){if(getChannelActivityPresentation(e)!==void 0||e.deliver!==void 0||e.fetchFile!==void 0||e.createAdapterContext!==void 0)return!0;for(let[t,n]of Object.entries(e))if(!ADAPTER_NON_EVENT_FIELDS.has(t)&&typeof n==`function`)return!0;return!1}export{createRuntimeAdapterRegistry,deserializeRuntimeAdapter};
1
+ import{getAdapterKind}from"#channel/adapter.js";import{SCHEDULE_ADAPTER}from"#channel/schedule.js";import{HTTP_ADAPTER}from"#channel/http.js";import{SUBAGENT_ADAPTER}from"#subagents/adapter.js";import{RuntimeRegistryError}from"#internal/runtime-registry.js";const FRAMEWORK_ADAPTERS=[HTTP_ADAPTER,SUBAGENT_ADAPTER,SCHEDULE_ADAPTER],ADAPTER_NON_EVENT_FIELDS=new Set([`kind`,`state`,`deliver`,`createAdapterContext`,`fetchFile`,`instrumentation`]);function createRuntimeAdapterRegistry(e){let t=new Map,n=new Set;for(let e of FRAMEWORK_ADAPTERS){let r=requireAdapterKind(e);n.add(r),t.set(r,e)}for(let r of e.channels){if(r.adapter===void 0)continue;let e={logicalPath:r.logicalPath,sourceId:r.sourceId},i=r.adapter,a=requireAdapterKind(i,e);if(n.has(a)){if(carriesAdapterBehavior(i))throw new RuntimeRegistryError(`adapter`,`Channel adapter kind "${a}" is reserved by the framework. A route-declared adapter may share a framework kind only as a pass-through with no \`deliver\` hook, event handlers, \`attachments\` resolver, or \`createAdapterContext\` factory. Use a custom \`kind\` to add channel-specific behavior.`,{...e,entryName:a});continue}t.set(a,i)}return{adaptersByKind:t}}function deserializeRuntimeAdapter(e,t){let n=t,r=e.adaptersByKind.get(n.kind);if(r===void 0)throw Error(`Unknown adapter kind: "${n.kind}". Declare the adapter on the route that starts this session so the runtime can rehydrate it.`);return{...r,state:n.state}}function requireAdapterKind(e,t){let n=getAdapterKind(e);if(typeof n!=`string`||n.length===0)throw new RuntimeRegistryError(`adapter`,"Adapters must declare a non-empty `kind` field.",{entryName:`unknown`,logicalPath:t?.logicalPath,sourceId:t?.sourceId});return n}function carriesAdapterBehavior(e){if(e.deliver!==void 0||e.fetchFile!==void 0||e.createAdapterContext!==void 0)return!0;for(let[t,n]of Object.entries(e))if(!ADAPTER_NON_EVENT_FIELDS.has(t)&&typeof n==`function`)return!0;return!1}export{createRuntimeAdapterRegistry,deserializeRuntimeAdapter};
@@ -61,7 +61,6 @@ export declare function passesToolFilter(toolName: string, filter: Readonly<Tool
61
61
  * {@link SessionContext}, then resolves the {@link ConnectionPrincipal}
62
62
  * and invokes `authorization.getToken({ principal })` to produce the bearer.
63
63
  * `getToken` may throw {@link ConnectionAuthorizationRequiredError};
64
- * callers (`connection_search`, wrapped connection tools) catch it
65
- * and it propagates as-is from here.
64
+ * callers catch it and it propagates as-is from here.
66
65
  */
67
66
  export declare function resolveHeaders(connection: ResolvedConnectionDefinition): Promise<Record<string, string>>;
@@ -1 +1 @@
1
- import{isLoopbackHostname}from"#shared/network-address.js";import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{parseJsonObject}from"#shared/json.js";import{omitProvidedArgumentsFromSchema,resolveProvidedArguments}from"#runtime/connections/provided-arguments.js";import{passesToolFilter,resolveHeaders}from"#runtime/connections/mcp-client.js";import{HTTP_METHODS,operationDescription,operationName,uniqueName}from"#runtime/connections/openapi-operations.js";import{buildInputSchema,deref,derefSchema,isArray}from"#runtime/connections/openapi-schema.js";import{applySecurity,resolveSecurity}from"#runtime/connections/openapi-security.js";import{extractServerUrl,parseSpecDocument}from"#runtime/connections/openapi-spec.js";const log=createLogger(`runtime.connections.openapi-client`),SWAGGER_PARAMETER_SCHEMA_KEYS=[`default`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`format`,`items`,`maximum`,`maxItems`,`maxLength`,`minimum`,`minItems`,`minLength`,`multipleOf`,`pattern`,`type`,`uniqueItems`];var OpenApiConnectionClient=class{#e;#t;#n;constructor(e){this.#n=e}async connect(){return this.#r()}async getToolMetadata(){return(await this.#r()).metadata}async executeTool(e,t,n){let r=await this.#r(),i=r.operations.get(e);if(i===void 0)throw Error(`Tool "${e}" not found in connection "${this.#n.connectionName}".`);return this.#f(i,r.baseUrl,isObject(t)?t:{},{abortSignal:n.abortSignal,callId:n.callId})}async close(){this.#e=void 0,this.#t=void 0}async#r(){if(this.#t!==void 0)return this.#t;if(this.#e!==void 0)return this.#e;this.#e=this.#i();try{return this.#t=await this.#e,this.#t}catch(e){throw this.#e=void 0,e}}async#i(){let e=await this.#o(),t=this.#a(e),n=this.#s(e),r=this.#n.tools,i=r===void 0?n:n.filter(e=>passesToolFilter(e.toolName,r)),a=[],o=new Map,s=Object.keys(this.#n.toolCall?.providedArguments??{});for(let e of i){let t;try{t=parseJsonObject(omitProvidedArgumentsFromSchema(e.inputSchema,s))}catch(t){log.warn(`omitting OpenAPI operation with an invalid input schema`,{connectionName:this.#n.connectionName,error:t,toolName:e.toolName});continue}o.set(e.toolName,e),a.push({description:e.description,inputSchema:t,name:e.toolName})}return{metadata:a,operations:o,baseUrl:t}}#a(e){let t=this.#n.url,n=typeof t==`string`&&t.trim().length>0?t:extractServerUrl(e,this.#n.spec);if(n===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" has no base URL: set "baseUrl" or ensure the document declares an absolute "servers" entry or Swagger "host".`);return assertSecureUrl(n,this.#n.connectionName,`base`),n}async#o(){let e=this.#n.spec;if(e===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" is missing its "spec" source.`);if(typeof e!=`string`)return e;assertSecureUrl(e,this.#n.connectionName,`spec`);let t;try{t=await fetch(e,{headers:{accept:`application/json, application/yaml, text/yaml, */*`}})}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": ${String(t)}`)}if(t.redirected&&assertSecureUrl(t.url,this.#n.connectionName,`spec`),!t.ok)throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": HTTP ${t.status}.`);let n=await t.text(),r;try{r=parseSpecDocument(n)}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" could not be parsed as JSON or YAML: ${String(t)}`)}if(!isObject(r))throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" is not an OpenAPI document object.`);return r}#s(e){let t=e.paths;if(!isObject(t))return[];let n=[],r=new Set;for(let[i,a]of Object.entries(t)){if(!isObject(a))continue;let t=isArray(a.parameters)?a.parameters:[];for(let o of HTTP_METHODS){let s=a[o];if(!isObject(s))continue;let c=uniqueName(operationName(s,o,i),r),l=isArray(s.parameters)?s.parameters:[],u=[...t,...l],d=this.#c(e,u),f=this.#l(e,s.requestBody,u);n.push({toolName:c,method:o,pathTemplate:i,description:operationDescription(s),parameters:d,requestBody:f,inputSchema:buildInputSchema(d,f),security:resolveSecurity(e,s)})}}return n}#c(e,t){let n=[];for(let r of t){let t=isObject(r)?deref(e,r):r;if(!isObject(t))continue;let i=t.in;if(i!==`path`&&i!==`query`&&i!==`header`&&i!==`cookie`||typeof t.name!=`string`)continue;let a=this.#u(e,t);n.push({name:t.name,location:i,required:t.required===!0||i===`path`,schema:a,description:typeof t.description==`string`?t.description:void 0})}return n}#l(e,t,n=[]){if(isObject(t)){let n=deref(e,t);if(isObject(n)&&isObject(n.content)){let t=n.content,r=`application/json`in t?`application/json`:Object.keys(t)[0];if(r!==void 0){let i=t[r],a=isObject(i)&&isObject(i.schema)?derefSchema(e,i.schema):{};return{required:n.required===!0,contentType:r,schema:a}}}}return this.#d(e,n)}#u(e,t){if(isObject(t.schema))return derefSchema(e,t.schema);let n={};for(let e of SWAGGER_PARAMETER_SCHEMA_KEYS)t[e]!==void 0&&(n[e]=t[e]);return derefSchema(e,n)}#d(e,t){for(let n of t){let t=isObject(n)?deref(e,n):n;if(!isObject(t)||t.in!==`body`)continue;let r=isObject(t.schema)?derefSchema(e,t.schema):{};return{required:t.required===!0,contentType:`application/json`,schema:r}}}async#f(e,t,n,r){let i=await resolveProvidedArguments({args:n,callId:r.callId,connection:this.#n,toolName:e.toolName}),a=await resolveHeaders(this.#n),o=e.pathTemplate,s=new URLSearchParams,c=[];for(let t of e.parameters){let e=i[t.name];e!=null&&(t.location===`path`?o=o.replace(`{${t.name}}`,encodeURIComponent(String(e))):t.location===`query`?appendQuery(s,t.name,e):t.location===`cookie`?c.push(`${t.name}=${encodeURIComponent(String(e))}`):a[t.name]=String(e))}if(applySecurity(e.security,this.#n,a,s,c),c.length>0){let e=a.cookie??a.Cookie;delete a.Cookie,a.cookie=[e,...c].filter(e=>!!e).join(`; `)}let l=new URL(joinPath(t,o));l.search=s.toString();let u;e.requestBody!==void 0&&i.body!==void 0&&(u=JSON.stringify(i.body),a[`content-type`]=e.requestBody.contentType);let d=await fetch(l,{method:e.method.toUpperCase(),headers:a,body:u,signal:r?.abortSignal});return{status:d.status,statusText:d.statusText,body:await readResponseBody(d)}}};function appendQuery(e,t,n){if(isArray(n)){for(let r of n)e.append(t,String(r));return}e.append(t,String(n))}function joinPath(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function assertSecureUrl(e,t,n){let r;try{r=new URL(e)}catch{throw Error(`OpenAPI connection "${t}" has an invalid ${n} URL "${e}".`)}if(r.protocol!==`https:`&&!(r.protocol===`http:`&&isLoopbackHostname(r.hostname)))throw Error(`OpenAPI connection "${t}" must use https for its ${n} (got "${r.protocol}//${r.host}").`)}async function readResponseBody(e){let t=await e.text();if(t.length===0)return null;if((e.headers.get(`content-type`)??``).includes(`application/json`))try{return JSON.parse(t)}catch{return t}return t}export{OpenApiConnectionClient};
1
+ import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{isLoopbackHostname}from"#shared/network-address.js";import{parseJsonObject}from"#shared/json.js";import{omitProvidedArgumentsFromSchema,resolveProvidedArguments}from"#runtime/connections/provided-arguments.js";import{passesToolFilter,resolveHeaders}from"#runtime/connections/mcp-client.js";import{HTTP_METHODS,operationDescription,operationName,uniqueName}from"#runtime/connections/openapi-operations.js";import{buildInputSchema,deref,derefSchema,isArray}from"#runtime/connections/openapi-schema.js";import{applySecurity,resolveSecurity}from"#runtime/connections/openapi-security.js";import{extractServerUrl,parseSpecDocument}from"#runtime/connections/openapi-spec.js";const log=createLogger(`runtime.connections.openapi-client`),SWAGGER_PARAMETER_SCHEMA_KEYS=[`default`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`format`,`items`,`maximum`,`maxItems`,`maxLength`,`minimum`,`minItems`,`minLength`,`multipleOf`,`pattern`,`type`,`uniqueItems`];var OpenApiConnectionClient=class{#e;#t;#n;constructor(e){this.#n=e}async connect(){return this.#r()}async getToolMetadata(){return(await this.#r()).metadata}async executeTool(e,t,n){let r=await this.#r(),i=r.operations.get(e);if(i===void 0)throw Error(`Tool "${e}" not found in connection "${this.#n.connectionName}".`);return this.#f(i,r.baseUrl,isObject(t)?t:{},{abortSignal:n.abortSignal,callId:n.callId})}async close(){this.#e=void 0,this.#t=void 0}async#r(){if(this.#t!==void 0)return this.#t;if(this.#e!==void 0)return this.#e;this.#e=this.#i();try{return this.#t=await this.#e,this.#t}catch(e){throw this.#e=void 0,e}}async#i(){let e=await this.#o(),t=this.#a(e),n=this.#s(e),r=this.#n.tools,i=r===void 0?n:n.filter(e=>passesToolFilter(e.toolName,r)),a=[],o=new Map,s=Object.keys(this.#n.toolCall?.providedArguments??{});for(let e of i){let t;try{t=parseJsonObject(omitProvidedArgumentsFromSchema(e.inputSchema,s))}catch(t){log.warn(`omitting OpenAPI operation with an invalid input schema`,{connectionName:this.#n.connectionName,error:t,toolName:e.toolName});continue}o.set(e.toolName,e),a.push({description:e.description,inputSchema:t,name:e.toolName})}return{metadata:a,operations:o,baseUrl:t}}#a(e){let t=this.#n.url,n=typeof t==`string`&&t.trim().length>0?t:extractServerUrl(e,this.#n.spec);if(n===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" has no base URL: set "baseUrl" or ensure the document declares an absolute "servers" entry or Swagger "host".`);return assertSecureUrl(n,this.#n.connectionName,`base`),n}async#o(){let e=this.#n.spec;if(e===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" is missing its "spec" source.`);if(typeof e!=`string`)return e;assertSecureUrl(e,this.#n.connectionName,`spec`);let t;try{t=await fetch(e,{headers:{accept:`application/json, application/yaml, text/yaml, */*`}})}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": ${String(t)}`)}if(t.redirected&&assertSecureUrl(t.url,this.#n.connectionName,`spec`),!t.ok)throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": HTTP ${t.status}.`);let n=await t.text(),r;try{r=parseSpecDocument(n)}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" could not be parsed as JSON or YAML: ${String(t)}`)}if(!isObject(r))throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" is not an OpenAPI document object.`);return r}#s(e){let t=e.paths;if(!isObject(t))return[];let n=[],r=new Set;for(let[i,a]of Object.entries(t)){if(!isObject(a))continue;let t=isArray(a.parameters)?a.parameters:[];for(let o of HTTP_METHODS){let s=a[o];if(!isObject(s))continue;let c=uniqueName(operationName(s,o,i),r),l=isArray(s.parameters)?s.parameters:[],u=[...t,...l],d=this.#c(e,u),f=this.#l(e,s.requestBody,u);n.push({toolName:c,method:o,pathTemplate:i,description:operationDescription(s),parameters:d,requestBody:f,inputSchema:buildInputSchema(d,f),security:resolveSecurity(e,s)})}}return n}#c(e,t){let n=[];for(let r of t){let t=isObject(r)?deref(e,r):r;if(!isObject(t))continue;let i=t.in;if(i!==`path`&&i!==`query`&&i!==`header`&&i!==`cookie`||typeof t.name!=`string`)continue;let a=this.#u(e,t);n.push({name:t.name,location:i,required:t.required===!0||i===`path`,schema:a,description:typeof t.description==`string`?t.description:void 0})}return n}#l(e,t,n=[]){if(isObject(t)){let n=deref(e,t);if(isObject(n)&&isObject(n.content)){let t=n.content,r=`application/json`in t?`application/json`:Object.keys(t)[0];if(r!==void 0){let i=t[r],a=isObject(i)&&isObject(i.schema)?derefSchema(e,i.schema):{};return{required:n.required===!0,contentType:r,schema:a}}}}return this.#d(e,n)}#u(e,t){if(isObject(t.schema))return derefSchema(e,t.schema);let n={};for(let e of SWAGGER_PARAMETER_SCHEMA_KEYS)t[e]!==void 0&&(n[e]=t[e]);return derefSchema(e,n)}#d(e,t){for(let n of t){let t=isObject(n)?deref(e,n):n;if(!isObject(t)||t.in!==`body`)continue;let r=isObject(t.schema)?derefSchema(e,t.schema):{};return{required:t.required===!0,contentType:`application/json`,schema:r}}}async#f(e,t,n,r){let i=await resolveProvidedArguments({args:n,callId:r.callId,connection:this.#n,toolName:e.toolName}),a=await resolveHeaders(this.#n),o=e.pathTemplate,s=new URLSearchParams,c=[];for(let t of e.parameters){let e=i[t.name];e!=null&&(t.location===`path`?o=o.replace(`{${t.name}}`,encodeURIComponent(String(e))):t.location===`query`?appendQuery(s,t.name,e):t.location===`cookie`?c.push(`${t.name}=${encodeURIComponent(String(e))}`):a[t.name]=String(e))}if(applySecurity(e.security,this.#n,a,s,c),c.length>0){let e=a.cookie??a.Cookie;delete a.Cookie,a.cookie=[e,...c].filter(e=>!!e).join(`; `)}let l=new URL(joinPath(t,o));l.search=s.toString();let u;e.requestBody!==void 0&&i.body!==void 0&&(u=JSON.stringify(i.body),a[`content-type`]=e.requestBody.contentType);let d=await fetch(l,{method:e.method.toUpperCase(),headers:a,body:u,signal:r?.abortSignal});return{status:d.status,statusText:d.statusText,body:await readResponseBody(d)}}};function appendQuery(e,t,n){if(isArray(n)){for(let r of n)e.append(t,String(r));return}e.append(t,String(n))}function joinPath(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function assertSecureUrl(e,t,n){let r;try{r=new URL(e)}catch{throw Error(`OpenAPI connection "${t}" has an invalid ${n} URL "${e}".`)}if(r.protocol!==`https:`&&!(r.protocol===`http:`&&isLoopbackHostname(r.hostname)))throw Error(`OpenAPI connection "${t}" must use https for its ${n} (got "${r.protocol}//${r.host}").`)}async function readResponseBody(e){let t=await e.text();if(t.length===0)return null;if((e.headers.get(`content-type`)??``).includes(`application/json`))try{return JSON.parse(t)}catch{return t}return t}export{OpenApiConnectionClient};