eve 0.82.0 → 0.83.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (528) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/NOTICE +1 -1
  3. package/dist/src/channel/pending-authorization.d.ts +5 -0
  4. package/dist/src/channel/pending-authorization.js +1 -1
  5. package/dist/src/channel/session.d.ts +2 -0
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +5 -0
  8. package/dist/src/chunks/{use-eve-agent-DTu78IAF.js → use-eve-agent-DnbG9c7c.js} +73 -14
  9. package/dist/src/chunks/{use-eve-agent-DlznYwQk.js → use-eve-agent-ZY7NQ2VW.js} +73 -14
  10. package/dist/src/cli/dev/local-server-child.js +1 -1
  11. package/dist/src/cli/dev/local-server-cleanup.js +1 -1
  12. package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
  13. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  14. package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
  15. package/dist/src/cli/run.js +1 -1
  16. package/dist/src/client/eve-agent-store.d.ts +1 -1
  17. package/dist/src/client/eve-agent-store.js +1 -1
  18. package/dist/src/client/index.d.ts +1 -0
  19. package/dist/src/client/message-response.d.ts +18 -0
  20. package/dist/src/client/message-response.js +1 -1
  21. package/dist/src/client/session-controls.d.ts +6 -0
  22. package/dist/src/client/session-controls.js +1 -1
  23. package/dist/src/client/session.d.ts +4 -0
  24. package/dist/src/client/session.js +1 -1
  25. package/dist/src/compiled/.vendor-stamp.json +8 -8
  26. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  27. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
  28. package/dist/src/compiled/@workflow/core/index.js +2 -2
  29. package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
  30. package/dist/src/compiled/@workflow/core/private.js +1 -1
  31. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
  32. package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
  33. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
  34. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  35. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
  36. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
  37. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
  38. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
  39. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  40. package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
  41. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
  42. package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
  43. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  44. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
  45. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  46. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  47. package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
  48. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  49. package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
  50. package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
  51. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  52. package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
  53. package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
  54. package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
  55. package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
  56. package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
  57. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  58. package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
  59. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
  60. package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
  61. package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
  62. package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
  63. package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
  64. package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
  65. package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
  66. package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
  67. package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
  68. package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
  69. package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
  70. package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
  71. package/dist/src/compiled/run/index.d.ts +384 -0
  72. package/dist/src/compiled/run/index.js +650 -0
  73. package/dist/src/compiler/extension-compatibility.d.ts +21 -14
  74. package/dist/src/compiler/extension-compatibility.js +1 -1
  75. package/dist/src/compiler/manifest.js +1 -1
  76. package/dist/src/compiler/normalize-agent-config.js +1 -1
  77. package/dist/src/compiler/normalize-manifest.js +1 -1
  78. package/dist/src/compiler/normalize-sandbox.js +1 -1
  79. package/dist/src/compiler/workspace-resources.js +1 -1
  80. package/dist/src/context/build-callback-context.js +1 -1
  81. package/dist/src/context/build-dynamic-tools.js +1 -1
  82. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -2
  83. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  84. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  85. package/dist/src/context/prewarm.d.ts +27 -0
  86. package/dist/src/context/prewarm.js +1 -0
  87. package/dist/src/context/providers/sandbox.d.ts +7 -0
  88. package/dist/src/context/providers/sandbox.js +1 -1
  89. package/dist/src/context/run-step.js +1 -1
  90. package/dist/src/discover/extension-specifier.d.ts +1 -0
  91. package/dist/src/discover/extension-specifier.js +1 -1
  92. package/dist/src/discover/lib.d.ts +4 -3
  93. package/dist/src/discover/lib.js +1 -1
  94. package/dist/src/discover/named-source-directory.d.ts +3 -2
  95. package/dist/src/evals/cli/eval.d.ts +2 -0
  96. package/dist/src/evals/cli/eval.js +2 -2
  97. package/dist/src/evals/define-eval-config.d.ts +5 -4
  98. package/dist/src/evals/define-eval-config.js +1 -1
  99. package/dist/src/evals/index.d.ts +1 -1
  100. package/dist/src/evals/runner/artifacts.js +2 -2
  101. package/dist/src/evals/runner/attempt-label.d.ts +2 -0
  102. package/dist/src/evals/runner/attempt-label.js +1 -0
  103. package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
  104. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  105. package/dist/src/evals/runner/execute-task.js +1 -1
  106. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  107. package/dist/src/evals/runner/reporters/console.js +1 -1
  108. package/dist/src/evals/runner/reporters/datadog.js +1 -1
  109. package/dist/src/evals/runner/reporters/junit.js +2 -2
  110. package/dist/src/evals/runner/reporters/types.d.ts +2 -0
  111. package/dist/src/evals/runner/run-evals.d.ts +5 -0
  112. package/dist/src/evals/runner/run-evals.js +1 -1
  113. package/dist/src/evals/session-manager.js +1 -1
  114. package/dist/src/evals/session.d.ts +4 -1
  115. package/dist/src/evals/session.js +2 -2
  116. package/dist/src/evals/types.d.ts +39 -2
  117. package/dist/src/eve-channel/index.js +1 -1
  118. package/dist/src/eve-channel/request.d.ts +0 -1
  119. package/dist/src/eve-channel/request.js +2 -2
  120. package/dist/src/execution/agent-sessions/context.d.ts +1 -1
  121. package/dist/src/execution/agent-sessions/context.js +1 -1
  122. package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -0
  123. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  124. package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
  125. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  126. package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
  127. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  128. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  129. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  130. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
  131. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  132. package/dist/src/execution/invoke-tool.js +1 -1
  133. package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
  134. package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
  135. package/dist/src/execution/sandbox/active-connections.js +1 -0
  136. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
  137. package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
  138. package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
  139. package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
  140. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
  141. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  142. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
  143. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
  144. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
  145. package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
  146. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  147. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
  148. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  149. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
  150. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  151. package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
  152. package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
  153. package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
  154. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  155. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
  156. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  157. package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
  158. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
  159. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  160. package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
  161. package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
  162. package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
  163. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  164. package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
  165. package/dist/src/execution/sandbox/development-run.d.ts +0 -2
  166. package/dist/src/execution/sandbox/development-run.js +1 -1
  167. package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
  168. package/dist/src/execution/sandbox/dockerfile.js +1 -1
  169. package/dist/src/execution/sandbox/ensure.d.ts +31 -11
  170. package/dist/src/execution/sandbox/ensure.js +1 -1
  171. package/dist/src/execution/sandbox/glob-tool.js +3 -3
  172. package/dist/src/execution/sandbox/grep-tool.js +1 -1
  173. package/dist/src/execution/sandbox/logging-session.js +1 -1
  174. package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
  175. package/dist/src/execution/sandbox/prewarm.js +2 -1
  176. package/dist/src/execution/sandbox/read-file.js +1 -1
  177. package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
  178. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  179. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
  180. package/dist/src/execution/sandbox/session.d.ts +10 -20
  181. package/dist/src/execution/sandbox/session.js +2 -2
  182. package/dist/src/execution/session/admission.js +1 -1
  183. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  184. package/dist/src/execution/session/entry-input.d.ts +5 -4
  185. package/dist/src/execution/session/entry.js +1 -1
  186. package/dist/src/execution/session/handoff-state.d.ts +5 -0
  187. package/dist/src/execution/session/handoff-state.js +1 -0
  188. package/dist/src/execution/session/handoff-steps.d.ts +1 -5
  189. package/dist/src/execution/session/handoff-steps.js +1 -1
  190. package/dist/src/execution/session/handoff.d.ts +2 -1
  191. package/dist/src/execution/session/handoff.js +1 -1
  192. package/dist/src/execution/session/handover-tracing.d.ts +3 -0
  193. package/dist/src/execution/session/handover-tracing.js +1 -0
  194. package/dist/src/execution/session/input-queue.d.ts +3 -0
  195. package/dist/src/execution/session/input-queue.js +1 -1
  196. package/dist/src/execution/session/next-input.d.ts +3 -0
  197. package/dist/src/execution/session/next-input.js +1 -1
  198. package/dist/src/execution/session/prewarm-step.d.ts +13 -0
  199. package/dist/src/execution/session/prewarm-step.js +1 -0
  200. package/dist/src/execution/session/program.d.ts +4 -1
  201. package/dist/src/execution/session/program.js +1 -1
  202. package/dist/src/execution/session/state-cursor.d.ts +11 -0
  203. package/dist/src/execution/session/state-cursor.js +1 -1
  204. package/dist/src/execution/session/timeout-control.d.ts +4 -0
  205. package/dist/src/execution/session/timeout-control.js +1 -1
  206. package/dist/src/execution/session/turn-control.d.ts +5 -2
  207. package/dist/src/execution/session/turn-control.js +1 -1
  208. package/dist/src/execution/session/turn-step-types.d.ts +2 -0
  209. package/dist/src/execution/session/turn-step.js +1 -1
  210. package/dist/src/execution/session/turn.d.ts +1 -0
  211. package/dist/src/execution/session/turn.js +1 -1
  212. package/dist/src/execution/session-inbox/inbox.d.ts +17 -1
  213. package/dist/src/execution/session-inbox/inbox.js +1 -1
  214. package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
  215. package/dist/src/execution/session-inbox/protocol.js +1 -1
  216. package/dist/src/execution/session-inbox/resume.d.ts +2 -1
  217. package/dist/src/execution/session-inbox/resume.js +1 -1
  218. package/dist/src/execution/session-prewarm.d.ts +8 -0
  219. package/dist/src/execution/session-prewarm.js +1 -0
  220. package/dist/src/execution/skills/instructions.js +1 -1
  221. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  222. package/dist/src/execution/tools/workflow/body.js +1 -1
  223. package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
  224. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  225. package/dist/src/execution/tools/workflow/step.js +1 -1
  226. package/dist/src/execution/workflow-runtime.js +1 -1
  227. package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
  228. package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
  229. package/dist/src/harness/attachment-staging.d.ts +3 -7
  230. package/dist/src/harness/attachment-staging.js +1 -1
  231. package/dist/src/harness/hitl/index.d.ts +2 -1
  232. package/dist/src/harness/hitl/index.js +1 -1
  233. package/dist/src/harness/hitl/view.d.ts +1 -0
  234. package/dist/src/harness/hitl/view.js +1 -0
  235. package/dist/src/harness/model-call/run.js +1 -1
  236. package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
  237. package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
  238. package/dist/src/harness/step/prompt.js +1 -1
  239. package/dist/src/harness/tool-history-repair.d.ts +9 -0
  240. package/dist/src/harness/tool-history-repair.js +1 -0
  241. package/dist/src/harness/tool-model-output.d.ts +19 -3
  242. package/dist/src/harness/tool-model-output.js +1 -1
  243. package/dist/src/internal/application/compiled-artifacts.js +8 -4
  244. package/dist/src/internal/application/optional-package-import.d.ts +10 -0
  245. package/dist/src/internal/application/optional-package-import.js +1 -1
  246. package/dist/src/internal/application/stamped-package-version.js +1 -1
  247. package/dist/src/internal/attachments/limited-read.d.ts +2 -2
  248. package/dist/src/internal/authored-module-build-options.d.ts +6 -0
  249. package/dist/src/internal/authored-module-build-options.js +1 -1
  250. package/dist/src/internal/authored-module-cache.d.ts +10 -0
  251. package/dist/src/internal/authored-module-cache.js +1 -0
  252. package/dist/src/internal/authored-module-graph.js +1 -1
  253. package/dist/src/internal/authored-module-loader.js +1 -1
  254. package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
  255. package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
  256. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  257. package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
  258. package/dist/src/internal/bundler/pseudo-packages.js +1 -0
  259. package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
  260. package/dist/src/internal/nitro/host/build-extension.js +2 -2
  261. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
  262. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
  263. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
  264. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  265. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
  266. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  267. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  268. package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
  269. package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
  270. package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
  271. package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
  272. package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
  273. package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
  274. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
  275. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
  276. package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
  277. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  278. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
  279. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
  280. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  281. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  282. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  283. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  284. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  285. package/dist/src/internal/nitro/host.js +1 -1
  286. package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
  287. package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
  288. package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
  289. package/dist/src/internal/workflow/queue-namespace.js +1 -1
  290. package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
  291. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  292. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  293. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  294. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
  295. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  296. package/dist/src/protocol/prewarm-session.d.ts +14 -0
  297. package/dist/src/protocol/prewarm-session.js +1 -0
  298. package/dist/src/protocol/routes.d.ts +2 -2
  299. package/dist/src/public/channels/discord/authorization.d.ts +45 -0
  300. package/dist/src/public/channels/discord/authorization.js +3 -0
  301. package/dist/src/public/channels/discord/defaults.d.ts +14 -3
  302. package/dist/src/public/channels/discord/defaults.js +2 -2
  303. package/dist/src/public/channels/discord/discordChannel.d.ts +15 -1
  304. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  305. package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
  306. package/dist/src/public/channels/discord/gateway/connection.js +1 -0
  307. package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
  308. package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
  309. package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
  310. package/dist/src/public/channels/discord/gateway/index.js +1 -0
  311. package/dist/src/public/channels/discord/inbound.d.ts +10 -3
  312. package/dist/src/public/channels/discord/inbound.js +2 -2
  313. package/dist/src/public/channels/discord/index.d.ts +3 -2
  314. package/dist/src/public/channels/discord/index.js +1 -1
  315. package/dist/src/public/channels/discord/messages.d.ts +116 -0
  316. package/dist/src/public/channels/discord/messages.js +2 -0
  317. package/dist/src/public/channels/github/checkout.js +1 -1
  318. package/dist/src/public/channels/linq/linqChannel.d.ts +4 -1
  319. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  320. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  321. package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
  322. package/dist/src/public/channels/same-environment-oidc.js +1 -0
  323. package/dist/src/public/definitions/channel.js +1 -1
  324. package/dist/src/public/definitions/sandbox.d.ts +1 -1
  325. package/dist/src/public/next/server.js +1 -1
  326. package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
  327. package/dist/src/public/sandbox/docker.d.ts +1 -8
  328. package/dist/src/public/sandbox/index.d.ts +3 -3
  329. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
  330. package/dist/src/public/sandbox/just-bash.d.ts +1 -1
  331. package/dist/src/public/sandbox/provider.d.ts +5 -1
  332. package/dist/src/public/sandbox/provider.js +1 -1
  333. package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
  334. package/dist/src/public/sandbox/vercel.d.ts +0 -1
  335. package/dist/src/public/sandbox/vercel.js +1 -1
  336. package/dist/src/public/tools/agent.d.ts +8 -1
  337. package/dist/src/public/tools/agent.js +1 -1
  338. package/dist/src/react/use-eve-agent.d.ts +1 -1
  339. package/dist/src/runtime/agent/resolve-model.js +1 -1
  340. package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
  341. package/dist/src/runtime/connections/openapi-client.js +1 -1
  342. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  343. package/dist/src/runtime/resolve-agent.js +1 -1
  344. package/dist/src/runtime/resolve-channel.js +1 -1
  345. package/dist/src/runtime/resolve-sandbox.js +1 -1
  346. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  347. package/dist/src/runtime/sandbox/registry.d.ts +2 -0
  348. package/dist/src/runtime/sandbox/registry.js +1 -1
  349. package/dist/src/runtime/subagents/workflow.d.ts +6 -0
  350. package/dist/src/runtime/subagents/workflow.js +1 -1
  351. package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
  352. package/dist/src/runtime/workspace/seed-files.js +1 -1
  353. package/dist/src/runtime/workspace/spec.d.ts +1 -1
  354. package/dist/src/runtime/workspace/spec.js +1 -1
  355. package/dist/src/runtime/workspace/types.d.ts +2 -6
  356. package/dist/src/sandbox/provider.d.ts +185 -0
  357. package/dist/src/sandbox/provider.js +1 -0
  358. package/dist/src/sandbox/providers/default.d.ts +20 -19
  359. package/dist/src/sandbox/providers/default.js +1 -1
  360. package/dist/src/sandbox/providers/docker.d.ts +5 -2
  361. package/dist/src/sandbox/providers/docker.js +1 -1
  362. package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
  363. package/dist/src/sandbox/providers/just-bash.js +1 -1
  364. package/dist/src/sandbox/providers/vercel.d.ts +4 -10
  365. package/dist/src/sandbox/providers/vercel.js +1 -1
  366. package/dist/src/sandbox/providers.d.ts +0 -1
  367. package/dist/src/sandbox/providers.js +1 -1
  368. package/dist/src/sandbox/state.d.ts +61 -0
  369. package/dist/src/sandbox/state.js +1 -1
  370. package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
  371. package/dist/src/self-modification/deployed-sandbox.js +1 -1
  372. package/dist/src/self-modification/filesystem.d.ts +3 -3
  373. package/dist/src/self-modification/remote/config.d.ts +2 -2
  374. package/dist/src/self-modification/remote/config.js +1 -1
  375. package/dist/src/self-modification/setup.d.ts +0 -1
  376. package/dist/src/self-modification/setup.js +8 -8
  377. package/dist/src/setup/integrations/discord/api.d.ts +7 -0
  378. package/dist/src/setup/integrations/discord/api.js +1 -1
  379. package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
  380. package/dist/src/setup/integrations/discord/daemon.js +21 -0
  381. package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
  382. package/dist/src/setup/integrations/discord/setup.js +5 -4
  383. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  384. package/dist/src/setup/scaffold/create/project.js +1 -1
  385. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  386. package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
  387. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  388. package/dist/src/shared/agent-definition.d.ts +2 -0
  389. package/dist/src/shared/built-server-start-failure.d.ts +12 -0
  390. package/dist/src/shared/built-server-start-failure.js +3 -0
  391. package/dist/src/shared/framework-eve-server.d.ts +2 -0
  392. package/dist/src/shared/framework-eve-server.js +2 -2
  393. package/dist/src/shared/sandbox-environment.d.ts +4 -10
  394. package/dist/src/shared/sandbox-environment.js +1 -1
  395. package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
  396. package/dist/src/shared/sandbox-provider.d.ts +0 -103
  397. package/dist/src/shared/sandbox-provider.js +1 -1
  398. package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
  399. package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
  400. package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
  401. package/dist/src/shared/sandbox-session-gone-error.js +1 -0
  402. package/dist/src/shared/sandbox-session.d.ts +97 -83
  403. package/dist/src/shared/sandbox-template-error.d.ts +19 -4
  404. package/dist/src/shared/sandbox-template-error.js +1 -1
  405. package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
  406. package/dist/src/shared/sandbox-tool-session-error.js +1 -0
  407. package/dist/src/shared/skill-package.js +1 -1
  408. package/dist/src/shared/skill-paths.d.ts +4 -5
  409. package/dist/src/shared/skill-paths.js +2 -2
  410. package/dist/src/shared/workflow-sandbox.d.ts +4 -41
  411. package/dist/src/shared/workflow-sandbox.js +1 -1
  412. package/dist/src/svelte/index.js +1 -1
  413. package/dist/src/svelte/use-eve-agent.d.ts +1 -1
  414. package/dist/src/svelte/use-eve-agent.js +1 -1
  415. package/dist/src/tools/definition.js +1 -1
  416. package/dist/src/tools/durable-callbacks.d.ts +5 -1
  417. package/dist/src/tools/durable-callbacks.js +1 -1
  418. package/dist/src/tools/dynamic.d.ts +3 -3
  419. package/dist/src/tools/model-output.d.ts +23 -5
  420. package/dist/src/tools/model-output.js +1 -1
  421. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  422. package/dist/src/tools/provided/glob.js +1 -1
  423. package/dist/src/tools/provided/grep.js +1 -1
  424. package/dist/src/tools/provided/read-file.js +1 -1
  425. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  426. package/dist/src/tools/provided/workflow.js +1 -1
  427. package/dist/src/tools/provided/write-file.js +1 -1
  428. package/dist/src/tools/workflow-definition.d.ts +19 -4
  429. package/dist/src/vue/index.js +1 -1
  430. package/dist/src/vue/use-eve-agent.d.ts +1 -1
  431. package/dist/src/vue/use-eve-agent.js +1 -1
  432. package/docs/channels/custom.mdx +3 -3
  433. package/docs/channels/discord.mdx +279 -7
  434. package/docs/channels/eve.mdx +13 -2
  435. package/docs/channels/linq.mdx +2 -2
  436. package/docs/channels/mcp.mdx +2 -2
  437. package/docs/channels/overview.mdx +1 -1
  438. package/docs/channels/photon.mdx +1 -1
  439. package/docs/concepts/built-in-tools.md +31 -8
  440. package/docs/concepts/execution-model-and-durability.mdx +6 -101
  441. package/docs/concepts/security-model.md +2 -0
  442. package/docs/concepts/sessions-runs-and-streaming.md +44 -36
  443. package/docs/connections/openapi.mdx +2 -0
  444. package/docs/evals/overview.mdx +1 -1
  445. package/docs/evals/reporters.mdx +5 -5
  446. package/docs/evals/running.mdx +19 -1
  447. package/docs/guides/client/messages.mdx +1 -1
  448. package/docs/guides/deployment/overview.md +4 -4
  449. package/docs/guides/deployment/self-hosting.md +50 -1
  450. package/docs/guides/dev-tui.md +1 -1
  451. package/docs/guides/dynamic-capabilities.md +2 -2
  452. package/docs/guides/frontend/overview.mdx +34 -10
  453. package/docs/guides/instrumentation/agent-runs.mdx +16 -0
  454. package/docs/guides/instrumentation/otel.mdx +23 -0
  455. package/docs/guides/self-modification.md +1 -1
  456. package/docs/guides/session-context.md +1 -1
  457. package/docs/instructions.mdx +1 -1
  458. package/docs/meta.json +1 -0
  459. package/docs/reference/agent-files.md +4 -4
  460. package/docs/reference/cli.md +24 -17
  461. package/docs/reference/typescript-api.md +9 -3
  462. package/docs/sandbox/custom-providers.mdx +254 -0
  463. package/docs/sandbox/default.mdx +71 -4
  464. package/docs/sandbox/docker.mdx +15 -3
  465. package/docs/sandbox/index.mdx +32 -106
  466. package/docs/sandbox/just-bash.mdx +54 -0
  467. package/docs/sandbox/meta.json +9 -1
  468. package/docs/sandbox/troubleshooting.mdx +215 -0
  469. package/docs/sandbox/vercel.mdx +48 -7
  470. package/docs/skills.mdx +1 -1
  471. package/docs/subagents/index.mdx +2 -2
  472. package/docs/tools/overview.mdx +20 -1
  473. package/docs/tools/workflows.mdx +73 -5
  474. package/docs/tutorial/run-analysis.mdx +2 -2
  475. package/docs/use-cases.mdx +250 -0
  476. package/package.json +14 -20
  477. package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
  478. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
  479. package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
  480. package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
  481. package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
  482. package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
  483. package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
  484. package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
  485. package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
  486. package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
  487. package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
  488. package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
  489. package/dist/src/execution/sandbox/active-handles.js +0 -1
  490. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
  491. package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
  492. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
  493. package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
  494. package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
  495. package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
  496. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
  497. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
  498. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
  499. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
  500. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
  501. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
  502. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
  503. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
  504. package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
  505. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
  506. package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
  507. package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
  508. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
  509. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
  510. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
  511. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
  512. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
  513. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
  514. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
  515. package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
  516. package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
  517. package/dist/src/execution/sandbox/provider-host-development.js +0 -1
  518. package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
  519. package/dist/src/execution/sandbox/provider-host.js +0 -1
  520. package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
  521. package/dist/src/execution/tool-session/sandbox.js +0 -1
  522. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
  523. package/dist/src/public/sandbox/microsandbox-sandbox.js +0 -1
  524. package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
  525. package/dist/src/public/sandbox/microsandbox.js +0 -1
  526. package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
  527. package/dist/src/sandbox/providers/microsandbox.js +0 -1
  528. package/docs/sandbox/microsandbox.mdx +0 -31
