eve 0.62.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (593) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/src/ai/evaluate.js +1 -1
  3. package/dist/src/channel/channel-address.d.ts +4 -1
  4. package/dist/src/channel/channel-address.js +1 -1
  5. package/dist/src/channel/channel-operations.d.ts +4 -1
  6. package/dist/src/channel/cross-channel-receive.d.ts +4 -1
  7. package/dist/src/channel/cross-channel-receive.js +1 -1
  8. package/dist/src/channel/session.d.ts +3 -1
  9. package/dist/src/channel/session.js +1 -1
  10. package/dist/src/channel/types.d.ts +7 -0
  11. package/dist/src/chunks/{use-eve-agent-C5-yqRuq.js → use-eve-agent-BdKlQF32.js} +8 -8
  12. package/dist/src/chunks/{use-eve-agent-CVWk5KKy.js → use-eve-agent-IIuxkn6y.js} +8 -8
  13. package/dist/src/cli/commands/build.js +1 -1
  14. package/dist/src/cli/commands/init-agent-workspace.d.ts +2 -0
  15. package/dist/src/cli/commands/init.js +1 -1
  16. package/dist/src/cli/dev/tui/line-editor.d.ts +11 -1
  17. package/dist/src/cli/dev/tui/line-editor.js +3 -3
  18. package/dist/src/cli/dev/tui/model-picker.d.ts +50 -0
  19. package/dist/src/cli/dev/tui/model-picker.js +1 -0
  20. package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
  21. package/dist/src/cli/dev/tui/runner.js +2 -2
  22. package/dist/src/cli/dev/tui/setup-commands.d.ts +1 -1
  23. package/dist/src/cli/dev/tui/setup-commands.js +1 -1
  24. package/dist/src/cli/dev/tui/setup-flow.d.ts +2 -2
  25. package/dist/src/cli/dev/tui/setup-panel.d.ts +1 -26
  26. package/dist/src/cli/dev/tui/setup-panel.js +3 -3
  27. package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
  28. package/dist/src/cli/dev/tui/stream-format.d.ts +6 -7
  29. package/dist/src/cli/dev/tui/stream-format.js +2 -2
  30. package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
  31. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  32. package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -1
  33. package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
  34. package/dist/src/cli/dev/tui/theme.d.ts +0 -8
  35. package/dist/src/cli/dev/tui/theme.js +1 -1
  36. package/dist/src/cli/run.js +1 -1
  37. package/dist/src/client/agent-info-schema.d.ts +8 -14
  38. package/dist/src/client/agent-info-schema.js +1 -1
  39. package/dist/src/client/eve-agent-store.js +1 -1
  40. package/dist/src/client/session.js +1 -1
  41. package/dist/src/client/types.d.ts +4 -2
  42. package/dist/src/compiled/.vendor-stamp.json +11 -11
  43. package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +1 -0
  44. package/dist/src/compiled/@chat-adapter/slack/api.d.ts +3 -2
  45. package/dist/src/compiled/@chat-adapter/slack/api.js +1 -1
  46. package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
  47. package/dist/src/compiled/@chat-adapter/slack/format.js +1 -1
  48. package/dist/src/compiled/@chat-adapter/slack/index.d.ts +410 -63
  49. package/dist/src/compiled/@chat-adapter/slack/index.js +47 -25
  50. package/dist/src/compiled/@chat-adapter/twilio/api.d.ts +5 -1
  51. package/dist/src/compiled/@chat-adapter/twilio/api.js +1 -1
  52. package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -3
  53. package/dist/src/compiled/@chat-adapter/twilio/index.js +5 -1
  54. package/dist/src/compiled/@chat-adapter/twilio/webhook.d.ts +2 -2
  55. package/dist/src/compiled/@chat-adapter/twilio/webhook.js +1 -1
  56. package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +6 -6
  57. package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +50 -50
  58. package/dist/src/compiled/@vercel/sandbox/index.js +4 -4
  59. package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -1
  60. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +6 -3
  61. package/dist/src/compiled/@workflow/core/index.js +2 -2
  62. package/dist/src/compiled/@workflow/core/private.d.ts +37 -5
  63. package/dist/src/compiled/@workflow/core/private.js +1 -1
  64. package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +2 -1
  65. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  66. package/dist/src/compiled/@workflow/core/runtime/invocations.d.ts +35 -0
  67. package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +90 -0
  68. package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +2 -1
  69. package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +8 -6
  70. package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
  71. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  72. package/dist/src/compiled/@workflow/core/serialization.d.ts +5 -1
  73. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  74. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  75. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +4 -0
  76. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  77. package/dist/src/compiled/@workflow/world/analytics.d.ts +1 -1
  78. package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +5 -0
  79. package/dist/src/compiled/@workflow/world/events.d.ts +2 -2
  80. package/dist/src/compiled/@workflow/world/index.d.ts +2 -1
  81. package/dist/src/compiled/@workflow/world/interfaces.d.ts +12 -1
  82. package/dist/src/compiled/@workflow/world/invocation.d.ts +19 -0
  83. package/dist/src/compiled/@workflow/world/queue.d.ts +24 -3
  84. package/dist/src/compiled/@workflow/world-local/index.js +3 -3
  85. package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
  86. package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +12 -0
  87. package/dist/src/compiled/_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js +1 -0
  88. package/dist/src/compiled/_chunks/node/chunk-KBOOTKHF-DJqFk2r1.js +1 -0
  89. package/dist/src/compiled/_chunks/node/chunk-TREVQR3E-CLsTAn-O.js +1 -0
  90. package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +98 -0
  91. package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +6 -0
  92. package/dist/src/compiled/_chunks/workflow/attribute-changes-DFx4eluc.js +6 -0
  93. package/dist/src/compiled/_chunks/workflow/{dist-D38gP7YF.js → dist-DjECvUyK.js} +1 -1
  94. package/dist/src/compiled/_chunks/workflow/{frames-QcJfYHmh.js → frames-D_Q-7A1N.js} +2 -2
  95. package/dist/src/compiled/_chunks/workflow/{helpers-6kObVbfS.js → helpers-Bw52uyzw.js} +1 -1
  96. package/dist/src/compiled/_chunks/workflow/{logger-NN5YHpYy.js → logger-DFNCa8Nl.js} +1 -1
  97. package/dist/src/compiled/_chunks/workflow/resume-hook-BhA_nDEV.js +1 -0
  98. package/dist/src/compiled/_chunks/workflow/{run-DJevv8zz.js → run-BT6SQv5f.js} +1 -1
  99. package/dist/src/compiled/_chunks/workflow/{serialization-C5KgPESk.js → serialization-Cl0SYU0I.js} +3 -3
  100. package/dist/src/compiled/_chunks/workflow/sleep-DB4AH9-A.js +1 -0
  101. package/dist/src/compiled/_chunks/workflow/{wait-until-BMY_tOr-.js → wait-until-Dzhr6tzf.js} +1 -1
  102. package/dist/src/compiled/_chunks/workflow/{ws-transport-DSDcKH08.js → ws-transport-BpTMh40s.js} +1 -1
  103. package/dist/src/compiled/chat/index.d.ts +1 -725
  104. package/dist/src/compiled/chat/index.js +1 -1
  105. package/dist/src/compiler/artifacts.d.ts +1 -0
  106. package/dist/src/compiler/artifacts.js +1 -1
  107. package/dist/src/compiler/extension-compatibility.d.ts +42 -15
  108. package/dist/src/compiler/extension-compatibility.js +1 -1
  109. package/dist/src/compiler/manifest.d.ts +14 -18
  110. package/dist/src/compiler/manifest.js +1 -1
  111. package/dist/src/compiler/normalize-agent-config.js +1 -1
  112. package/dist/src/compiler/normalize-helpers.js +1 -1
  113. package/dist/src/compiler/normalize-sandbox.d.ts +2 -7
  114. package/dist/src/compiler/normalize-sandbox.js +1 -1
  115. package/dist/src/compiler/normalize-tool.js +1 -1
  116. package/dist/src/compiler/workspace-resources.js +1 -1
  117. package/dist/src/context/build-callback-context.d.ts +2 -0
  118. package/dist/src/context/build-callback-context.js +1 -1
  119. package/dist/src/context/build-dynamic-tools.js +1 -1
  120. package/dist/src/context/container.d.ts +1 -1
  121. package/dist/src/context/container.js +1 -1
  122. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  123. package/dist/src/context/key-names.d.ts +1 -0
  124. package/dist/src/context/key-names.js +1 -1
  125. package/dist/src/context/keys.d.ts +7 -2
  126. package/dist/src/context/keys.js +1 -1
  127. package/dist/src/context/providers/sandbox.js +1 -1
  128. package/dist/src/context/providers/session.d.ts +19 -2
  129. package/dist/src/context/session-context.d.ts +1 -1
  130. package/dist/src/discover/sandbox.js +1 -1
  131. package/dist/src/evals/cli/eval.js +1 -1
  132. package/dist/src/evals/context.d.ts +1 -0
  133. package/dist/src/evals/context.js +1 -1
  134. package/dist/src/evals/define-eval-config.d.ts +7 -7
  135. package/dist/src/evals/define-eval-config.js +1 -1
  136. package/dist/src/evals/define-eval.d.ts +5 -2
  137. package/dist/src/evals/index.d.ts +1 -1
  138. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  139. package/dist/src/evals/runner/execute-eval.d.ts +2 -0
  140. package/dist/src/evals/runner/execute-eval.js +1 -1
  141. package/dist/src/evals/runner/execute-task.d.ts +2 -0
  142. package/dist/src/evals/runner/execute-task.js +1 -1
  143. package/dist/src/evals/runner/run-evals.d.ts +2 -0
  144. package/dist/src/evals/runner/run-evals.js +1 -1
  145. package/dist/src/evals/target.js +1 -1
  146. package/dist/src/evals/types.d.ts +26 -9
  147. package/dist/src/eve-channel/create-request.d.ts +2 -1
  148. package/dist/src/eve-channel/delivery-policy-request.d.ts +4 -0
  149. package/dist/src/eve-channel/delivery-policy-request.js +1 -0
  150. package/dist/src/eve-channel/index.js +1 -1
  151. package/dist/src/eve-channel/request.d.ts +2 -1
  152. package/dist/src/eve-channel/request.js +1 -1
  153. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  154. package/dist/src/execution/cancel-indexed-session-tasks-step.d.ts +2 -1
  155. package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -1
  156. package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -7
  157. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  158. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  159. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  160. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  161. package/dist/src/execution/node-step.js +1 -1
  162. package/dist/src/execution/proxied-deliver-step.js +1 -1
  163. package/dist/src/execution/route-child-delivery.js +3 -1
  164. package/dist/src/execution/runtime-context.js +1 -1
  165. package/dist/src/execution/sandbox/active-handles.d.ts +7 -8
  166. package/dist/src/execution/sandbox/active-handles.js +1 -1
  167. package/dist/src/execution/sandbox/bash.js +1 -1
  168. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +1 -1
  169. package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
  170. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -2
  171. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  172. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +1 -1
  173. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
  174. package/dist/src/execution/sandbox/bindings/docker-options.d.ts +4 -5
  175. package/dist/src/execution/sandbox/bindings/docker-options.js +1 -1
  176. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -1
  177. package/dist/src/execution/sandbox/bindings/docker-session.js +2 -2
  178. package/dist/src/execution/sandbox/bindings/docker.d.ts +16 -18
  179. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  180. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +21 -0
  181. package/dist/src/execution/sandbox/bindings/immutable-resources.js +2 -0
  182. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +9 -5
  183. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  184. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +13 -26
  185. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  186. package/dist/src/execution/sandbox/bindings/{local-backend-utils.d.ts → local-provider-utils.d.ts} +7 -5
  187. package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -0
  188. package/dist/src/execution/sandbox/bindings/local.d.ts +3 -3
  189. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  190. package/dist/src/execution/sandbox/bindings/microsandbox-create.js +1 -1
  191. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +30 -8
  192. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
  193. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +9 -1
  194. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -1
  195. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -1
  196. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +10 -4
  197. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
  198. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +1 -1
  199. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +7 -5
  200. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
  201. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
  202. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +11 -21
  203. package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -1
  204. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  205. package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
  206. package/dist/src/execution/sandbox/bindings/vercel-errors.js +1 -1
  207. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +2 -2
  208. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  209. package/dist/src/execution/sandbox/bindings/vercel-lookup.js +1 -1
  210. package/dist/src/execution/sandbox/bindings/vercel-options.d.ts +1 -2
  211. package/dist/src/execution/sandbox/bindings/vercel-options.js +1 -1
  212. package/dist/src/execution/sandbox/bindings/vercel.d.ts +20 -12
  213. package/dist/src/execution/sandbox/bindings/vercel.js +2 -2
  214. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  215. package/dist/src/execution/sandbox/development-prewarm.d.ts +5 -0
  216. package/dist/src/execution/sandbox/development-prewarm.js +1 -1
  217. package/dist/src/execution/sandbox/development-run.d.ts +2 -3
  218. package/dist/src/execution/sandbox/dockerfile.d.ts +25 -0
  219. package/dist/src/execution/sandbox/dockerfile.js +1 -0
  220. package/dist/src/execution/sandbox/ensure.d.ts +0 -17
  221. package/dist/src/execution/sandbox/ensure.js +1 -1
  222. package/dist/src/execution/sandbox/logging-session.js +1 -1
  223. package/dist/src/execution/sandbox/prewarm.d.ts +23 -27
  224. package/dist/src/execution/sandbox/prewarm.js +1 -2
  225. package/dist/src/execution/sandbox/provider-files.d.ts +2 -0
  226. package/dist/src/execution/sandbox/provider-files.js +1 -0
  227. package/dist/src/execution/sandbox/provider-host-development.d.ts +2 -0
  228. package/dist/src/execution/sandbox/provider-host-development.js +1 -0
  229. package/dist/src/execution/sandbox/provider-host.d.ts +2 -0
  230. package/dist/src/execution/sandbox/provider-host.js +1 -0
  231. package/dist/src/execution/sandbox/provider-identity.d.ts +1 -0
  232. package/dist/src/execution/sandbox/provider-identity.js +1 -0
  233. package/dist/src/execution/sandbox/ripgrep-probe.d.ts +0 -7
  234. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
  235. package/dist/src/execution/sandbox/session.d.ts +8 -8
  236. package/dist/src/execution/sandbox/session.js +1 -1
  237. package/dist/src/execution/session/admission.js +1 -1
  238. package/dist/src/execution/session/handoff-steps.js +1 -1
  239. package/dist/src/execution/session/handoff.d.ts +2 -1
  240. package/dist/src/execution/session/handoff.js +1 -1
  241. package/dist/src/execution/session/input-queue.d.ts +4 -1
  242. package/dist/src/execution/session/input-queue.js +1 -1
  243. package/dist/src/execution/session/next-input.js +1 -1
  244. package/dist/src/execution/session/program.js +1 -1
  245. package/dist/src/execution/session/turn-step.js +1 -1
  246. package/dist/src/execution/session/turn.js +1 -1
  247. package/dist/src/execution/session-inbox/protocol.js +1 -1
  248. package/dist/src/execution/session-workflow-tool-run.js +1 -1
  249. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  250. package/dist/src/execution/stable-workflow-names.d.ts +0 -1
  251. package/dist/src/execution/stable-workflow-names.js +1 -1
  252. package/dist/src/execution/tasks/child/notify.d.ts +44 -0
  253. package/dist/src/execution/tasks/child/notify.js +1 -0
  254. package/dist/src/execution/tasks/parent/control-shared.d.ts +2 -5
  255. package/dist/src/execution/tasks/parent/control-shared.js +1 -1
  256. package/dist/src/execution/tasks/parent/delegate.d.ts +8 -36
  257. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  258. package/dist/src/execution/tasks/parent/dispatch.d.ts +3 -5
  259. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  260. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +4 -1
  261. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  262. package/dist/src/execution/tasks/parent/run-parent.d.ts +5 -19
  263. package/dist/src/execution/tasks/parent/run-parent.js +1 -1
  264. package/dist/src/execution/tasks/parent/task-cancel.d.ts +6 -5
  265. package/dist/src/execution/tasks/parent/task-cancel.js +1 -1
  266. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  267. package/dist/src/execution/tool-auth.d.ts +3 -9
  268. package/dist/src/execution/tool-auth.js +1 -1
  269. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  270. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  271. package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
  272. package/dist/src/execution/tools/subagent/emit-event-step.d.ts +11 -0
  273. package/dist/src/execution/tools/subagent/emit-event-step.js +1 -0
  274. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +5 -7
  275. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
  276. package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
  277. package/dist/src/execution/tools/subagent/invoke-step.d.ts +3 -2
  278. package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
  279. package/dist/src/execution/tools/subagent/start.d.ts +1 -0
  280. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +0 -1
  281. package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
  282. package/dist/src/execution/tools/subagent/task-cancel.d.ts +1 -1
  283. package/dist/src/execution/tools/subagent/task-cancel.js +1 -1
  284. package/dist/src/execution/tools/workflow/background.d.ts +1 -1
  285. package/dist/src/execution/tools/workflow/background.js +1 -1
  286. package/dist/src/execution/tools/workflow/body.d.ts +0 -2
  287. package/dist/src/execution/tools/workflow/body.js +1 -1
  288. package/dist/src/execution/tools/workflow/cancel.d.ts +4 -3
  289. package/dist/src/execution/tools/workflow/cancel.js +1 -1
  290. package/dist/src/execution/tools/workflow/cancellation-policy.d.ts +2 -0
  291. package/dist/src/execution/tools/workflow/cancellation-policy.js +1 -0
  292. package/dist/src/execution/tools/workflow/messages.d.ts +0 -1
  293. package/dist/src/execution/tools/workflow/owner-channels.d.ts +6 -6
  294. package/dist/src/execution/tools/workflow/owner-inbox.d.ts +5 -9
  295. package/dist/src/execution/tools/workflow/owner-inbox.js +1 -1
  296. package/dist/src/execution/tools/workflow/owner.d.ts +6 -2
  297. package/dist/src/execution/tools/workflow/owner.js +1 -1
  298. package/dist/src/execution/tools/workflow/start.js +1 -1
  299. package/dist/src/execution/tools/workflow/types.d.ts +11 -19
  300. package/dist/src/execution/tools/workflow/types.js +1 -1
  301. package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +13 -0
  302. package/dist/src/execution/tools/workflow/workflow-owner-background.js +1 -0
  303. package/dist/src/execution/tools/workflow/workflow-owner-blocking.d.ts +12 -0
  304. package/dist/src/execution/tools/workflow/workflow-owner-blocking.js +1 -0
  305. package/dist/src/execution/tools/workflow/workflow.d.ts +3 -3
  306. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  307. package/dist/src/execution/workflow-runtime.d.ts +0 -4
  308. package/dist/src/execution/workflow-runtime.js +1 -1
  309. package/dist/src/framework/sources/modules/sandbox.d.ts +2 -1
  310. package/dist/src/framework/sources/modules/sandbox.js +1 -1
  311. package/dist/src/harness/approval-delivery-coordinator.js +1 -1
  312. package/dist/src/harness/background-tools.d.ts +3 -5
  313. package/dist/src/harness/coordination.js +1 -1
  314. package/dist/src/harness/emission.js +1 -1
  315. package/dist/src/harness/execute-tool.d.ts +2 -29
  316. package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
  317. package/dist/src/harness/hitl/approval-input-requests.js +1 -1
  318. package/dist/src/harness/input-requests.d.ts +6 -0
  319. package/dist/src/harness/input-requests.js +1 -1
  320. package/dist/src/harness/messages.d.ts +2 -1
  321. package/dist/src/harness/messages.js +1 -1
  322. package/dist/src/harness/pending-input-batches.d.ts +1 -0
  323. package/dist/src/harness/pending-input-batches.js +1 -1
  324. package/dist/src/harness/tool-loop.js +2 -2
  325. package/dist/src/harness/tool-model-output.js +1 -1
  326. package/dist/src/harness/tools.js +1 -1
  327. package/dist/src/harness/workflow-tool-runs.d.ts +53 -18
  328. package/dist/src/harness/workflow-tool-runs.js +1 -1
  329. package/dist/src/instrumentation/ai-sdk-warnings.d.ts +6 -0
  330. package/dist/src/instrumentation/ai-sdk-warnings.js +1 -0
  331. package/dist/src/instrumentation/runtime.d.ts +1 -0
  332. package/dist/src/instrumentation/runtime.js +1 -1
  333. package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
  334. package/dist/src/internal/application/compiled-artifacts.js +2 -2
  335. package/dist/src/internal/application/package.js +1 -1
  336. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  337. package/dist/src/internal/nitro/host/artifacts-config.d.ts +6 -1
  338. package/dist/src/internal/nitro/host/artifacts-config.js +1 -1
  339. package/dist/src/internal/nitro/host/build-application.js +1 -1
  340. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +16 -0
  341. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +5 -0
  342. package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
  343. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +3 -3
  344. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  345. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  346. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  347. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +1 -0
  348. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  349. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  350. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  351. package/dist/src/internal/nitro/host/start-production-server.js +2 -2
  352. package/dist/src/internal/nitro/host/types.d.ts +1 -1
  353. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  354. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +1 -0
  355. package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
  356. package/dist/src/internal/runtime-registry.d.ts +2 -2
  357. package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -1
  358. package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
  359. package/dist/src/protocol/message.d.ts +4 -4
  360. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +4 -5
  361. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  362. package/dist/src/public/channels/github/checkout.js +1 -1
  363. package/dist/src/public/channels/index.d.ts +1 -1
  364. package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
  365. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  366. package/dist/src/public/definitions/channel.d.ts +1 -1
  367. package/dist/src/public/definitions/sandbox.d.ts +5 -43
  368. package/dist/src/public/definitions/sandbox.js +1 -1
  369. package/dist/src/public/local-dev.d.ts +4 -5
  370. package/dist/src/public/sandbox/docker-sandbox.d.ts +16 -40
  371. package/dist/src/public/sandbox/docker.d.ts +2 -2
  372. package/dist/src/public/sandbox/docker.js +1 -1
  373. package/dist/src/public/sandbox/index.d.ts +4 -9
  374. package/dist/src/public/sandbox/index.js +1 -1
  375. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +11 -6
  376. package/dist/src/public/sandbox/just-bash.d.ts +2 -2
  377. package/dist/src/public/sandbox/just-bash.js +1 -1
  378. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +11 -17
  379. package/dist/src/public/sandbox/microsandbox.d.ts +2 -2
  380. package/dist/src/public/sandbox/microsandbox.js +1 -1
  381. package/dist/src/public/sandbox/provider.d.ts +1 -0
  382. package/dist/src/public/sandbox/provider.js +1 -0
  383. package/dist/src/public/sandbox/vercel-sandbox.d.ts +10 -41
  384. package/dist/src/public/sandbox/vercel.d.ts +2 -2
  385. package/dist/src/public/sandbox/vercel.js +1 -1
  386. package/dist/src/public/tools/index.d.ts +2 -2
  387. package/dist/src/runtime/agent/resolve-model.js +1 -1
  388. package/dist/src/runtime/cache-key.js +1 -1
  389. package/dist/src/runtime/compiled-artifacts-source.d.ts +6 -1
  390. package/dist/src/runtime/compiled-artifacts-source.js +1 -1
  391. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  392. package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
  393. package/dist/src/runtime/loaders/artifact-paths.js +1 -1
  394. package/dist/src/runtime/loaders/bundled-artifacts.d.ts +3 -0
  395. package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
  396. package/dist/src/runtime/loaders/compile-metadata.js +1 -1
  397. package/dist/src/runtime/loaders/manifest.js +1 -1
  398. package/dist/src/runtime/loaders/module-map.js +1 -1
  399. package/dist/src/runtime/local-dev-capability.d.ts +14 -12
  400. package/dist/src/runtime/local-dev-capability.js +1 -1
  401. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  402. package/dist/src/runtime/resolve-sandbox.d.ts +1 -10
  403. package/dist/src/runtime/resolve-sandbox.js +1 -1
  404. package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +13 -0
  405. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -0
  406. package/dist/src/runtime/sandbox/registry.d.ts +2 -9
  407. package/dist/src/runtime/sandbox/registry.js +1 -1
  408. package/dist/src/runtime/sessions/runtime-session.js +1 -1
  409. package/dist/src/runtime/sessions/turn.d.ts +10 -8
  410. package/dist/src/runtime/subagents/registry.js +1 -1
  411. package/dist/src/runtime/subagents/workflow.js +1 -1
  412. package/dist/src/runtime/tools/registry.js +1 -1
  413. package/dist/src/runtime/types.d.ts +13 -26
  414. package/dist/src/runtime/workspace/types.d.ts +1 -1
  415. package/dist/src/sandbox/providers/default.d.ts +27 -0
  416. package/dist/src/sandbox/providers/default.js +1 -0
  417. package/dist/src/sandbox/providers/docker.d.ts +11 -0
  418. package/dist/src/sandbox/providers/docker.js +1 -0
  419. package/dist/src/sandbox/providers/just-bash.d.ts +4 -0
  420. package/dist/src/sandbox/providers/just-bash.js +1 -0
  421. package/dist/src/sandbox/providers/microsandbox.d.ts +12 -0
  422. package/dist/src/sandbox/providers/microsandbox.js +1 -0
  423. package/dist/src/sandbox/providers/vercel.d.ts +12 -0
  424. package/dist/src/sandbox/providers/vercel.js +1 -0
  425. package/dist/src/sandbox/providers.d.ts +5 -0
  426. package/dist/src/sandbox/providers.js +1 -0
  427. package/dist/src/sandbox/state.d.ts +6 -25
  428. package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
  429. package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
  430. package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +2 -25
  431. package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -1
  432. package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +1 -1
  433. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
  434. package/dist/src/self-modification/filesystem.d.ts +3 -1
  435. package/dist/src/self-modification/filesystem.js +1 -1
  436. package/dist/src/self-modification/git-workspace.d.ts +1 -1
  437. package/dist/src/self-modification/git.d.ts +1 -1
  438. package/dist/src/self-modification/sandbox.d.ts +14 -9
  439. package/dist/src/self-modification/sandbox.js +1 -1
  440. package/dist/src/setup/boxes/select-model.js +1 -1
  441. package/dist/src/setup/cli/select-state.d.ts +4 -2
  442. package/dist/src/setup/cli/select-state.js +1 -1
  443. package/dist/src/setup/flows/model-login.js +1 -1
  444. package/dist/src/setup/flows/model.d.ts +5 -5
  445. package/dist/src/setup/primitives/pm/pnpm.js +3 -2
  446. package/dist/src/setup/scaffold/create/project.js +1 -1
  447. package/dist/src/shared/action-types.d.ts +0 -4
  448. package/dist/src/shared/action-types.js +1 -1
  449. package/dist/src/shared/default-agent-model.d.ts +1 -1
  450. package/dist/src/shared/default-agent-model.js +1 -1
  451. package/dist/src/shared/sandbox-environment.d.ts +45 -0
  452. package/dist/src/shared/sandbox-environment.js +1 -0
  453. package/dist/src/shared/sandbox-network-policy.d.ts +8 -3
  454. package/dist/src/shared/sandbox-network-policy.js +1 -1
  455. package/dist/src/shared/sandbox-prepared-artifacts.d.ts +16 -0
  456. package/dist/src/shared/sandbox-prepared-artifacts.js +1 -0
  457. package/dist/src/shared/sandbox-provider.d.ts +110 -0
  458. package/dist/src/shared/sandbox-provider.js +1 -0
  459. package/dist/src/shared/sandbox-session.d.ts +18 -41
  460. package/dist/src/shared/sandbox-template-error.d.ts +9 -0
  461. package/dist/src/shared/sandbox-template-error.js +1 -0
  462. package/dist/src/subagents/tool.d.ts +1 -1
  463. package/dist/src/subagents/tool.js +1 -1
  464. package/dist/src/svelte/index.js +1 -1
  465. package/dist/src/svelte/use-eve-agent.js +1 -1
  466. package/dist/src/tasks/delivery-context.d.ts +6 -4
  467. package/dist/src/tasks/delivery-context.js +2 -2
  468. package/dist/src/tasks/delivery-policy.d.ts +2 -0
  469. package/dist/src/tasks/delivery-policy.js +1 -1
  470. package/dist/src/tasks/notification.d.ts +4 -0
  471. package/dist/src/tasks/notification.js +1 -0
  472. package/dist/src/tasks/session-task-cohorts.d.ts +1 -12
  473. package/dist/src/tasks/session-task-cohorts.js +1 -1
  474. package/dist/src/tasks/transitions.d.ts +5 -2
  475. package/dist/src/tasks/transitions.js +1 -1
  476. package/dist/src/tasks/types.d.ts +2 -52
  477. package/dist/src/tasks/types.js +1 -1
  478. package/dist/src/tools/definition.d.ts +1 -25
  479. package/dist/src/tools/definition.js +1 -1
  480. package/dist/src/tools/dynamic.d.ts +1 -3
  481. package/dist/src/tools/framework/agent-contract.js +1 -1
  482. package/dist/src/tools/framework/agent.d.ts +16 -22
  483. package/dist/src/tools/framework/agent.js +1 -1
  484. package/dist/src/tools/workflow-definition.d.ts +16 -5
  485. package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
  486. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  487. package/dist/src/vue/index.js +1 -1
  488. package/dist/src/vue/use-eve-agent.js +1 -1
  489. package/docs/README.md +40 -45
  490. package/docs/agent-config.md +2 -2
  491. package/docs/channels/eve.mdx +1 -1
  492. package/docs/channels/overview.mdx +48 -0
  493. package/docs/concepts/execution-model-and-durability.mdx +5 -6
  494. package/docs/concepts/sessions-runs-and-streaming.md +5 -5
  495. package/docs/dynamic-configuration/meta.json +5 -0
  496. package/docs/evals/assertions.mdx +5 -1
  497. package/docs/evals/overview.mdx +43 -0
  498. package/docs/getting-started.mdx +1 -1
  499. package/docs/guides/client/overview.mdx +1 -1
  500. package/docs/guides/deployment/overview.md +1 -1
  501. package/docs/guides/deployment/self-hosting.md +5 -5
  502. package/docs/guides/deployment/vercel.mdx +10 -12
  503. package/docs/guides/dev-tui.md +22 -10
  504. package/docs/guides/frontend/overview.mdx +1 -1
  505. package/docs/guides/hooks.md +4 -0
  506. package/docs/memory/meta.json +1 -1
  507. package/docs/memory/overview.mdx +4 -0
  508. package/docs/meta.json +13 -16
  509. package/docs/patterns/meta.json +2 -2
  510. package/docs/protocols/acp.md +1 -1
  511. package/docs/protocols/ucp.mdx +1 -1
  512. package/docs/reference/cli.md +10 -9
  513. package/docs/reference/meta.json +4 -1
  514. package/docs/reference/typescript-api.md +1 -24
  515. package/docs/sandbox/default.mdx +17 -0
  516. package/docs/sandbox/docker.mdx +29 -0
  517. package/docs/sandbox/index.mdx +216 -0
  518. package/docs/sandbox/just-bash.mdx +18 -0
  519. package/docs/sandbox/meta.json +5 -0
  520. package/docs/sandbox/microsandbox.mdx +31 -0
  521. package/docs/sandbox/vercel.mdx +106 -0
  522. package/docs/schedules.mdx +35 -1
  523. package/docs/subagents/index.mdx +27 -6
  524. package/docs/subagents/meta.json +1 -1
  525. package/docs/tools/overview.mdx +37 -37
  526. package/docs/tools/workflows.mdx +31 -24
  527. package/docs/tutorial/run-analysis.mdx +6 -5
  528. package/package.json +20 -11
  529. package/dist/src/cli/dev/tui/model-editor.d.ts +0 -103
  530. package/dist/src/cli/dev/tui/model-editor.js +0 -1
  531. package/dist/src/compiled/_chunks/node/chunk-5OX2R7AJ-CxVV-owP.js +0 -1
  532. package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-B__hKQV7.js +0 -1
  533. package/dist/src/compiled/_chunks/node/chunk-QZV7YRVM-Dzw4WEBv.js +0 -1
  534. package/dist/src/compiled/_chunks/node/dist-CweJdVFE.js +0 -6
  535. package/dist/src/compiled/_chunks/node/dist-Da54NuK8.js +0 -96
  536. package/dist/src/compiled/_chunks/workflow/attribute-changes-A6HfMNG3.js +0 -6
  537. package/dist/src/compiled/_chunks/workflow/resume-hook-CAqlhwic.js +0 -1
  538. package/dist/src/compiled/_chunks/workflow/sleep-CbUwdv6O.js +0 -1
  539. package/dist/src/compiled/chat/_mdast.d.ts +0 -24
  540. package/dist/src/compiled/chat/_workflow-serde.d.ts +0 -3
  541. package/dist/src/compiled/chat/jsx-runtime-_JEEAotp.d.ts +0 -907
  542. package/dist/src/execution/sandbox/bindings/local-backend-utils.js +0 -1
  543. package/dist/src/execution/sandbox/lazy-backend.d.ts +0 -15
  544. package/dist/src/execution/sandbox/lazy-backend.js +0 -1
  545. package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +0 -8
  546. package/dist/src/execution/sandbox/template-prewarm-lock.js +0 -1
  547. package/dist/src/execution/tasks/child/steps.d.ts +0 -81
  548. package/dist/src/execution/tasks/child/steps.js +0 -1
  549. package/dist/src/execution/tasks/child/workflow.d.ts +0 -28
  550. package/dist/src/execution/tasks/child/workflow.js +0 -1
  551. package/dist/src/execution/tools/subagent/emit-called-step.d.ts +0 -9
  552. package/dist/src/execution/tools/subagent/emit-called-step.js +0 -1
  553. package/dist/src/execution/tools/workflow/run-control.d.ts +0 -14
  554. package/dist/src/execution/tools/workflow/run-control.js +0 -1
  555. package/dist/src/internal/authored-definition/sandbox.d.ts +0 -17
  556. package/dist/src/internal/authored-definition/sandbox.js +0 -1
  557. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +0 -16
  558. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +0 -2
  559. package/dist/src/public/definitions/sandbox-backend.d.ts +0 -17
  560. package/dist/src/public/definitions/sandbox-backend.js +0 -1
  561. package/dist/src/public/sandbox/backends/default.d.ts +0 -1
  562. package/dist/src/public/sandbox/backends/default.js +0 -1
  563. package/dist/src/public/sandbox/backends/docker.d.ts +0 -1
  564. package/dist/src/public/sandbox/backends/docker.js +0 -1
  565. package/dist/src/public/sandbox/backends/just-bash.d.ts +0 -1
  566. package/dist/src/public/sandbox/backends/just-bash.js +0 -1
  567. package/dist/src/public/sandbox/backends/microsandbox.d.ts +0 -1
  568. package/dist/src/public/sandbox/backends/microsandbox.js +0 -1
  569. package/dist/src/public/sandbox/backends/vercel.d.ts +0 -1
  570. package/dist/src/public/sandbox/backends/vercel.js +0 -1
  571. package/dist/src/runtime/sandbox/keys.d.ts +0 -42
  572. package/dist/src/runtime/sandbox/keys.js +0 -1
  573. package/dist/src/runtime/sandbox/template-plan.d.ts +0 -24
  574. package/dist/src/runtime/sandbox/template-plan.js +0 -1
  575. package/dist/src/sandbox/backends/default.d.ts +0 -42
  576. package/dist/src/sandbox/backends/default.js +0 -1
  577. package/dist/src/sandbox/backends/docker.d.ts +0 -14
  578. package/dist/src/sandbox/backends/docker.js +0 -1
  579. package/dist/src/sandbox/backends/just-bash.d.ts +0 -17
  580. package/dist/src/sandbox/backends/just-bash.js +0 -1
  581. package/dist/src/sandbox/backends/microsandbox.d.ts +0 -17
  582. package/dist/src/sandbox/backends/microsandbox.js +0 -1
  583. package/dist/src/sandbox/backends/vercel.d.ts +0 -30
  584. package/dist/src/sandbox/backends/vercel.js +0 -1
  585. package/dist/src/shared/sandbox-backend.d.ts +0 -176
  586. package/dist/src/shared/sandbox-backend.js +0 -1
  587. package/dist/src/shared/sandbox-definition.d.ts +0 -112
  588. package/dist/src/shared/sandbox-definition.js +0 -1
  589. package/dist/src/tasks/session-index.d.ts +0 -65
  590. package/dist/src/tasks/session-index.js +0 -1
  591. package/dist/src/tools/task.d.ts +0 -55
  592. package/dist/src/tools/task.js +0 -1
  593. package/docs/sandbox.mdx +0 -342
