eve 0.82.0 → 0.83.1

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 (528) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/NOTICE +1 -1
  3. package/dist/src/channel/pending-authorization.d.ts +5 -0
  4. package/dist/src/channel/pending-authorization.js +1 -1
  5. package/dist/src/channel/session.d.ts +2 -0
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +5 -0
  8. package/dist/src/chunks/{use-eve-agent-DTu78IAF.js → use-eve-agent-DnbG9c7c.js} +73 -14
  9. package/dist/src/chunks/{use-eve-agent-DlznYwQk.js → use-eve-agent-ZY7NQ2VW.js} +73 -14
  10. package/dist/src/cli/dev/local-server-child.js +1 -1
  11. package/dist/src/cli/dev/local-server-cleanup.js +1 -1
  12. package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
  13. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  14. package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
  15. package/dist/src/cli/run.js +1 -1
  16. package/dist/src/client/eve-agent-store.d.ts +1 -1
  17. package/dist/src/client/eve-agent-store.js +1 -1
  18. package/dist/src/client/index.d.ts +1 -0
  19. package/dist/src/client/message-response.d.ts +18 -0
  20. package/dist/src/client/message-response.js +1 -1
  21. package/dist/src/client/session-controls.d.ts +6 -0
  22. package/dist/src/client/session-controls.js +1 -1
  23. package/dist/src/client/session.d.ts +4 -0
  24. package/dist/src/client/session.js +1 -1
  25. package/dist/src/compiled/.vendor-stamp.json +8 -8
  26. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  27. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
  28. package/dist/src/compiled/@workflow/core/index.js +2 -2
  29. package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
  30. package/dist/src/compiled/@workflow/core/private.js +1 -1
  31. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
  32. package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
  33. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
  34. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  35. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
  36. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
  37. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
  38. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
  39. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  40. package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
  41. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
  42. package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
  43. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  44. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
  45. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  46. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  47. package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
  48. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  49. package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
  50. package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
  51. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  52. package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
  53. package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
  54. package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
  55. package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
  56. package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
  57. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  58. package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
  59. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
  60. package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
  61. package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
  62. package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
  63. package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
  64. package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
  65. package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
  66. package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
  67. package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
  68. package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
  69. package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
  70. package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
  71. package/dist/src/compiled/run/index.d.ts +384 -0
  72. package/dist/src/compiled/run/index.js +650 -0
  73. package/dist/src/compiler/extension-compatibility.d.ts +21 -14
  74. package/dist/src/compiler/extension-compatibility.js +1 -1
  75. package/dist/src/compiler/manifest.js +1 -1
  76. package/dist/src/compiler/normalize-agent-config.js +1 -1
  77. package/dist/src/compiler/normalize-manifest.js +1 -1
  78. package/dist/src/compiler/normalize-sandbox.js +1 -1
  79. package/dist/src/compiler/workspace-resources.js +1 -1
  80. package/dist/src/context/build-callback-context.js +1 -1
  81. package/dist/src/context/build-dynamic-tools.js +1 -1
  82. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -2
  83. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  84. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  85. package/dist/src/context/prewarm.d.ts +27 -0
  86. package/dist/src/context/prewarm.js +1 -0
  87. package/dist/src/context/providers/sandbox.d.ts +7 -0
  88. package/dist/src/context/providers/sandbox.js +1 -1
  89. package/dist/src/context/run-step.js +1 -1
  90. package/dist/src/discover/extension-specifier.d.ts +1 -0
  91. package/dist/src/discover/extension-specifier.js +1 -1
  92. package/dist/src/discover/lib.d.ts +4 -3
  93. package/dist/src/discover/lib.js +1 -1
  94. package/dist/src/discover/named-source-directory.d.ts +3 -2
  95. package/dist/src/evals/cli/eval.d.ts +2 -0
  96. package/dist/src/evals/cli/eval.js +2 -2
  97. package/dist/src/evals/define-eval-config.d.ts +5 -4
  98. package/dist/src/evals/define-eval-config.js +1 -1
  99. package/dist/src/evals/index.d.ts +1 -1
  100. package/dist/src/evals/runner/artifacts.js +2 -2
  101. package/dist/src/evals/runner/attempt-label.d.ts +2 -0
  102. package/dist/src/evals/runner/attempt-label.js +1 -0
  103. package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
  104. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  105. package/dist/src/evals/runner/execute-task.js +1 -1
  106. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  107. package/dist/src/evals/runner/reporters/console.js +1 -1
  108. package/dist/src/evals/runner/reporters/datadog.js +1 -1
  109. package/dist/src/evals/runner/reporters/junit.js +2 -2
  110. package/dist/src/evals/runner/reporters/types.d.ts +2 -0
  111. package/dist/src/evals/runner/run-evals.d.ts +5 -0
  112. package/dist/src/evals/runner/run-evals.js +1 -1
  113. package/dist/src/evals/session-manager.js +1 -1
  114. package/dist/src/evals/session.d.ts +4 -1
  115. package/dist/src/evals/session.js +2 -2
  116. package/dist/src/evals/types.d.ts +39 -2
  117. package/dist/src/eve-channel/index.js +1 -1
  118. package/dist/src/eve-channel/request.d.ts +0 -1
  119. package/dist/src/eve-channel/request.js +2 -2
  120. package/dist/src/execution/agent-sessions/context.d.ts +1 -1
  121. package/dist/src/execution/agent-sessions/context.js +1 -1
  122. package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -0
  123. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  124. package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
  125. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  126. package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
  127. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  128. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  129. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  130. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
  131. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  132. package/dist/src/execution/invoke-tool.js +1 -1
  133. package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
  134. package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
  135. package/dist/src/execution/sandbox/active-connections.js +1 -0
  136. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
  137. package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
  138. package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
  139. package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
  140. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
  141. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  142. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
  143. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
  144. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
  145. package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
  146. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  147. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
  148. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  149. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
  150. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  151. package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
  152. package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
  153. package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
  154. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  155. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
  156. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  157. package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
  158. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
  159. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  160. package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
  161. package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
  162. package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
  163. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  164. package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
  165. package/dist/src/execution/sandbox/development-run.d.ts +0 -2
  166. package/dist/src/execution/sandbox/development-run.js +1 -1
  167. package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
  168. package/dist/src/execution/sandbox/dockerfile.js +1 -1
  169. package/dist/src/execution/sandbox/ensure.d.ts +31 -11
  170. package/dist/src/execution/sandbox/ensure.js +1 -1
  171. package/dist/src/execution/sandbox/glob-tool.js +3 -3
  172. package/dist/src/execution/sandbox/grep-tool.js +1 -1
  173. package/dist/src/execution/sandbox/logging-session.js +1 -1
  174. package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
  175. package/dist/src/execution/sandbox/prewarm.js +2 -1
  176. package/dist/src/execution/sandbox/read-file.js +1 -1
  177. package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
  178. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  179. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
  180. package/dist/src/execution/sandbox/session.d.ts +10 -20
  181. package/dist/src/execution/sandbox/session.js +2 -2
  182. package/dist/src/execution/session/admission.js +1 -1
  183. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  184. package/dist/src/execution/session/entry-input.d.ts +5 -4
  185. package/dist/src/execution/session/entry.js +1 -1
  186. package/dist/src/execution/session/handoff-state.d.ts +5 -0
  187. package/dist/src/execution/session/handoff-state.js +1 -0
  188. package/dist/src/execution/session/handoff-steps.d.ts +1 -5
  189. package/dist/src/execution/session/handoff-steps.js +1 -1
  190. package/dist/src/execution/session/handoff.d.ts +2 -1
  191. package/dist/src/execution/session/handoff.js +1 -1
  192. package/dist/src/execution/session/handover-tracing.d.ts +3 -0
  193. package/dist/src/execution/session/handover-tracing.js +1 -0
  194. package/dist/src/execution/session/input-queue.d.ts +3 -0
  195. package/dist/src/execution/session/input-queue.js +1 -1
  196. package/dist/src/execution/session/next-input.d.ts +3 -0
  197. package/dist/src/execution/session/next-input.js +1 -1
  198. package/dist/src/execution/session/prewarm-step.d.ts +13 -0
  199. package/dist/src/execution/session/prewarm-step.js +1 -0
  200. package/dist/src/execution/session/program.d.ts +4 -1
  201. package/dist/src/execution/session/program.js +1 -1
  202. package/dist/src/execution/session/state-cursor.d.ts +11 -0
  203. package/dist/src/execution/session/state-cursor.js +1 -1
  204. package/dist/src/execution/session/timeout-control.d.ts +4 -0
  205. package/dist/src/execution/session/timeout-control.js +1 -1
  206. package/dist/src/execution/session/turn-control.d.ts +5 -2
  207. package/dist/src/execution/session/turn-control.js +1 -1
  208. package/dist/src/execution/session/turn-step-types.d.ts +2 -0
  209. package/dist/src/execution/session/turn-step.js +1 -1
  210. package/dist/src/execution/session/turn.d.ts +1 -0
  211. package/dist/src/execution/session/turn.js +1 -1
  212. package/dist/src/execution/session-inbox/inbox.d.ts +17 -1
  213. package/dist/src/execution/session-inbox/inbox.js +1 -1
  214. package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
  215. package/dist/src/execution/session-inbox/protocol.js +1 -1
  216. package/dist/src/execution/session-inbox/resume.d.ts +2 -1
  217. package/dist/src/execution/session-inbox/resume.js +1 -1
  218. package/dist/src/execution/session-prewarm.d.ts +8 -0
  219. package/dist/src/execution/session-prewarm.js +1 -0
  220. package/dist/src/execution/skills/instructions.js +1 -1
  221. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  222. package/dist/src/execution/tools/workflow/body.js +1 -1
  223. package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
  224. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  225. package/dist/src/execution/tools/workflow/step.js +1 -1
  226. package/dist/src/execution/workflow-runtime.js +1 -1
  227. package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
  228. package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
  229. package/dist/src/harness/attachment-staging.d.ts +3 -7
  230. package/dist/src/harness/attachment-staging.js +1 -1
  231. package/dist/src/harness/hitl/index.d.ts +2 -1
  232. package/dist/src/harness/hitl/index.js +1 -1
  233. package/dist/src/harness/hitl/view.d.ts +1 -0
  234. package/dist/src/harness/hitl/view.js +1 -0
  235. package/dist/src/harness/model-call/run.js +1 -1
  236. package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
  237. package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
  238. package/dist/src/harness/step/prompt.js +1 -1
  239. package/dist/src/harness/tool-history-repair.d.ts +9 -0
  240. package/dist/src/harness/tool-history-repair.js +1 -0
  241. package/dist/src/harness/tool-model-output.d.ts +19 -3
  242. package/dist/src/harness/tool-model-output.js +1 -1
  243. package/dist/src/internal/application/compiled-artifacts.js +8 -4
  244. package/dist/src/internal/application/optional-package-import.d.ts +10 -0
  245. package/dist/src/internal/application/optional-package-import.js +1 -1
  246. package/dist/src/internal/application/stamped-package-version.js +1 -1
  247. package/dist/src/internal/attachments/limited-read.d.ts +2 -2
  248. package/dist/src/internal/authored-module-build-options.d.ts +6 -0
  249. package/dist/src/internal/authored-module-build-options.js +1 -1
  250. package/dist/src/internal/authored-module-cache.d.ts +10 -0
  251. package/dist/src/internal/authored-module-cache.js +1 -0
  252. package/dist/src/internal/authored-module-graph.js +1 -1
  253. package/dist/src/internal/authored-module-loader.js +1 -1
  254. package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
  255. package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
  256. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  257. package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
  258. package/dist/src/internal/bundler/pseudo-packages.js +1 -0
  259. package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
  260. package/dist/src/internal/nitro/host/build-extension.js +2 -2
  261. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
  262. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
  263. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
  264. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  265. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
  266. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  267. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  268. package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
  269. package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
  270. package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
  271. package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
  272. package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
  273. package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
  274. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
  275. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
  276. package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
  277. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  278. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
  279. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
  280. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  281. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  282. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  283. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  284. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  285. package/dist/src/internal/nitro/host.js +1 -1
  286. package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
  287. package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
  288. package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
  289. package/dist/src/internal/workflow/queue-namespace.js +1 -1
  290. package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
  291. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  292. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  293. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  294. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
  295. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  296. package/dist/src/protocol/prewarm-session.d.ts +14 -0
  297. package/dist/src/protocol/prewarm-session.js +1 -0
  298. package/dist/src/protocol/routes.d.ts +2 -2
  299. package/dist/src/public/channels/discord/authorization.d.ts +45 -0
  300. package/dist/src/public/channels/discord/authorization.js +3 -0
  301. package/dist/src/public/channels/discord/defaults.d.ts +14 -3
  302. package/dist/src/public/channels/discord/defaults.js +2 -2
  303. package/dist/src/public/channels/discord/discordChannel.d.ts +15 -1
  304. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  305. package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
  306. package/dist/src/public/channels/discord/gateway/connection.js +1 -0
  307. package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
  308. package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
  309. package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
  310. package/dist/src/public/channels/discord/gateway/index.js +1 -0
  311. package/dist/src/public/channels/discord/inbound.d.ts +10 -3
  312. package/dist/src/public/channels/discord/inbound.js +2 -2
  313. package/dist/src/public/channels/discord/index.d.ts +3 -2
  314. package/dist/src/public/channels/discord/index.js +1 -1
  315. package/dist/src/public/channels/discord/messages.d.ts +116 -0
  316. package/dist/src/public/channels/discord/messages.js +2 -0
  317. package/dist/src/public/channels/github/checkout.js +1 -1
  318. package/dist/src/public/channels/linq/linqChannel.d.ts +4 -1
  319. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  320. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  321. package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
  322. package/dist/src/public/channels/same-environment-oidc.js +1 -0
  323. package/dist/src/public/definitions/channel.js +1 -1
  324. package/dist/src/public/definitions/sandbox.d.ts +1 -1
  325. package/dist/src/public/next/server.js +1 -1
  326. package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
  327. package/dist/src/public/sandbox/docker.d.ts +1 -8
  328. package/dist/src/public/sandbox/index.d.ts +3 -3
  329. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
  330. package/dist/src/public/sandbox/just-bash.d.ts +1 -1
  331. package/dist/src/public/sandbox/provider.d.ts +5 -1
  332. package/dist/src/public/sandbox/provider.js +1 -1
  333. package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
  334. package/dist/src/public/sandbox/vercel.d.ts +0 -1
  335. package/dist/src/public/sandbox/vercel.js +1 -1
  336. package/dist/src/public/tools/agent.d.ts +8 -1
  337. package/dist/src/public/tools/agent.js +1 -1
  338. package/dist/src/react/use-eve-agent.d.ts +1 -1
  339. package/dist/src/runtime/agent/resolve-model.js +1 -1
  340. package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
  341. package/dist/src/runtime/connections/openapi-client.js +1 -1
  342. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  343. package/dist/src/runtime/resolve-agent.js +1 -1
  344. package/dist/src/runtime/resolve-channel.js +1 -1
  345. package/dist/src/runtime/resolve-sandbox.js +1 -1
  346. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  347. package/dist/src/runtime/sandbox/registry.d.ts +2 -0
  348. package/dist/src/runtime/sandbox/registry.js +1 -1
  349. package/dist/src/runtime/subagents/workflow.d.ts +6 -0
  350. package/dist/src/runtime/subagents/workflow.js +1 -1
  351. package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
  352. package/dist/src/runtime/workspace/seed-files.js +1 -1
  353. package/dist/src/runtime/workspace/spec.d.ts +1 -1
  354. package/dist/src/runtime/workspace/spec.js +1 -1
  355. package/dist/src/runtime/workspace/types.d.ts +2 -6
  356. package/dist/src/sandbox/provider.d.ts +185 -0
  357. package/dist/src/sandbox/provider.js +1 -0
  358. package/dist/src/sandbox/providers/default.d.ts +20 -19
  359. package/dist/src/sandbox/providers/default.js +1 -1
  360. package/dist/src/sandbox/providers/docker.d.ts +5 -2
  361. package/dist/src/sandbox/providers/docker.js +1 -1
  362. package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
  363. package/dist/src/sandbox/providers/just-bash.js +1 -1
  364. package/dist/src/sandbox/providers/vercel.d.ts +4 -10
  365. package/dist/src/sandbox/providers/vercel.js +1 -1
  366. package/dist/src/sandbox/providers.d.ts +0 -1
  367. package/dist/src/sandbox/providers.js +1 -1
  368. package/dist/src/sandbox/state.d.ts +61 -0
  369. package/dist/src/sandbox/state.js +1 -1
  370. package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
  371. package/dist/src/self-modification/deployed-sandbox.js +1 -1
  372. package/dist/src/self-modification/filesystem.d.ts +3 -3
  373. package/dist/src/self-modification/remote/config.d.ts +2 -2
  374. package/dist/src/self-modification/remote/config.js +1 -1
  375. package/dist/src/self-modification/setup.d.ts +0 -1
  376. package/dist/src/self-modification/setup.js +8 -8
  377. package/dist/src/setup/integrations/discord/api.d.ts +7 -0
  378. package/dist/src/setup/integrations/discord/api.js +1 -1
  379. package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
  380. package/dist/src/setup/integrations/discord/daemon.js +21 -0
  381. package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
  382. package/dist/src/setup/integrations/discord/setup.js +5 -4
  383. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  384. package/dist/src/setup/scaffold/create/project.js +1 -1
  385. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  386. package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
  387. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  388. package/dist/src/shared/agent-definition.d.ts +2 -0
  389. package/dist/src/shared/built-server-start-failure.d.ts +12 -0
  390. package/dist/src/shared/built-server-start-failure.js +3 -0
  391. package/dist/src/shared/framework-eve-server.d.ts +2 -0
  392. package/dist/src/shared/framework-eve-server.js +2 -2
  393. package/dist/src/shared/sandbox-environment.d.ts +4 -10
  394. package/dist/src/shared/sandbox-environment.js +1 -1
  395. package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
  396. package/dist/src/shared/sandbox-provider.d.ts +0 -103
  397. package/dist/src/shared/sandbox-provider.js +1 -1
  398. package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
  399. package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
  400. package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
  401. package/dist/src/shared/sandbox-session-gone-error.js +1 -0
  402. package/dist/src/shared/sandbox-session.d.ts +97 -83
  403. package/dist/src/shared/sandbox-template-error.d.ts +19 -4
  404. package/dist/src/shared/sandbox-template-error.js +1 -1
  405. package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
  406. package/dist/src/shared/sandbox-tool-session-error.js +1 -0
  407. package/dist/src/shared/skill-package.js +1 -1
  408. package/dist/src/shared/skill-paths.d.ts +4 -5
  409. package/dist/src/shared/skill-paths.js +2 -2
  410. package/dist/src/shared/workflow-sandbox.d.ts +4 -41
  411. package/dist/src/shared/workflow-sandbox.js +1 -1
  412. package/dist/src/svelte/index.js +1 -1
  413. package/dist/src/svelte/use-eve-agent.d.ts +1 -1
  414. package/dist/src/svelte/use-eve-agent.js +1 -1
  415. package/dist/src/tools/definition.js +1 -1
  416. package/dist/src/tools/durable-callbacks.d.ts +5 -1
  417. package/dist/src/tools/durable-callbacks.js +1 -1
  418. package/dist/src/tools/dynamic.d.ts +3 -3
  419. package/dist/src/tools/model-output.d.ts +23 -5
  420. package/dist/src/tools/model-output.js +1 -1
  421. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  422. package/dist/src/tools/provided/glob.js +1 -1
  423. package/dist/src/tools/provided/grep.js +1 -1
  424. package/dist/src/tools/provided/read-file.js +1 -1
  425. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  426. package/dist/src/tools/provided/workflow.js +1 -1
  427. package/dist/src/tools/provided/write-file.js +1 -1
  428. package/dist/src/tools/workflow-definition.d.ts +19 -4
  429. package/dist/src/vue/index.js +1 -1
  430. package/dist/src/vue/use-eve-agent.d.ts +1 -1
  431. package/dist/src/vue/use-eve-agent.js +1 -1
  432. package/docs/channels/custom.mdx +3 -3
  433. package/docs/channels/discord.mdx +279 -7
  434. package/docs/channels/eve.mdx +13 -2
  435. package/docs/channels/linq.mdx +2 -2
  436. package/docs/channels/mcp.mdx +2 -2
  437. package/docs/channels/overview.mdx +1 -1
  438. package/docs/channels/photon.mdx +1 -1
  439. package/docs/concepts/built-in-tools.md +31 -8
  440. package/docs/concepts/execution-model-and-durability.mdx +6 -101
  441. package/docs/concepts/security-model.md +2 -0
  442. package/docs/concepts/sessions-runs-and-streaming.md +44 -36
  443. package/docs/connections/openapi.mdx +2 -0
  444. package/docs/evals/overview.mdx +1 -1
  445. package/docs/evals/reporters.mdx +5 -5
  446. package/docs/evals/running.mdx +19 -1
  447. package/docs/guides/client/messages.mdx +1 -1
  448. package/docs/guides/deployment/overview.md +4 -4
  449. package/docs/guides/deployment/self-hosting.md +50 -1
  450. package/docs/guides/dev-tui.md +1 -1
  451. package/docs/guides/dynamic-capabilities.md +2 -2
  452. package/docs/guides/frontend/overview.mdx +34 -10
  453. package/docs/guides/instrumentation/agent-runs.mdx +16 -0
  454. package/docs/guides/instrumentation/otel.mdx +23 -0
  455. package/docs/guides/self-modification.md +1 -1
  456. package/docs/guides/session-context.md +1 -1
  457. package/docs/instructions.mdx +1 -1
  458. package/docs/meta.json +1 -0
  459. package/docs/reference/agent-files.md +4 -4
  460. package/docs/reference/cli.md +24 -17
  461. package/docs/reference/typescript-api.md +9 -3
  462. package/docs/sandbox/custom-providers.mdx +254 -0
  463. package/docs/sandbox/default.mdx +71 -4
  464. package/docs/sandbox/docker.mdx +15 -3
  465. package/docs/sandbox/index.mdx +32 -106
  466. package/docs/sandbox/just-bash.mdx +54 -0
  467. package/docs/sandbox/meta.json +9 -1
  468. package/docs/sandbox/troubleshooting.mdx +215 -0
  469. package/docs/sandbox/vercel.mdx +48 -7
  470. package/docs/skills.mdx +1 -1
  471. package/docs/subagents/index.mdx +2 -2
  472. package/docs/tools/overview.mdx +20 -1
  473. package/docs/tools/workflows.mdx +73 -5
  474. package/docs/tutorial/run-analysis.mdx +2 -2
  475. package/docs/use-cases.mdx +250 -0
  476. package/package.json +14 -20
  477. package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
  478. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
  479. package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
  480. package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
  481. package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
  482. package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
  483. package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
  484. package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
  485. package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
  486. package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
  487. package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
  488. package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
  489. package/dist/src/execution/sandbox/active-handles.js +0 -1
  490. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
  491. package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
  492. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
  493. package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
  494. package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
  495. package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
  496. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
  497. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
  498. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
  499. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
  500. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
  501. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
  502. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
  503. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
  504. package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
  505. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
  506. package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
  507. package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
  508. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
  509. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
  510. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
  511. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
  512. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
  513. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
  514. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
  515. package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
  516. package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
  517. package/dist/src/execution/sandbox/provider-host-development.js +0 -1
  518. package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
  519. package/dist/src/execution/sandbox/provider-host.js +0 -1
  520. package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
  521. package/dist/src/execution/tool-session/sandbox.js +0 -1
  522. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
  523. package/dist/src/public/sandbox/microsandbox-sandbox.js +0 -1
  524. package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
  525. package/dist/src/public/sandbox/microsandbox.js +0 -1
  526. package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
  527. package/dist/src/sandbox/providers/microsandbox.js +0 -1
  528. package/docs/sandbox/microsandbox.mdx +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,86 @@