@@ -1,59 +1,88 @@
1
- import type { Experimental_SandboxSession as AiSdkSandbox } from "ai";
2
1
  import type { SandboxDeleteOptions } from "#shared/sandbox-provider.js";
3
2
  /**
4
- * Options for running one command in a sandbox. Shape mirrors the AI
5
- * SDK {@link AiSdkSandbox} `run` argument so authored code that targets
6
- * either surface uses the same call shape.
3
+ * Options for running one command, or spawning one process, in a sandbox.
4
+ * `env` holds per-call variables, merged over the sandbox's environment.
5
+ * Aborting kills the process.
7
6
  */
8
- export type SandboxRunOptions = Parameters<AiSdkSandbox["run"]>[0];
9
- /**
10
- * Serializable result returned after running one sandbox command.
11
- */
12
- export type SandboxCommandResult = Awaited<ReturnType<AiSdkSandbox["run"]>>;
13
- /**
14
- * Options for spawning one long-running process in a sandbox. Shape
15
- * mirrors the AI SDK {@link AiSdkSandbox} `spawn` argument.
16
- */
17
- export type SandboxSpawnOptions = Parameters<AiSdkSandbox["spawn"]>[0];
18
- /**
19
- * Handle to a long-running process spawned via {@link SandboxSession.spawn}.
20
- * Mirrors the AI SDK `Experimental_SandboxProcess` type.
21
- */
22
- export type SandboxProcess = Awaited<ReturnType<AiSdkSandbox["spawn"]>>;
23
- /**
24
- * Options for reading one file as a stream of bytes.
25
- */
26
- export type SandboxReadFileOptions = Parameters<AiSdkSandbox["readFile"]>[0];
27
- /**
28
- * Options for reading one file as raw bytes.
29
- */
30
- export type SandboxReadBinaryFileOptions = Parameters<AiSdkSandbox["readBinaryFile"]>[0];
7
+ export interface SandboxRunOptions {
8
+ readonly abortSignal?: AbortSignal;
9
+ readonly command: string;
10
+ readonly env?: Readonly<Record<string, string>>;
11
+ /** Relative directories resolve from the workspace root, which is also the default. */
12
+ readonly workingDirectory?: string;
13
+ }
14
+ /** Options for spawning one long-running process in a sandbox. */
15
+ export type SandboxSpawnOptions = SandboxRunOptions;
16
+ /** Result of one finished sandbox command. A nonzero `exitCode` does not throw. */
17
+ export interface SandboxCommandResult {
18
+ readonly exitCode: number;
19
+ readonly stderr: string;
20
+ readonly stdout: string;
21
+ }
22
+ /** Handle to a long-running process spawned via {@link SandboxSession.spawn}. */
23
+ export interface SandboxProcess {
24
+ readonly pid?: number;
25
+ readonly stderr: ReadableStream<Uint8Array>;
26
+ readonly stdout: ReadableStream<Uint8Array>;
27
+ /** Terminates the process. Idempotent. */
28
+ kill(): Promise<void>;
29
+ wait(): Promise<{
30
+ readonly exitCode: number;
31
+ }>;
32
+ }
33
+ /** Options for reading one file as a stream of bytes. */
34
+ export interface SandboxReadFileOptions {
35
+ readonly abortSignal?: AbortSignal;
36
+ readonly path: string;
37
+ }
38
+ /** Options for reading one file as raw bytes. */
39
+ export type SandboxReadBinaryFileOptions = SandboxReadFileOptions;
31
40
  /**
32
41
  * Options for reading one text file from a sandbox.
33
42
  *
34
- * `encoding`, `startLine`, and `endLine` are passed through to the
35
- * public-surface decoder. `"utf-8"` decodes with `TextDecoder` in fatal
36
- * mode; other encodings fall back to Node's `Buffer.toString(encoding)`.
37
- * Line ranges are 1-based and inclusive; `endLine` past the file's line
38
- * count returns through EOF without error.
43
+ * `"utf-8"` decodes with `TextDecoder` in fatal mode; other encodings fall
44
+ * back to Node's `Buffer.toString(encoding)`. Line ranges are 1-based and
45
+ * inclusive; `endLine` past the file's line count returns through EOF
46
+ * without error.
39
47
  */