@@ -1,46 +1,22 @@
1
- /**
2
- * Image pull behavior for the Docker sandbox backend.
3
- *
4
- * - `"if-not-present"` (default): pull the base image only when it is
5
- * missing from the local image store.
6
- * - `"always"`: pull before every template build so the image floats to
7
- * the registry's latest digest.
8
- * - `"never"`: never pull; fail when the image is missing locally.
9
- */
1
+ import type { SandboxSession } from "#shared/sandbox-session.js";
2
+ import type { SandboxNetworkOptions, SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
3
+ /** Image pull behavior for Docker sandbox environments. */
10
4
  export type DockerSandboxPullPolicy = "if-not-present" | "always" | "never";
11
- /**
12
- * Initial network policy for sandboxes created by the Docker backend.
13
- * Docker supports coarse-grained egress control only: `"allow-all"`
14
- * attaches the container to the default bridge network, `"deny-all"`
15
- * runs it with networking disabled. Domain-level policies and
16
- * credential brokering require `vercel()`.
17
- */
18
- export type DockerSandboxNetworkPolicy = "allow-all" | "deny-all";
19
- /**
20
- * Options accepted by `docker(opts)`.
21
- */
22
- export interface DockerSandboxCreateOptions {
23
- /**
24
- * Base container image for templates and sessions. Defaults to eve's
25
- * published `ghcr.io/vercel/eve` image, tagged with the installed eve
26
- * version without build metadata or `EVE_SANDBOX_IMAGE_TAG` when set. Framework setup creates
27
- * `/workspace` and verifies Bash. Install
28
- * any authored runtime tools in sandbox bootstrap or provide them through a
29
- * custom image.
30
- */
5
+ /** Coarse-grained egress policy for one live Docker sandbox. */
6
+ export type DockerSandboxNetworkPolicy = Extract<SandboxNetworkPolicy, "allow-all" | "deny-all">;
7
+ /** Options shared by every sandbox created from one Docker environment. */
8
+ export interface DockerSandboxEnvironmentOptions {
9
+ /** Base container image. Defaults to eve's published sandbox image. */
31
10
  readonly image?: string;
32
- /**
33
- * Environment variables baked into every container the backend
34
- * creates (template builds and sessions).
35
- */
11
+ /** Environment variables baked into template builds and live containers. */
36
12
  readonly env?: Readonly<Record<string, string>>;
37
- /**
38
- * Base image pull behavior. Defaults to `"if-not-present"`.
39
- */
13
+ /** Base image pull behavior. @default "if-not-present" */
40
14
  readonly pullPolicy?: DockerSandboxPullPolicy;
41
- /**
42
- * Initial network policy for created containers. Defaults to
43
- * `"allow-all"`.
44
- */
15
+ /** Idempotent setup captured in the prepared image. */
16
+ readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
17
+ }
18
+ /** Options applied when eve creates one live Docker sandbox. */
19
+ export interface DockerSandboxRuntimeOptions extends SandboxNetworkOptions {
20
+ /** Initial network policy for this container. @default "allow-all" */
45
21
  readonly networkPolicy?: DockerSandboxNetworkPolicy;
46
22
  }
@@ -1,2 +1,2 @@
1
- export { docker } from "#public/sandbox/backends/docker.js";
2
- export type { DockerSandboxCreateOptions, DockerSandboxNetworkPolicy, DockerSandboxPullPolicy, } from "#public/sandbox/docker-sandbox.js";
1
+ export { DockerSandbox, type DockerSandboxEnvironmentOptions, type DockerSandboxRuntimeOptions, } from "#sandbox/providers/docker.js";
2
+ export type { DockerSandboxNetworkPolicy, DockerSandboxPullPolicy, } from "#public/sandbox/docker-sandbox.js";
@@ -1 +1 @@
1
- import{docker}from"#public/sandbox/backends/docker.js";export{docker};
1
+ import{DockerSandbox}from"#sandbox/providers/docker.js";export{DockerSandbox};
@@ -1,9 +1,4 @@
1
- /**
2
- * Sandbox authoring helpers for `agent/sandbox.ts` (or
3
- * `agent/sandbox/sandbox.ts` when paired with a `workspace/` folder).
4
- */
5
- export { defineSandbox, type SandboxAncestorReference, type SandboxBootstrapContext, type SandboxBootstrapUseFn, type SandboxCommandResult, type SandboxDefinition, type SandboxParentDefinition, type SandboxParentDefinitionContext, type SandboxParentValue, type SandboxProcess, type SandboxReadBinaryFileOptions, type SandboxReadFileOptions, type SandboxReadTextFileOptions, type SandboxRevalidationKeyFn, type SandboxRunOptions, type SandboxSession, type RuntimeSandboxSession, type SandboxSpawnOptions, type SandboxSessionContext, type SandboxSessionUseFn, type SandboxWriteBinaryFileOptions, type SandboxWriteFileOptions, type SandboxWriteTextFileOptions, } from "#public/definitions/sandbox.js";
6
- export type { SandboxBackend, SandboxBackendCreateInput, SandboxBackendHandle, SandboxBackendPrewarmInput, SandboxBackendRuntimeContext, SandboxBackendSessionState, SandboxDeleteOptions, SandboxSeedFile, } from "#public/definitions/sandbox-backend.js";
7
- export type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
8
- export { SandboxTemplateNotProvisionedError } from "#public/definitions/sandbox-backend.js";
9
- export { defaultSandbox as defaultBackend, type DefaultSandboxOptions as DefaultBackendOptions, } from "#public/sandbox/backends/default.js";
1
+ export { defineParentSandbox, defineSandbox, type SandboxOpenArguments, type SandboxEnvironment, type SandboxSelector, type SandboxSelectorContext, type SandboxCommandResult, type FixedNetworkSandboxSession, type MutableNetworkSandboxSession, type SandboxProcess, type SandboxReadBinaryFileOptions, type SandboxReadFileOptions, type SandboxReadTextFileOptions, type SandboxRunOptions, type SandboxSession, type RuntimeSandboxSession, type RuntimeSandboxSessionFor, type SandboxSpawnOptions, type SandboxWriteBinaryFileOptions, type SandboxWriteFileOptions, type SandboxWriteTextFileOptions, } from "#public/definitions/sandbox.js";
2
+ export { DefaultSandbox } from "#sandbox/providers/default.js";
3
+ export type { DefaultSandboxEnvironmentOptions } from "#sandbox/providers/default.js";
4
+ export type { SandboxNetworkOptions, SandboxNetworkPolicy, } from "#shared/sandbox-network-policy.js";
@@ -1 +1 @@
1
- import{SandboxTemplateNotProvisionedError}from"#public/definitions/sandbox-backend.js";import{defineSandbox}from"#public/definitions/sandbox.js";import{defaultSandbox as defaultBackend}from"#public/sandbox/backends/default.js";export{SandboxTemplateNotProvisionedError,defaultBackend,defineSandbox};
1
+ import{defineParentSandbox,defineSandbox}from"#public/definitions/sandbox.js";import{DefaultSandbox}from"#sandbox/providers/default.js";export{DefaultSandbox,defineParentSandbox,defineSandbox};
@@ -1,19 +1,22 @@
1
1
  import type { CustomCommand, IFileSystem } from "just-bash";
2
+ import type { SandboxSession } from "#shared/sandbox-session.js";
2
3
  /**
3
4
  * Context passed to a custom just-bash filesystem factory for each live handle.
4
5
  */
5
6
  export interface JustBashFilesystemContext {
6
- /** Stable application root for this backend create call. */
7
- readonly appRoot: string;
7
+ /** Resolves an application-relative path without exposing project layout. */
8
+ resolveProjectPath(path: string): string;
9
+ /** Stable provider-private storage directory for this sandbox. */
10
+ readonly storagePath: string;
8
11
  /** eve's durable, session-owned filesystem, including `/workspace`. */
9
12
  readonly defaultFilesystem: IFileSystem;
10
13
  /** The just-bash engine resolved by eve after its optional installation check. */
11
14
  readonly justBash: typeof import("just-bash");
12
15
  }
13
16
  /**
14
- * Options accepted by `justbash(opts)`.
17
+ * Options accepted by just-bash environment constructors.
15
18
  *
16
- * The just-bash backend runs the workspace under the pure-JS `just-bash`
19
+ * The just-bash provider runs the workspace under the pure-JS `just-bash`
17
20
  * interpreter with a virtual filesystem — no daemon or VM required, but
18
21
  * no real binaries either. The `just-bash` package is not bundled with
19
22
  * eve; it is loaded lazily from the application install.
@@ -31,7 +34,7 @@ export interface JustBashSandboxCreateOptions {
31
34
  * just-bash interpreter. Custom commands can participate in normal shell
32
35
  * composition, including pipelines and redirections.
33
36
  *
34
- * Custom commands are not available during template prewarming. They run in
37
+ * Custom commands are not available during environment preparation. They run in
35
38
  * eve's host process, outside the virtual filesystem security boundary, and
36
39
  * are responsible for validating their own inputs and cleaning up host
37
40
  * resources.
@@ -45,7 +48,9 @@ export interface JustBashSandboxCreateOptions {
45
48
  *
46
49
  * This just-bash-specific escape hatch requires the application to install
47
50
  * a compatible `just-bash` version. It is not invoked during template
48
- * prewarming.
51
+ * preparation.
49
52
  */
50
53
  readonly filesystem?: (context: JustBashFilesystemContext) => IFileSystem | Promise<IFileSystem>;
54
+ /** Idempotent setup captured in the prepared virtual filesystem. */
55
+ readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
51
56
  }
@@ -1,2 +1,2 @@
1
- export { justbash } from "#public/sandbox/backends/just-bash.js";
2
- export type { JustBashFilesystemContext, JustBashSandboxCreateOptions, } from "#public/sandbox/just-bash-sandbox.js";
1
+ export { JustBashSandbox, type JustBashEnvironmentOptions } from "#sandbox/providers/just-bash.js";
2
+ export type { JustBashFilesystemContext } from "#public/sandbox/just-bash-sandbox.js";
@@ -1 +1 @@
1
- import{justbash}from"#public/sandbox/backends/just-bash.js";export{justbash};
1
+ import{JustBashSandbox}from"#sandbox/providers/just-bash.js";export{JustBashSandbox};
@@ -1,8 +1,9 @@
1
- import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
1
+ import type { SandboxSession } from "#shared/sandbox-session.js";
2
+ import type { SandboxNetworkOptions, SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
2
3
  /**
3
- * Options accepted by `microsandbox(opts)`.
4
+ * Options accepted by microsandbox environment constructors.
4
5
  *
5
- * The microsandbox backend runs sandboxes in lightweight local VMs via
6
+ * The microsandbox provider runs sandboxes in lightweight local VMs via
6
7
  * [microsandbox](https://www.npmjs.com/package/microsandbox). Options
7
8
  * are eve-owned rather than a raw passthrough so the public surface can
8
9
  * stay stable while the underlying runtime evolves. Supported hosts:
@@ -12,8 +13,8 @@ export interface MicrosandboxSandboxCreateOptions {
12
13
  /**
13
14
  * OCI image used as the base runtime. eve prepares this image with
14
15
  * Bash, the framework workspace, and the sandbox user before authored
15
- * bootstrap code runs. Install authored runtime tools such as Node,
16
- * Python, or ripgrep in sandbox bootstrap or provide them through a
16
+ * environment preparation runs. Install authored runtime tools such as Node,
17
+ * Python, or ripgrep during preparation or provide them through a
17
18
  * custom image.
18
19
  *
19
20
  * @default The `ghcr.io/vercel/eve` tag matching the installed eve version without build metadata, or `EVE_SANDBOX_IMAGE_TAG` when set.
@@ -27,6 +28,8 @@ export interface MicrosandboxSandboxCreateOptions {
27
28
  readonly env?: Readonly<Record<string, string>>;
28
29
  /** OCI image pull policy. @default "if-missing" */
29
30
  readonly pullPolicy?: "always" | "if-missing" | "never";
31
+ /** Idempotent setup captured in the prepared VM snapshot. */
32
+ readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
30
33
  /**
31
34
  * Installation behavior for the microsandbox npm package and its VM
32
35
  * runtime. By default eve installs both automatically when missing —
@@ -37,18 +40,9 @@ export interface MicrosandboxSandboxCreateOptions {
37
40
  readonly autoInstall?: boolean;
38
41
  readonly skipVerify?: boolean;
39
42
  };
40
- /** Initial network policy applied to sandboxes after framework setup. */
41
- readonly networkPolicy?: SandboxNetworkPolicy;
42
43
  }
43
- /**
44
- * Options accepted by the microsandbox backend's `bootstrap({ use })` hook.
45
- */
46
- export interface MicrosandboxBootstrapUseOptions {
47
- readonly networkPolicy?: SandboxNetworkPolicy;
48
- }
49
- /**
50
- * Options accepted by the microsandbox backend's `onSession({ use })` hook.
51
- */
52
- export interface MicrosandboxSessionUseOptions {
44
+ /** Options applied when eve creates one live microsandbox VM. */
45
+ export interface MicrosandboxSandboxRuntimeOptions extends SandboxNetworkOptions {
46
+ /** Initial network policy for this VM. @default "allow-all" */
53
47
  readonly networkPolicy?: SandboxNetworkPolicy;
54
48
  }
@@ -1,2 +1,2 @@
1
- export { microsandbox } from "#public/sandbox/backends/microsandbox.js";
2
- export type { MicrosandboxBootstrapUseOptions, MicrosandboxSandboxCreateOptions, MicrosandboxSessionUseOptions, } from "#public/sandbox/microsandbox-sandbox.js";
1
+ export { MicrosandboxSandbox, type MicrosandboxEnvironmentOptions, } from "#sandbox/providers/microsandbox.js";
2
+ export type { MicrosandboxSandboxRuntimeOptions } from "#public/sandbox/microsandbox-sandbox.js";
@@ -1 +1 @@
1
- import{microsandbox}from"#public/sandbox/backends/microsandbox.js";export{microsandbox};
1
+ import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";export{MicrosandboxSandbox};
@@ -0,0 +1 @@
1
+ export { defineSandboxProvider, type SandboxDeleteOptions, type SandboxPreparedArtifact, type SandboxProvider, type SandboxProviderDefinition, type SandboxProviderFiles, type SandboxProviderHandle, type SandboxProviderImplementation, type SandboxProviderPrepareContext, type SandboxProviderResourceFile, type SandboxProviderResources, type SandboxProviderResourceSource, type SandboxProviderResourceTree, type SandboxProviderSessionContext, type SandboxProviderTargetFile, } from "#shared/sandbox-provider.js";
@@ -0,0 +1 @@
1
+ import{defineSandboxProvider}from"#shared/sandbox-provider.js";export{defineSandboxProvider};
@@ -1,19 +1,19 @@
1
1
  import type * as Vercel from "#compiled/@vercel/sandbox/index.js";
2
+ import type { SandboxNetworkOptions } from "#shared/sandbox-network-policy.js";
2
3
  type VercelCreateOptions = NonNullable<Parameters<typeof Vercel.Sandbox.create>[0]>;
3
- type VercelUpdateOptions = Parameters<Vercel.Sandbox["update"]>[0];
4
4
  type VercelSandboxInternalCreateOptions = {
5
5
  readonly [key: `__${string}`]: unknown;
6
6
  };
7
7
  type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts" | "name" | "onResume" | "persistent" | "runtime" | "signal"> & VercelSandboxInternalCreateOptions : never;
8
8
  /**
9
- * Options accepted by `vercel(opts)`. Forwarded to Vercel
9
+ * Options accepted by Vercel sandbox environment constructors. Forwarded to Vercel
10
10
  * Sandbox creation for every fresh sandbox the framework creates
11
- * (template at prewarm time, session at first-time session-create).
11
+ * (template during preparation, session at first creation).
12
12
  * Skipped on resume (`Sandbox.get`) since no create happens there.
13
13
  *
14
14
  * `networkPolicy` is deferred until after framework-owned base setup
15
15
  * for fresh templates and template-less sessions, so eve can install
16
- * required packages before authored bootstrap code runs. Template-backed
16
+ * required packages before authored environment preparation runs. Template-backed
17
17
  * session creates receive it at creation time because the template
18
18
  * already contains the prepared base runtime.
19
19
  *
@@ -22,7 +22,7 @@ type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts"
22
22
  * author-supplied values.
23
23
  *
24
24
  * `runtime` is excluded: eve defaults to its published
25
- * `vcr.vercel.com/vercel/eve/base` image tagged with the installed eve version without build metadata
25
+ * `vcr.vercel.com/vercel/eve/base` image tagged with the installed eve version
26
26
  * or `EVE_SANDBOX_IMAGE_TAG` when `image` is not supplied. Both are mutually
27
27
  * exclusive with a stock runtime.
28
28
  *
@@ -30,9 +30,9 @@ type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts"
30
30
  * snapshot `source` takes precedence because the Vercel SDK makes it mutually
31
31
  * exclusive with `image`.
32
32
  *
33
- * `source` is honored only on the template create at prewarm time, so
33
+ * `source` is honored only on the template creation during preparation, so
34
34
  * an author-supplied snapshot, git revision, or tarball becomes the
35
- * base layer for the template. Framework setup, bootstrap, and seed
35
+ * base layer for the template. Framework setup, preparation, and seed
36
36
  * files all run on top, and the resulting
37
37
  * framework-owned snapshot is what every later session derives from,
38
38
  * so `source` is stripped from the session-create path. eve does not
@@ -48,40 +48,9 @@ export type VercelSandboxMount = Vercel.SandboxMounts[string];
48
48
  /** Drive mounts keyed by absolute sandbox path. */
49
49
  export type VercelSandboxMounts = Vercel.SandboxMounts;
50
50
  /** Options resolved when eve creates a fresh live session sandbox. */
51
- export interface VercelSandboxSessionCreateOptions {
51
+ export interface VercelSandboxMountOptions {
52
52
  readonly mounts?: VercelSandboxMounts;
53
53
  }
54
- /** Context available while resolving fresh live-session creation options. */
55
- export interface VercelSandboxSessionCreateContext {
56
- readonly session: {
57
- readonly id: string;
58
- };
59
- }
60
- /** Options accepted by `vercel(opts)`. */
61
- export type VercelSandboxOptions = VercelSandboxCreateOptions & {
62
- /**
63
- * Resolves options that apply only to fresh live sessions. It is not called
64
- * while prewarming templates or resuming an existing sandbox.
65
- */
66
- readonly sessionCreateOptions?: (context: VercelSandboxSessionCreateContext) => Promise<VercelSandboxSessionCreateOptions> | VercelSandboxSessionCreateOptions;
67
- };
68
- /**
69
- * Options accepted by the Vercel backend's `bootstrap({ use })` hook.
70
- * Tracks the Vercel SDK's `Sandbox.update(...)` parameter because bootstrap
71
- * applies its options to the template via `sandbox.update(...)` after
72
- * `Sandbox.create()` and before the snapshot is captured. The Vercel
73
- * SDK persists `update`-d settings on the sandbox so they survive into
74
- * the snapshot, which becomes the seed for every later session.
75
- *
76
- * Today this is the same shape as
77
- * {@link VercelSandboxSessionUseOptions}; both are exposed as separate
78
- * named aliases so future divergence is non-breaking.
79
- */
80
- export type VercelSandboxBootstrapUseOptions = VercelUpdateOptions;
81
- /**
82
- * Options accepted by the Vercel backend's `onSession({ use })` hook.
83
- * Tracks the Vercel SDK's `Sandbox.update(...)` parameter; passed values are
84
- * applied to the live session via the SDK's `update`.
85
- */
86
- export type VercelSandboxSessionUseOptions = VercelUpdateOptions;
54
+ /** Options accepted when creating one live Vercel sandbox from an environment. */
55
+ export type VercelSandboxRuntimeOptions = Omit<VercelSandboxCreateOptions, "fetch" | "image" | "projectId" | "source" | "tags" | "teamId" | "token"> & SandboxNetworkOptions & VercelSandboxMountOptions;
87
56
  export {};
@@ -1,3 +1,3 @@
1
- export { vercel } from "#public/sandbox/backends/vercel.js";
1
+ export { VercelSandbox, type VercelSandboxEnvironmentOptions, type VercelSandboxRuntimeOptions, } from "#sandbox/providers/vercel.js";
2
2
  export { Drive } from "#compiled/@vercel/sandbox/index.js";
3
- export type { VercelSandboxBootstrapUseOptions, VercelSandboxCreateOptions, VercelSandboxMount, VercelSandboxMountMode, VercelSandboxMounts, VercelSandboxOptions, VercelSandboxSessionCreateContext, VercelSandboxSessionCreateOptions, VercelSandboxSessionUseOptions, } from "#public/sandbox/vercel-sandbox.js";
3
+ export type { VercelSandboxMount, VercelSandboxMountMode, VercelSandboxMounts, } from "#public/sandbox/vercel-sandbox.js";
@@ -1 +1 @@
1
- import{vercel}from"#public/sandbox/backends/vercel.js";import{Drive}from"#compiled/@vercel/sandbox/index.js";export{Drive,vercel};
1
+ import{VercelSandbox}from"#sandbox/providers/vercel.js";import{Drive}from"#compiled/@vercel/sandbox/index.js";export{Drive,VercelSandbox};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Tool authoring helpers for `agent/tools/*.ts` files.
3
3
  */
4
- export { type BackgroundToolDefinition, type DisabledToolSentinel, defineTool, disableTool, isDisabledToolSentinel, type TaskExec, type TaskReceipt, type ToolLabelDefinition, type ToolAuthOptions, type ToolAuthProvider, type ToolDefinition, type ToolContext, type ToolModelOutput, type ToolModelOutputPart, } from "#tools/definition.js";
4
+ export { type DisabledToolSentinel, defineTool, disableTool, isDisabledToolSentinel, type ToolLabelDefinition, type ToolAuthOptions, type ToolAuthProvider, type ToolDefinition, type ToolContext, type ToolModelOutput, type ToolModelOutputPart, } from "#tools/definition.js";
5
5
  export { defineDynamic } from "#dynamic/definition.js";
6
6
  export { defineDurableSchema } from "#tools/durable-schema.js";
7
7
  export { defineDurableCallback } from "#tools/durable-callbacks.js";
@@ -10,5 +10,5 @@ export type { DynamicEvents, DynamicResolveContext, DynamicSentinel } from "#dyn
10
10
  export type { DynamicToolEntry, DynamicToolEvents, DynamicToolSet, DynamicToolResult, } from "#tools/dynamic.js";
11
11
  export { type SessionContext } from "#public/definitions/callback-context.js";
12
12
  export { toolResultFrom, type MatchedConnectionResult, type MatchedToolResult, type ToolResultFromFn, } from "#public/tools/result.js";
13
- export { defineWorkflowTool, type WorkflowStepToolContext, type WorkflowToolContext, type WorkflowToolDefinition, type AgentInput, type WorkflowAgentMetadata, } from "#tools/workflow-definition.js";
13
+ export { defineWorkflowTool, type WorkflowStepToolContext, type TaskReceipt, type WorkflowToolContext, type WorkflowToolDefinition, type AgentInput, type WorkflowAgentMetadata, } from "#tools/workflow-definition.js";
14
14
  export type { ToolInputRequest, ToolInputResponse } from "#tools/definition.js";
@@ -1 +1 @@
1
- import{localGatewayModel}from"#internal/model-auth/transport.js";import{RuntimeModelMetadataCacheKey}from"#context/keys.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId,isAgentReasoningDefinition,isRuntimeLanguageModel}from"#internal/runtime-model.js";import{parseJsonObject}from"#shared/json.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";import{createRuntimeModelCatalog}from"#runtime/agent/model-catalog.js";async function resolveRuntimeModelReference(e,t){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):localGatewayModel(e.id)??e.id:r}async function loadSourceBackedRuntimeModelReference(e,t){if(t===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${e.id}".`);let n=await loadResolvedModuleExport({definition:e.source,kindLabel:`runtime model "${e.id}"`,moduleMap:t.moduleMap,nodeId:t.nodeId}),r=normalizeAgentDefinition(n,`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to match the public eve shape.`).model;if(r===void 0)throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a runtime model.`);if(isDynamicModelDefinition(r))throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a static runtime model.`);return r}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}async function loadDynamicRuntimeModelDefinition(e){let t=await loadResolvedModuleExport({definition:e.dynamicModel,kindLabel:`dynamic runtime model`,moduleMap:e.scope.moduleMap,nodeId:e.scope.nodeId}),n=normalizeAgentDefinition(t,`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to match the public eve shape.`).model;if(!isDynamicModelDefinition(n))throw Error(`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to provide a dynamic model definition.`);return n}async function resolveRuntimeModelSelection(e){if(e.selection===null||e.selection===void 0)throw Error(`Dynamic model resolver returned no model. Every matching dynamic model handler must return a concrete model selection.`);let t=normalizeDynamicModelSelection(e.selection);validateDynamicModelSelection(t);let n=t.modelOptions?.providerOptions===void 0?void 0:parseProviderOptionsRecord(t.modelOptions.providerOptions),r=t.model,i=e.catalog??runtimeModelCatalogForState(e.state);if(typeof r==`string`){let a=formatLanguageModelGatewayId(r),o=await resolveSelectionMetadata({cacheKey:`gateway:${a}`,catalog:i,contextWindowTokens:t.modelContextWindowTokens,load:e=>e.getByGatewayId(a),modelLabel:a,state:e.state});return{reference:{id:o.resolvedModelId,contextWindowTokens:o.contextWindowTokens,maxOutputTokens:o.maxOutputTokens,providerOptions:n,reasoning:t.reasoning}}}if(validateRuntimeLanguageModel(r),e.durability===`durable`)throw Error(`Dynamic model selection returned a provider object, but durable model selections must be serializable. Return a model id string, or use a "step.started" model resolver.`);let a=formatLanguageModelGatewayId(r),o=r.provider.split(`.`)[0],s=await resolveSelectionMetadata({cacheKey:o===`gateway`?`gateway:${r.modelId}`:`provider:${r.provider}:${r.modelId}`,catalog:i,contextWindowTokens:t.modelContextWindowTokens,load:e=>o===`gateway`?e.getByGatewayId(r.modelId):e.getByProviderModelId(r.provider,r.modelId),modelLabel:a,state:e.state});return{model:r,reference:{id:s.resolvedModelId,contextWindowTokens:s.contextWindowTokens,maxOutputTokens:s.maxOutputTokens,providerOptions:n,reasoning:t.reasoning}}}const runtimeModelCatalogsByState=new WeakMap;function runtimeModelCatalogForState(e){let t=runtimeModelCatalogsByState.get(e);if(t!==void 0)return t;let n=createRuntimeModelCatalog();return runtimeModelCatalogsByState.set(e,n),n}async function resolveSelectionMetadata(e){if(e.contextWindowTokens!==void 0)return{contextWindowTokens:e.contextWindowTokens,resolvedModelId:e.modelLabel};let t=Date.now(),n=e.state.get(RuntimeModelMetadataCacheKey)?.[e.cacheKey];if(n!==void 0&&n.expiresAt>t)return n;let r=await e.load(e.catalog);if(r===null)throw Error(`Cannot select model "${e.modelLabel}" because AI Gateway did not provide context window metadata. Return modelContextWindowTokens with this selection for an unlisted or custom model.`);let i={...r,expiresAt:t+864e5};return e.state.set(RuntimeModelMetadataCacheKey,n=>({...Object.fromEntries(Object.entries(n??{}).filter(([,e])=>e.expiresAt>t)),[e.cacheKey]:i})),i}const DYNAMIC_MODEL_SELECTION_KEYS=new Set([`model`,`modelContextWindowTokens`,`modelOptions`,`reasoning`]);function validateDynamicModelSelection(e){let t=Object.keys(e).filter(e=>!DYNAMIC_MODEL_SELECTION_KEYS.has(e));if(t.length>0)throw Error(`Dynamic model resolver returned a selection with unknown key(s): ${t.join(`, `)}. Expected { model, reasoning?, modelContextWindowTokens?, modelOptions? }.`);if(e.reasoning!==void 0&&!isAgentReasoningDefinition(e.reasoning))throw Error(`Dynamic model resolver returned an invalid reasoning effort. Expected provider-default, none, minimal, low, medium, high, or xhigh.`);let n=e.modelContextWindowTokens;if(n!==void 0&&(!Number.isInteger(n)||n<=0))throw Error(`Dynamic model resolver returned an invalid modelContextWindowTokens value. Expected a positive integer.`);if(typeof e.model==`string`&&e.model.trim()===``)throw Error(`Dynamic model resolver returned an empty model id.`)}function normalizeDynamicModelSelection(e){return isModelSelectionDefinition(e)?e:{model:e}}function isModelSelectionDefinition(e){return typeof e==`object`&&!!e&&`model`in e&&!isRuntimeLanguageModel(e)}function validateRuntimeLanguageModel(e){if(!isRuntimeLanguageModel(e))throw Error(`Dynamic model resolver returned an invalid model. Return an AI Gateway model id string, an AI SDK language model, or { model, modelContextWindowTokens?, modelOptions? }.`)}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=parseJsonObject(r);return t}export{loadDynamicRuntimeModelDefinition,resolveRuntimeModelReference,resolveRuntimeModelSelection,shouldMockAuthoredRuntimeModels};
1
+ import{localGatewayModel}from"#internal/model-auth/transport.js";import{RuntimeModelMetadataCacheKey}from"#context/keys.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId,isAgentReasoningDefinition,isRuntimeLanguageModel}from"#internal/runtime-model.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";import{createRuntimeModelCatalog}from"#runtime/agent/model-catalog.js";async function resolveRuntimeModelReference(e,t){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):localGatewayModel(e.id)??e.id:r}async function loadSourceBackedRuntimeModelReference(e,t){if(t===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${e.id}".`);let n=await loadResolvedModuleExport({definition:e.source,kindLabel:`runtime model "${e.id}"`,moduleMap:t.moduleMap,nodeId:t.nodeId}),r=normalizeAgentDefinition(n,`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to match the public eve shape.`).model;if(r===void 0)throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a runtime model.`);if(isDynamicModelDefinition(r))throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a static runtime model.`);return r}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}async function loadDynamicRuntimeModelDefinition(e){let t=await loadResolvedModuleExport({definition:e.dynamicModel,kindLabel:`dynamic runtime model`,moduleMap:e.scope.moduleMap,nodeId:e.scope.nodeId}),n=normalizeAgentDefinition(t,`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to match the public eve shape.`).model;if(!isDynamicModelDefinition(n))throw Error(`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to provide a dynamic model definition.`);return n}async function resolveRuntimeModelSelection(e){if(e.selection===null||e.selection===void 0)throw Error(`Dynamic model resolver returned no model. Every matching dynamic model handler must return a concrete model selection.`);let t=normalizeDynamicModelSelection(e.selection);validateDynamicModelSelection(t);let n=t.modelOptions?.providerOptions===void 0?void 0:parseProviderOptionsRecord(t.modelOptions.providerOptions),r=t.model,i=e.catalog??runtimeModelCatalogForState(e.state);if(typeof r==`string`){let a=formatLanguageModelGatewayId(r),o=await resolveSelectionMetadata({cacheKey:`gateway:${a}`,catalog:i,contextWindowTokens:t.modelContextWindowTokens,load:e=>e.getByGatewayId(a),modelLabel:a,state:e.state});return{reference:{id:o.resolvedModelId,contextWindowTokens:o.contextWindowTokens,maxOutputTokens:o.maxOutputTokens,providerOptions:n,reasoning:t.reasoning}}}if(validateRuntimeLanguageModel(r),e.durability===`durable`)throw Error(`Dynamic model selection returned a provider object, but durable model selections must be serializable. Return a model id string, or use a "step.started" model resolver.`);let a=formatLanguageModelGatewayId(r),o=r.provider.split(`.`)[0],s=await resolveSelectionMetadata({cacheKey:o===`gateway`?`gateway:${r.modelId}`:`provider:${r.provider}:${r.modelId}`,catalog:i,contextWindowTokens:t.modelContextWindowTokens,load:e=>o===`gateway`?e.getByGatewayId(r.modelId):e.getByProviderModelId(r.provider,r.modelId),modelLabel:a,state:e.state});return{model:r,reference:{id:s.resolvedModelId,contextWindowTokens:s.contextWindowTokens,maxOutputTokens:s.maxOutputTokens,providerOptions:n,reasoning:t.reasoning}}}const runtimeModelCatalogsByState=new WeakMap;function runtimeModelCatalogForState(e){let t=runtimeModelCatalogsByState.get(e);if(t!==void 0)return t;let n=createRuntimeModelCatalog();return runtimeModelCatalogsByState.set(e,n),n}async function resolveSelectionMetadata(e){if(e.contextWindowTokens!==void 0)return{contextWindowTokens:e.contextWindowTokens,resolvedModelId:e.modelLabel};let t=Date.now(),n=e.state.get(RuntimeModelMetadataCacheKey)?.[e.cacheKey];if(n!==void 0&&n.expiresAt>t)return n;let r=await e.load(e.catalog);if(r===null)throw Error(`Cannot select model "${e.modelLabel}" because AI Gateway did not provide context window metadata. Return modelContextWindowTokens with this selection for an unlisted or custom model.`);let i={...r,expiresAt:t+864e5};return e.state.set(RuntimeModelMetadataCacheKey,n=>({...Object.fromEntries(Object.entries(n??{}).filter(([,e])=>e.expiresAt>t)),[e.cacheKey]:i})),i}const DYNAMIC_MODEL_SELECTION_KEYS=new Set([`model`,`modelContextWindowTokens`,`modelOptions`,`reasoning`]);function validateDynamicModelSelection(e){let t=Object.keys(e).filter(e=>!DYNAMIC_MODEL_SELECTION_KEYS.has(e));if(t.length>0)throw Error(`Dynamic model resolver returned a selection with unknown key(s): ${t.join(`, `)}. Expected { model, reasoning?, modelContextWindowTokens?, modelOptions? }.`);if(e.reasoning!==void 0&&!isAgentReasoningDefinition(e.reasoning))throw Error(`Dynamic model resolver returned an invalid reasoning effort. Expected provider-default, none, minimal, low, medium, high, or xhigh.`);let n=e.modelContextWindowTokens;if(n!==void 0&&(!Number.isInteger(n)||n<=0))throw Error(`Dynamic model resolver returned an invalid modelContextWindowTokens value. Expected a positive integer.`);if(typeof e.model==`string`&&e.model.trim()===``)throw Error(`Dynamic model resolver returned an empty model id.`)}function normalizeDynamicModelSelection(e){return isModelSelectionDefinition(e)?e:{model:e}}function isModelSelectionDefinition(e){return typeof e==`object`&&!!e&&`model`in e&&!isRuntimeLanguageModel(e)}function validateRuntimeLanguageModel(e){if(!isRuntimeLanguageModel(e))throw Error(`Dynamic model resolver returned an invalid model. Return an AI Gateway model id string, an AI SDK language model, or { model, modelContextWindowTokens?, modelOptions? }.`)}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=parseJsonObject(r);return t}export{loadDynamicRuntimeModelDefinition,resolveRuntimeModelReference,resolveRuntimeModelSelection,shouldMockAuthoredRuntimeModels};
@@ -1 +1 @@
1
- import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{loadCompileMetadata}from"#runtime/loaders/compile-metadata.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";async function resolveRuntimeCompiledArtifactsVersionedCacheKey(e){let t=getRuntimeCompiledArtifactsCacheKey(e),n=await resolveCompileMetadataMtimeMs(e);try{let r=(await loadCompileMetadata({compiledArtifactsSource:e}))?.discovery.sourceGraphHash;return r===void 0||r.length===0?n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`:n===void 0?`${t}:${r}`:`${t}:${r}:mtime-${formatMtimeMsForCacheKey(n)}`}catch{return n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`}}async function resolveCompileMetadataMtimeMs(e){if(e.kind!==`disk`)return;let{stat:t}=await import(`node:fs/promises`),{compileMetadataPath:n}=resolveRuntimeCompilerArtifactPaths(e.appRoot);try{return(await t(n)).mtimeMs}catch{return}}function formatMtimeMsForCacheKey(e){return Math.floor(e).toString(36)}export{resolveRuntimeCompiledArtifactsVersionedCacheKey};
1
+ import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{loadCompileMetadata}from"#runtime/loaders/compile-metadata.js";async function resolveRuntimeCompiledArtifactsVersionedCacheKey(e){let t=getRuntimeCompiledArtifactsCacheKey(e),n=await resolveCompileMetadataMtimeMs(e);try{let r=(await loadCompileMetadata({compiledArtifactsSource:e}))?.discovery.sourceGraphHash;return r===void 0||r.length===0?n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`:n===void 0?`${t}:${r}`:`${t}:${r}:mtime-${formatMtimeMsForCacheKey(n)}`}catch{return n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`}}async function resolveCompileMetadataMtimeMs(e){if(e.kind!==`disk`)return;let{stat:t}=await import(`node:fs/promises`),{compileMetadataPath:n}=resolveRuntimeCompilerArtifactPaths(e.appRoot);try{return(await t(n)).mtimeMs}catch{return}}function formatMtimeMsForCacheKey(e){return Math.floor(e).toString(36)}export{resolveRuntimeCompiledArtifactsVersionedCacheKey};
@@ -8,6 +8,8 @@ export type RuntimeCompiledArtifactsSource = RuntimeBundledCompiledArtifactsSour
8
8
  */
9
9
  export interface RuntimeBundledCompiledArtifactsSource {
10
10
  readonly kind: "bundled";
11
+ /** Stable app partition embedded by a production build for local providers. */
12
+ readonly sandboxScope?: string;
11
13
  }
12
14
  /**
13
15
  * Disk-backed compiled artifacts rooted at one authored application.
@@ -23,6 +25,8 @@ export interface RuntimeDiskCompiledArtifactsSource {
23
25
  * emitted by the build.
24
26
  */
25
27
  readonly moduleMapLoaderPath?: string;
28
+ /** Stable app partition shared by production build preparation and runtime. */
29
+ readonly sandboxScope?: string;
26
30
  /**
27
31
  * Stable application root used for local sandbox template/session caches.
28
32
  * In development, `appRoot` can point at an immutable runtime snapshot
@@ -41,7 +45,7 @@ export interface RuntimeDiskCompiledArtifactsSource {
41
45
  /**
42
46
  * Creates the bundled compiled-artifact source.
43
47
  */
44
- export declare function createBundledRuntimeCompiledArtifactsSource(): RuntimeBundledCompiledArtifactsSource;
48
+ export declare function createBundledRuntimeCompiledArtifactsSource(sandboxScope?: string): RuntimeBundledCompiledArtifactsSource;
45
49
  /**
46
50
  * Creates the disk-backed compiled-artifact source for one authored app root.
47
51
  */
@@ -49,6 +53,7 @@ export declare function createDiskRuntimeCompiledArtifactsSource(appRoot: string
49
53
  readonly durableReference?: "development-generation";
50
54
  readonly moduleMapLoaderPath?: string;
51
55
  readonly sandboxAppRoot?: string;
56
+ readonly sandboxScope?: string;
52
57
  }): RuntimeDiskCompiledArtifactsSource;
53
58
  /**
54
59
  * Returns the disk-backed app root when one exists for the artifact source.
@@ -1 +1 @@
1
- function createBundledRuntimeCompiledArtifactsSource(){return{kind:`bundled`}}function createDiskRuntimeCompiledArtifactsSource(e,t={}){return t.moduleMapLoaderPath!==void 0||t.sandboxAppRoot!==void 0||t.durableReference!==void 0?{appRoot:e,durableReference:t.durableReference,kind:`disk`,moduleMapLoaderPath:t.moduleMapLoaderPath,sandboxAppRoot:t.sandboxAppRoot}:{appRoot:e,kind:`disk`}}function getRuntimeCompiledArtifactsAppRoot(e){return e.kind===`disk`?e.appRoot:void 0}function getRuntimeCompiledArtifactsSandboxAppRoot(e){return e.kind===`disk`?e.sandboxAppRoot??e.appRoot:void 0}function getRuntimeCompiledArtifactsCacheKey(e){return e.kind===`disk`?e.moduleMapLoaderPath===void 0?`disk:${e.appRoot}`:`disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}`:`bundled`}export{createBundledRuntimeCompiledArtifactsSource,createDiskRuntimeCompiledArtifactsSource,getRuntimeCompiledArtifactsAppRoot,getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot};
1
+ function createBundledRuntimeCompiledArtifactsSource(e){return e===void 0?{kind:`bundled`}:{kind:`bundled`,sandboxScope:e}}function createDiskRuntimeCompiledArtifactsSource(e,t={}){return t.moduleMapLoaderPath!==void 0||t.sandboxAppRoot!==void 0||t.sandboxScope!==void 0||t.durableReference!==void 0?{appRoot:e,durableReference:t.durableReference,kind:`disk`,moduleMapLoaderPath:t.moduleMapLoaderPath,sandboxAppRoot:t.sandboxAppRoot,sandboxScope:t.sandboxScope}:{appRoot:e,kind:`disk`}}function getRuntimeCompiledArtifactsAppRoot(e){return e.kind===`disk`?e.appRoot:void 0}function getRuntimeCompiledArtifactsSandboxAppRoot(e){return e.kind===`disk`?e.sandboxAppRoot??e.appRoot:void 0}function getRuntimeCompiledArtifactsCacheKey(e){return e.kind===`disk`?e.moduleMapLoaderPath===void 0?`disk:${e.appRoot}`:`disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}`:`bundled`}export{createBundledRuntimeCompiledArtifactsSource,createDiskRuntimeCompiledArtifactsSource,getRuntimeCompiledArtifactsAppRoot,getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot};
@@ -1 +1 @@
1
- import{contextStorage,loadContext}from"#context/container.js";import{consumeAuthorizationResult,createAuthorizationAttempt,requestAuthorization}from"#harness/authorization.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{ConnectionAuthorizationFailedError,ConnectionAuthorizationRequiredError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";import{evictCachedToken,readCachedToken,writeCachedToken}from"#runtime/connections/authorization-tokens.js";import{principalKey,resolveConnectionPrincipal,resolveConnectionPrincipalFromAuth}from"#runtime/connections/principal.js";const LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES=new Set([`127.0.0.1`,`[::1]`]);function createAuthorizationExecution(e={}){let t=new Set;async function complete(n){let r=n.instanceId??n.scope;!t.has(r)&&await(e.completeAuthorization??completeScopedAuthorization)(n)&&t.add(r)}function requireAuth(e,n){throw new ScopedAuthorizationRequiredError(e,t.has(e.instanceId??e.scope),n)}return{complete,async getToken(e){await complete(e);try{return await resolveScopedToken(e)}catch(t){if(!isConnectionAuthorizationRequiredError(t))throw t;return requireAuth(e,t)}},requireAuth,async handleError(e,n){return n!==void 0&&isConnectionAuthorizationRequiredError(e)?await handleAuthorizationError(new ScopedAuthorizationRequiredError(n,t.has(n.instanceId??n.scope),e),{evictToken:!1}):await handleAuthorizationError(e)},run:executeWithAuthorization}}var ScopedAuthorizationRequiredError=class extends Error{scoped;justAuthorized;constructor(e,t,n){super(`Authorization required.`,{cause:n}),this.name=`ScopedAuthorizationRequiredError`,this.scoped=e,this.justAuthorized=t}};function isScopedAuthorizationRequiredError(e){return e instanceof Error&&e.name===`ScopedAuthorizationRequiredError`}async function handleAuthorizationError(e,t={evictToken:!0}){if(!isScopedAuthorizationRequiredError(e))throw e;let{scoped:n}=e;if(e.justAuthorized)throw new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" failed: the service rejected the token immediately after authorization.`,reason:`token_rejected_after_authorization`,retryable:!1});t.evictToken&&await evictScopedToken(n);let r=await startScopedAuthorization(n);if(r!==void 0)return r;throw supportsInteractiveAuthorization(n.authorization)?new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" requires sign-in, but no authorization callback URL could be minted for this run (missing session context).`,reason:`authorization_callback_unavailable`,retryable:!1}):e.cause??new ConnectionAuthorizationRequiredError(n.scope)}function executeWithAuthorization(e){try{let t=e();return isAsyncIterable(t)?handleIterable(t):Promise.resolve(t).catch(handleAuthorizationError)}catch(e){return handleAuthorizationError(e)}}async function*handleIterable(e){try{for await(let t of e)yield t}catch(e){yield await handleAuthorizationError(e)}}async function resolveScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore(),o=resolveScopedPrincipal(e,a);if(a===void 0)return await n.getToken({connection:r,principal:o});let s=principalKey(o),c=readCachedToken(a,i,s);if(c!==void 0)return c;let l=await n.getToken({connection:r,principal:o});return writeCachedToken(a,i,s,l),l}async function evictScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore();if(a===void 0)return;let o;try{o=resolveScopedPrincipal(e,a),evictCachedToken(a,i,principalKey(o))}catch{return}try{await n.evict?.({connection:r,principal:o})}catch{}}async function completeScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return!1;let i=consumeAuthorizationResult(t,e.instanceId);if(i===void 0)return!1;let a=n,o=loadContext(),s=i.principal??resolveScopedPrincipal(e,o),c=await a.completeAuthorization({callbackUrl:i.hookUrl,connection:r,principal:s,resume:i.resume,callback:i.callback});return writeCachedToken(o,e.instanceId??t,principalKey(s),c),!0}async function startScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return;let i=createAuthorizationAttempt(t);if(i===void 0)return;let a=n,o=resolveScopedPrincipal(e),s=resolveAuthorizationCallbackUrl({authorization:n,callbackUrl:i.hookUrl}),{challenge:c,resume:l}=await a.startAuthorization({callbackUrl:s,connection:r,principal:o});return requestAuthorization([{attemptId:i.attemptId,challenge:stampChallengeDisplayName(c,n),hookUrl:s,instanceId:e.instanceId,name:t,principal:o,resume:l}])}function resolveScopedPrincipal(e,t){return e.boundResponder===void 0?resolveConnectionPrincipal(e.scope,e.authorization,t):resolveConnectionPrincipalFromAuth(e.scope,e.authorization,e.boundResponder,t)}function resolveAuthorizationCallbackUrl(e){if(e.authorization.vercelConnect===void 0)return e.callbackUrl;let t;try{t=new URL(e.callbackUrl)}catch{return e.callbackUrl}return t.protocol!==`http:`||!LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES.has(t.hostname)?e.callbackUrl:(t.hostname=`localhost`,t.toString())}function stampChallengeDisplayName(e,t){let n=t.displayName??e.displayName;return n===e.displayName?e:{...e,displayName:n}}export{completeScopedAuthorization,createAuthorizationExecution,evictScopedToken,handleAuthorizationError,resolveAuthorizationCallbackUrl,resolveScopedToken,stampChallengeDisplayName,startScopedAuthorization};
1
+ import{contextStorage,loadContext}from"#context/container.js";import{consumeAuthorizationResult,createAuthorizationAttempt,requestAuthorization}from"#harness/authorization.js";import{ConnectionAuthorizationFailedError,ConnectionAuthorizationRequiredError,isConnectionAuthorizationRequiredError}from"#connections/errors.js";import{supportsInteractiveAuthorization}from"#shared/connection-types.js";import{isAsyncIterable}from"#shared/async-iterable.js";import{evictCachedToken,readCachedToken,writeCachedToken}from"#runtime/connections/authorization-tokens.js";import{principalKey,resolveConnectionPrincipal,resolveConnectionPrincipalFromAuth}from"#runtime/connections/principal.js";const LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES=new Set([`127.0.0.1`,`[::1]`]);function createAuthorizationExecution(e={}){let t=new Set;async function complete(n){let r=n.instanceId??n.scope;!t.has(r)&&await(e.completeAuthorization??completeScopedAuthorization)(n)&&t.add(r)}function requireAuth(e,n){throw new ScopedAuthorizationRequiredError(e,t.has(e.instanceId??e.scope),n)}return{complete,async getToken(e){await complete(e);try{return await resolveScopedToken(e)}catch(t){if(!isConnectionAuthorizationRequiredError(t))throw t;return requireAuth(e,t)}},requireAuth,async handleError(e,n){return n!==void 0&&isConnectionAuthorizationRequiredError(e)?await handleAuthorizationError(new ScopedAuthorizationRequiredError(n,t.has(n.instanceId??n.scope),e),{evictToken:!1}):await handleAuthorizationError(e)},run:executeWithAuthorization}}var ScopedAuthorizationRequiredError=class extends Error{scoped;justAuthorized;constructor(e,t,n){super(`Authorization required.`,{cause:n}),this.name=`ScopedAuthorizationRequiredError`,this.scoped=e,this.justAuthorized=t}};function isScopedAuthorizationRequiredError(e){return e instanceof Error&&e.name===`ScopedAuthorizationRequiredError`}async function handleAuthorizationError(e,t={evictToken:!0}){if(!isScopedAuthorizationRequiredError(e))throw e;let{scoped:n}=e;if(e.justAuthorized)throw new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" failed: the service rejected the token immediately after authorization.`,reason:`token_rejected_after_authorization`,retryable:!1});t.evictToken&&await evictScopedToken(n);let r=await startScopedAuthorization(n);if(r!==void 0)return r;throw supportsInteractiveAuthorization(n.authorization)?new ConnectionAuthorizationFailedError(n.scope,{message:`Authorization for "${n.scope}" requires sign-in, but no authorization callback URL could be minted for this run (missing session context).`,reason:`authorization_callback_unavailable`,retryable:!1}):e.cause??new ConnectionAuthorizationRequiredError(n.scope)}function executeWithAuthorization(e){try{let t=e();return isAsyncIterable(t)?handleIterable(t):Promise.resolve(t).catch(handleAuthorizationError)}catch(e){return handleAuthorizationError(e)}}async function*handleIterable(e){try{for await(let t of e)yield t}catch(e){yield await handleAuthorizationError(e)}}async function resolveScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore(),o=resolveScopedPrincipal(e,a);if(a===void 0)return await n.getToken({connection:r,principal:o});let s=principalKey(o),c=readCachedToken(a,i,s);if(c!==void 0)return c;let l=await n.getToken({connection:r,principal:o});return writeCachedToken(a,i,s,l),l}async function evictScopedToken(e){let{scope:t,authorization:n,connection:r}=e,i=e.instanceId??t,a=contextStorage.getStore();if(a===void 0)return;let o;try{o=resolveScopedPrincipal(e,a),evictCachedToken(a,i,principalKey(o))}catch{return}try{await n.evict?.({connection:r,principal:o})}catch{}}async function completeScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return!1;let i=consumeAuthorizationResult(t,e.instanceId);if(i===void 0)return!1;let a=n,o=loadContext(),s=i.principal??resolveScopedPrincipal(e,o),c=await a.completeAuthorization({callbackUrl:i.hookUrl,connection:r,principal:s,resume:i.resume,callback:i.callback});return writeCachedToken(o,e.instanceId??t,principalKey(s),c),!0}async function startScopedAuthorization(e){let{scope:t,authorization:n,connection:r}=e;if(!supportsInteractiveAuthorization(n))return;let i=createAuthorizationAttempt(t);if(i===void 0)return;let a=n,o=resolveScopedPrincipal(e),s=resolveAuthorizationCallbackUrl({authorization:n,callbackUrl:i.hookUrl}),{challenge:c,resume:l}=await a.startAuthorization({callbackUrl:s,connection:r,principal:o});return requestAuthorization([{attemptId:i.attemptId,challenge:stampChallengeDisplayName(c,n),hookUrl:s,instanceId:e.instanceId,name:t,principal:o,resume:l}])}function resolveScopedPrincipal(e,t){return e.boundResponder===void 0?resolveConnectionPrincipal(e.scope,e.authorization,t):resolveConnectionPrincipalFromAuth(e.scope,e.authorization,e.boundResponder,t)}function resolveAuthorizationCallbackUrl(e){if(e.authorization.vercelConnect===void 0)return e.callbackUrl;let t;try{t=new URL(e.callbackUrl)}catch{return e.callbackUrl}return t.protocol!==`http:`||!LOCAL_HTTP_VERCEL_CONNECT_HOSTNAMES.has(t.hostname)?e.callbackUrl:(t.hostname=`localhost`,t.toString())}function stampChallengeDisplayName(e,t){let n=t.displayName??e.displayName;return n===e.displayName?e:{...e,displayName:n}}export{completeScopedAuthorization,createAuthorizationExecution,evictScopedToken,handleAuthorizationError,resolveAuthorizationCallbackUrl,resolveScopedToken,stampChallengeDisplayName,startScopedAuthorization};
@@ -10,6 +10,7 @@ export interface RuntimeCompilerArtifactPaths {
10
10
  readonly discoveryManifestPath: string;
11
11
  readonly discoveryDirectoryPath: string;
12
12
  readonly moduleMapPath: string;
13
+ readonly sandboxPreparedArtifactsPath: string;
13
14
  }
14
15
  /**
15
16
  * Resolves the stable eve artifact paths for one application root without
@@ -1 +1 @@
1
- function resolveRuntimeCompilerArtifactPaths(e){let t=normalizeFilesystemPath(e),n=`${t}/.eve/discovery`,r=`${t}/.eve/compile`;return{appRoot:t,compiledManifestPath:`${r}/compiled-agent-manifest.json`,compileDirectoryPath:r,compileMetadataPath:`${r}/compile-metadata.json`,diagnosticsPath:`${n}/diagnostics.json`,discoveryDirectoryPath:n,discoveryManifestPath:`${n}/agent-discovery-manifest.json`,moduleMapPath:`${r}/module-map.mjs`}}function normalizeFilesystemPath(e){let t=e.replaceAll(`\\`,`/`);return t===`/`?t:t.replace(/\/+$/,``)}export{resolveRuntimeCompilerArtifactPaths};
1
+ function resolveRuntimeCompilerArtifactPaths(e){let t=normalizeFilesystemPath(e),n=`${t}/.eve/discovery`,r=`${t}/.eve/compile`;return{appRoot:t,compiledManifestPath:`${r}/compiled-agent-manifest.json`,compileDirectoryPath:r,compileMetadataPath:`${r}/compile-metadata.json`,diagnosticsPath:`${n}/diagnostics.json`,discoveryDirectoryPath:n,discoveryManifestPath:`${n}/agent-discovery-manifest.json`,moduleMapPath:`${r}/module-map.mjs`,sandboxPreparedArtifactsPath:`${r}/sandbox-prepared-artifacts.json`}}function normalizeFilesystemPath(e){let t=e.replaceAll(`\\`,`/`);return t===`/`?t:t.replace(/\/+$/,``)}export{resolveRuntimeCompilerArtifactPaths};
@@ -1,6 +1,7 @@
1
1
  import type { CompileMetadata } from "#compiler/artifacts.js";
2
2
  import type { CompiledAgentManifest } from "#compiler/manifest.js";
3
3
  import type { CompiledModuleMap } from "#compiler/module-map.js";
4
+ import type { SandboxPreparedArtifactsManifest } from "#shared/sandbox-prepared-artifacts.js";
4
5
  /**
5
6
  * Bundled compiled artifacts installed by Nitro when authored runtime state is
6
7
  * embedded directly into the server bundle.
@@ -9,6 +10,7 @@ export interface BundledCompiledArtifacts {
9
10
  manifest: CompiledAgentManifest;
10
11
  metadata?: CompileMetadata;
11
12
  moduleMap: CompiledModuleMap;
13
+ sandboxPreparedArtifacts?: SandboxPreparedArtifactsManifest;
12
14
  }
13
15
  /**
14
16
  * Input for running code against one isolated bundled compiled-artifact
@@ -33,4 +35,5 @@ export declare function withBundledCompiledArtifacts<T>(input: WithBundledCompil
33
35
  * Reads the bundled compiled-artifact snapshot for the active runtime
34
36
  * session, or `null` if none has been installed.
35
37
  */
38
+ export declare function updateBundledSandboxPreparedArtifacts(sandboxPreparedArtifacts: SandboxPreparedArtifactsManifest): boolean;
36
39
  export declare function readBundledCompiledArtifacts(): BundledCompiledArtifacts | null;
@@ -1 +1 @@
1
- import{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession}from"#runtime/sessions/runtime-session.js";function installBundledCompiledArtifacts(e){setRuntimeSessionCompiledArtifacts(getActiveRuntimeSession(),{manifest:e.manifest,metadata:e.metadata,moduleMap:e.moduleMap})}async function withBundledCompiledArtifacts(e,t){let n=createRuntimeSession(e.sessionId??`bundled-compiled-artifacts`);return await withRuntimeSession(n,async()=>(installBundledCompiledArtifacts(e),await t()))}function readBundledCompiledArtifacts(){return getActiveRuntimeSession().compiledArtifacts}export{installBundledCompiledArtifacts,readBundledCompiledArtifacts,withBundledCompiledArtifacts};
1
+ import{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession}from"#runtime/sessions/runtime-session.js";function installBundledCompiledArtifacts(e){setRuntimeSessionCompiledArtifacts(getActiveRuntimeSession(),{manifest:e.manifest,metadata:e.metadata,moduleMap:e.moduleMap,sandboxPreparedArtifacts:e.sandboxPreparedArtifacts})}async function withBundledCompiledArtifacts(e,t){let n=createRuntimeSession(e.sessionId??`bundled-compiled-artifacts`);return await withRuntimeSession(n,async()=>(installBundledCompiledArtifacts(e),await t()))}function updateBundledSandboxPreparedArtifacts(e){let t=getActiveRuntimeSession(),n=t.compiledArtifacts;return n!==null&&(setRuntimeSessionCompiledArtifacts(t,{...n,sandboxPreparedArtifacts:e}),!0)}function readBundledCompiledArtifacts(){return getActiveRuntimeSession().compiledArtifacts}export{installBundledCompiledArtifacts,readBundledCompiledArtifacts,updateBundledSandboxPreparedArtifacts,withBundledCompiledArtifacts};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{formatValidationError}from"#runtime/validation.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({manifest:compileArtifactDigestSchema,moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}export{loadCompileMetadata};
1
+ import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{formatValidationError}from"#runtime/validation.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({manifest:compileArtifactDigestSchema,moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}export{loadCompileMetadata};
@@ -1 +1 @@
1
- import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{formatValidationError}from"#runtime/validation.js";import{validateCompiledAgentManifest}from"#compiler/validate-artifact.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),t)}return parseCompiledManifest(n,t)}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledManifest(n.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(e,t){let n=compiledAgentManifestSchema.safeParse(e);if(!n.success)throw new LoadCompiledManifestError(`Expected "${t}" to contain a valid compiled eve agent manifest. ${formatValidationError(n.error)}`,t);try{validateCompiledAgentManifest(n.data)}catch(e){throw new LoadCompiledManifestError(`Expected "${t}" to contain a semantically valid compiled eve agent manifest. ${formatLoadErrorMessage(e)}`,t)}return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}export{LoadCompiledManifestError,loadCompiledManifest};
1
+ import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{formatValidationError}from"#runtime/validation.js";import{validateCompiledAgentManifest}from"#compiler/validate-artifact.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),t)}return parseCompiledManifest(n,t)}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledManifest(n.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(e,t){let n=compiledAgentManifestSchema.safeParse(e);if(!n.success)throw new LoadCompiledManifestError(`Expected "${t}" to contain a valid compiled eve agent manifest. ${formatValidationError(n.error)}`,t);try{validateCompiledAgentManifest(n.data)}catch(e){throw new LoadCompiledManifestError(`Expected "${t}" to contain a semantically valid compiled eve agent manifest. ${formatLoadErrorMessage(e)}`,t)}return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}export{LoadCompiledManifestError,loadCompiledManifest};
@@ -1 +1 @@
1
- import{compiledModuleMapSchema}from"#compiler/module-map.js";import{formatValidationError}from"#runtime/validation.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(t!==void 0){let e=createFileImportSpecifier(t);try{let n=await import(e);return parseCompiledModuleMap(n.moduleMap??n.default,t)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),t)}}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledModuleMap(n.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(e,t){let n=compiledModuleMapSchema.safeParse(e);if(!n.success)throw new LoadCompiledModuleMapError(`Expected "${t}" to export a valid compiled eve module map. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}export{LoadCompiledModuleMapError,loadCompiledModuleMap};
1
+ import{compiledModuleMapSchema}from"#compiler/module-map.js";import{formatValidationError}from"#runtime/validation.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(t!==void 0){let e=createFileImportSpecifier(t);try{let n=await import(e);return parseCompiledModuleMap(n.moduleMap??n.default,t)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),t)}}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledModuleMap(n.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(e,t){let n=compiledModuleMapSchema.safeParse(e);if(!n.success)throw new LoadCompiledModuleMapError(`Expected "${t}" to export a valid compiled eve module map. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}export{LoadCompiledModuleMapError,loadCompiledModuleMap};
@@ -1,12 +1,11 @@
1
1
  export declare const LOCAL_DEV_INTERACTIVE_CLIENT_HEADER = "x-eve-dev-interactive-client";
2
2
  /**
3
- * Capabilities available to authored code in an execution initiated by a
4
- * same-machine request to `eve dev`.
3
+ * Host facilities available to authored code running on an `eve dev` server.
5
4
  *
6
- * Absence is the signal, not a disabled flag: a deployed runtime has no
7
- * authored tree to mutate or watcher to pause, and a request from a remote
8
- * client is not authorized to mutate the server's authored tree.
9
- * {@link getLocalDevCapability} returns `undefined` in both cases.
5
+ * Absence means this host has no authored tree to mutate or watcher to pause.
6
+ * When present, the capability is available to every execution on that host;
7
+ * callers admitted to the development server are trusted with enabled local
8
+ * editing tools.
10
9
  */
11
10
  export interface LocalDevCapability {
12
11
  /**
@@ -15,8 +14,9 @@ export interface LocalDevCapability {
15
14
  */
16
15
  readonly appRoot: string;
17
16
  /**
18
- * Whether the requesting client is the dev TUI and can therefore run a flow
19
- * that asks questions in its terminal.
17
+ * Whether the originating client is the dev TUI and can run a flow that asks
18
+ * questions in its terminal. This inherited hint is not proof that the
19
+ * current sender has a live terminal.
20
20
  */
21
21
  readonly interactiveClient: boolean;
22
22
  /**
@@ -39,13 +39,15 @@ export declare function installLocalDevCapabilityEnvironment(input: {
39
39
  readonly serverUrl: string;
40
40
  }): () => void;
41
41
  /**
42
- * Seeds durable local-dev provenance only when the parent host signed a
43
- * loopback peer address. Public address headers cannot grant access.
42
+ * Seeds the inherited dev-TUI hint only when the dev host signed a loopback
43
+ * peer address. Client-supplied address headers cannot create that hint.
44
44
  */
45
45
  export declare function withLocalDevRequestScope<T>(request: Request, callback: () => Promise<T>): Promise<T>;
46
46
  /**
47
- * Resolves the local dev capability, or `undefined` outside an execution
48
- * initiated by an authorized local request to `eve dev`.
47
+ * Resolves local development host facilities, or `undefined` when this host
48
+ * lacks the authored root or watcher control origin installed by `eve dev`.
49
+ * Request provenance affects only the optional dev-TUI hint, never access to
50
+ * the authored tree.
49
51
  *
50
52
  * This is deliberately not a {@link import("#public/definitions/tool.js").ToolContext}
51
53
  * field: both values are meaningless in a deployed runtime, and a capability