1
1
  # eve
2
2
 
3
+ ## 0.83.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 25c9fff: Dynamic tools now accept an `endsTurn` function, as static tools do. eve replays it from a durable descriptor like `execute`, so a tool returned by a `defineDynamic` resolver can decide from its output whether the call ends the turn.
8
+ - eda6122: Eval artifacts now record client timing for each captured session: when each request was sent and accepted (including time spent retrying `session_not_ready`) and when each event arrived. `eve eval --keep-state` keeps the local eval server's state, including its Workflow data, after the run.
9
+ - 77f4473: `eve eval --repeat <n>` and the `repeat` option in `evals.config.ts` run every eval `n` times to measure repeatability. Each attempt is reported as its own result with a 1-based `attempt`, with its own artifact files, Braintrust row, JUnit test case, and Datadog run iteration, and the console summary shows a per-eval pass rate such as `3/5 passed`.
10
+ - 6f551a7: Model calls no longer resume the session sandbox just to render attachment labels. Images and PDFs that eve staged or already read for the session are served from a bounded in-memory cache, so the sandbox is resumed only when eve needs bytes it doesn't already hold.
11
+ - d77462d: Non-module files under `agent/lib/`, such as a JSON file imported by a helper, no longer fail discovery. eve ignores them like it does in `tools/`, `channels/`, and `hooks/`, and the bundler resolves them when imported.
12
+ - 3fbef89: Sandbox work no longer delays the model call. Prewarmed sessions start the sandbox in the background, turns resume a sandbox the session already uses as they begin, and dynamic skill files are written in the background; a tool that uses the sandbox waits only for what remains. A first message sent to a prewarmed session no longer waits for prewarming, and its `defineSandbox()` selector runs with the auth of the request that created the session.
13
+ - 0a9f857: Add correlated OpenTelemetry events for session handover forwarding and inbox unblocking. Receiver observations include a replay-stable Workflow timestamp and are exported by the next existing turn step without adding tracing-only Workflow steps.
14
+
15
+ ## 0.83.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 12a1e90: `DefaultSandbox` now selects its provider once, when eve prepares the sandbox, and records the choice in the build: Vercel Sandbox on Vercel, then Docker when a daemon is reachable, then just-bash only in `eve dev` and `eve eval`. The runtime uses the recorded provider instead of probing the host again, so a build and its server can no longer select different providers. A production `eve build` with neither Vercel nor Docker no longer falls back to just-bash: the build succeeds, and opening the sandbox fails with an error that asks you to start Docker and rebuild, deploy to Vercel, or select a provider explicitly.
20
+
21
+ `DefaultSandbox.environment().open()` now accepts `networkPolicy`, and its sessions expose `setNetworkPolicy()`. eve forwards the policy to the selected provider. Docker rejects any policy other than `"allow-all"` or `"deny-all"` when it opens the sandbox, instead of starting the container with open network access, and just-bash rejects any policy other than `"allow-all"`.
22
+
23
+ Sessions now record their sandbox under the provider name `"default"` instead of `vercel`, `docker`, or `just-bash`. Sessions saved by an earlier eve under the provider that `DefaultSandbox` selected resume the same sandbox. When a session's recorded state belongs to another provider or state protocol, for example after you change providers, eve now starts a fresh sandbox instead of failing; the old sandbox is not deleted. This upgrade is one-way: if you roll back to an earlier eve release, sessions created on this release fail to open their sandbox, because earlier releases reject state recorded under `"default"`.
24
+
25
+ `VercelSandbox.environment()` no longer captures a snapshot when the environment has no `prepare` callback, no managed workspace or skill files, and no `source`. Session sandboxes start from the image and install the base runtime themselves, as `DefaultSandbox` already did on Vercel. Such sessions now apply a `networkPolicy` set on the environment after base setup; before, only a policy passed to `open()` applied, so `VercelSandbox.environment({ networkPolicy })` and `DefaultSandbox.environment({ vercel: { networkPolicy } })` could leave a session with open network access.
26
+ - 62112b5: The just-bash sandbox provider now runs on the public `defineSandboxProvider()` API, and `customCommands` and `filesystem` use eve-owned types from `eve/sandbox/just-bash`, such as `JustBashCommand` and `JustBashFilesystem`, that still accept just-bash's `defineCommand()` results and filesystems. Local just-bash templates rebuild once after upgrading, since their keys no longer include custom commands or the filesystem; reading a directory now rejects instead of returning `null`, and a command ending in a `# comment` runs in any working directory.
27
+ - 8b68a92: Remove the microsandbox sandbox provider. The `eve/sandbox/microsandbox` export and the `microsandbox` option on `DefaultSandbox.environment()` are gone, and `DefaultSandbox` now selects Vercel Sandbox on Vercel, then Docker when a daemon is reachable, then just-bash. To migrate, switch `MicrosandboxSandbox.image()` and `MicrosandboxSandbox.dockerfile()` to `DockerSandbox.image()` and `DockerSandbox.dockerfile()` from `eve/sandbox/docker`, and remove the `microsandbox` dependency. A session that recorded a microsandbox sandbox starts a fresh sandbox from its current provider on its next `ctx.getSandbox()`.
28
+
29
+ eve no longer cleans up what microsandbox left on your machine. Before you uninstall `microsandbox`, use its tooling to remove sandboxes and snapshots whose names start with `eve-sbx-`. Then delete `.eve/sandbox-cache/microsandbox` in each app. If you used `MicrosandboxSandbox.dockerfile()`, also run `docker rm -f eve-sandbox-registry` to remove the local image registry it started, and remove the local images tagged `127.0.0.1:51921/eve/…`.
30
+
31
+ Deployed self-modification (`eve/self-modification/remote`) now requires deploying on Vercel. Builds still succeed on any host, but in a deployment outside Vercel the deployed subagent fails with an error that names this requirement when it opens its sandbox.
32
+ - 5b27aa8: **Breaking for custom sandbox providers.** `defineSandboxProvider()` now takes a byte-level `SandboxConnection` (`spawn`, `readFile`, `writeFiles`, `removePath`, `stop`, optional `close` and `extensions`), and eve derives the full sandbox session from it. Built-in providers are unchanged. See the [custom sandbox providers guide](https://eve.dev/docs/sandbox/custom-providers). To migrate a provider:
33
+
34
+ - Return `{ connection, state }` from `start()` and a connection from `resume()`. `onSandboxStop()` and `onRuntimeShutdown()` become `connection.stop()`, and `onSandboxDelete()` folds into `onSessionEnd()` with `reason: "deleted"`.
35
+ - Replace `ctx.resources` and `ctx.sourceRevision` with `ctx.templateKey()` and `ctx.populate()`, and remove your own `prepare` option, which eve now runs. `environment()` receives `{}` instead of `undefined` when no options are passed. Set `toolSessions: true` to support keyed `invokeTool` calls.
36
+ - Rename `SandboxPreparedArtifact` to `SandboxJson`, `SandboxProviderSessionContext` to `SandboxSessionContext`, and `SandboxProviderPrepareContext` to `SandboxPrepareContext`. `SandboxProviderHandle` and the `SandboxProviderResource*` and `SandboxProviderTargetFile` types are removed, as is `ctx.host`.
37
+
38
+ `eve/sandbox/provider` also exports `SandboxSessionGoneError`, `SandboxTemplateNotProvisionedError`, and `SANDBOX_AGENT_ENV`. In `eve/sandbox`, `SandboxSession` gains a required `writeFiles()`, so hand-built sessions such as test doubles need one, and `SandboxNetworkPolicy` is now an eve-owned type rather than the Vercel Sandbox SDK's `NetworkPolicy`.
39
+ - 3f698dd: Sandbox providers now key each sandbox by its session: `start()` must return the existing sandbox for `ctx.session.id` when one exists, and the required `onSessionEnd(ctx, state | null, { reason })` takes no artifact and must delete by key when `state` is `null`. Session end now removes a sandbox even when the session never recorded it, such as one a subagent sharing the sandbox opened first. Built-in providers keep a session's sandbox across rebuilds and open-option changes.
40
+ - 950409f: `VercelSandbox` now runs on the public `defineSandboxProvider()` API, keeping existing sandbox names, session state, and snapshots. Breaking: a relative `workingDirectory` now resolves from `/workspace`, and `eve/sandbox/vercel` no longer re-exports `Drive`, so import it from `@vercel/sandbox` instead.
41
+
42
+ ### Patch Changes
43
+
44
+ - bd050f8: Clearer sandbox error messages. Sandbox errors now say what went wrong and how to fix it, for example when the build and the runtime select different providers, a prepared template is missing, a session's sandbox came from another provider, or the sandbox file does not export its environment.
45
+ - 95571f1: Fix discovery of extension mounts written as `export { default } from "<pkg>"` inside a packaged extension, which `eve extension build` compiles to `import x from "<pkg>"; export { x as default };`.
46
+ - 7066b20: `eve dev` memory no longer grows with every save. Each rebuild now compiles and bundles your agent in a short-lived child process, and each new version of your code is served by a fresh worker, so old copies of authored modules no longer stay loaded. Modules imported by relative path now keep their package's `sideEffects` setting, so identical source bundles the same way on every save; in `"type": "module"` apps, default imports of older CommonJS packages that set `__esModule` now follow Node's rules. Thanks @callicles for reporting this in #5203.
47
+ - dff87bc: `eve dev` now rebuilds once per edit to a source-backed workspace extension. Before, the temporary `.eve-extension-build-*` files from the extension build started a second, unnecessary rebuild.
48
+ - 2b07d0a: The Discord channel can now answer DMs, mentions, and thread replies. `discordChannel({ gateway: {} })` accepts messages forwarded from the Discord Gateway, and `experimental_runDiscordGatewayRelay` from the new `eve/channels/discord/gateway` entry point holds that connection, for example in a Vercel Daemon. In text channels, a mention starts a thread that holds the conversation, and a reply to any bot message continues the session that posted it; set `gateway.startThread: false` to answer in the channel, or return `conversation` or `startThread` from `gateway.onMessage` to decide per message. `defaultDiscordMessageAuth` gives a message's author the same principal `defaultDiscordAuth` gives them for commands and button presses.
49
+ - 87962a0: `eve add channel/discord` now first asks whether people reach the agent through DMs, mentions, and threads, or a slash command. The first scaffolds the Discord Gateway relay in `daemon/`, registers it as a Vercel Daemon in `vercel.json`, enables `gateway` on the channel, turns on the bot's Message Content intent when Discord allows it, and skips registering `/ask`; the second keeps today's slash command setup and is what `--yes` picks. Non-interactive runs answer `discord-messages` with `"gateway"` or `"commands"`.
50
+ - acc76d5: The Discord channel now shows connection sign-ins. In a DM it posts the sign-in link and any confirmation code; in a server it posts a **Sign in** button that shows the link only to the person who has to sign in, in an ephemeral message. The message updates once the sign-in completes or is cancelled.
51
+ - 4db529f: `DockerSandbox` now runs on the public `defineSandboxProvider()` contract. Container names, recorded session state, and template image references stay the same, so running sessions and prepared images from earlier builds keep working. A few behaviors change: `sandbox.delete()` removes the session's container by its session-derived name, honors the caller's `abortSignal`, and succeeds when the container is already gone; eve normalizes relative paths such as `logs/../out.txt` to `/workspace/out.txt` before they reach the container; and a Docker environment's `prepare` callback is typed with `DockerSandboxSession`.
52
+ - 5cf30b6: A dynamic model resolver's `step.started` event now carries the index of the step it selects a model for. From the second step of a turn on, it used to carry the previous step's index, so per-step work keyed on `stepIndex` was attributed to the wrong step.
53
+ - 3c25e62: A dynamic skill that stops returning `files` but is still returned now keeps the files already written to the sandbox, so files the sandbox provides another way, such as from its snapshot, stay in place. If you dropped `files` to take files away from some callers, stop returning the skill for them instead: a skill the resolver stops returning still has its files removed. On Vercel Sandbox, eve now writes a dynamic skill's files in one batch, with one path lookup and one upload instead of two round trips per file.
54
+ - 1bbe939: `eve eval` artifacts now record each eval's `startedAt` and `completedAt` in `summary.json`, `results.jsonl`, and the per-eval detail file.
55
+ - 448804d: An eval's `derived.usage` now takes each session's latest usage by time. An eval that captured a session again with an earlier snapshot reported that snapshot's lower total. Its `costUsd` is now absent when a counted session reported no cost, instead of summing only the sessions that did.
56
+ - 94784e1: Validate idle session state inside the workflow before starting a deployment handoff, avoiding unnecessary successor starts when durable work is still pending. Preserve inbox ownership and the original session stream throughout the move.
57
+ - 580417f: Fix repeated horizontal rules and question text accumulating in terminal scrollback during human-in-the-loop prompts. Question and approval drawers now fit small terminals, keeping the focused choice or text editor visible.
58
+ - b848a51: Avoid an extra setup command when creating a Vercel sandbox from a prepared snapshot of the standard eve image without Drive mounts. eve now checks the base runtime again after authored preparation, so a `prepare` callback that breaks it fails the build; existing sandboxes, resumes, custom images or sources, Drive mounts, and sandboxes without a prepared snapshot keep their setup checks. Vercel templates rebuild once so every snapshot has passed the new check.
59
+ - 39a8b4c: A session whose sandbox is gone (for example after a removed Docker container, a deleted Vercel Sandbox, or a deleted just-bash session directory) now starts a fresh sandbox on its next `ctx.getSandbox()`. Previously every sandbox call in that session failed with the same resume error until the session ended. Thanks @bradhallett for reporting this in #5113 and @moinulmoin for the just-bash case in #4440.
60
+ - bb4afff: New sessions start their first model step sooner, and later turns no longer wait for their cancellation hooks to register before their first step. Thanks @Lukavyi for reporting the startup latency in #876.
61
+ - 798a91e: The Linq channel now rejects inbound webhooks with a 401 whenever its webhook verifier returns any falsy value, including the `null` that `vercelOidc()` returns for a missing or invalid token. Previously only `false` rejected a request, so Vercel Connect setups without a `signingSecret` accepted unsigned webhooks.
62
+ - aaae448: Self-hosted `eve start` servers now reject requests to `/.well-known/workflow/v1/flow` that did not come from the server's own workflow queue, so a client can no longer forge a workflow delivery with a chosen run context or principal. Startup always recovers pending and running local workflow runs through the authenticated queue, ignoring `WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS`; queue deliveries must stay on the process that enqueued them.
63
+ - 9d1998f: Export `agentWithModel` for `agent/tools/agent.ts` to opt into a root-copy tool whose model-facing input selects the AI Gateway model for each task.
64
+ - cbc87ae: OpenAPI connection tool calls now follow redirects only within the base URL's origin. A redirect to another origin is returned as the tool result, with its target in `location`, instead of followed, so credentials in custom headers, such as an `apiKey` security scheme's header, no longer reach the redirect target. A same-origin redirect loop now fails after 10 hops with an explicit error.
65
+ - 7a908f5: Compaction summaries now run on the AI SDK model instance set as `compaction.model`. Before, a direct model instance there was ignored and summaries ran on the agent's top-level `model`.
66
+ - 84daf59: Compiles now prune `node_modules/.cache/eve/authored-modules` in the background, deleting cached bundles that no running eve process can still import, so the directory no longer grows without bound locally or in persisted Vercel build caches. Thanks @ryantbrown for reporting this in #847 and @kevludwig for reporting the Vercel build-cache impact.
67
+ - 9bd75df: `server-only` and `client-only` imports now load as empty modules in every eve bundle, so tools, channels, workflow steps, and shared workspace packages that import them build and boot without `--conditions=react-server` or a direct dependency. Thanks @jakeleventhal for the original implementation in #3752.
68
+ - b9f984c: Update the bundled Workflow runtime to reduce redundant history reads during concurrent hook registration and avoid unnecessary input/output reads when resuming hooks. Include replay-ordering fixes and the local-world fix for deliveries that race a session handoff.
69
+ - f5b36b3: Repair orphaned local tool calls in saved history before the next model request with an explicit unknown-outcome error. The repair never reruns tools or moves recorded results, and leaves provider-executed calls, approval requests and duplicate call IDs alone.
70
+ - 1fe0d91: Dynamic skills with supporting files are written into a sandbox that eve recreates after the old one was gone, at the start of the next turn. Before, the recreated sandbox got the same identity as the old one, so its skills were missing their files until the skill changed.
71
+ - b3ede07: The Linq and Photon channels' default webhook verification now only accepts Vercel OIDC tokens from the same project and environment.
72
+ - 00aa593: eve now runs every sandbox provider, including `DefaultSandbox`, directly on the public `defineSandboxProvider()` contract, and calls `connection.close()` when the step that opened a connection ends, so the next step resumes through a new connection. Server shutdown stops only connections eve still holds, so a custom provider that defines `close()` and runs remote compute should bound idle compute itself, for example with an idle timeout.
73
+ - c3bbae4: Relative symlinks in an agent's `sandbox/workspace/` files, in skill packages, and in sandbox templates now stay relative in build output and in each sandbox session. Before, eve rewrote them as absolute host paths: `just-bash` sessions rejected them with `EACCES ... resolves outside sandbox`, and they did not resolve inside Docker, microsandbox, or remote sandboxes.
74
+ - 00aa593: Custom sandbox providers can declare `workspaceRoot` on a connection, and eve resolves relative paths, the default working directory, `resolvePath(".")`, and build-time workspace seeding from it; built-in providers keep `/workspace`. The `read_file`, `write_file`, `glob`, and `grep` tools now accept paths relative to the workspace root, and the workspace and skills prompt sections no longer name `/workspace`.
75
+ - db18149: `eve start` and the `withEve` production server for Next.js now fail fast with a clear "port is already in use" error when another process holds the port, instead of reporting a server they did not start and leaving the built server running in the background. Thanks @KingAmo for reporting this in #4938.
76
+ - 9d804f2: A sandbox that was stopped and then ended no longer stays registered for server shutdown, so long-running eve servers stop accumulating ended sessions and shutdown no longer stops their connections again.
77
+ - f1656a5: Tools can now hand the model a file by URL. `toolOutputPart.fileUrl(url, { mediaType })` from `eve/tools` returns a `{ type: "file", data: { type: "url", url } }` content part from `toModelOutput`, so a large file such as a presigned PDF link reaches the model without being base64-encoded, staged into the sandbox, or stored in session history. Only `https:` URLs are accepted, and the URL must stay readable for the rest of the session because every later model call sends it again.
78
+ - ea3a387: Calling `prewarm()` on an existing session can now prepare an idle owner on the Vercel deployment accepting the request before the next message. Apps can trigger it when typing starts; it preserves the session, history, stream, and expiry, and does not block Send or run the model.
79
+
80
+ Preparation uses the existing `POST /eve/v1/session/:sessionId` endpoint with no body or `{}`. Requests with messages or input responses keep their existing behavior.
81
+ - 07dbdef: Each start or resume of a `workflow` tool program may now run up to 30 seconds of JavaScript and take up to 5 minutes in total, and time spent waiting for child agents counts toward neither limit.
82
+ - dd0aac6: A `"use step"` helper in a workflow tool can now call `ctx.getSandbox()` to open the sandbox of the session that called the tool, on any sandbox provider, so a task can prepare files the session's later tool calls read. When the session had not recorded its sandbox when it called the tool, the step opens it with the owning session's sandbox definition; the step never owns the sandbox, and the session removes it when the session ends.
83
+
3
84
  ## 0.82.0
4
85
 
5
86
  ### Minor Changes
package/NOTICE CHANGED
@@ -4,7 +4,7 @@ Copyright 2026 Vercel, Inc. and contributors
4
4
  This product includes software developed at Vercel, Inc.
5
5
  (https://vercel.com/).
6
6
 
7
- The bundled code-mode runtime includes run, Copyright 2023 Vercel, Inc.,
7
+ The bundled workflow program runtime is run, Copyright 2023 Vercel, Inc.,
8
8
  licensed under the Apache License, Version 2.0.
9
9
 
10
10
  run embeds devalue 5.8.2, quickjs-wasi 3.6.0, and QuickJS under the MIT
@@ -7,4 +7,9 @@ type AuthorizationRequired = AuthorizationRequiredStreamEvent["data"];
7
7
  * `attemptId`, so one attempt completing never hides another still pending.
8
8
  */
9
9
  export declare function findPendingAuthorization(session: Pick<Session, "getEventStream">, matches: (event: AuthorizationRequired) => boolean): Promise<AuthorizationRequired | undefined>;
10
+ /** Identifies one sign-in attempt: a connection name and its `attemptId`. */
11
+ export declare function attemptKey(event: {
12
+ readonly attemptId?: string;
13
+ readonly name: string;
14
+ }): string;
10
15
  export {};
@@ -1 +1 @@
1
- async function findPendingAuthorization(e,t){let n=new Map,r=(await e.getEventStream({follow:!1,startIndex:-500})).getReader();try{for(;;){let e=await r.read();if(e.done)break;let i=e.value;if(i.type===`authorization.required`&&t(i.data)){let e=attemptKey(i.data);n.delete(e),n.set(e,i.data)}else i.type===`authorization.completed`&&n.delete(attemptKey(i.data))}}finally{await r.cancel().catch(()=>{})}return[...n.values()].at(-1)}function attemptKey(e){return JSON.stringify([e.name,e.attemptId??null])}export{findPendingAuthorization};
1
+ async function findPendingAuthorization(e,t){let n=new Map,r=(await e.getEventStream({follow:!1,startIndex:-500})).getReader();try{for(;;){let e=await r.read();if(e.done)break;let i=e.value;if(i.type===`authorization.required`&&t(i.data)){let e=attemptKey(i.data);n.delete(e),n.set(e,i.data)}else i.type===`authorization.completed`&&n.delete(attemptKey(i.data))}}finally{await r.cancel().catch(()=>{})}return[...n.values()].at(-1)}function attemptKey(e){return JSON.stringify([e.name,e.attemptId??null])}export{attemptKey,findPendingAuthorization};
@@ -22,6 +22,8 @@ export interface Session {
22
22
  cancel(options?: {
23
23
  turnId?: string;
24
24
  }): Promise<CancelTurnResult>;
25
+ /** Prepares an idle session on the deployment accepting this request, without a model turn. */
26
+ prewarm(): Promise<import("#protocol/prewarm-session.js").PrewarmSessionResult>;
25
27
  /** Queues compaction on this exact session ID. */
26
28
  compact(): Promise<CompactSessionResult>;
27
29
  /** Queues a context clear on this exact session ID. */
@@ -1 +1 @@
1
- import{attachClientContext,readClientContext}from"#internal/client-context.js";import{validateDeliveryIdempotencyKey}from"#channel/delivery-idempotency.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{serializeFilePartsInMessage}from"#channel/send-input.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{validateSessionHistory}from"#shared/session-history.js";import{parseInputResponses}from"#shared/input.js";import{AuthKey,ContinuationHookTokensKey,ContinuationTokenKey,InitiatorAuthKey,SessionIdKey}from"#context/keys.js";import{toChannelLocalContinuationToken}from"#shared/continuation-token.js";function createSession(e,t,n={}){return{id:e,async send(r,i){validateDeliveryIdempotencyKey(i.idempotencyKey);let a=createDelivery(n),o=sessionCallbackToTurnCaller(i.callback),s=validateSessionHistory(i.history),c=attachClientContext({message:serializeFilePartsInMessage(r)},readClientContext(i));i.context!==void 0&&(c.context=i.context),s!==void 0&&(c.history=s),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:a,kind:`send`,payload:c,requestId:n.requestId,turnPolicy:i.turnPolicy??n.turnPolicy??DEFAULT_TURN_POLICY,title:i.title};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async respond(r,i){if(validateDeliveryIdempotencyKey(i.idempotencyKey),r.length===0)throw Error(`respond() requires at least one input response.`);let a=parseInputResponses(r),o=sessionCallbackToTurnCaller(i.callback),s=createDelivery(n),c=attachClientContext({inputResponses:a},readClientContext(i));i.context!==void 0&&(c.context=i.context),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:s,kind:`send`,payload:c,requestId:n.requestId};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async cancel(n){let r={kind:`cancel`};return n?.turnId!==void 0&&(r.turnId=n.turnId),await t.dispatchSession({command:r,sessionId:e})},async compact(){return await t.dispatchSession({command:{kind:`compact`},sessionId:e})},async clear(){return await t.dispatchSession({command:{kind:`clear`},sessionId:e})},async reset(n){return await t.dispatchSession({command:{kind:`reset`,reason:n?.reason},sessionId:e})},async getEventStream(n){return t.getEventStream(e,n)},async getStreamTailIndex(){return t.getStreamTailIndex(e)}}}function createAttachSessionFn(e,t={}){return n=>createSession(n,e,t)}function createDelivery(e){return e.channelKind!==void 0&&e.channelName!==void 0?createChannelDeliveryMetadata(e):void 0}function buildSessionHandle(e){return{get id(){return e.get(SessionIdKey)??``},get auth(){return{current:e.get(AuthKey)??null,initiator:e.get(InitiatorAuthKey)??null}},get continuation(){let t=e.get(ContinuationTokenKey);if(t!==void 0&&t.length!==0)return{token:toChannelLocalContinuationToken(t),alias(n){if(n.length===0)throw Error(`A session alias requires a nonempty token.`);let r=namespaceContinuationToken(t,n);t!==r&&(e.set(ContinuationHookTokensKey,e=>{let n=e??[t];return n.includes(r)?n:[...n,r]}),e.set(ContinuationTokenKey,r))}}}}}function namespaceContinuationToken(e,t){let n=e.indexOf(`:`);if(n<=0)throw Error(`Cannot set session continuation token without an existing namespaced continuation token. Start the session with a placeholder continuationToken.`);return`${e.slice(0,n+1)}${t}`}function sessionCallbackToTurnCaller(e){return e===void 0?void 0:{callId:e.callId,replyTo:{kind:`callback`,token:e.token,url:e.url},subagentName:e.subagentName}}export{buildSessionHandle,createAttachSessionFn,createSession,sessionCallbackToTurnCaller};
1
+ import{attachClientContext,readClientContext}from"#internal/client-context.js";import{validateDeliveryIdempotencyKey}from"#channel/delivery-idempotency.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{serializeFilePartsInMessage}from"#channel/send-input.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{validateSessionHistory}from"#shared/session-history.js";import{parseInputResponses}from"#shared/input.js";import{AuthKey,ContinuationHookTokensKey,ContinuationTokenKey,InitiatorAuthKey,SessionIdKey}from"#context/keys.js";import{toChannelLocalContinuationToken}from"#shared/continuation-token.js";function createSession(e,t,n={}){return{id:e,async send(r,i){validateDeliveryIdempotencyKey(i.idempotencyKey);let a=createDelivery(n),o=sessionCallbackToTurnCaller(i.callback),s=validateSessionHistory(i.history),c=attachClientContext({message:serializeFilePartsInMessage(r)},readClientContext(i));i.context!==void 0&&(c.context=i.context),s!==void 0&&(c.history=s),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:a,kind:`send`,payload:c,requestId:n.requestId,turnPolicy:i.turnPolicy??n.turnPolicy??DEFAULT_TURN_POLICY,title:i.title};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async respond(r,i){if(validateDeliveryIdempotencyKey(i.idempotencyKey),r.length===0)throw Error(`respond() requires at least one input response.`);let a=parseInputResponses(r),o=sessionCallbackToTurnCaller(i.callback),s=createDelivery(n),c=attachClientContext({inputResponses:a},readClientContext(i));i.context!==void 0&&(c.context=i.context),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:s,kind:`send`,payload:c,requestId:n.requestId};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async cancel(n){let r={kind:`cancel`};return n?.turnId!==void 0&&(r.turnId=n.turnId),await t.dispatchSession({command:r,sessionId:e})},async prewarm(){return await t.dispatchSession({command:{kind:`prewarm`,targetDeploymentId:n.acceptedDeploymentId},sessionId:e})},async compact(){return await t.dispatchSession({command:{kind:`compact`},sessionId:e})},async clear(){return await t.dispatchSession({command:{kind:`clear`},sessionId:e})},async reset(n){return await t.dispatchSession({command:{kind:`reset`,reason:n?.reason},sessionId:e})},async getEventStream(n){return t.getEventStream(e,n)},async getStreamTailIndex(){return t.getStreamTailIndex(e)}}}function createAttachSessionFn(e,t={}){return n=>createSession(n,e,t)}function createDelivery(e){return e.channelKind!==void 0&&e.channelName!==void 0?createChannelDeliveryMetadata(e):void 0}function buildSessionHandle(e){return{get id(){return e.get(SessionIdKey)??``},get auth(){return{current:e.get(AuthKey)??null,initiator:e.get(InitiatorAuthKey)??null}},get continuation(){let t=e.get(ContinuationTokenKey);if(t!==void 0&&t.length!==0)return{token:toChannelLocalContinuationToken(t),alias(n){if(n.length===0)throw Error(`A session alias requires a nonempty token.`);let r=namespaceContinuationToken(t,n);t!==r&&(e.set(ContinuationHookTokensKey,e=>{let n=e??[t];return n.includes(r)?n:[...n,r]}),e.set(ContinuationTokenKey,r))}}}}}function namespaceContinuationToken(e,t){let n=e.indexOf(`:`);if(n<=0)throw Error(`Cannot set session continuation token without an existing namespaced continuation token. Start the session with a placeholder continuationToken.`);return`${e.slice(0,n+1)}${t}`}function sessionCallbackToTurnCaller(e){return e===void 0?void 0:{callId:e.callId,replyTo:{kind:`callback`,token:e.token,url:e.url},subagentName:e.subagentName}}export{buildSessionHandle,createAttachSessionFn,createSession,sessionCallbackToTurnCaller};
@@ -179,6 +179,9 @@ export type SessionCommand = {
179
179
  } | {
180
180
  readonly kind: "cancel";
181
181
  readonly turnId?: string;
182
+ } | {
183
+ readonly kind: "prewarm";
184
+ readonly targetDeploymentId?: string;
182
185
  } | {
183
186
  readonly kind: "compact";
184
187
  } | {
@@ -204,6 +207,8 @@ export type ResetSessionResult = {
204
207
  readonly status: "no_active_session";
205
208
  };
206
209
  export type SessionCommandResult<TCommand extends SessionCommand = SessionCommand> = TCommand extends {
210
+ readonly kind: "prewarm";
211
+ } ? import("#protocol/prewarm-session.js").PrewarmSessionResult : TCommand extends {
207
212
  readonly kind: "send";
208
213
  } ? SessionSendCommandResult : TCommand extends {
209
214
  readonly kind: "cancel";
@@ -1751,9 +1751,11 @@ function isResultCompletedEvent(event) {
1751
1751
  //#region src/client/message-response.ts
1752
1752
  const consumeResponse = Symbol("consumeMessageResponse");
1753
1753
  const acceptedDeliveryId = Symbol("acceptedDeliveryId");
1754
+ const sendReceipt = Symbol("sendReceipt");
1754
1755
  var MessageResponse = class {
1755
1756
  sessionId;
1756
1757
  [acceptedDeliveryId];
1758
+ [sendReceipt];
1757
1759
  #cancelTurn;
1758
1760
  #cancellation;
1759
1761
  #consumed = false;
@@ -1765,6 +1767,7 @@ var MessageResponse = class {
1765
1767
  this.#cancelTurn = input.cancelTurn;
1766
1768
  this.sessionId = input.sessionId;
1767
1769
  this[acceptedDeliveryId] = input.deliveryId;
1770
+ this[sendReceipt] = input.receipt;
1768
1771
  this.#createStream = input.createStream;
1769
1772
  this.#resumesTurn = input.resumesTurn ?? false;
1770
1773
  }
@@ -1821,6 +1824,18 @@ function consumeMessageResponse(response, source) {
1821
1824
  return response[consumeResponse](source);
1822
1825
  }
1823
1826
 
1827
+ //#endregion
1828
+ //#region src/protocol/prewarm-session.ts
1829
+ const PrewarmResponseSchema = z.object({
1830
+ ok: z.literal(true),
1831
+ status: z.enum([
1832
+ "ready",
1833
+ "accepted",
1834
+ "unsupported",
1835
+ "no_active_session"
1836
+ ])
1837
+ });
1838
+
1824
1839
  //#endregion
1825
1840
  //#region src/protocol/cancel-turn.ts
1826
1841
  const CancelTurnResponseSchema = z.discriminatedUnion("status", [z.strictObject({
@@ -1867,6 +1882,17 @@ const ResetResponseSchema = z.discriminatedUnion("status", [z.object({
1867
1882
 
1868
1883
  //#endregion
1869
1884
  //#region src/client/session-controls.ts
1885
+ async function prewarmClientSession(input) {
1886
+ const { payload } = await postJson({
1887
+ context: input.context,
1888
+ operation: "Prewarm",
1889
+ path: createEveSessionRoutePath(input.sessionId),
1890
+ signal: input.signal
1891
+ });
1892
+ const result = PrewarmResponseSchema.safeParse(payload);
1893
+ if (!result.success) throw new Error("Prewarm route returned an invalid response.");
1894
+ return { status: result.data.status };
1895
+ }
1870
1896
  async function cancelClientSession(input) {
1871
1897
  const { signal, ...body } = input.options ?? {};
1872
1898
  const { payload, response } = await postJson({
@@ -2323,14 +2349,22 @@ var ClientSession = class ClientSession {
2323
2349
  this.#state = state;
2324
2350
  }
2325
2351
  static async create(context, input) {
2352
+ const startedAt = Date.now();
2326
2353
  const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true, input.stubs);
2327
- const { sessionId } = await readAcceptedMessage(response);
2354
+ const acceptedAt = Date.now();
2355
+ const { sessionId, deliveryId } = await readAcceptedMessage(response);
2328
2356
  const session = new ClientSession(context, {
2329
2357
  sessionId,
2330
2358
  streamIndex: 0
2331
2359
  });
2360
+ const receipt = {
2361
+ deliveryId,
2362
+ startedAt,
2363
+ notReadyMs: 0,
2364
+ acceptedAt
2365
+ };
2332
2366
  return {
2333
- response: session.#messageResponse(response, input, 0),
2367
+ response: session.#messageResponse(response, input, 0, void 0, receipt),
2334
2368
  session
2335
2369
  };
2336
2370
  }
@@ -2377,11 +2411,21 @@ var ClientSession = class ClientSession {
2377
2411
  async #send(input, retrySessionNotReady) {
2378
2412
  const initialStreamIndex = this.#state.streamIndex;
2379
2413
  const path = createEveSessionRoutePath(this.#state.sessionId);
2380
- const response = retrySessionNotReady ? await postSessionSend(this.#context, path, input) : await postTurn(this.#context, path, input, false);
2414
+ const { response, timing } = await postSessionSend(this.#context, path, input, retrySessionNotReady);
2381
2415
  const { sessionId: responseSessionId, deliveryId } = await readAcceptedMessage(response, this.#state.sessionId);
2382
2416
  if (responseSessionId !== this.#state.sessionId) throw new Error("Message route returned a different session id.");
2383
2417
  if (input.message !== void 0 && deliveryId === void 0) throw new Error("Message route did not return a delivery id. Update the server before sending with this client.");
2384
- return this.#messageResponse(response, input, initialStreamIndex, input.message === void 0 ? void 0 : deliveryId);
2418
+ return this.#messageResponse(response, input, initialStreamIndex, input.message === void 0 ? void 0 : deliveryId, {
2419
+ ...timing,
2420
+ deliveryId
2421
+ });
2422
+ }
2423
+ async prewarm(options) {
2424
+ return await prewarmClientSession({
2425
+ context: this.#context,
2426
+ sessionId: this.#state.sessionId,
2427
+ signal: options?.signal
2428
+ });
2385
2429
  }
2386
2430
  async cancel(options) {
2387
2431
  return await cancelClientSession({
@@ -2422,12 +2466,13 @@ var ClientSession = class ClientSession {
2422
2466
  keepAlive: true
2423
2467
  });
2424
2468
  }
2425
- #messageResponse(response, input, initialStreamIndex, deliveryId) {
2469
+ #messageResponse(response, input, initialStreamIndex, deliveryId, receipt) {
2426
2470
  response.body?.cancel().catch(() => {});
2427
2471
  return new MessageResponse({
2428
2472
  cancelTurn: async (turnId) => await this.cancel({ turnId }),
2429
2473
  createStream: (source) => this.#createEventStream(initialStreamIndex, input, deliveryId, source),
2430
2474
  deliveryId,
2475
+ receipt,
2431
2476
  resumesTurn: input.inputResponses !== void 0,
2432
2477
  sessionId: this.#state.sessionId
2433
2478
  });
@@ -2508,14 +2553,23 @@ var ClientSession = class ClientSession {
2508
2553
  function followClientSession(session, options) {
2509
2554
  return session[followSession](options);
2510
2555
  }
2511
- async function postSessionSend(context, path, input) {
2512
- const readyDeadline = Date.now() + SESSION_SEND_READY_TIMEOUT_MS;
2556
+ async function postSessionSend(context, path, input, retrySessionNotReady) {
2557
+ const startedAt = Date.now();
2558
+ const readyDeadline = startedAt + SESSION_SEND_READY_TIMEOUT_MS;
2513
2559
  let retryDelayMs = SESSION_SEND_RETRY_BASE_DELAY_MS;
2514
2560
  for (;;) {
2561
+ const attemptAt = Date.now();
2515
2562
  try {
2516
- return await postTurn(context, path, input, false);
2563
+ return {
2564
+ response: await postTurn(context, path, input, false),
2565
+ timing: {
2566
+ startedAt,
2567
+ notReadyMs: attemptAt - startedAt,
2568
+ acceptedAt: Date.now()
2569
+ }
2570
+ };
2517
2571
  } catch (error) {
2518
- if (!isSessionNotReady(error)) throw error;
2572
+ if (!retrySessionNotReady || !isSessionNotReady(error)) throw error;
2519
2573
  const remainingMs = readyDeadline - Date.now();
2520
2574
  if (remainingMs <= 0) throw error;
2521
2575
  await sleep(Math.min(retryDelayMs, remainingMs), input.signal);
@@ -4358,17 +4412,22 @@ var EveAgentStore = class {
4358
4412
  }
4359
4413
  prewarm() {
4360
4414
  if (this.#prewarmPromise !== void 0) return this.#prewarmPromise;
4361
- if (this.#session !== void 0 || this.#externalSession) return Promise.resolve();
4362
- if (this.#activeTurn !== void 0) return this.#activeTurn.response.then((response) => {
4415
+ if (this.#session === void 0 && this.#externalSession) return Promise.resolve();
4416
+ if (this.#activeTurn !== void 0 && this.#session === void 0) return this.#activeTurn.response.then((response) => {
4363
4417
  if (response === void 0) throw this.#error ?? new DOMException("Session creation was aborted.", "AbortError");
4364
4418
  });
4365
4419
  const client = this.#client;
4366
- if (client === void 0) return Promise.reject(/* @__PURE__ */ new Error("This eve agent store does not own a session client."));
4420
+ const session = this.#session;
4421
+ if (client === void 0 && session === void 0) return Promise.reject(/* @__PURE__ */ new Error("This eve agent store does not own a session client."));
4367
4422
  const generation = this.#prewarmGeneration;
4368
4423
  const controller = new AbortController();
4369
4424
  this.#prewarmController = controller;
4370
4425
  const promise = (async () => {
4371
4426
  try {
4427
+ if (session !== void 0) {
4428
+ await session.prewarm({ signal: controller.signal });
4429
+ return;
4430
+ }
4372
4431
  const created = await client.sessions.create({ signal: controller.signal });
4373
4432
  if (generation !== this.#prewarmGeneration) return;
4374
4433
  this.#error = void 0;
@@ -4376,7 +4435,7 @@ var EveAgentStore = class {
4376
4435
  this.#adoptSession(created.session);
4377
4436
  if (this.#followIdle) this.#ensureStream();
4378
4437
  } catch (error) {
4379
- if (generation === this.#prewarmGeneration && this.#activeTurn === void 0 && this.#error === void 0) this.#fail(error);
4438
+ if (session === void 0 && generation === this.#prewarmGeneration && this.#activeTurn === void 0 && this.#error === void 0) this.#fail(error);
4380
4439
  throw error;
4381
4440
  }
4382
4441
  })();
@@ -4626,7 +4685,7 @@ var EveAgentStore = class {
4626
4685
  headers: input.headers,
4627
4686
  streamReconnectPolicy: input.streamReconnectPolicy
4628
4687
  };
4629
- if (this.#prewarmPromise !== void 0) {
4688
+ if (this.#session === void 0 && this.#prewarmPromise !== void 0) {
4630
4689
  await waitWithSignal(this.#prewarmPromise.catch((error) => {
4631
4690
  if (this.#session !== void 0) throw error;
4632
4691
  }), input.signal);
@@ -1752,9 +1752,11 @@ function isResultCompletedEvent(event) {
1752
1752
  //#region src/client/message-response.ts
1753
1753
  const consumeResponse = Symbol("consumeMessageResponse");
1754
1754
  const acceptedDeliveryId = Symbol("acceptedDeliveryId");
1755
+ const sendReceipt = Symbol("sendReceipt");
1755
1756
  var MessageResponse = class {
1756
1757
  sessionId;
1757
1758
  [acceptedDeliveryId];
1759
+ [sendReceipt];
1758
1760
  #cancelTurn;
1759
1761
  #cancellation;
1760
1762
  #consumed = false;
@@ -1766,6 +1768,7 @@ var MessageResponse = class {
1766
1768
  this.#cancelTurn = input.cancelTurn;
1767
1769
  this.sessionId = input.sessionId;
1768
1770
  this[acceptedDeliveryId] = input.deliveryId;
1771
+ this[sendReceipt] = input.receipt;
1769
1772
  this.#createStream = input.createStream;
1770
1773
  this.#resumesTurn = input.resumesTurn ?? false;
1771
1774
  }
@@ -1822,6 +1825,18 @@ function consumeMessageResponse(response, source) {
1822
1825
  return response[consumeResponse](source);
1823
1826
  }
1824
1827
 
1828
+ //#endregion
1829
+ //#region src/protocol/prewarm-session.ts
1830
+ const PrewarmResponseSchema = z.object({
1831
+ ok: z.literal(true),
1832
+ status: z.enum([
1833
+ "ready",
1834
+ "accepted",
1835
+ "unsupported",
1836
+ "no_active_session"
1837
+ ])
1838
+ });
1839
+
1825
1840
  //#endregion
1826
1841
  //#region src/protocol/cancel-turn.ts
1827
1842
  const CancelTurnResponseSchema = z.discriminatedUnion("status", [z.strictObject({
@@ -1868,6 +1883,17 @@ const ResetResponseSchema = z.discriminatedUnion("status", [z.object({
1868
1883
 
1869
1884
  //#endregion
1870
1885
  //#region src/client/session-controls.ts
1886
+ async function prewarmClientSession(input) {
1887
+ const { payload } = await postJson({
1888
+ context: input.context,
1889
+ operation: "Prewarm",
1890
+ path: createEveSessionRoutePath(input.sessionId),
1891
+ signal: input.signal
1892
+ });
1893
+ const result = PrewarmResponseSchema.safeParse(payload);
1894
+ if (!result.success) throw new Error("Prewarm route returned an invalid response.");
1895
+ return { status: result.data.status };
1896
+ }
1871
1897
  async function cancelClientSession(input) {
1872
1898
  const { signal, ...body } = input.options ?? {};
1873
1899
  const { payload, response } = await postJson({
@@ -2324,14 +2350,22 @@ var ClientSession = class ClientSession {
2324
2350
  this.#state = state;
2325
2351
  }
2326
2352
  static async create(context, input) {
2353
+ const startedAt = Date.now();
2327
2354
  const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true, input.stubs);
2328
- const { sessionId } = await readAcceptedMessage(response);
2355
+ const acceptedAt = Date.now();
2356
+ const { sessionId, deliveryId } = await readAcceptedMessage(response);
2329
2357
  const session = new ClientSession(context, {
2330
2358
  sessionId,
2331
2359
  streamIndex: 0
2332
2360
  });
2361
+ const receipt = {
2362
+ deliveryId,
2363
+ startedAt,
2364
+ notReadyMs: 0,
2365
+ acceptedAt
2366
+ };
2333
2367
  return {
2334
- response: session.#messageResponse(response, input, 0),
2368
+ response: session.#messageResponse(response, input, 0, void 0, receipt),
2335
2369
  session
2336
2370
  };
2337
2371
  }
@@ -2378,11 +2412,21 @@ var ClientSession = class ClientSession {
2378
2412
  async #send(input, retrySessionNotReady) {
2379
2413
  const initialStreamIndex = this.#state.streamIndex;
2380
2414
  const path = createEveSessionRoutePath(this.#state.sessionId);
2381
- const response = retrySessionNotReady ? await postSessionSend(this.#context, path, input) : await postTurn(this.#context, path, input, false);
2415
+ const { response, timing } = await postSessionSend(this.#context, path, input, retrySessionNotReady);
2382
2416
  const { sessionId: responseSessionId, deliveryId } = await readAcceptedMessage(response, this.#state.sessionId);
2383
2417
  if (responseSessionId !== this.#state.sessionId) throw new Error("Message route returned a different session id.");
2384
2418
  if (input.message !== void 0 && deliveryId === void 0) throw new Error("Message route did not return a delivery id. Update the server before sending with this client.");
2385
- return this.#messageResponse(response, input, initialStreamIndex, input.message === void 0 ? void 0 : deliveryId);
2419
+ return this.#messageResponse(response, input, initialStreamIndex, input.message === void 0 ? void 0 : deliveryId, {
2420
+ ...timing,
2421
+ deliveryId
2422
+ });
2423
+ }
2424
+ async prewarm(options) {
2425
+ return await prewarmClientSession({
2426
+ context: this.#context,
2427
+ sessionId: this.#state.sessionId,
2428
+ signal: options?.signal
2429
+ });
2386
2430
  }
2387
2431
  async cancel(options) {
2388
2432
  return await cancelClientSession({
@@ -2423,12 +2467,13 @@ var ClientSession = class ClientSession {
2423
2467
  keepAlive: true
2424
2468
  });
2425
2469
  }
2426
- #messageResponse(response, input, initialStreamIndex, deliveryId) {
2470
+ #messageResponse(response, input, initialStreamIndex, deliveryId, receipt) {
2427
2471
  response.body?.cancel().catch(() => {});
2428
2472
  return new MessageResponse({
2429
2473
  cancelTurn: async (turnId) => await this.cancel({ turnId }),
2430
2474
  createStream: (source) => this.#createEventStream(initialStreamIndex, input, deliveryId, source),
2431
2475
  deliveryId,
2476
+ receipt,
2432
2477
  resumesTurn: input.inputResponses !== void 0,
2433
2478
  sessionId: this.#state.sessionId
2434
2479
  });
@@ -2509,14 +2554,23 @@ var ClientSession = class ClientSession {
2509
2554
  function followClientSession(session, options) {
2510
2555
  return session[followSession](options);
2511
2556
  }
2512
- async function postSessionSend(context, path, input) {
2513
- const readyDeadline = Date.now() + SESSION_SEND_READY_TIMEOUT_MS;
2557
+ async function postSessionSend(context, path, input, retrySessionNotReady) {
2558
+ const startedAt = Date.now();
2559
+ const readyDeadline = startedAt + SESSION_SEND_READY_TIMEOUT_MS;
2514
2560
  let retryDelayMs = SESSION_SEND_RETRY_BASE_DELAY_MS;
2515
2561
  for (;;) {
2562
+ const attemptAt = Date.now();
2516
2563
  try {
2517
- return await postTurn(context, path, input, false);
2564
+ return {
2565
+ response: await postTurn(context, path, input, false),
2566
+ timing: {
2567
+ startedAt,
2568
+ notReadyMs: attemptAt - startedAt,
2569
+ acceptedAt: Date.now()
2570
+ }
2571
+ };
2518
2572
  } catch (error) {
2519
- if (!isSessionNotReady(error)) throw error;
2573
+ if (!retrySessionNotReady || !isSessionNotReady(error)) throw error;
2520
2574
  const remainingMs = readyDeadline - Date.now();
2521
2575
  if (remainingMs <= 0) throw error;
2522
2576
  await sleep(Math.min(retryDelayMs, remainingMs), input.signal);
@@ -4359,17 +4413,22 @@ var EveAgentStore = class {
4359
4413
  }
4360
4414
  prewarm() {
4361
4415
  if (this.#prewarmPromise !== void 0) return this.#prewarmPromise;
4362
- if (this.#session !== void 0 || this.#externalSession) return Promise.resolve();
4363
- if (this.#activeTurn !== void 0) return this.#activeTurn.response.then((response) => {
4416
+ if (this.#session === void 0 && this.#externalSession) return Promise.resolve();
4417
+ if (this.#activeTurn !== void 0 && this.#session === void 0) return this.#activeTurn.response.then((response) => {
4364
4418
  if (response === void 0) throw this.#error ?? new DOMException("Session creation was aborted.", "AbortError");
4365
4419
  });
4366
4420
  const client = this.#client;
4367
- if (client === void 0) return Promise.reject(/* @__PURE__ */ new Error("This eve agent store does not own a session client."));
4421
+ const session = this.#session;
4422
+ if (client === void 0 && session === void 0) return Promise.reject(/* @__PURE__ */ new Error("This eve agent store does not own a session client."));
4368
4423
  const generation = this.#prewarmGeneration;
4369
4424
  const controller = new AbortController();
4370
4425
  this.#prewarmController = controller;
4371
4426
  const promise = (async () => {
4372
4427
  try {
4428
+ if (session !== void 0) {
4429
+ await session.prewarm({ signal: controller.signal });
4430
+ return;
4431
+ }
4373
4432
  const created = await client.sessions.create({ signal: controller.signal });
4374
4433
  if (generation !== this.#prewarmGeneration) return;
4375
4434
  this.#error = void 0;
@@ -4377,7 +4436,7 @@ var EveAgentStore = class {
4377
4436
  this.#adoptSession(created.session);
4378
4437
  if (this.#followIdle) this.#ensureStream();
4379
4438
  } catch (error) {
4380
- if (generation === this.#prewarmGeneration && this.#activeTurn === void 0 && this.#error === void 0) this.#fail(error);
4439
+ if (session === void 0 && generation === this.#prewarmGeneration && this.#activeTurn === void 0 && this.#error === void 0) this.#fail(error);
4381
4440
  throw error;
4382
4441
  }
4383
4442
  })();
@@ -4627,7 +4686,7 @@ var EveAgentStore = class {
4627
4686
  headers: input.headers,
4628
4687
  streamReconnectPolicy: input.streamReconnectPolicy
4629
4688
  };
4630
- if (this.#prewarmPromise !== void 0) {
4689
+ if (this.#session === void 0 && this.#prewarmPromise !== void 0) {
4631
4690
  await waitWithSignal(this.#prewarmPromise.catch((error) => {
4632
4691
  if (this.#session !== void 0) throw error;
4633
4692
  }), input.signal);
@@ -1 +1 @@
1
- import{createDevelopmentServer}from"#internal/nitro/host/start-development-server.js";import{getDevelopmentSandboxRunId}from"#execution/sandbox/development-run.js";import{reconcileCleanupIntents,recordCleanupIntent}from"#cli/dev/local-server-cleanup.js";const options=JSON.parse(process.argv[2]??`{}`),server=createDevelopmentServer(process.cwd(),{...options,onBootProgress:e=>send({type:`progress`,event:e})});let stopping=!1,removeCleanupIntent;reconcileCleanupIntents(process.cwd()).catch(()=>void 0);const send=e=>{try{process.connected&&process.send?.(e,()=>{})}catch{}},stop=()=>{if(stopping)return;stopping=!0,console.log=console.warn=console.error=()=>{},process.stdout.on(`error`,()=>{}),process.stderr.on(`error`,()=>{});let e=server.close();process.connected&&process.disconnect?.(),e.then(async()=>{await intentReady.catch(()=>void 0),await removeCleanupIntent?.().catch(()=>void 0),process.exit(0)},()=>process.exit(1))};process.on(`message`,e=>{e.type===`shutdown`&&stop()}),process.once(`disconnect`,stop),process.once(`SIGINT`,stop),process.once(`SIGTERM`,stop);const intentReady=server.start().then(async e=>{let t=getDevelopmentSandboxRunId();e.kind===`started`&&t!==void 0&&(removeCleanupIntent=await recordCleanupIntent(process.cwd(),{ownerPid:process.pid,runId:t})),send({type:`started`,handle:e}),e.kind===`existing`&&process.connected&&process.disconnect?.()},e=>{let t=e instanceof Error?e:Error(String(e));send({type:`failed`,message:t.message,stack:t.stack}),process.exitCode=1,process.connected&&process.disconnect?.()});export{};
1
+ import{getDevelopmentSandboxRunId}from"#execution/sandbox/development-run.js";import{prewarmDevelopmentBuildProcess}from"#internal/nitro/host/dev-build-host.js";prewarmDevelopmentBuildProcess();const[{createDevelopmentServer},{reconcileCleanupIntents,recordCleanupIntent}]=await Promise.all([import(`#internal/nitro/host/start-development-server.js`),import(`#cli/dev/local-server-cleanup.js`)]),options=JSON.parse(process.argv[2]??`{}`),server=createDevelopmentServer(process.cwd(),{...options,onBootProgress:e=>send({type:`progress`,event:e})});let stopping=!1,removeCleanupIntent;reconcileCleanupIntents(process.cwd()).catch(()=>void 0);const send=e=>{try{process.connected&&process.send?.(e,()=>{})}catch{}},stop=()=>{if(stopping)return;stopping=!0,console.log=console.warn=console.error=()=>{},process.stdout.on(`error`,()=>{}),process.stderr.on(`error`,()=>{});let e=server.close();process.connected&&process.disconnect?.(),e.then(async()=>{await intentReady.catch(()=>void 0),await removeCleanupIntent?.().catch(()=>void 0),process.exit(0)},()=>process.exit(1))};process.on(`message`,e=>{e.type===`shutdown`&&stop()}),process.once(`disconnect`,stop),process.once(`SIGINT`,stop),process.once(`SIGTERM`,stop);const intentReady=server.start().then(async e=>{let t=getDevelopmentSandboxRunId();e.kind===`started`&&t!==void 0&&(removeCleanupIntent=await recordCleanupIntent(process.cwd(),{ownerPid:process.pid,runId:t})),send({type:`started`,handle:e}),e.kind===`existing`&&process.connected&&process.disconnect?.()},e=>{let t=e instanceof Error?e:Error(String(e));send({type:`failed`,message:t.message,stack:t.stack}),process.exitCode=1,process.connected&&process.disconnect?.()});export{};
@@ -1 +1 @@
1
- import{mkdir,readFile,readdir,rm,writeFile}from"node:fs/promises";import{join}from"node:path";import{stopDevelopmentSandboxResources}from"#execution/sandbox/bindings/local.js";const PREFIX=`dev-cleanup-intent.`,SUFFIX=`.json`;async function recordCleanupIntent(e,t){let n=join(e,`.eve`),r=join(n,`${PREFIX}${t.runId}${SUFFIX}`);return await mkdir(n,{recursive:!0}),await writeFile(r,`${JSON.stringify(t)}\n`,`utf8`),async()=>await rm(r,{force:!0})}async function reconcileCleanupIntents(e){let t=join(e,`.eve`),n;try{n=await readdir(t)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e}await Promise.all(n.filter(e=>e.startsWith(PREFIX)&&e.endsWith(SUFFIX)).map(async n=>{try{let r=join(t,n),i=JSON.parse(await readFile(r,`utf8`));if(typeof i.runId!=`string`||typeof i.ownerPid!=`number`||!Number.isInteger(i.ownerPid)||i.ownerPid<=0||isProcessAlive(i.ownerPid))return;await stopDevelopmentSandboxResources({appRoot:e,devRunId:i.runId}),await rm(r,{force:!0})}catch{}}))}function isProcessAlive(e){try{return process.kill(e,0),!0}catch(e){return e instanceof Error&&`code`in e&&e.code===`EPERM`}}export{reconcileCleanupIntents,recordCleanupIntent};
1
+ import{mkdir,readFile,readdir,rm,writeFile}from"node:fs/promises";import{join}from"node:path";import{stopDevelopmentSandboxResources}from"#execution/sandbox/bindings/local.js";const PREFIX=`dev-cleanup-intent.`,SUFFIX=`.json`;async function recordCleanupIntent(e,t){let n=join(e,`.eve`),r=join(n,`${PREFIX}${t.runId}${SUFFIX}`);return await mkdir(n,{recursive:!0}),await writeFile(r,`${JSON.stringify(t)}\n`,`utf8`),async()=>await rm(r,{force:!0})}async function reconcileCleanupIntents(e){let t=join(e,`.eve`),n;try{n=await readdir(t)}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return;throw e}await Promise.all(n.filter(e=>e.startsWith(PREFIX)&&e.endsWith(SUFFIX)).map(async e=>{try{let n=join(t,e),r=JSON.parse(await readFile(n,`utf8`));if(typeof r.runId!=`string`||typeof r.ownerPid!=`number`||!Number.isInteger(r.ownerPid)||r.ownerPid<=0||isProcessAlive(r.ownerPid))return;await stopDevelopmentSandboxResources({devRunId:r.runId}),await rm(n,{force:!0})}catch{}}))}function isProcessAlive(e){try{return process.kill(e,0),!0}catch(e){return e instanceof Error&&`code`in e&&e.code===`EPERM`}}export{reconcileCleanupIntents,recordCleanupIntent};
@@ -20,9 +20,12 @@ interface QuestionPanelState {
20
20
  /** The freeform row's inline editor; focused while the cursor rests on it. */
21
21
  readonly editor: LineState;
22
22
  readonly caretVisible: boolean;
23
+ readonly maxRows?: number;
23
24
  }
24
25
  export declare function renderQuestionPanel(state: QuestionPanelState, theme: Theme, width: number): string[];
26
+ export declare function renderQuestionPrompt(prompt: string, theme: Theme, width: number): string[];
27
+ /** Window the body, keeping the focused choice or editor reachable on short terminals. */
28
+ export declare function fitQuestionPanel(rows: readonly string[], maxRows: number, focusedRow?: number, focusedEndRow?: number): string[];
25
29
  /** Who asked for a prompt and where it sits among the open requests, for the drawer's corner. */
26
30
  export declare function inputContextLabel(context: AgentTUIInputContext | undefined, theme: Theme): string | undefined;
27
- export declare function renderQuestionChoices(options: readonly AgentTUIInputOption[], cursor: number, theme: Theme, forceCursor?: boolean): string[];
28
31
  export {};
@@ -1 +1 @@
1
- import{visibleLine}from"./line-editor.js";import{clipVisible,renderInputText,renderInputWithBlockCursor,stripTerminalControls,wrapVisibleLine}from"#cli/ui/terminal-text.js";import{renderOptionRow}from"#setup/cli/option-row.js";const FREEFORM_ROW_LABEL=`Type your own answer…`;function renderQuestionPanel(e,t,n){let r=t.colors,i=[];for(let t of e.prompt.split(/\r?\n/u))for(let e of wrapVisibleLine(t,Math.max(8,n-2)))i.push(` ${r.bold(e)}`);return i.push(``),i.push(...renderQuestionChoices(e.options,e.cursor,t)),e.allowFreeform&&i.push(renderFreeformRow(e,t,n)),i.map(e=>clipVisible(e,n))}function inputContextLabel(e,t){let n=[];return e?.requester!==void 0&&n.push(stripTerminalControls(e.requester)),e?.position!==void 0&&n.push(`${e.position.index} of ${e.position.total}`),n.length===0?void 0:n.join(` ${t.glyph.dot} `)}function renderQuestionChoices(e,t,n,r=!1){return e.flatMap((e,i)=>{let a=r||t===i,o=[` ${renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,selectedPointer:n.glyph.selectedPointer,success:n.glyph.success,placeholder:n.glyph.option,dot:n.glyph.dot,warning:n.glyph.warning},label:e.label,isCursor:a,state:{kind:`available`,checked:!1},placeholder:!1,presentation:`minimal`})}`];return e.description!==void 0&&e.description.length>0&&o.push(` ${n.colors.dim(e.description)}`),o})}function renderFreeformRow(e,t,n){let r=t.colors,i=e.cursor===e.options.length,a=Math.max(4,n-6);if(!i){let n=visibleLine(e.editor,a,t.glyph.ellipsis),i=e.editor.text.length===0?FREEFORM_ROW_LABEL:`${n.before}${n.under}${n.after}`;return` ${r.dim(i)}`}let o=e.editor.text.length===0,s=o?{text:FREEFORM_ROW_LABEL,cursor:0}:e.editor;return` ${renderInputWithBlockCursor({...visibleLine(s,a,t.glyph.ellipsis),visible:e.caretVisible,inverse:r.inverse,render:o?e=>r.dim(renderInputText(e)):void 0})}`}export{inputContextLabel,renderQuestionChoices,renderQuestionPanel};
1
+ import{visibleLine}from"./line-editor.js";import{clipVisible,renderInputText,renderInputWithBlockCursor,stripTerminalControls,wrapVisibleLine}from"#cli/ui/terminal-text.js";import{renderOptionRow}from"#setup/cli/option-row.js";const FREEFORM_ROW_LABEL=`Type your own answer…`;function renderQuestionPanel(e,t,n){let r=renderQuestionPrompt(e.prompt,t,n);r.push(``);let i=r.length,a=i;for(let[n,o]of e.options.entries())n===e.cursor&&(i=r.length),r.push(...renderQuestionChoice(o,n===e.cursor,t).flatMap(e=>e.split(/\r?\n/u))),n===e.cursor&&(a=r.length-1);return e.allowFreeform&&(e.cursor===e.options.length&&(i=a=r.length),r.push(renderFreeformRow(e,t,n))),fitQuestionPanel(r.map(e=>clipVisible(e,n)),e.maxRows??r.length,i,a)}function renderQuestionPrompt(e,t,n){return stripTerminalControls(e).split(/\r?\n/u).flatMap(e=>wrapVisibleLine(e,Math.max(1,n-2))).map(e=>` ${t.colors.bold(e)}`)}function fitQuestionPanel(e,t,n=e.length-1,r=n){let i=Math.min(r,n+t-1),a=Math.max(0,Math.min(i-t+1,e.length-t));return e.slice(a,a+t)}function inputContextLabel(e,t){let n=[];return e?.requester!==void 0&&n.push(stripTerminalControls(e.requester)),e?.position!==void 0&&n.push(`${e.position.index} of ${e.position.total}`),n.length===0?void 0:n.join(` ${t.glyph.dot} `)}function renderQuestionChoice(e,t,n){let r=[` ${renderOptionRow({colors:n.colors,glyphs:{pointer:n.glyph.pointer,selectedPointer:n.glyph.selectedPointer,success:n.glyph.success,placeholder:n.glyph.option,dot:n.glyph.dot,warning:n.glyph.warning},label:e.label,isCursor:t,state:{kind:`available`,checked:!1},placeholder:!1,presentation:`minimal`})}`];return e.description!==void 0&&e.description.length>0&&r.push(` ${n.colors.dim(e.description)}`),r}function renderFreeformRow(e,t,n){let r=t.colors,i=e.cursor===e.options.length,a=Math.max(4,n-6);if(!i){let n=visibleLine(e.editor,a,t.glyph.ellipsis),i=e.editor.text.length===0?FREEFORM_ROW_LABEL:`${n.before}${n.under}${n.after}`;return` ${r.dim(i)}`}let o=e.editor.text.length===0,s=o?{text:FREEFORM_ROW_LABEL,cursor:0}:e.editor;return` ${renderInputWithBlockCursor({...visibleLine(s,a,t.glyph.ellipsis),visible:e.caretVisible,inverse:r.inverse,render:o?e=>r.dim(renderInputText(e)):void 0})}`}export{fitQuestionPanel,inputContextLabel,renderQuestionPanel,renderQuestionPrompt};