40
- export type SandboxReadTextFileOptions = Parameters<AiSdkSandbox["readTextFile"]>[0];
41
- /**
42
- * Options for writing one file from a stream of bytes.
43
- */
44
- export type SandboxWriteFileOptions = Parameters<AiSdkSandbox["writeFile"]>[0];
45
- /**
46
- * Options for writing one file from raw bytes.
47
- */
48
- export type SandboxWriteBinaryFileOptions = Parameters<AiSdkSandbox["writeBinaryFile"]>[0];
48
+ export interface SandboxReadTextFileOptions extends SandboxReadFileOptions {
49
+ readonly encoding?: string;
50
+ readonly endLine?: number;
51
+ readonly startLine?: number;
52
+ }
53
+ /** Options for writing one file from a stream of bytes. */
54
+ export interface SandboxWriteFileOptions {
55
+ readonly abortSignal?: AbortSignal;
56
+ readonly content: ReadableStream<Uint8Array>;
57
+ readonly path: string;
58
+ }
59
+ /** Options for writing one file from raw bytes. */
60
+ export interface SandboxWriteBinaryFileOptions {
61
+ readonly abortSignal?: AbortSignal;
62
+ readonly content: Uint8Array;
63
+ readonly path: string;
64
+ }
65
+ /** Options for writing one text file to a sandbox. Encodes as UTF-8 unless `encoding` is set. */
66
+ export interface SandboxWriteTextFileOptions {
67
+ readonly abortSignal?: AbortSignal;
68
+ readonly content: string;
69
+ readonly encoding?: string;
70
+ readonly path: string;
71
+ }
49
72
  /**
50
- * Options for writing one text file to a sandbox.
73
+ * Options for writing several files from raw bytes in one batch.
51
74
  */
52
- export type SandboxWriteTextFileOptions = Parameters<AiSdkSandbox["writeTextFile"]>[0];
75
+ export interface SandboxWriteFilesOptions {
76
+ readonly abortSignal?: AbortSignal;
77
+ readonly files: readonly {
78
+ readonly content: Uint8Array;
79
+ readonly path: string;
80
+ }[];
81
+ }
53
82
  /**
54
83
  * Options for removing a path from a sandbox.
55
84
  *
56
- * Relative paths resolve from `/workspace`; absolute paths pass through.
85
+ * Relative paths resolve from the workspace root; absolute paths pass through.
57
86
  * `force` ignores missing paths. `recursive` permits removing non-empty
58
87
  * directories.
59
88
  */
@@ -64,32 +93,37 @@ export interface SandboxRemovePathOptions {
64
93
  readonly recursive?: boolean;
65
94
  }
66
95
  /**
67
- * Public eve-owned sandbox session exposed to authored lifecycle hooks.
96
+ * The sandbox session that authored tools, hooks, and `prepare` receive.
68
97
  *
69
- * The eight I/O methods (`run`, `spawn`, `readFile`, `readBinaryFile`,
70
- * `readTextFile`, `writeFile`, `writeBinaryFile`, `writeTextFile`) are
71
- * pulled directly from the AI SDK {@link AiSdkSandbox} type, so authored
72
- * code that targets either surface uses identical signatures. `resolvePath`
73
- * is an eve-specific extension for `/workspace` path anchoring.
74
- *
75
- * Relative paths resolve from `/workspace`, the live working directory
76
- * for every provider. Absolute paths pass through unchanged.
98
+ * Relative paths resolve from the workspace root, where commands start by
99
+ * default: `/workspace` on every built-in provider. Absolute paths pass
100
+ * through unchanged. Writes create missing parent directories and overwrite
101
+ * existing files. Reads resolve to `null` only when the path does not exist.
77
102
  *
103
+ * The method set stays assignable to the AI SDK's
104
+ * `Experimental_SandboxSession`, apart from its `description`.
78
105
  */
79
- export interface SandboxSession extends Pick<AiSdkSandbox, "run" | "spawn" | "readFile" | "readBinaryFile" | "readTextFile" | "writeFile" | "writeBinaryFile" | "writeTextFile"> {
106
+ export interface SandboxSession {
107
+ run(options: SandboxRunOptions): Promise<SandboxCommandResult>;
108
+ spawn(options: SandboxSpawnOptions): Promise<SandboxProcess>;
109
+ readFile(options: SandboxReadFileOptions): Promise<ReadableStream<Uint8Array> | null>;
110
+ readBinaryFile(options: SandboxReadBinaryFileOptions): Promise<Uint8Array | null>;
111
+ readTextFile(options: SandboxReadTextFileOptions): Promise<string | null>;
112
+ writeFile(options: SandboxWriteFileOptions): Promise<void>;
113
+ writeBinaryFile(options: SandboxWriteBinaryFileOptions): Promise<void>;
114
+ writeTextFile(options: SandboxWriteTextFileOptions): Promise<void>;
80
115
  /**
81
- * Anchors a sandbox-relative path to `/workspace` and returns the
82
- * resulting absolute path.
83
- *
84
- * Relative paths resolve from `/workspace`; absolute paths pass through.
85
- * The read and write methods already apply this internally.
116
+ * Writes several files in as few provider calls as the provider allows. A
117
+ * batch is not atomic: a rejected batch may leave earlier files written.
86
118
  */
87
- resolvePath(path: string): string;
119
+ writeFiles(options: SandboxWriteFilesOptions): Promise<void>;
88
120
  /**
89
- * Removes one file or directory from the sandbox filesystem.
90
- *
91
- * Relative paths resolve from `/workspace`; absolute paths pass through.
121
+ * Anchors a sandbox-relative path to the workspace root and returns the
122
+ * resulting absolute path, so `resolvePath(".")` is the root itself. The
123
+ * read and write methods already apply it.
92
124
  */
125
+ resolvePath(path: string): string;
126
+ /** Removes one file or directory from the sandbox filesystem. */
93
127
  removePath(options: SandboxRemovePathOptions): Promise<void>;
94
128
  }
95
129
  export interface RuntimeSandboxSession extends SandboxSession {
@@ -103,23 +137,3 @@ export interface RuntimeSandboxSession extends SandboxSession {
103
137
  stop(): Promise<void>;
104
138
  }
105
139
  export type RuntimeSandboxSessionFor<Session extends SandboxSession> = Session & Pick<RuntimeSandboxSession, "delete" | "stop">;
106
- /**
107
- * Internal sandbox session, used to construct the public {@link SandboxSession}.
108
- *
109
- * Provider implementations only need to provide byte-oriented file I/O and
110
- * a `spawn` primitive; the public surface (binary and text variants,
111
- * line-range slicing, encoding handling, the `run` wrapper) is built on
112
- * top of these primitives by `buildSandboxSession`.
113
- *
114
- * Each method's signature mirrors its public counterpart (and the AI
115
- * SDK {@link AiSdkSandbox} surface) so providers look symmetric with
116
- * what authored code sees. The `path` field on `readFile`/`writeFile`
117
- * here is the **already-resolved** path: the public-surface builder
118
- * calls `resolvePath` before delegating.
119
- */
120
- export interface InternalSandboxSession extends Pick<AiSdkSandbox, "spawn" | "readFile" | "writeFile"> {
121
- /** Removes an already-resolved path from the provider filesystem. */
122
- removePath(options: SandboxRemovePathOptions): Promise<void>;
123
- /** Translates a user-facing path to the provider's native path. */
124
- resolvePath(path: string): string;
125
- }
@@ -1,9 +1,24 @@
1
+ type SandboxTemplateNotProvisionedInput =
2
+ /** The build recorded no prepared artifact for this agent node. */
3
+ {
4
+ readonly nodeId: string;
5
+ readonly providerName: string;
6
+ }
7
+ /**
8
+ * The provider cannot use the recorded template. Callers that know why pass
9
+ * `reason`; the default message names no cause, because callers raise this for
10
+ * several different ones.
11
+ */
12
+ | {
13
+ readonly providerName: string;
14
+ readonly reason?: string;
15
+ readonly templateKey: string;
16
+ };
1
17
  export declare class SandboxTemplateNotProvisionedError extends Error {
2
18
  readonly providerName: string;
19
+ /** The provider's template identifier, or the agent node id when the build recorded no artifact. */
3
20
  readonly templateKey: string;
4
- constructor(input: {
5
- readonly providerName: string;
6
- readonly templateKey: string;
7
- });
21
+ constructor(input: SandboxTemplateNotProvisionedInput);
8
22
  static is(error: unknown): error is SandboxTemplateNotProvisionedError;
9
23
  }
24
+ export {};
@@ -1 +1 @@
1
- var SandboxTemplateNotProvisionedError=class SandboxTemplateNotProvisionedError extends Error{providerName;templateKey;constructor(e){super(`Sandbox template "${e.templateKey}" is not provisioned for provider "${e.providerName}". Run \`eve build\` before serving traffic.`),this.name=`SandboxTemplateNotProvisionedError`,this.providerName=e.providerName,this.templateKey=e.templateKey}static is(e){return e instanceof SandboxTemplateNotProvisionedError||typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SandboxTemplateNotProvisionedError`&&typeof Reflect.get(e,`providerName`)==`string`&&typeof Reflect.get(e,`templateKey`)==`string`}};export{SandboxTemplateNotProvisionedError};
1
+ var SandboxTemplateNotProvisionedError=class SandboxTemplateNotProvisionedError extends Error{providerName;templateKey;constructor(e){super(`nodeId`in e?`No prepared "${e.providerName}" sandbox environment is recorded for agent node "${e.nodeId}". eve prepares sandbox environments during \`eve build\` and never prepares them in production. Run \`eve build\` without \`--skip-sandbox-prewarm\` and deploy that output with this runtime.`:`Sandbox template "${e.templateKey}" for provider "${e.providerName}" is not available to this runtime. `+(e.reason===void 0?``:`${e.reason} `)+"The runtime only uses templates that `eve build` prepared and never recreates them. Run `eve build` again and deploy its output."),this.name=`SandboxTemplateNotProvisionedError`,this.providerName=e.providerName,this.templateKey=`nodeId`in e?e.nodeId:e.templateKey}static is(e){return e instanceof SandboxTemplateNotProvisionedError||typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SandboxTemplateNotProvisionedError`&&typeof Reflect.get(e,`providerName`)==`string`&&typeof Reflect.get(e,`templateKey`)==`string`}};export{SandboxTemplateNotProvisionedError};
@@ -0,0 +1,4 @@
1
+ /** Raised when a keyed tool session opens a sandbox on a provider that cannot keep it. */
2
+ export declare class ToolSessionSandboxUnsupportedError extends Error {
3
+ constructor(providerName: string);
4
+ }
@@ -0,0 +1 @@
1
+ var ToolSessionSandboxUnsupportedError=class extends Error{constructor(e){super(`Sandbox provider "${e}" cannot keep a sandbox between invokeTool calls, so a call with a key cannot open one. Call without a key for a sandbox that lasts one call, or use Vercel Sandbox, just-bash, or a custom provider that sets \`toolSessions: true\`.`),this.name=`ToolSessionSandboxUnsupportedError`}};export{ToolSessionSandboxUnsupportedError};
@@ -1 +1 @@
1
- import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{mapWithConcurrency}from"#shared/map-with-concurrency.js";import{Buffer}from"node:buffer";function stripSkillFrontmatter(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)}function skillPackageRevision(e){let t=createHash(`sha256`);for(let n of e.files)t.update(`${n.relativePath}\0${n.content.byteLength}\0`).update(n.content);return t.digest(`hex`)}function normalizeSkillPackage(e){assertSafeSkillPackageName(e.name);let t=[{content:Buffer.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))assertSafeSkillPackageFilePath(n),t.push({content:contentToBuffer(r),relativePath:n});return t.sort((e,t)=>comparePaths(e.relativePath,t.relativePath)),{deferred:e.deferred,description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function writeSkillPackageDirectory(e){for(let t of e.skill.files){let n=join(e.rootPath,`skills`,e.skill.name,t.relativePath);await mkdir(dirname(n),{recursive:!0}),await writeFile(n,t.content)}}async function writeSkillPackageToSandbox(e){await mapWithConcurrency(e.skill.files,16,async t=>{await e.sandbox.writeBinaryFile({content:t.content,path:await resolveSandboxSkillWritePath({name:e.skill.name,relativePath:t.relativePath,sandbox:e.sandbox})})})}async function removeSkillPackageFromSandbox(e){assertSafeSkillPackageName(e.name);let t=await resolveSandboxSkillRoot({sandbox:e.sandbox});await e.sandbox.removePath({force:!0,path:`${t}/${e.name}`,recursive:!0})}function assertSafeSkillPackageName(e){if(e.length===0||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`)}function assertSafeSkillPackageFilePath(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function contentToBuffer(e){return typeof e==`string`?Buffer.from(e,`utf8`):Buffer.from(e)}function comparePaths(e,t){return e<t?-1:+(e>t)}export{normalizeSkillPackage,removeSkillPackageFromSandbox,skillPackageRevision,stripSkillFrontmatter,writeSkillPackageDirectory,writeSkillPackageToSandbox};
1
+ import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{Buffer}from"node:buffer";function stripSkillFrontmatter(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)}function skillPackageRevision(e){let t=createHash(`sha256`);for(let n of e.files)t.update(`${n.relativePath}\0${n.content.byteLength}\0`).update(n.content);return t.digest(`hex`)}function normalizeSkillPackage(e){assertSafeSkillPackageName(e.name);let t=[{content:Buffer.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))assertSafeSkillPackageFilePath(n),t.push({content:contentToBuffer(r),relativePath:n});return t.sort((e,t)=>comparePaths(e.relativePath,t.relativePath)),{deferred:e.deferred,description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function writeSkillPackageDirectory(e){for(let t of e.skill.files){let n=join(e.rootPath,`skills`,e.skill.name,t.relativePath);await mkdir(dirname(n),{recursive:!0}),await writeFile(n,t.content)}}async function writeSkillPackageToSandbox(e){let t=await Promise.all(e.skill.files.map(async t=>({content:t.content,path:await resolveSandboxSkillWritePath({name:e.skill.name,relativePath:t.relativePath,sandbox:e.sandbox})})));await e.sandbox.writeFiles({files:t})}async function removeSkillPackageFromSandbox(e){assertSafeSkillPackageName(e.name);let t=await resolveSandboxSkillRoot({sandbox:e.sandbox});await e.sandbox.removePath({force:!0,path:`${t}/${e.name}`,recursive:!0})}function assertSafeSkillPackageName(e){if(e.length===0||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`)}function assertSafeSkillPackageFilePath(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function contentToBuffer(e){return typeof e==`string`?Buffer.from(e,`utf8`):Buffer.from(e)}function comparePaths(e,t){return e<t?-1:+(e>t)}export{normalizeSkillPackage,removeSkillPackageFromSandbox,skillPackageRevision,stripSkillFrontmatter,writeSkillPackageDirectory,writeSkillPackageToSandbox};
@@ -1,18 +1,17 @@
1
1
  import type { SandboxSession } from "#shared/sandbox-session.js";
2
2
  export declare const MODEL_SKILL_ROOT = "$HOME/.agents/skills";
3
- export declare const FALLBACK_SKILL_ROOT = "/workspace/skills";
4
3
  /**
5
4
  * Resolves where skills live in the sandbox: under the probed home when it has
6
- * one, and under {@link FALLBACK_SKILL_ROOT} when it does not.
5
+ * one, and under `skills/` in the workspace root when it does not.
7
6
  */
8
7
  export declare function resolveSandboxSkillRoot(input: {
9
8
  readonly sandbox: SandboxSession;
10
9
  }): Promise<string>;
11
10
  /**
12
11
  * Resolves a leading `$HOME` in a model-supplied sandbox path without
13
- * evaluating any other shell syntax. Skill paths retain their documented
14
- * `/workspace/skills` fallback when the sandbox does not expose a usable
15
- * home directory.
12
+ * evaluating any other shell syntax. Skill paths fall back to `skills/` in
13
+ * the workspace root when the sandbox does not expose a usable home
14
+ * directory.
16
15
  */
17
16
  export declare function resolveSandboxModelPath(input: {
18
17
  readonly path: string;
@@ -1,2 +1,2 @@
1
- const MODEL_HOME_ROOT=`$HOME`,MODEL_SKILL_ROOT=`${MODEL_HOME_ROOT}/.agents/skills`,FALLBACK_SKILL_ROOT=`/workspace/skills`,sandboxHomeCache=new WeakMap;async function resolveSandboxSkillRoot(e){return await resolveSandboxModelPath({path:MODEL_SKILL_ROOT,sandbox:e.sandbox})}async function resolveSandboxModelPath(e){if(!isModelHomePath(e.path))return e.path;let t=await resolveSandboxHome(e.sandbox);if(t!==null){let n=e.path.slice(5);return n.length===0?t:`${t===`/`?``:t}${n}`}return isModelSkillPath(e.path)?`${FALLBACK_SKILL_ROOT}${e.path.slice(MODEL_SKILL_ROOT.length)}`:e.path}async function resolveSandboxSkillWritePath(e){return formatSkillPath({name:e.name,relativePath:e.relativePath,root:await resolveSandboxSkillRoot({sandbox:e.sandbox})})}function formatSkillPath(e){return`${e.root}/${e.name}/${e.relativePath}`}async function resolveSandboxHome(e){let t=sandboxHomeCache.get(e);if(t!==void 0)return await t;let n=probeSandboxHome(e);return sandboxHomeCache.set(e,n),await n}async function probeSandboxHome(e){try{let t=await e.run({command:`printf '%s\\n' "$HOME"`});if(t.exitCode!==0)return null;let n=t.stdout.trim();return isUsableSandboxHome(n)?normalizeSandboxHome(n):null}catch{return null}}function isModelHomePath(e){return e===MODEL_HOME_ROOT||e.startsWith(`${MODEL_HOME_ROOT}/`)}function isModelSkillPath(e){return e===MODEL_SKILL_ROOT||e.startsWith(`${MODEL_SKILL_ROOT}/`)}function isUsableSandboxHome(e){return e.length>0&&e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`
2
- `)&&!e.includes(`\r`)}function normalizeSandboxHome(e){return e===`/`?e:e.replace(/\/+$/,``)}export{FALLBACK_SKILL_ROOT,MODEL_SKILL_ROOT,resolveSandboxModelPath,resolveSandboxSkillRoot,resolveSandboxSkillWritePath};
1
+ const MODEL_HOME_ROOT=`$HOME`,MODEL_SKILL_ROOT=`${MODEL_HOME_ROOT}/.agents/skills`,sandboxHomeCache=new WeakMap;async function resolveSandboxSkillRoot(e){return await resolveSandboxModelPath({path:MODEL_SKILL_ROOT,sandbox:e.sandbox})}async function resolveSandboxModelPath(e){if(!isModelHomePath(e.path))return e.path;let t=await resolveSandboxHome(e.sandbox);if(t!==null){let n=e.path.slice(5);return n.length===0?t:`${t===`/`?``:t}${n}`}return isModelSkillPath(e.path)?e.sandbox.resolvePath(`skills${e.path.slice(MODEL_SKILL_ROOT.length)}`):e.path}async function resolveSandboxSkillWritePath(e){return formatSkillPath({name:e.name,relativePath:e.relativePath,root:await resolveSandboxSkillRoot({sandbox:e.sandbox})})}function formatSkillPath(e){return`${e.root}/${e.name}/${e.relativePath}`}async function resolveSandboxHome(e){let t=sandboxHomeCache.get(e);if(t!==void 0)return await t;let n=probeSandboxHome(e);return sandboxHomeCache.set(e,n),await n}async function probeSandboxHome(e){try{let t=await e.run({command:`printf '%s\\n' "$HOME"`});if(t.exitCode!==0)return null;let n=t.stdout.trim();return isUsableSandboxHome(n)?normalizeSandboxHome(n):null}catch{return null}}function isModelHomePath(e){return e===MODEL_HOME_ROOT||e.startsWith(`${MODEL_HOME_ROOT}/`)}function isModelSkillPath(e){return e===MODEL_SKILL_ROOT||e.startsWith(`${MODEL_SKILL_ROOT}/`)}function isUsableSandboxHome(e){return e.length>0&&e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`
2
+ `)&&!e.includes(`\r`)}function normalizeSandboxHome(e){return e===`/`?e:e.replace(/\/+$/,``)}export{MODEL_SKILL_ROOT,resolveSandboxModelPath,resolveSandboxSkillRoot,resolveSandboxSkillWritePath};
@@ -1,43 +1,6 @@
1
- import type { FlexibleSchema, ToolSet } from "ai";
2
- import type * as CodeModeModule from "#compiled/@ai-sdk/code-mode/index.js";
3
- type WorkflowSandboxModule = {
4
- readonly CodeModeToolError: typeof CodeModeModule.CodeModeToolError;
5
- readonly continueCodeModeInterrupt: typeof CodeModeModule.experimental_continueCodeModeInterrupt;
6
- readonly createCodeModeTool: typeof CodeModeModule.experimental_createCodeModeTool;
7
- readonly requestCodeModeInterrupt: typeof CodeModeModule.experimental_requestCodeModeInterrupt;
8
- readonly unwrapCodeModeResult: typeof CodeModeModule.experimental_unwrapCodeModeResult;
9
- };
10
- export type WorkflowSandboxInterrupt = CodeModeModule.CodeModeInterrupt;
11
- export type WorkflowSandboxContinuationSecurity = CodeModeModule.CodeModeContinuationSecurityOptions;
1
+ import type * as RunModule from "#compiled/run/index.js";
2
+ type WorkflowSandboxModule = Pick<typeof RunModule, "createRunner" | "createSignedContinuationCodec" | "getHostFunctionContext" | "RunError">;
12
3
  export declare function installWorkflowSandboxModule(module: WorkflowSandboxModule): void;
13
- export declare function createWorkflowSandboxTool(input: {
14
- readonly bridgeRequestLimit: number;
15
- readonly continuationSecurity: WorkflowSandboxContinuationSecurity;
16
- readonly hostTools: ToolSet;
17
- }): Promise<ToolSet[string]>;
18
- export declare function continueWorkflowSandboxInterrupt(input: {
19
- readonly bridgeRequestLimit: number;
20
- readonly continuationSecurity: WorkflowSandboxContinuationSecurity;
21
- readonly interrupt: WorkflowSandboxInterrupt;
22
- readonly resolution: unknown;
23
- readonly tools: ToolSet;
24
- }): Promise<unknown>;
25
- export declare function unwrapWorkflowSandboxResult(value: unknown, continuationSecurity: WorkflowSandboxContinuationSecurity): Promise<{
26
- readonly output: unknown;
27
- readonly status: "completed";
28
- } | {
29
- readonly interrupt: WorkflowSandboxInterrupt;
30
- readonly status: "interrupted";
31
- }>;
32
- /** A host tool that parks on first call and consumes its resolution on replay. */
33
- export declare function createParkingHostTool(input: {
34
- readonly description: string;
35
- readonly inputSchema: FlexibleSchema;
36
- readonly outputSchema?: FlexibleSchema | null;
37
- readonly interrupt: (toolInput: unknown) => {
38
- readonly kind: string;
39
- } & Record<string, unknown>;
40
- }): ToolSet[string];
41
- /** Reconstructs every unresolved interruption from the authenticated continuation. */
42
- export declare function getWorkflowSandboxPendingInterrupts(interrupt: WorkflowSandboxInterrupt): WorkflowSandboxInterrupt[];
4
+ /** Returns the vendored `run` runtime that executes generated workflow programs. */
5
+ export declare function loadWorkflowSandboxModule(): Promise<WorkflowSandboxModule>;
43
6
  export {};
@@ -1 +1 @@
1
- const WORKFLOW_SANDBOX_MODULE_KEY=Symbol.for(`eve.workflowSandbox.module`),WORKFLOW_SANDBOX_MODULE_SPECIFIER=[`#compiled`,`@ai-sdk`,`code-mode`,`index.js`].join(`/`);let workflowSandboxModulePromise;function installWorkflowSandboxModule(e){globalThis[WORKFLOW_SANDBOX_MODULE_KEY]=e}async function createWorkflowSandboxTool(e){let{createCodeModeTool:t}=await loadWorkflowSandboxModule();return t(e.hostTools,createWorkflowSandboxOptions(e.bridgeRequestLimit,e.continuationSecurity))}async function continueWorkflowSandboxInterrupt(e){let{continueCodeModeInterrupt:t}=await loadWorkflowSandboxModule();return t({interrupt:e.interrupt,options:createWorkflowSandboxOptions(e.bridgeRequestLimit,e.continuationSecurity),resolution:e.resolution,tools:e.tools})}async function unwrapWorkflowSandboxResult(e,t){let{unwrapCodeModeResult:n}=await loadWorkflowSandboxModule();return n(e,t)}function createParkingHostTool(e){return{description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema??void 0,execute:async(t,n)=>{let r=await loadWorkflowSandboxModule(),i=readWorkflowProgramResolution(n);if(i?.status===`failed`)throw new r.CodeModeToolError(i.error);return i?.status===`completed`?i.output:r.requestCodeModeInterrupt(e.interrupt(t))}}}function readWorkflowProgramResolution(e){if(typeof e!=`object`||!e)return;let t=e.codeModeInterrupt;if(typeof t!=`object`||!t)return;let n=t.resolution;if(typeof n!=`object`||!n)return;let r=n.status;return r===`completed`||r===`failed`?n:void 0}function getWorkflowSandboxPendingInterrupts(e){let t=e.continuation,n=new Set(t.resolutions.map(e=>e.runInterruptionId));return t.pendingInterruptions.flatMap(e=>n.has(e.runInterruptionId)?[]:[{continuation:t,input:e.input,interruptId:e.interruptId,outerToolCallId:t.outerToolCallId,payload:e.payload,toolCallId:e.toolCallId,toolName:e.toolName,type:`code-mode-interrupt`}])}function createWorkflowSandboxOptions(e,t){return{continuationSecurity:t,executionPolicy:{maxBridgeRequests:e,maxInFlightBridgeRequests:e}}}async function loadWorkflowSandboxModule(){let e=globalThis[WORKFLOW_SANDBOX_MODULE_KEY];return e===void 0?(workflowSandboxModulePromise??=importWorkflowSandboxModule(WORKFLOW_SANDBOX_MODULE_SPECIFIER),await workflowSandboxModulePromise):e}async function importWorkflowSandboxModule(e){let t=await import(e);return{CodeModeToolError:t.CodeModeToolError,continueCodeModeInterrupt:t.experimental_continueCodeModeInterrupt,createCodeModeTool:t.experimental_createCodeModeTool,requestCodeModeInterrupt:t.experimental_requestCodeModeInterrupt,unwrapCodeModeResult:t.experimental_unwrapCodeModeResult}}export{continueWorkflowSandboxInterrupt,createParkingHostTool,createWorkflowSandboxTool,getWorkflowSandboxPendingInterrupts,installWorkflowSandboxModule,unwrapWorkflowSandboxResult};
1
+ const WORKFLOW_SANDBOX_MODULE_KEY=Symbol.for(`eve.workflowSandbox.module`),WORKFLOW_SANDBOX_MODULE_SPECIFIER=[`#compiled`,`run`,`index.js`].join(`/`);let workflowSandboxModulePromise;function installWorkflowSandboxModule(e){globalThis[WORKFLOW_SANDBOX_MODULE_KEY]=e}async function loadWorkflowSandboxModule(){let e=globalThis[WORKFLOW_SANDBOX_MODULE_KEY];return e===void 0?(workflowSandboxModulePromise??=import(WORKFLOW_SANDBOX_MODULE_SPECIFIER),await workflowSandboxModulePromise):e}export{installWorkflowSandboxModule,loadWorkflowSandboxModule};
@@ -1,4 +1,4 @@
1
- import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DlznYwQk.js";
1
+ import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-ZY7NQ2VW.js";
2
2
 
3
3
  //#region src/client/tool-call-state.ts
4
4
  function toolCallState(conversation, callId, options = {}) {
@@ -110,7 +110,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
110
110
  * on the next send, answer, or resume. @default true
111
111
  */
112
112
  readonly followIdle?: boolean;
113
- /** Prewarm an owned session on mount and after reset. @default false */
113
+ /** Create a session or prepare its existing idle owner on mount and after reset. @default false */
114
114
  readonly prewarm?: boolean;
115
115
  /**
116
116
  * Projects stream events into `TData`. Defaults to the conversation reducer.
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-DlznYwQk.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-ZY7NQ2VW.js";
2
2
 
3
3
  export { useEveAgent };
@@ -1 +1 @@
1
- import{collectDurableDynamicToolCallbacks,stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(e){return stampToolDefinition(e,`defineTool`)}function stampToolDefinition(e,t){if(e.auth!==void 0)throw Error(`${t}: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDurableDynamicToolCallbacks(e,collectDurableDynamicToolCallbacks({inputSchema:e.inputSchema,outputSchema:e.outputSchema,label:e.label,approval:e.approval,approvalKey:e.approvalKey,execute:e.execute,toModelOutput:e.toModelOutput})),stampDefinitionKey(e,`tool:${e.description}`),e}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}export{defineTool,disableTool,isDisabledToolSentinel,stampToolDefinition};
1
+ import{collectDurableDynamicToolCallbacks,stampDurableDynamicToolCallbacks}from"#tools/durable-callbacks.js";import{TOOL_BRAND}from"#tools/dynamic.js";import{stampDefinitionKey}from"#internal/authored-definition/source-identity.js";function defineTool(e){return stampToolDefinition(e,`defineTool`)}function stampToolDefinition(e,t){if(e.auth!==void 0)throw Error(`${t}: The "auth" field is no longer supported. Pass auth providers inline to ctx.getToken(provider) or ctx.requireAuth(provider).`);return Object.assign(e,{[TOOL_BRAND]:!0}),stampDurableDynamicToolCallbacks(e,collectDurableDynamicToolCallbacks({inputSchema:e.inputSchema,outputSchema:e.outputSchema,label:e.label,approval:e.approval,approvalKey:e.approvalKey,endsTurn:e.endsTurn,execute:e.execute,toModelOutput:e.toModelOutput})),stampDefinitionKey(e,`tool:${e.description}`),e}const DISABLED_TOOL_SENTINEL_KIND=`eve:disabled-tool`;function disableTool(){return{kind:DISABLED_TOOL_SENTINEL_KIND}}function isDisabledToolSentinel(e){return typeof e==`object`&&!!e&&e.kind===DISABLED_TOOL_SENTINEL_KIND}export{defineTool,disableTool,isDisabledToolSentinel,stampToolDefinition};
@@ -1,6 +1,6 @@
1
1
  import type { ToolApproval } from "#approval/definition.js";
2
2
  import type { JsonObject, JsonPrimitive } from "#shared/json.js";
3
- export type DurableDynamicCallbackPhase = "labelComplete" | "labelDelta" | "labelStart" | "approvalKey" | "approvalPrompt" | "approvalRequest" | "approvalResponse" | "execute" | "toModelOutput" | "inputSchema" | "outputSchema";
3
+ export type DurableDynamicCallbackPhase = "labelComplete" | "labelDelta" | "labelStart" | "approvalKey" | "approvalPrompt" | "approvalRequest" | "approvalResponse" | "endsTurn" | "execute" | "toModelOutput" | "inputSchema" | "outputSchema";
4
4
  export type DurableDynamicCallbackFn = (closure: JsonObject, ...args: never[]) => unknown;
5
5
  /**
6
6
  * Persisted binding for one callback phase. Identity is
@@ -13,6 +13,7 @@ export interface DurableDynamicCallbackReference {
13
13
  readonly stepId?: never;
14
14
  }
15
15
  export interface DurableDynamicToolCallbacks {
16
+ readonly endsTurn?: DurableDynamicCallbackReference;
16
17
  readonly execute: DurableDynamicCallbackReference;
17
18
  readonly inputSchema?: DurableDynamicCallbackReference;
18
19
  readonly outputSchema?: DurableDynamicCallbackReference;
@@ -33,6 +34,7 @@ export interface StampedDurableDynamicCallback {
33
34
  readonly closure: JsonObject;
34
35
  }
35
36
  type LiveDurableDynamicToolCallbacks = Partial<{
37
+ endsTurn: StampedDurableDynamicCallback;
36
38
  execute: StampedDurableDynamicCallback;
37
39
  inputSchema: StampedDurableDynamicCallback;
38
40
  outputSchema: StampedDurableDynamicCallback;
@@ -107,6 +109,8 @@ export declare function collectDurableDynamicToolCallbacks(input: {
107
109
  };
108
110
  readonly approval?: ToolApproval<never>;
109
111
  readonly approvalKey?: (...args: never[]) => unknown;
112
+ /** A boolean `endsTurn` is durable metadata already; only a function needs a descriptor. */
113
+ readonly endsTurn?: unknown;
110
114
  readonly execute?: (...args: never[]) => unknown;
111
115
  readonly toModelOutput?: (...args: never[]) => unknown;
112
116
  }): LiveDurableDynamicToolCallbacks;
@@ -1 +1 @@
1
- import{readDurableSchema}from"#tools/durable-schema.js";import{resolveApprovalPolicy}from"#approval/definition.js";const STAMPED_CALLBACK=Symbol.for(`eve:durable-dynamic-callback`),DURABLE_DYNAMIC_TOOL_CALLBACKS=Symbol.for(`eve:durable-dynamic-tool-callbacks`),REGISTRY=Symbol.for(`eve:scoped-dynamic-tool-callbacks`);function getRegistry(){let e=globalThis;return e[REGISTRY]??=new Map}function getSessionBindings(e){let t=getRegistry(),n=t.get(e);return n!==void 0&&(t.delete(e),t.set(e,n)),n}function callbackKey(e,t){return JSON.stringify([e.scope,e.resolverSlug,e.entryKey,e.name,t])}function registerDurableDynamicCallback(e){let t=getRegistry(),n=getSessionBindings(e.owner.sessionId);n===void 0&&(n=new Map,t.set(e.owner.sessionId,n),t.size>1024&&t.delete(t.keys().next().value)),n.set(callbackKey(e.owner,e.phase),e.callback)}function lookupDurableDynamicCallback(e,t){return getSessionBindings(e.sessionId)?.get(callbackKey(e,t))}function clearDurableDynamicCallbacks(e,t){if(t===void 0){getRegistry().delete(e);return}let n=getSessionBindings(e);if(n===void 0)return;let r=JSON.stringify([t.scope,t.resolverSlug]).slice(0,-1)+`,`;for(let e of n.keys())e.startsWith(r)&&n.delete(e)}function callDurableDynamicCallback(e,t,...n){return e(t,...n)}function hasUnregisteredDurableDynamicCallbacks(e,t){return e.some(e=>durableCallbackPhases(e.callbacks).some(n=>lookupDurableDynamicCallback({...e,...t},n)===void 0))}function durableCallbackPhases(e){return[[`execute`,e.execute],[`inputSchema`,e.inputSchema],[`outputSchema`,e.outputSchema],[`labelComplete`,e.label?.complete],[`labelDelta`,e.label?.delta],[`labelStart`,e.label?.start],[`approvalKey`,e.approvalKey],[`approvalPrompt`,e.approvalPrompt],[`approvalRequest`,e.approvalRequest],[`approvalResponse`,e.approvalResponse],[`toModelOutput`,e.toModelOutput]].flatMap(([e,t])=>t===void 0?[]:[e])}function defineDurableCallback(e){return stampDurableDynamicCallback((...t)=>e.callback(e.closure,...t),{callback:(t,...n)=>Reflect.apply(e.callback,void 0,[t,...n]),closure:e.closure})}function stampDurableDynamicCallback(e,t){return Object.defineProperty(e,STAMPED_CALLBACK,{configurable:!0,value:t}),e}function readDurableDynamicCallback(e){if(typeof e==`function`)return Reflect.get(e,STAMPED_CALLBACK)}function stampDurableDynamicToolCallbacks(e,t){Object.defineProperty(e,DURABLE_DYNAMIC_TOOL_CALLBACKS,{configurable:!0,value:t})}function collectDurableDynamicToolCallbacks(e){let t=readDurableDynamicCallback(e.label?.complete),n=readDurableDynamicCallback(e.label?.delta),r=readDurableDynamicCallback(e.label?.start),i=e.approval===void 0?void 0:readDurableDynamicCallback(resolveApprovalPolicy(e.approval)),a=e.approval===void 0||typeof e.approval==`function`?void 0:readDurableDynamicCallback(e.approval.response),o=readDurableDynamicCallback(e.approvalKey),s=readDurableDynamicCallback(e.approval===void 0||typeof e.approval==`function`?void 0:e.approval.prompt),c=readDurableDynamicCallback(e.execute),l=readDurableDynamicCallback(e.toModelOutput),u={},d=readDurableSchema(e.inputSchema),f=readDurableSchema(e.outputSchema);return d!==void 0&&(u.inputSchema=d),f!==void 0&&(u.outputSchema=f),c!==void 0&&(u.execute=c),(t!==void 0||n!==void 0||r!==void 0)&&(u.label={complete:t,delta:n,start:r}),o!==void 0&&(u.approvalKey=o),s!==void 0&&(u.approvalPrompt=s),i!==void 0&&(u.approvalRequest=i),a!==void 0&&(u.approvalResponse=a),l!==void 0&&(u.toModelOutput=l),u}function readDurableDynamicToolCallbacks(e){return e[DURABLE_DYNAMIC_TOOL_CALLBACKS]}export{callDurableDynamicCallback,clearDurableDynamicCallbacks,collectDurableDynamicToolCallbacks,defineDurableCallback,hasUnregisteredDurableDynamicCallbacks,lookupDurableDynamicCallback,readDurableDynamicCallback,readDurableDynamicToolCallbacks,registerDurableDynamicCallback,stampDurableDynamicCallback,stampDurableDynamicToolCallbacks};
1
+ import{readDurableSchema}from"#tools/durable-schema.js";import{resolveApprovalPolicy}from"#approval/definition.js";const STAMPED_CALLBACK=Symbol.for(`eve:durable-dynamic-callback`),DURABLE_DYNAMIC_TOOL_CALLBACKS=Symbol.for(`eve:durable-dynamic-tool-callbacks`),REGISTRY=Symbol.for(`eve:scoped-dynamic-tool-callbacks`);function getRegistry(){let e=globalThis;return e[REGISTRY]??=new Map}function getSessionBindings(e){let t=getRegistry(),n=t.get(e);return n!==void 0&&(t.delete(e),t.set(e,n)),n}function callbackKey(e,t){return JSON.stringify([e.scope,e.resolverSlug,e.entryKey,e.name,t])}function registerDurableDynamicCallback(e){let t=getRegistry(),n=getSessionBindings(e.owner.sessionId);n===void 0&&(n=new Map,t.set(e.owner.sessionId,n),t.size>1024&&t.delete(t.keys().next().value)),n.set(callbackKey(e.owner,e.phase),e.callback)}function lookupDurableDynamicCallback(e,t){return getSessionBindings(e.sessionId)?.get(callbackKey(e,t))}function clearDurableDynamicCallbacks(e,t){if(t===void 0){getRegistry().delete(e);return}let n=getSessionBindings(e);if(n===void 0)return;let r=JSON.stringify([t.scope,t.resolverSlug]).slice(0,-1)+`,`;for(let e of n.keys())e.startsWith(r)&&n.delete(e)}function callDurableDynamicCallback(e,t,...n){return e(t,...n)}function hasUnregisteredDurableDynamicCallbacks(e,t){return e.some(e=>durableCallbackPhases(e.callbacks).some(n=>lookupDurableDynamicCallback({...e,...t},n)===void 0))}function durableCallbackPhases(e){return[[`endsTurn`,e.endsTurn],[`execute`,e.execute],[`inputSchema`,e.inputSchema],[`outputSchema`,e.outputSchema],[`labelComplete`,e.label?.complete],[`labelDelta`,e.label?.delta],[`labelStart`,e.label?.start],[`approvalKey`,e.approvalKey],[`approvalPrompt`,e.approvalPrompt],[`approvalRequest`,e.approvalRequest],[`approvalResponse`,e.approvalResponse],[`toModelOutput`,e.toModelOutput]].flatMap(([e,t])=>t===void 0?[]:[e])}function defineDurableCallback(e){return stampDurableDynamicCallback((...t)=>e.callback(e.closure,...t),{callback:(t,...n)=>Reflect.apply(e.callback,void 0,[t,...n]),closure:e.closure})}function stampDurableDynamicCallback(e,t){return Object.defineProperty(e,STAMPED_CALLBACK,{configurable:!0,value:t}),e}function readDurableDynamicCallback(e){if(typeof e==`function`)return Reflect.get(e,STAMPED_CALLBACK)}function stampDurableDynamicToolCallbacks(e,t){Object.defineProperty(e,DURABLE_DYNAMIC_TOOL_CALLBACKS,{configurable:!0,value:t})}function collectDurableDynamicToolCallbacks(e){let t=readDurableDynamicCallback(e.label?.complete),n=readDurableDynamicCallback(e.label?.delta),r=readDurableDynamicCallback(e.label?.start),i=e.approval===void 0?void 0:readDurableDynamicCallback(resolveApprovalPolicy(e.approval)),a=e.approval===void 0||typeof e.approval==`function`?void 0:readDurableDynamicCallback(e.approval.response),o=readDurableDynamicCallback(e.approvalKey),s=readDurableDynamicCallback(e.approval===void 0||typeof e.approval==`function`?void 0:e.approval.prompt),c=readDurableDynamicCallback(e.endsTurn),l=readDurableDynamicCallback(e.execute),u=readDurableDynamicCallback(e.toModelOutput),d={},f=readDurableSchema(e.inputSchema),p=readDurableSchema(e.outputSchema);return f!==void 0&&(d.inputSchema=f),p!==void 0&&(d.outputSchema=p),c!==void 0&&(d.endsTurn=c),l!==void 0&&(d.execute=l),(t!==void 0||n!==void 0||r!==void 0)&&(d.label={complete:t,delta:n,start:r}),o!==void 0&&(d.approvalKey=o),s!==void 0&&(d.approvalPrompt=s),i!==void 0&&(d.approvalRequest=i),a!==void 0&&(d.approvalResponse=a),u!==void 0&&(d.toModelOutput=u),d}function readDurableDynamicToolCallbacks(e){return e[DURABLE_DYNAMIC_TOOL_CALLBACKS]}export{callDurableDynamicCallback,clearDurableDynamicCallbacks,collectDurableDynamicToolCallbacks,defineDurableCallback,hasUnregisteredDurableDynamicCallbacks,lookupDurableDynamicCallback,readDurableDynamicCallback,readDurableDynamicToolCallbacks,registerDurableDynamicCallback,stampDurableDynamicCallback,stampDurableDynamicToolCallbacks};
@@ -22,9 +22,9 @@ export interface DynamicToolEntry<TInput = Record<string, unknown>, TOutput = an
22
22
  readonly label?: ToolLabelDefinition<TInput, TOutput>;
23
23
  readonly description: string;
24
24
  /**
25
- * Ends the turn after a successful call, as `endsTurn: true` on
26
- * `defineTool`. Dynamic tools accept only `true` or `false`: eve rejects a
27
- * function when the resolver returns this entry.
25
+ * Ends the turn after a successful call, as `endsTurn` on a static
26
+ * `defineTool`. A function is replayed from its durable descriptor, like
27
+ * `execute`.
28
28
  */
29
29
  readonly endsTurn?: boolean | ((output: TOutput) => boolean | Promise<boolean>);
30
30
  readonly inputSchema: PublicToolInputSchema<TInput>;
@@ -20,20 +20,28 @@ export type ToolModelOutput = {
20
20
  /**
21
21
  * One part of a `content` {@link ToolModelOutput}. Mirrors the AI SDK's
22
22
  * `ToolResultOutput` content parts narrowed to the JSON-safe subset:
23
- * file data is the SDK's tagged `FileData` union restricted to
24
- * `{ type: "data" }` with a base64 string, so persisted tool results
25
- * survive the durable JSON boundary. Use the `toolOutputPart` builders
26
- * from `eve/tools` to construct parts without hand-writing the nesting.
23
+ * file data is the SDK's tagged `FileData` union restricted to a base64
24
+ * `{ type: "data" }` payload or an `https:` `{ type: "url" }` string, so
25
+ * persisted tool results survive the durable JSON boundary. Use the
26
+ * `toolOutputPart` builders from `eve/tools` to construct parts without
27
+ * hand-writing the nesting.
27
28
  */
28
29
  export type ToolModelOutputPart = {
29
30
  readonly type: "text";
30
31
  readonly text: string;
31
32
  } | {
32
33
  readonly type: "file";
33
- /** Tagged file data; only JSON-safe base64 payloads are accepted. */
34
+ /**
35
+ * Tagged file data: a base64 payload, or an `https:` URL the
36
+ * provider fetches itself. A URL must stay readable for the whole
37
+ * session because every later model call sends it again.
38
+ */
34
39
  readonly data: {
35
40
  readonly type: "data";
36
41
  readonly data: string;
42
+ } | {
43
+ readonly type: "url";
44
+ readonly url: string;
37
45
  };
38
46
  /** IANA media type, e.g. `image/png`. */
39
47
  readonly mediaType: string;
@@ -90,4 +98,14 @@ export declare const toolOutputPart: {
90
98
  readonly mediaType: string;
91
99
  readonly filename?: string;
92
100
  }): ToolModelOutputPart;
101
+ /**
102
+ * Builds a file part from an `https:` URL, e.g. a presigned object
103
+ * storage link. The provider fetches the file, so eve neither downloads
104
+ * it nor stores its bytes in session history. Every later model call
105
+ * sends the URL again, so it must not expire before the session ends.
106
+ */
107
+ fileUrl(url: string, options: {
108
+ readonly mediaType: string;
109
+ readonly filename?: string;
110
+ }): ToolModelOutputPart;
93
111
  };
@@ -1 +1 @@
1
- const toolOutput={text(e){return{type:`text`,value:e}},json(e){return{type:`json`,value:e}},content(e){return{type:`content`,value:e}}},toolOutputPart={text(e){return{type:`text`,text:e}},file(e,t){let n={type:`file`,data:{type:`data`,data:e},mediaType:t.mediaType};return t.filename!==void 0&&(n.filename=t.filename),n}};export{toolOutput,toolOutputPart};
1
+ const toolOutput={text(e){return{type:`text`,value:e}},json(e){return{type:`json`,value:e}},content(e){return{type:`content`,value:e}}},toolOutputPart={text(e){return{type:`text`,text:e}},file(e,t){return filePart({type:`data`,data:e},t)},fileUrl(e,t){return filePart({type:`url`,url:e},t)}};function filePart(e,t){return t.filename===void 0?{type:`file`,data:e,mediaType:t.mediaType}:{type:`file`,data:e,mediaType:t.mediaType,filename:t.filename}}export{toolOutput,toolOutputPart};
@@ -1 +1 @@
1
- async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.82.0//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
1
+ async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.83.1//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
@@ -1,2 +1,2 @@
1
- import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeGlobOnSandbox}from"#execution/sandbox/glob-tool.js";const GLOB_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{limit:{type:`integer`,minimum:1,maximum:1e3,description:`Maximum number of results to return. Defaults to 100.`},path:{type:`string`,description:`The directory to search in. Defaults to /workspace. Must be an absolute path or begin with $HOME/. Omit to use the default.`},pattern:{type:`string`,description:`The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`}},required:[`pattern`],additionalProperties:!1}),GLOB_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},count:{type:`integer`},path:{type:`string`},truncated:{type:`boolean`}},required:[`content`,`count`,`path`,`truncated`],additionalProperties:!1}),glob=frameworkTool(defineTool({label:{start:e=>toolLabel(`Find`,e.pattern)},description:[`Fast file pattern matching tool that works with any codebase size.`,``,`Usage:`,`- Supports glob patterns like "**/*.js" or "src/**/*.ts".`,`- Returns matching file paths.`,`- Call this tool in parallel when you know there are multiple patterns to search for.`].join(`
1
+ import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeGlobOnSandbox}from"#execution/sandbox/glob-tool.js";const GLOB_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{limit:{type:`integer`,minimum:1,maximum:1e3,description:`Maximum number of results to return. Defaults to 100.`},path:{type:`string`,description:`The directory to search in: absolute, relative to the workspace root, or beginning with $HOME/. Omit to search the workspace root.`},pattern:{type:`string`,description:`The glob pattern to match files against (e.g. "**/*.ts", "src/**/*.js").`}},required:[`pattern`],additionalProperties:!1}),GLOB_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},count:{type:`integer`},path:{type:`string`},truncated:{type:`boolean`}},required:[`content`,`count`,`path`,`truncated`],additionalProperties:!1}),glob=frameworkTool(defineTool({label:{start:e=>toolLabel(`Find`,e.pattern)},description:[`Fast file pattern matching tool that works with any codebase size.`,``,`Usage:`,`- Supports glob patterns like "**/*.js" or "src/**/*.ts".`,`- Returns matching file paths.`,`- Call this tool in parallel when you know there are multiple patterns to search for.`].join(`
2
2
  `),async execute(e,t){return await executeGlobOnSandbox(await t.getSandbox(),e)},inputSchema:GLOB_INPUT_SCHEMA,outputSchema:GLOB_OUTPUT_SCHEMA}));export{GLOB_INPUT_SCHEMA,GLOB_OUTPUT_SCHEMA,glob as default,glob};
@@ -1,2 +1,2 @@
1
- import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeGrepOnSandbox}from"#execution/sandbox/grep-tool.js";const GREP_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{context:{type:`integer`,minimum:0,description:`Number of surrounding context lines to include before and after each match. Defaults to 0.`},glob:{type:`string`,description:`Filter files by glob pattern (e.g. "*.ts", "*.{ts,tsx}").`},ignoreCase:{type:`boolean`,description:`Perform case-insensitive search. Defaults to false.`},limit:{type:`integer`,minimum:1,maximum:1e3,description:`Maximum number of matches to return per file. Defaults to 100.`},literal:{type:`boolean`,description:`Treat the pattern as a literal string instead of a regular expression. Defaults to false.`},path:{type:`string`,description:`The directory or file to search in. Defaults to /workspace. Must be an absolute path or begin with $HOME/. Omit to use the default.`},pattern:{type:`string`,description:`The regex pattern to search for in file contents (e.g. "log.*Error", "function\\s+\\w+").`}},required:[`pattern`],additionalProperties:!1}),GREP_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},matchCount:{type:`integer`},path:{type:`string`},truncated:{type:`boolean`}},required:[`content`,`matchCount`,`path`,`truncated`],additionalProperties:!1}),grep=frameworkTool(defineTool({label:{start:e=>toolLabel(`Search`,e.pattern)},description:[`Fast content search tool that works with any codebase size.`,``,`Usage:`,`- Searches file contents using regular expressions.`,`- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").`,`- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").`,`- Returns matching lines with file paths and line numbers.`,`- Call this tool in parallel when you have multiple independent searches.`,`- Any line longer than 2000 characters is truncated.`].join(`
1
+ import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeGrepOnSandbox}from"#execution/sandbox/grep-tool.js";const GREP_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{context:{type:`integer`,minimum:0,description:`Number of surrounding context lines to include before and after each match. Defaults to 0.`},glob:{type:`string`,description:`Filter files by glob pattern (e.g. "*.ts", "*.{ts,tsx}").`},ignoreCase:{type:`boolean`,description:`Perform case-insensitive search. Defaults to false.`},limit:{type:`integer`,minimum:1,maximum:1e3,description:`Maximum number of matches to return per file. Defaults to 100.`},literal:{type:`boolean`,description:`Treat the pattern as a literal string instead of a regular expression. Defaults to false.`},path:{type:`string`,description:`The directory or file to search in: absolute, relative to the workspace root, or beginning with $HOME/. Omit to search the workspace root.`},pattern:{type:`string`,description:`The regex pattern to search for in file contents (e.g. "log.*Error", "function\\s+\\w+").`}},required:[`pattern`],additionalProperties:!1}),GREP_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},matchCount:{type:`integer`},path:{type:`string`},truncated:{type:`boolean`}},required:[`content`,`matchCount`,`path`,`truncated`],additionalProperties:!1}),grep=frameworkTool(defineTool({label:{start:e=>toolLabel(`Search`,e.pattern)},description:[`Fast content search tool that works with any codebase size.`,``,`Usage:`,`- Searches file contents using regular expressions.`,`- Supports full regex syntax (e.g. "log.*Error", "function\\s+\\w+").`,`- Filter files by pattern with the glob parameter (e.g. "*.js", "*.{ts,tsx}").`,`- Returns matching lines with file paths and line numbers.`,`- Call this tool in parallel when you have multiple independent searches.`,`- Any line longer than 2000 characters is truncated.`].join(`
2
2
  `),async execute(e,t){return await executeGrepOnSandbox(await t.getSandbox(),e)},inputSchema:GREP_INPUT_SCHEMA,outputSchema:GREP_OUTPUT_SCHEMA}));export{GREP_INPUT_SCHEMA,GREP_OUTPUT_SCHEMA,grep as default,grep};
@@ -1,2 +1,2 @@
1
- import{frameworkTool}from"./framework-tool.js";import{contextStorage}from"#context/container.js";import{SandboxKey}from"#context/keys.js";import{basename}from"node:path";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{resolveAbsoluteFilePath}from"#execution/sandbox/require-sandbox.js";import{toolLabel}from"#tools/tool-label.js";import{toolOutput,toolOutputPart}from"#tools/model-output.js";import{executeReadFileOnSandbox}from"#execution/sandbox/read-file.js";const READ_FILE_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{filePath:{type:`string`,description:`The absolute path to the file to read. A leading $HOME is supported.`},limit:{type:`integer`,minimum:1,description:`Maximum number of lines to return. Defaults to 2000.`},offset:{type:`integer`,minimum:1,description:`1-based line number to start from. Defaults to 1.`}},required:[`filePath`],additionalProperties:!1}),READ_FILE_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},file:{type:`object`,properties:{height:{type:`integer`,minimum:1},mediaType:{type:`string`},pages:{type:`integer`,minimum:1},size:{type:`integer`,minimum:0},width:{type:`integer`,minimum:1}},required:[`mediaType`,`size`],additionalProperties:!1},nextOffset:{type:`integer`,minimum:1},path:{type:`string`},totalLines:{type:`integer`,minimum:0},truncated:{type:`boolean`}},required:[`content`,`path`,`totalLines`,`truncated`],additionalProperties:!1}),readFile=frameworkTool(defineTool({label:{start:e=>toolLabel(`Read`,e.filePath)},description:[`Read a file from the local filesystem. If the path does not exist, an error is returned.`,``,`Usage:`,`- The filePath parameter should be an absolute path or begin with $HOME/.`,`- By default, this tool returns up to 2000 lines from the start of the file.`,`- The offset parameter is the line number to start from (1-indexed).`,`- To read later sections, call this tool again with a larger offset.`,'- Contents are returned with each line prefixed by its line number as `<line>: <content>`. For example, if a file has contents "foo\\n", you will receive "1: foo\\n".',`- Any line longer than 2000 characters is truncated.`,"- PNG, JPEG, GIF, and WebP images up to 3 MiB and PDFs up to 20 MiB are shown to you as files, including files named in `Attached file <path>` references.",`- Call this tool in parallel when you know there are multiple files you want to read.`,`- Avoid tiny repeated slices (30 line chunks). If you need more context, read a larger window.`].join(`
1
+ import{frameworkTool}from"./framework-tool.js";import{contextStorage}from"#context/container.js";import{SandboxKey}from"#context/keys.js";import{basename}from"node:path";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{resolveAbsoluteFilePath}from"#execution/sandbox/require-sandbox.js";import{toolLabel}from"#tools/tool-label.js";import{toolOutput,toolOutputPart}from"#tools/model-output.js";import{executeReadFileOnSandbox}from"#execution/sandbox/read-file.js";const READ_FILE_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{filePath:{type:`string`,description:`The path to the file to read: absolute, relative to the workspace root, or beginning with $HOME/.`},limit:{type:`integer`,minimum:1,description:`Maximum number of lines to return. Defaults to 2000.`},offset:{type:`integer`,minimum:1,description:`1-based line number to start from. Defaults to 1.`}},required:[`filePath`],additionalProperties:!1}),READ_FILE_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`},file:{type:`object`,properties:{height:{type:`integer`,minimum:1},mediaType:{type:`string`},pages:{type:`integer`,minimum:1},size:{type:`integer`,minimum:0},width:{type:`integer`,minimum:1}},required:[`mediaType`,`size`],additionalProperties:!1},nextOffset:{type:`integer`,minimum:1},path:{type:`string`},totalLines:{type:`integer`,minimum:0},truncated:{type:`boolean`}},required:[`content`,`path`,`totalLines`,`truncated`],additionalProperties:!1}),readFile=frameworkTool(defineTool({label:{start:e=>toolLabel(`Read`,e.filePath)},description:[`Read a file from the local filesystem. If the path does not exist, an error is returned.`,``,`Usage:`,"- The filePath parameter is an absolute path, a path relative to the workspace root (where `bash` commands start), or a path beginning with $HOME/.",`- By default, this tool returns up to 2000 lines from the start of the file.`,`- The offset parameter is the line number to start from (1-indexed).`,`- To read later sections, call this tool again with a larger offset.`,'- Contents are returned with each line prefixed by its line number as `<line>: <content>`. For example, if a file has contents "foo\\n", you will receive "1: foo\\n".',`- Any line longer than 2000 characters is truncated.`,"- PNG, JPEG, GIF, and WebP images up to 3 MiB and PDFs up to 20 MiB are shown to you as files, including files named in `Attached file <path>` references.",`- Call this tool in parallel when you know there are multiple files you want to read.`,`- Avoid tiny repeated slices (30 line chunks). If you need more context, read a larger window.`].join(`
2
2
  `),async execute(e,t){return await executeReadFileOnSandbox(await t.getSandbox(),e)},inputSchema:READ_FILE_INPUT_SCHEMA,outputSchema:READ_FILE_OUTPUT_SCHEMA,async toModelOutput(e){if(e.file===void 0)return toolOutput.json(e);let t=await contextStorage.getStore()?.get(SandboxKey)?.get(),n=t==null?null:await t.readBinaryFile({path:await resolveAbsoluteFilePath(t,e.path)});return n===null?toolOutput.text(`${e.content} The file could not be loaded.`):n.byteLength===e.file.size?toolOutput.content([toolOutputPart.text(e.content),toolOutputPart.file(Buffer.from(n).toString(`base64`),{filename:basename(e.path),mediaType:e.file.mediaType})]):toolOutput.text(`${e.content} The file changed after it was read; read it again.`)}}));export{READ_FILE_INPUT_SCHEMA,READ_FILE_OUTPUT_SCHEMA,readFile as default,readFile};
@@ -1 +1 @@
1
- import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";if(t.abortSignal.aborted)return{interrupted:!0};let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.82.0//executeSleepTool`;export{executeSleepTool};
1
+ import{sleep}from"#compiled/@workflow/core/index.js";async function executeSleepTool(e,t){"use workflow";if(t.abortSignal.aborted)return{interrupted:!0};let n=new Promise(e=>t.abortSignal.addEventListener(`abort`,()=>e(`interrupted`),{once:!0})),r=sleep(Math.ceil(e.seconds*1e3)).then(()=>`elapsed`);return await Promise.race([r,n])===`elapsed`?{waitedSeconds:e.seconds}:{interrupted:!0}}executeSleepTool.workflowId=`workflow//eve@0.83.1//executeSleepTool`;export{executeSleepTool};
@@ -1 +1 @@
1
- import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineWorkflowTool}from"#tools/workflow-definition.js";import{DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS,parseWorkflowProgramOptions}from"#execution/dynamic-workflow/schema.js";import{attachWorkflowProgramOptions}from"#tools/workflow-program-input.js";import{runWorkflowProgramTask}from"#execution/dynamic-workflow/tool.js";const workflowProgramAgentContract=`Call ctx.agent(name, { message: string, outputSchema?: object }). Each call starts a new agent that does not see this conversation, so put everything it needs in message. It resolves directly to the agent's reply; when outputSchema is provided, the reply matches that schema. It does not return an agent metadata wrapper. The owning agent resolves the target and applies its existing availability and authorization checks.`,workflowInputSchema=defineJsonSchema({type:`object`,properties:{js:{type:`string`,description:`JavaScript statements executed inside an async function. Supply only the body, without a surrounding function declaration or arrow function. ${workflowProgramAgentContract} Return one JSON-serializable value.`}},required:[`js`],additionalProperties:!1});function workflow(e={}){let t=normalizeWorkflowToolOptions(e),n=[`Run an async JavaScript function body that invokes agents and returns one JSON-serializable value.`,workflowProgramAgentContract,`Supply the body directly, for example: return await ctx.agent("researcher", { message: "Describe the task" });`,`The program may invoke at most ${String(t.maxSubagents)} agents.`].join(` `);return attachWorkflowProgramOptions(frameworkTool(defineWorkflowTool({description:n,inputSchema:workflowInputSchema,task:runWorkflowProgramTask})),t)}function normalizeWorkflowToolOptions(e){if(typeof e!=`object`||!e)throw TypeError(`workflow options must be an object.`);return parseWorkflowProgramOptions({maxSubagents:e.maxSubagents??DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS})}export{workflow};
1
+ import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineWorkflowTool}from"#tools/workflow-definition.js";import{DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS,parseWorkflowProgramOptions}from"#execution/dynamic-workflow/schema.js";import{attachWorkflowProgramOptions}from"#tools/workflow-program-input.js";import{runWorkflowProgramTask}from"#execution/dynamic-workflow/tool.js";const workflowProgramAgentContract=`Call ctx.agent(name, { message: string, outputSchema?: object }). Each call starts a new agent that does not see this conversation, so put everything it needs in message. It resolves directly to the agent's reply; when outputSchema is provided, the reply matches that schema. It does not return an agent metadata wrapper. The owning agent resolves the target and applies its existing availability and authorization checks.`,workflowInputSchema=defineJsonSchema({type:`object`,properties:{js:{type:`string`,description:`JavaScript statements executed inside an async function. Supply only the body, without a surrounding function declaration or arrow function. ${workflowProgramAgentContract} Return one JSON-serializable value.`}},required:[`js`],additionalProperties:!1});function workflow(e={}){let t=normalizeWorkflowToolOptions(e),n=[`Run an async JavaScript function body that invokes agents and returns one JSON-serializable value.`,workflowProgramAgentContract,`Supply the body directly, for example: return await ctx.agent("researcher", { message: "Describe the task" });`,`Await every ctx.agent call before returning.`,`The program may invoke at most ${String(t.maxSubagents)} agents.`].join(` `);return attachWorkflowProgramOptions(frameworkTool(defineWorkflowTool({description:n,inputSchema:workflowInputSchema,task:runWorkflowProgramTask})),t)}function normalizeWorkflowToolOptions(e){if(typeof e!=`object`||!e)throw TypeError(`workflow options must be an object.`);return parseWorkflowProgramOptions({maxSubagents:e.maxSubagents??DEFAULT_WORKFLOW_PROGRAM_MAX_SUBAGENTS})}export{workflow};