eve 0.81.1 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (687) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/NOTICE +1 -1
  3. package/dist/src/channel/channel-address.d.ts +21 -2
  4. package/dist/src/channel/channel-address.js +1 -1
  5. package/dist/src/channel/channel-operations.d.ts +32 -1
  6. package/dist/src/channel/channel-operations.js +1 -1
  7. package/dist/src/channel/delivery-idempotency.d.ts +4 -0
  8. package/dist/src/channel/delivery-idempotency.js +1 -0
  9. package/dist/src/channel/pending-authorization.d.ts +5 -0
  10. package/dist/src/channel/pending-authorization.js +1 -1
  11. package/dist/src/channel/routes.d.ts +6 -0
  12. package/dist/src/channel/session.d.ts +7 -0
  13. package/dist/src/channel/session.js +1 -1
  14. package/dist/src/channel/types.d.ts +19 -11
  15. package/dist/src/chunks/{use-eve-agent-DLkjJIm3.js → use-eve-agent-3-WRmJkd.js} +76 -5
  16. package/dist/src/chunks/{use-eve-agent-Bp6nbhfV.js → use-eve-agent-Ci5dr0aR.js} +76 -5
  17. package/dist/src/cli/dev/command-options.d.ts +1 -0
  18. package/dist/src/cli/dev/diagnostic-dump.js +1 -1
  19. package/dist/src/cli/dev/local-server-child.js +1 -1
  20. package/dist/src/cli/dev/local-server-cleanup.js +1 -1
  21. package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
  22. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  23. package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
  24. package/dist/src/cli/run.d.ts +1 -0
  25. package/dist/src/cli/run.js +1 -1
  26. package/dist/src/client/eve-agent-store.d.ts +1 -1
  27. package/dist/src/client/eve-agent-store.js +1 -1
  28. package/dist/src/client/index.d.ts +2 -1
  29. package/dist/src/client/message-reducer-types.d.ts +7 -3
  30. package/dist/src/client/message-reducer.js +1 -1
  31. package/dist/src/client/session-controls.d.ts +6 -0
  32. package/dist/src/client/session-controls.js +1 -1
  33. package/dist/src/client/session.d.ts +4 -0
  34. package/dist/src/client/session.js +1 -1
  35. package/dist/src/client/transcript-reducer.d.ts +6 -3
  36. package/dist/src/client/transcript-reducer.js +1 -1
  37. package/dist/src/compiled/.vendor-stamp.json +8 -8
  38. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  39. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
  40. package/dist/src/compiled/@workflow/core/index.js +2 -2
  41. package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
  42. package/dist/src/compiled/@workflow/core/private.js +1 -1
  43. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
  44. package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
  45. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
  46. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  47. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
  48. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
  49. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
  50. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
  51. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  52. package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
  53. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
  54. package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
  55. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  56. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
  57. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  58. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  59. package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
  60. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  61. package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
  62. package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
  63. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  64. package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
  65. package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
  66. package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
  67. package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
  68. package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
  69. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  70. package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
  71. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
  72. package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
  73. package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
  74. package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
  75. package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
  76. package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
  77. package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
  78. package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
  79. package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
  80. package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
  81. package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
  82. package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
  83. package/dist/src/compiled/run/index.d.ts +384 -0
  84. package/dist/src/compiled/run/index.js +650 -0
  85. package/dist/src/compiler/extension-compatibility.d.ts +28 -20
  86. package/dist/src/compiler/extension-compatibility.js +1 -1
  87. package/dist/src/compiler/load-binding-namespace.d.ts +2 -0
  88. package/dist/src/compiler/load-binding-namespace.js +1 -1
  89. package/dist/src/compiler/manifest.js +1 -1
  90. package/dist/src/compiler/module-lifecycle.d.ts +1 -1
  91. package/dist/src/compiler/module-lifecycle.js +1 -1
  92. package/dist/src/compiler/module-map.js +1 -1
  93. package/dist/src/compiler/normalize-agent-config.js +1 -1
  94. package/dist/src/compiler/normalize-manifest.js +1 -1
  95. package/dist/src/compiler/normalize-sandbox.js +1 -1
  96. package/dist/src/compiler/project-sources.d.ts +6 -0
  97. package/dist/src/compiler/project-sources.js +1 -1
  98. package/dist/src/compiler/workspace-resources.js +1 -1
  99. package/dist/src/context/build-callback-context.js +1 -1
  100. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  101. package/dist/src/context/keys.d.ts +2 -0
  102. package/dist/src/context/keys.js +1 -1
  103. package/dist/src/context/providers/sandbox.js +1 -1
  104. package/dist/src/discover/extension-specifier.d.ts +1 -0
  105. package/dist/src/discover/extension-specifier.js +1 -1
  106. package/dist/src/evals/cli/eval-state-directory.d.ts +7 -0
  107. package/dist/src/evals/cli/eval-state-directory.js +1 -0
  108. package/dist/src/evals/cli/eval.js +2 -2
  109. package/dist/src/evals/runner/artifacts.js +1 -1
  110. package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
  111. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  112. package/dist/src/evals/runner/execute-task.js +1 -1
  113. package/dist/src/evals/types.d.ts +3 -2
  114. package/dist/src/eve-channel/index.js +1 -1
  115. package/dist/src/eve-channel/request.d.ts +0 -1
  116. package/dist/src/eve-channel/request.js +2 -2
  117. package/dist/src/eve-channel/support.d.ts +2 -0
  118. package/dist/src/eve-channel/support.js +1 -1
  119. package/dist/src/eve-channel/types.d.ts +7 -0
  120. package/dist/src/execution/agent-sessions/context.d.ts +3 -14
  121. package/dist/src/execution/agent-sessions/context.js +1 -1
  122. package/dist/src/execution/agent-sessions/runtime-overrides.d.ts +5 -0
  123. package/dist/src/execution/agent-sessions/session.d.ts +2 -2
  124. package/dist/src/execution/agent-sessions/session.js +1 -1
  125. package/dist/src/execution/agent-sessions/steps.d.ts +2 -0
  126. package/dist/src/execution/agent-sessions/steps.js +1 -1
  127. package/dist/src/execution/coordination-dispatch-shared.d.ts +8 -5
  128. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  129. package/dist/src/execution/coordination-dispatch-step.d.ts +17 -2
  130. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  131. package/dist/src/execution/create-session-step.d.ts +5 -2
  132. package/dist/src/execution/create-session-step.js +1 -1
  133. package/dist/src/execution/deliver-payloads.js +1 -1
  134. package/dist/src/execution/durable-session-store.d.ts +0 -1
  135. package/dist/src/execution/dynamic-connection-recovery.js +1 -1
  136. package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
  137. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  138. package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
  139. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  140. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  141. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  142. package/dist/src/execution/effective-agent-config.d.ts +8 -2
  143. package/dist/src/execution/effective-agent-config.js +1 -1
  144. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
  145. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  146. package/dist/src/execution/install-workflow-deployment-id.d.ts +3 -0
  147. package/dist/src/execution/install-workflow-deployment-id.js +1 -0
  148. package/dist/src/execution/invoke-tool.js +1 -1
  149. package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
  150. package/dist/src/execution/node-step.d.ts +1 -0
  151. package/dist/src/execution/node-step.js +1 -1
  152. package/dist/src/execution/runtime-context.d.ts +2 -0
  153. package/dist/src/execution/runtime-context.js +1 -1
  154. package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
  155. package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
  156. package/dist/src/execution/sandbox/active-connections.js +1 -0
  157. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
  158. package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
  159. package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
  160. package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
  161. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
  162. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  163. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
  164. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
  165. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
  166. package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
  167. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  168. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
  169. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  170. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
  171. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  172. package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
  173. package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
  174. package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
  175. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  176. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
  177. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  178. package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
  179. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
  180. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  181. package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
  182. package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
  183. package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
  184. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  185. package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
  186. package/dist/src/execution/sandbox/development-run.d.ts +0 -2
  187. package/dist/src/execution/sandbox/development-run.js +1 -1
  188. package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
  189. package/dist/src/execution/sandbox/dockerfile.js +1 -1
  190. package/dist/src/execution/sandbox/ensure.d.ts +23 -11
  191. package/dist/src/execution/sandbox/ensure.js +1 -1
  192. package/dist/src/execution/sandbox/glob-tool.js +3 -3
  193. package/dist/src/execution/sandbox/grep-tool.js +1 -1
  194. package/dist/src/execution/sandbox/logging-session.js +1 -1
  195. package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
  196. package/dist/src/execution/sandbox/prewarm.js +2 -1
  197. package/dist/src/execution/sandbox/read-file.js +1 -1
  198. package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
  199. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  200. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
  201. package/dist/src/execution/sandbox/session.d.ts +10 -20
  202. package/dist/src/execution/sandbox/session.js +2 -2
  203. package/dist/src/execution/session/active-turn.js +1 -1
  204. package/dist/src/execution/session/admission.js +1 -1
  205. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  206. package/dist/src/execution/session/entry-input.d.ts +5 -6
  207. package/dist/src/execution/session/entry.js +1 -1
  208. package/dist/src/execution/session/finalization.js +1 -1
  209. package/dist/src/execution/session/handoff-state.d.ts +5 -0
  210. package/dist/src/execution/session/handoff-state.js +1 -0
  211. package/dist/src/execution/session/handoff-steps.d.ts +0 -5
  212. package/dist/src/execution/session/handoff-steps.js +1 -1
  213. package/dist/src/execution/session/handoff.d.ts +7 -9
  214. package/dist/src/execution/session/handoff.js +1 -1
  215. package/dist/src/execution/session/input-queue.d.ts +8 -1
  216. package/dist/src/execution/session/input-queue.js +1 -1
  217. package/dist/src/execution/session/next-input.d.ts +3 -0
  218. package/dist/src/execution/session/next-input.js +1 -1
  219. package/dist/src/execution/session/pending-history.d.ts +5 -0
  220. package/dist/src/execution/session/pending-history.js +1 -0
  221. package/dist/src/execution/session/pending-turn-state.js +1 -1
  222. package/dist/src/execution/session/program.d.ts +1 -1
  223. package/dist/src/execution/session/program.js +1 -1
  224. package/dist/src/execution/session/timeout-control.d.ts +22 -4
  225. package/dist/src/execution/session/timeout-control.js +1 -1
  226. package/dist/src/execution/session/timeout.d.ts +1 -2
  227. package/dist/src/execution/session/timeout.js +1 -1
  228. package/dist/src/execution/session/turn-control.d.ts +5 -2
  229. package/dist/src/execution/session/turn-control.js +1 -1
  230. package/dist/src/execution/session/turn-event-handler.js +1 -1
  231. package/dist/src/execution/session/turn-step-result.js +1 -1
  232. package/dist/src/execution/session/turn-step.js +1 -1
  233. package/dist/src/execution/session/turn-waiting-step.js +1 -1
  234. package/dist/src/execution/session/turn.js +1 -1
  235. package/dist/src/execution/session-inbox/inbox.d.ts +9 -1
  236. package/dist/src/execution/session-inbox/inbox.js +1 -1
  237. package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
  238. package/dist/src/execution/session-inbox/protocol.js +1 -1
  239. package/dist/src/execution/session-inbox/resume.d.ts +2 -1
  240. package/dist/src/execution/session-inbox/resume.js +1 -1
  241. package/dist/src/execution/session-prewarm.d.ts +8 -0
  242. package/dist/src/execution/session-prewarm.js +1 -0
  243. package/dist/src/execution/session.d.ts +0 -12
  244. package/dist/src/execution/session.js +2 -2
  245. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  246. package/dist/src/execution/skills/instructions.js +1 -1
  247. package/dist/src/execution/tasks/model-step.js +1 -1
  248. package/dist/src/execution/tasks/start.d.ts +4 -4
  249. package/dist/src/execution/tasks/start.js +1 -1
  250. package/dist/src/execution/tasks/steps.js +1 -1
  251. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  252. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  253. package/dist/src/execution/tools/workflow/body.d.ts +2 -2
  254. package/dist/src/execution/tools/workflow/body.js +1 -1
  255. package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
  256. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  257. package/dist/src/execution/tools/workflow/step.js +1 -1
  258. package/dist/src/execution/workflow-runtime.d.ts +5 -1
  259. package/dist/src/execution/workflow-runtime.js +1 -1
  260. package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
  261. package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
  262. package/dist/src/harness/attachment-staging.d.ts +0 -7
  263. package/dist/src/harness/attachment-staging.js +1 -1
  264. package/dist/src/harness/hitl/approvals.js +1 -1
  265. package/dist/src/harness/hitl/budget-request.d.ts +12 -6
  266. package/dist/src/harness/hitl/budget-request.js +1 -1
  267. package/dist/src/harness/hitl/budget.d.ts +7 -1
  268. package/dist/src/harness/hitl/budget.js +1 -1
  269. package/dist/src/harness/hitl/coordinator.js +1 -1
  270. package/dist/src/harness/hitl/delivery.d.ts +1 -1
  271. package/dist/src/harness/hitl/delivery.js +1 -1
  272. package/dist/src/harness/hitl/index.d.ts +2 -1
  273. package/dist/src/harness/hitl/index.js +1 -1
  274. package/dist/src/harness/hitl/intake.d.ts +2 -2
  275. package/dist/src/harness/hitl/intake.js +1 -1
  276. package/dist/src/harness/hitl/view.d.ts +1 -0
  277. package/dist/src/harness/hitl/view.js +1 -0
  278. package/dist/src/harness/messages.d.ts +5 -0
  279. package/dist/src/harness/messages.js +1 -1
  280. package/dist/src/harness/model-call/call.d.ts +2 -2
  281. package/dist/src/harness/model-call/request.d.ts +2 -2
  282. package/dist/src/harness/model-call/run.js +1 -1
  283. package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
  284. package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
  285. package/dist/src/harness/session-machine/transitions.d.ts +3 -1
  286. package/dist/src/harness/session-machine/transitions.js +1 -1
  287. package/dist/src/harness/step/context.d.ts +3 -0
  288. package/dist/src/harness/step/context.js +1 -1
  289. package/dist/src/harness/step/intake.d.ts +5 -2
  290. package/dist/src/harness/step/intake.js +1 -1
  291. package/dist/src/harness/step/prompt.js +1 -1
  292. package/dist/src/harness/tool-history-repair.d.ts +9 -0
  293. package/dist/src/harness/tool-history-repair.js +1 -0
  294. package/dist/src/harness/tool-loop.js +1 -1
  295. package/dist/src/harness/tool-model-output.d.ts +19 -3
  296. package/dist/src/harness/tool-model-output.js +1 -1
  297. package/dist/src/harness/turn-tag-state.d.ts +7 -26
  298. package/dist/src/harness/turn-tag-state.js +1 -1
  299. package/dist/src/harness/types.d.ts +10 -25
  300. package/dist/src/internal/application/build-profile.d.ts +3 -0
  301. package/dist/src/internal/application/build-profile.js +1 -1
  302. package/dist/src/internal/application/compiled-artifacts.js +10 -6
  303. package/dist/src/internal/application/dev-environment.d.ts +13 -0
  304. package/dist/src/internal/application/dev-environment.js +1 -1
  305. package/dist/src/internal/application/optional-package-import.d.ts +10 -0
  306. package/dist/src/internal/application/optional-package-import.js +1 -1
  307. package/dist/src/internal/application/stamped-package-version.js +1 -1
  308. package/dist/src/internal/attachments/limited-read.d.ts +2 -2
  309. package/dist/src/internal/authored-definition/core.js +1 -1
  310. package/dist/src/internal/authored-module-build-options.d.ts +13 -0
  311. package/dist/src/internal/authored-module-build-options.js +1 -0
  312. package/dist/src/internal/authored-module-cache.d.ts +10 -0
  313. package/dist/src/internal/authored-module-cache.js +1 -0
  314. package/dist/src/internal/authored-module-graph.d.ts +13 -0
  315. package/dist/src/internal/authored-module-graph.js +1 -0
  316. package/dist/src/internal/authored-module-loader.d.ts +22 -1
  317. package/dist/src/internal/authored-module-loader.js +1 -3
  318. package/dist/src/internal/authored-module.d.ts +7 -0
  319. package/dist/src/internal/authored-module.js +1 -1
  320. package/dist/src/internal/authored-package-boundary.js +1 -1
  321. package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
  322. package/dist/src/internal/bundler/nitro-rolldown.d.ts +8 -2
  323. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  324. package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
  325. package/dist/src/internal/bundler/pseudo-packages.js +1 -0
  326. package/dist/src/internal/development-programmatic-source-loader.d.ts +1 -0
  327. package/dist/src/internal/development-programmatic-source-loader.js +1 -1
  328. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  329. package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -1
  330. package/dist/src/internal/nitro/host/build-application.js +1 -1
  331. package/dist/src/internal/nitro/host/build-deployment-id.d.ts +8 -0
  332. package/dist/src/internal/nitro/host/build-deployment-id.js +1 -0
  333. package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
  334. package/dist/src/internal/nitro/host/build-extension.js +2 -2
  335. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
  336. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
  337. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
  338. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  339. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
  340. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  341. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  342. package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
  343. package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
  344. package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
  345. package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
  346. package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
  347. package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
  348. package/dist/src/internal/nitro/host/dev-server-state.js +1 -1
  349. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
  350. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
  351. package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
  352. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  353. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
  354. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
  355. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  356. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  357. package/dist/src/internal/nitro/host/skill-server-assets.js +1 -1
  358. package/dist/src/internal/nitro/host/stage-build-deployment-id.d.ts +2 -0
  359. package/dist/src/internal/nitro/host/stage-build-deployment-id.js +1 -0
  360. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  361. package/dist/src/internal/nitro/host/start-production-server.d.ts +1 -0
  362. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  363. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  364. package/dist/src/internal/nitro/host.js +1 -1
  365. package/dist/src/internal/nitro/routes/schedule-task.d.ts +3 -0
  366. package/dist/src/internal/nitro/routes/schedule-task.js +1 -1
  367. package/dist/src/internal/programmatic-source-loader.d.ts +1 -0
  368. package/dist/src/internal/programmatic-source-loader.js +1 -1
  369. package/dist/src/internal/schedules/disabled.d.ts +2 -0
  370. package/dist/src/internal/schedules/disabled.js +1 -0
  371. package/dist/src/internal/workflow/development-world-server.js +1 -1
  372. package/dist/src/internal/workflow/local-world-data-directory.d.ts +2 -1
  373. package/dist/src/internal/workflow/local-world-data-directory.js +1 -1
  374. package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
  375. package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
  376. package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
  377. package/dist/src/internal/workflow/queue-namespace.js +1 -1
  378. package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
  379. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  380. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  381. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
  382. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  383. package/dist/src/protocol/message.d.ts +27 -1
  384. package/dist/src/protocol/message.js +2 -2
  385. package/dist/src/protocol/prewarm-session.d.ts +14 -0
  386. package/dist/src/protocol/prewarm-session.js +1 -0
  387. package/dist/src/protocol/routes.d.ts +2 -2
  388. package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +13 -0
  389. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  390. package/dist/src/public/channels/chat-sdk/fetch-message.d.ts +10 -0
  391. package/dist/src/public/channels/chat-sdk/fetch-message.js +1 -0
  392. package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
  393. package/dist/src/public/channels/chat-sdk/reply-context.d.ts +15 -0
  394. package/dist/src/public/channels/chat-sdk/reply-context.js +2 -0
  395. package/dist/src/public/channels/discord/authorization.d.ts +45 -0
  396. package/dist/src/public/channels/discord/authorization.js +3 -0
  397. package/dist/src/public/channels/discord/defaults.d.ts +14 -3
  398. package/dist/src/public/channels/discord/defaults.js +2 -2
  399. package/dist/src/public/channels/discord/discordChannel.d.ts +18 -1
  400. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  401. package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
  402. package/dist/src/public/channels/discord/gateway/connection.js +1 -0
  403. package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
  404. package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
  405. package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
  406. package/dist/src/public/channels/discord/gateway/index.js +1 -0
  407. package/dist/src/public/channels/discord/inbound.d.ts +10 -3
  408. package/dist/src/public/channels/discord/inbound.js +2 -2
  409. package/dist/src/public/channels/discord/index.d.ts +3 -2
  410. package/dist/src/public/channels/discord/index.js +1 -1
  411. package/dist/src/public/channels/discord/messages.d.ts +116 -0
  412. package/dist/src/public/channels/discord/messages.js +2 -0
  413. package/dist/src/public/channels/github/checkout.js +1 -1
  414. package/dist/src/public/channels/github/dispatch.js +1 -1
  415. package/dist/src/public/channels/github/githubChannel.d.ts +3 -0
  416. package/dist/src/public/channels/imessage-tapbacks.d.ts +74 -0
  417. package/dist/src/public/channels/imessage-tapbacks.js +1 -0
  418. package/dist/src/public/channels/index.d.ts +2 -1
  419. package/dist/src/public/channels/index.js +1 -1
  420. package/dist/src/public/channels/linear/linearChannel.d.ts +3 -0
  421. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  422. package/dist/src/public/channels/linq/inboundContent.d.ts +7 -0
  423. package/dist/src/public/channels/linq/inboundContent.js +1 -1
  424. package/dist/src/public/channels/linq/index.d.ts +1 -0
  425. package/dist/src/public/channels/linq/index.js +1 -1
  426. package/dist/src/public/channels/linq/linqChannel.d.ts +21 -2
  427. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  428. package/dist/src/public/channels/photon/inboundContent.d.ts +7 -0
  429. package/dist/src/public/channels/photon/inboundContent.js +2 -1
  430. package/dist/src/public/channels/photon/index.d.ts +1 -0
  431. package/dist/src/public/channels/photon/index.js +1 -1
  432. package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +17 -1
  433. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  434. package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
  435. package/dist/src/public/channels/same-environment-oidc.js +1 -0
  436. package/dist/src/public/channels/slack/api.d.ts +6 -0
  437. package/dist/src/public/channels/slack/api.js +1 -1
  438. package/dist/src/public/channels/slack/model-context.d.ts +7 -0
  439. package/dist/src/public/channels/slack/model-context.js +1 -1
  440. package/dist/src/public/channels/slack/reply-delivery.d.ts +5 -0
  441. package/dist/src/public/channels/slack/reply-delivery.js +1 -1
  442. package/dist/src/public/channels/slack/slackChannel.d.ts +17 -3
  443. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  444. package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -0
  445. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  446. package/dist/src/public/channels/telegram/telegramChannel.d.ts +3 -0
  447. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  448. package/dist/src/public/definitions/agent.d.ts +1 -1
  449. package/dist/src/public/definitions/channel.d.ts +2 -2
  450. package/dist/src/public/definitions/channel.js +1 -1
  451. package/dist/src/public/definitions/hook.d.ts +1 -0
  452. package/dist/src/public/definitions/sandbox.d.ts +1 -1
  453. package/dist/src/public/index.d.ts +1 -1
  454. package/dist/src/public/next/server.js +1 -1
  455. package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
  456. package/dist/src/public/sandbox/docker.d.ts +1 -8
  457. package/dist/src/public/sandbox/index.d.ts +3 -3
  458. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
  459. package/dist/src/public/sandbox/just-bash.d.ts +1 -1
  460. package/dist/src/public/sandbox/provider.d.ts +5 -1
  461. package/dist/src/public/sandbox/provider.js +1 -1
  462. package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
  463. package/dist/src/public/sandbox/vercel.d.ts +0 -1
  464. package/dist/src/public/sandbox/vercel.js +1 -1
  465. package/dist/src/public/tools/agent.d.ts +8 -1
  466. package/dist/src/public/tools/agent.js +1 -1
  467. package/dist/src/public/tools/index.d.ts +1 -1
  468. package/dist/src/react/use-eve-agent.d.ts +1 -1
  469. package/dist/src/runtime/agent/resolve-model.d.ts +4 -0
  470. package/dist/src/runtime/agent/resolve-model.js +1 -1
  471. package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
  472. package/dist/src/runtime/connections/openapi-client.js +1 -1
  473. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  474. package/dist/src/runtime/resolve-agent.js +1 -1
  475. package/dist/src/runtime/resolve-channel.js +1 -1
  476. package/dist/src/runtime/resolve-sandbox.js +1 -1
  477. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  478. package/dist/src/runtime/sandbox/registry.d.ts +2 -0
  479. package/dist/src/runtime/sandbox/registry.js +1 -1
  480. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  481. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -1
  482. package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
  483. package/dist/src/runtime/subagents/workflow.d.ts +6 -0
  484. package/dist/src/runtime/subagents/workflow.js +1 -1
  485. package/dist/src/runtime/types.d.ts +3 -2
  486. package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
  487. package/dist/src/runtime/workspace/seed-files.js +1 -1
  488. package/dist/src/runtime/workspace/spec.d.ts +1 -1
  489. package/dist/src/runtime/workspace/spec.js +1 -1
  490. package/dist/src/runtime/workspace/types.d.ts +2 -6
  491. package/dist/src/sandbox/provider.d.ts +185 -0
  492. package/dist/src/sandbox/provider.js +1 -0
  493. package/dist/src/sandbox/providers/default.d.ts +20 -19
  494. package/dist/src/sandbox/providers/default.js +1 -1
  495. package/dist/src/sandbox/providers/docker.d.ts +5 -2
  496. package/dist/src/sandbox/providers/docker.js +1 -1
  497. package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
  498. package/dist/src/sandbox/providers/just-bash.js +1 -1
  499. package/dist/src/sandbox/providers/vercel.d.ts +4 -10
  500. package/dist/src/sandbox/providers/vercel.js +1 -1
  501. package/dist/src/sandbox/providers.d.ts +0 -1
  502. package/dist/src/sandbox/providers.js +1 -1
  503. package/dist/src/sandbox/state.d.ts +44 -0
  504. package/dist/src/sandbox/state.js +1 -1
  505. package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
  506. package/dist/src/self-modification/deployed-sandbox.js +1 -1
  507. package/dist/src/self-modification/filesystem.d.ts +3 -3
  508. package/dist/src/self-modification/remote/config.d.ts +2 -2
  509. package/dist/src/self-modification/remote/config.js +1 -1
  510. package/dist/src/self-modification/setup.d.ts +0 -1
  511. package/dist/src/self-modification/setup.js +8 -8
  512. package/dist/src/setup/integrations/discord/api.d.ts +7 -0
  513. package/dist/src/setup/integrations/discord/api.js +1 -1
  514. package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
  515. package/dist/src/setup/integrations/discord/daemon.js +21 -0
  516. package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
  517. package/dist/src/setup/integrations/discord/setup.js +5 -4
  518. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  519. package/dist/src/setup/scaffold/create/project.js +1 -1
  520. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  521. package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
  522. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  523. package/dist/src/shared/agent-definition.d.ts +33 -42
  524. package/dist/src/shared/built-server-start-failure.d.ts +12 -0
  525. package/dist/src/shared/built-server-start-failure.js +3 -0
  526. package/dist/src/shared/framework-eve-server.d.ts +2 -0
  527. package/dist/src/shared/framework-eve-server.js +2 -2
  528. package/dist/src/shared/sandbox-environment.d.ts +4 -10
  529. package/dist/src/shared/sandbox-environment.js +1 -1
  530. package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
  531. package/dist/src/shared/sandbox-provider.d.ts +0 -103
  532. package/dist/src/shared/sandbox-provider.js +1 -1
  533. package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
  534. package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
  535. package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
  536. package/dist/src/shared/sandbox-session-gone-error.js +1 -0
  537. package/dist/src/shared/sandbox-session.d.ts +97 -83
  538. package/dist/src/shared/sandbox-template-error.d.ts +19 -4
  539. package/dist/src/shared/sandbox-template-error.js +1 -1
  540. package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
  541. package/dist/src/shared/sandbox-tool-session-error.js +1 -0
  542. package/dist/src/shared/session-history.d.ts +22 -0
  543. package/dist/src/shared/session-history.js +1 -0
  544. package/dist/src/shared/skill-package.js +1 -1
  545. package/dist/src/shared/skill-paths.d.ts +4 -5
  546. package/dist/src/shared/skill-paths.js +2 -2
  547. package/dist/src/shared/workflow-sandbox.d.ts +4 -41
  548. package/dist/src/shared/workflow-sandbox.js +1 -1
  549. package/dist/src/subagents/tool.d.ts +1 -3
  550. package/dist/src/subagents/tool.js +1 -1
  551. package/dist/src/svelte/index.js +1 -1
  552. package/dist/src/svelte/use-eve-agent.d.ts +1 -1
  553. package/dist/src/svelte/use-eve-agent.js +1 -1
  554. package/dist/src/tools/model-output.d.ts +23 -5
  555. package/dist/src/tools/model-output.js +1 -1
  556. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  557. package/dist/src/tools/provided/glob.js +1 -1
  558. package/dist/src/tools/provided/grep.js +1 -1
  559. package/dist/src/tools/provided/read-file.js +1 -1
  560. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  561. package/dist/src/tools/provided/workflow.js +1 -1
  562. package/dist/src/tools/provided/write-file.js +1 -1
  563. package/dist/src/tools/workflow-definition.d.ts +33 -5
  564. package/dist/src/tracing/eve/conversation-context.d.ts +4 -1
  565. package/dist/src/tracing/eve/conversation-context.js +1 -1
  566. package/dist/src/tracing/eve/invoke-tool-span.js +1 -1
  567. package/dist/src/tracing/eve/operation-input.d.ts +0 -5
  568. package/dist/src/tracing/eve/operation-input.js +1 -1
  569. package/dist/src/tracing/eve/otel-registration.js +1 -1
  570. package/dist/src/tracing/eve/session.d.ts +3 -2
  571. package/dist/src/tracing/eve/session.js +1 -1
  572. package/dist/src/vue/index.js +1 -1
  573. package/dist/src/vue/use-eve-agent.d.ts +1 -1
  574. package/dist/src/vue/use-eve-agent.js +1 -1
  575. package/docs/agent-config.md +86 -65
  576. package/docs/channels/chat-sdk.mdx +6 -1
  577. package/docs/channels/custom.mdx +41 -9
  578. package/docs/channels/discord.mdx +279 -7
  579. package/docs/channels/eve.mdx +58 -1
  580. package/docs/channels/linq.mdx +53 -2
  581. package/docs/channels/mcp.mdx +2 -2
  582. package/docs/channels/overview.mdx +1 -1
  583. package/docs/channels/photon.mdx +65 -1
  584. package/docs/channels/slack.mdx +4 -2
  585. package/docs/concepts/built-in-tools.md +32 -9
  586. package/docs/concepts/execution-model-and-durability.mdx +15 -103
  587. package/docs/concepts/security-model.md +2 -0
  588. package/docs/concepts/sessions-runs-and-streaming.md +52 -43
  589. package/docs/connections/openapi.mdx +2 -0
  590. package/docs/connections/overview.mdx +1 -1
  591. package/docs/evals/reporters.mdx +1 -1
  592. package/docs/evals/running.mdx +1 -1
  593. package/docs/experimental/dynamic-schedules.mdx +186 -0
  594. package/docs/experimental/meta.json +4 -0
  595. package/docs/guides/client/messages.mdx +1 -1
  596. package/docs/guides/client/streaming.mdx +1 -0
  597. package/docs/guides/deployment/overview.md +4 -4
  598. package/docs/guides/deployment/self-hosting.md +53 -1
  599. package/docs/guides/dev-tui.md +1 -1
  600. package/docs/guides/dynamic-capabilities.md +1 -1
  601. package/docs/guides/frontend/overview.mdx +26 -6
  602. package/docs/guides/hooks.md +21 -1
  603. package/docs/guides/instrumentation/agent-runs.mdx +16 -0
  604. package/docs/guides/self-modification.md +1 -1
  605. package/docs/guides/session-context.md +1 -1
  606. package/docs/instructions.mdx +1 -1
  607. package/docs/memory/overview.mdx +2 -1
  608. package/docs/patterns/dynamic-scheduling.md +3 -1
  609. package/docs/reference/agent-files.md +3 -3
  610. package/docs/reference/cli.md +21 -9
  611. package/docs/reference/typescript-api.md +9 -3
  612. package/docs/sandbox/custom-providers.mdx +254 -0
  613. package/docs/sandbox/default.mdx +71 -4
  614. package/docs/sandbox/docker.mdx +15 -3
  615. package/docs/sandbox/index.mdx +27 -103
  616. package/docs/sandbox/just-bash.mdx +54 -0
  617. package/docs/sandbox/meta.json +9 -1
  618. package/docs/sandbox/troubleshooting.mdx +215 -0
  619. package/docs/sandbox/vercel.mdx +48 -7
  620. package/docs/schedules.mdx +2 -0
  621. package/docs/skills.mdx +1 -1
  622. package/docs/subagents/index.mdx +3 -1
  623. package/docs/tools/overview.mdx +21 -1
  624. package/docs/tools/tasks-upgrade.md +12 -7
  625. package/docs/tools/tasks.md +10 -6
  626. package/docs/tools/workflows.mdx +109 -10
  627. package/docs/tutorial/connect-a-warehouse.mdx +1 -1
  628. package/docs/tutorial/run-analysis.mdx +3 -3
  629. package/package.json +14 -20
  630. package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
  631. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
  632. package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
  633. package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
  634. package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
  635. package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
  636. package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
  637. package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
  638. package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
  639. package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
  640. package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
  641. package/dist/src/execution/run-session-limits.d.ts +0 -12
  642. package/dist/src/execution/run-session-limits.js +0 -1
  643. package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
  644. package/dist/src/execution/sandbox/active-handles.js +0 -1
  645. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
  646. package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
  647. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
  648. package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
  649. package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
  650. package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
  651. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
  652. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
  653. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
  654. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
  655. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
  656. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
  657. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
  658. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
  659. package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
  660. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
  661. package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
  662. package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
  663. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
  664. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
  665. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
  666. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
  667. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
  668. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
  669. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
  670. package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
  671. package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
  672. package/dist/src/execution/sandbox/provider-host-development.js +0 -1
  673. package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
  674. package/dist/src/execution/sandbox/provider-host.js +0 -1
  675. package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
  676. package/dist/src/execution/tool-session/sandbox.js +0 -1
  677. package/dist/src/harness/session-usage-limits.d.ts +0 -49
  678. package/dist/src/harness/session-usage-limits.js +0 -1
  679. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
  680. package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
  681. package/dist/src/public/sandbox/microsandbox.js +0 -1
  682. package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
  683. package/dist/src/sandbox/providers/microsandbox.js +0 -1
  684. package/dist/src/subagents/token-budget.d.ts +0 -15
  685. package/dist/src/subagents/token-budget.js +0 -1
  686. package/docs/sandbox/microsandbox.mdx +0 -31
  687. /package/dist/src/{public/sandbox/microsandbox-sandbox.js → execution/agent-sessions/runtime-overrides.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # eve
2
2
 
3
+ ## 0.83.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 12a1e90: `DefaultSandbox` now selects its provider once, when eve prepares the sandbox, and records the choice in the build: Vercel Sandbox on Vercel, then Docker when a daemon is reachable, then just-bash only in `eve dev` and `eve eval`. The runtime uses the recorded provider instead of probing the host again, so a build and its server can no longer select different providers. A production `eve build` with neither Vercel nor Docker no longer falls back to just-bash: the build succeeds, and opening the sandbox fails with an error that asks you to start Docker and rebuild, deploy to Vercel, or select a provider explicitly.
8
+
9
+ `DefaultSandbox.environment().open()` now accepts `networkPolicy`, and its sessions expose `setNetworkPolicy()`. eve forwards the policy to the selected provider. Docker rejects any policy other than `"allow-all"` or `"deny-all"` when it opens the sandbox, instead of starting the container with open network access, and just-bash rejects any policy other than `"allow-all"`.
10
+
11
+ Sessions now record their sandbox under the provider name `"default"` instead of `vercel`, `docker`, or `just-bash`. Sessions saved by an earlier eve under the provider that `DefaultSandbox` selected resume the same sandbox. When a session's recorded state belongs to another provider or state protocol, for example after you change providers, eve now starts a fresh sandbox instead of failing; the old sandbox is not deleted. This upgrade is one-way: if you roll back to an earlier eve release, sessions created on this release fail to open their sandbox, because earlier releases reject state recorded under `"default"`.
12
+
13
+ `VercelSandbox.environment()` no longer captures a snapshot when the environment has no `prepare` callback, no managed workspace or skill files, and no `source`. Session sandboxes start from the image and install the base runtime themselves, as `DefaultSandbox` already did on Vercel. Such sessions now apply a `networkPolicy` set on the environment after base setup; before, only a policy passed to `open()` applied, so `VercelSandbox.environment({ networkPolicy })` and `DefaultSandbox.environment({ vercel: { networkPolicy } })` could leave a session with open network access.
14
+ - 62112b5: The just-bash sandbox provider now runs on the public `defineSandboxProvider()` API, and `customCommands` and `filesystem` use eve-owned types from `eve/sandbox/just-bash`, such as `JustBashCommand` and `JustBashFilesystem`, that still accept just-bash's `defineCommand()` results and filesystems. Local just-bash templates rebuild once after upgrading, since their keys no longer include custom commands or the filesystem; reading a directory now rejects instead of returning `null`, and a command ending in a `# comment` runs in any working directory.
15
+ - 8b68a92: Remove the microsandbox sandbox provider. The `eve/sandbox/microsandbox` export and the `microsandbox` option on `DefaultSandbox.environment()` are gone, and `DefaultSandbox` now selects Vercel Sandbox on Vercel, then Docker when a daemon is reachable, then just-bash. To migrate, switch `MicrosandboxSandbox.image()` and `MicrosandboxSandbox.dockerfile()` to `DockerSandbox.image()` and `DockerSandbox.dockerfile()` from `eve/sandbox/docker`, and remove the `microsandbox` dependency. A session that recorded a microsandbox sandbox starts a fresh sandbox from its current provider on its next `ctx.getSandbox()`.
16
+
17
+ eve no longer cleans up what microsandbox left on your machine. Before you uninstall `microsandbox`, use its tooling to remove sandboxes and snapshots whose names start with `eve-sbx-`. Then delete `.eve/sandbox-cache/microsandbox` in each app. If you used `MicrosandboxSandbox.dockerfile()`, also run `docker rm -f eve-sandbox-registry` to remove the local image registry it started, and remove the local images tagged `127.0.0.1:51921/eve/…`.
18
+
19
+ Deployed self-modification (`eve/self-modification/remote`) now requires deploying on Vercel. Builds still succeed on any host, but in a deployment outside Vercel the deployed subagent fails with an error that names this requirement when it opens its sandbox.
20
+ - 5b27aa8: **Breaking for custom sandbox providers.** `defineSandboxProvider()` now takes a byte-level `SandboxConnection` (`spawn`, `readFile`, `writeFiles`, `removePath`, `stop`, optional `close` and `extensions`), and eve derives the full sandbox session from it. Built-in providers are unchanged. See the [custom sandbox providers guide](https://eve.dev/docs/sandbox/custom-providers). To migrate a provider:
21
+
22
+ - Return `{ connection, state }` from `start()` and a connection from `resume()`. `onSandboxStop()` and `onRuntimeShutdown()` become `connection.stop()`, and `onSandboxDelete()` folds into `onSessionEnd()` with `reason: "deleted"`.
23
+ - Replace `ctx.resources` and `ctx.sourceRevision` with `ctx.templateKey()` and `ctx.populate()`, and remove your own `prepare` option, which eve now runs. `environment()` receives `{}` instead of `undefined` when no options are passed. Set `toolSessions: true` to support keyed `invokeTool` calls.
24
+ - Rename `SandboxPreparedArtifact` to `SandboxJson`, `SandboxProviderSessionContext` to `SandboxSessionContext`, and `SandboxProviderPrepareContext` to `SandboxPrepareContext`. `SandboxProviderHandle` and the `SandboxProviderResource*` and `SandboxProviderTargetFile` types are removed, as is `ctx.host`.
25
+
26
+ `eve/sandbox/provider` also exports `SandboxSessionGoneError`, `SandboxTemplateNotProvisionedError`, and `SANDBOX_AGENT_ENV`. In `eve/sandbox`, `SandboxSession` gains a required `writeFiles()`, so hand-built sessions such as test doubles need one, and `SandboxNetworkPolicy` is now an eve-owned type rather than the Vercel Sandbox SDK's `NetworkPolicy`.
27
+ - 3f698dd: Sandbox providers now key each sandbox by its session: `start()` must return the existing sandbox for `ctx.session.id` when one exists, and the required `onSessionEnd(ctx, state | null, { reason })` takes no artifact and must delete by key when `state` is `null`. Session end now removes a sandbox even when the session never recorded it, such as one a subagent sharing the sandbox opened first. Built-in providers keep a session's sandbox across rebuilds and open-option changes.
28
+ - 950409f: `VercelSandbox` now runs on the public `defineSandboxProvider()` API, keeping existing sandbox names, session state, and snapshots. Breaking: a relative `workingDirectory` now resolves from `/workspace`, and `eve/sandbox/vercel` no longer re-exports `Drive`, so import it from `@vercel/sandbox` instead.
29
+
30
+ ### Patch Changes
31
+
32
+ - bd050f8: Clearer sandbox error messages. Sandbox errors now say what went wrong and how to fix it, for example when the build and the runtime select different providers, a prepared template is missing, a session's sandbox came from another provider, or the sandbox file does not export its environment.
33
+ - 95571f1: Fix discovery of extension mounts written as `export { default } from "<pkg>"` inside a packaged extension, which `eve extension build` compiles to `import x from "<pkg>"; export { x as default };`.
34
+ - 7066b20: `eve dev` memory no longer grows with every save. Each rebuild now compiles and bundles your agent in a short-lived child process, and each new version of your code is served by a fresh worker, so old copies of authored modules no longer stay loaded. Modules imported by relative path now keep their package's `sideEffects` setting, so identical source bundles the same way on every save; in `"type": "module"` apps, default imports of older CommonJS packages that set `__esModule` now follow Node's rules. Thanks @callicles for reporting this in #5203.
35
+ - dff87bc: `eve dev` now rebuilds once per edit to a source-backed workspace extension. Before, the temporary `.eve-extension-build-*` files from the extension build started a second, unnecessary rebuild.
36
+ - 2b07d0a: The Discord channel can now answer DMs, mentions, and thread replies. `discordChannel({ gateway: {} })` accepts messages forwarded from the Discord Gateway, and `experimental_runDiscordGatewayRelay` from the new `eve/channels/discord/gateway` entry point holds that connection, for example in a Vercel Daemon. In text channels, a mention starts a thread that holds the conversation, and a reply to any bot message continues the session that posted it; set `gateway.startThread: false` to answer in the channel, or return `conversation` or `startThread` from `gateway.onMessage` to decide per message. `defaultDiscordMessageAuth` gives a message's author the same principal `defaultDiscordAuth` gives them for commands and button presses.
37
+ - 87962a0: `eve add channel/discord` now first asks whether people reach the agent through DMs, mentions, and threads, or a slash command. The first scaffolds the Discord Gateway relay in `daemon/`, registers it as a Vercel Daemon in `vercel.json`, enables `gateway` on the channel, turns on the bot's Message Content intent when Discord allows it, and skips registering `/ask`; the second keeps today's slash command setup and is what `--yes` picks. Non-interactive runs answer `discord-messages` with `"gateway"` or `"commands"`.
38
+ - acc76d5: The Discord channel now shows connection sign-ins. In a DM it posts the sign-in link and any confirmation code; in a server it posts a **Sign in** button that shows the link only to the person who has to sign in, in an ephemeral message. The message updates once the sign-in completes or is cancelled.
39
+ - 4db529f: `DockerSandbox` now runs on the public `defineSandboxProvider()` contract. Container names, recorded session state, and template image references stay the same, so running sessions and prepared images from earlier builds keep working. A few behaviors change: `sandbox.delete()` removes the session's container by its session-derived name, honors the caller's `abortSignal`, and succeeds when the container is already gone; eve normalizes relative paths such as `logs/../out.txt` to `/workspace/out.txt` before they reach the container; and a Docker environment's `prepare` callback is typed with `DockerSandboxSession`.
40
+ - 5cf30b6: A dynamic model resolver's `step.started` event now carries the index of the step it selects a model for. From the second step of a turn on, it used to carry the previous step's index, so per-step work keyed on `stepIndex` was attributed to the wrong step.
41
+ - 3c25e62: A dynamic skill that stops returning `files` but is still returned now keeps the files already written to the sandbox, so files the sandbox provides another way, such as from its snapshot, stay in place. If you dropped `files` to take files away from some callers, stop returning the skill for them instead: a skill the resolver stops returning still has its files removed. On Vercel Sandbox, eve now writes a dynamic skill's files in one batch, with one path lookup and one upload instead of two round trips per file.
42
+ - 1bbe939: `eve eval` artifacts now record each eval's `startedAt` and `completedAt` in `summary.json`, `results.jsonl`, and the per-eval detail file.
43
+ - 448804d: An eval's `derived.usage` now takes each session's latest usage by time. An eval that captured a session again with an earlier snapshot reported that snapshot's lower total. Its `costUsd` is now absent when a counted session reported no cost, instead of summing only the sessions that did.
44
+ - 94784e1: Validate idle session state inside the workflow before starting a deployment handoff, avoiding unnecessary successor starts when durable work is still pending. Preserve inbox ownership and the original session stream throughout the move.
45
+ - 580417f: Fix repeated horizontal rules and question text accumulating in terminal scrollback during human-in-the-loop prompts. Question and approval drawers now fit small terminals, keeping the focused choice or text editor visible.
46
+ - b848a51: Avoid an extra setup command when creating a Vercel sandbox from a prepared snapshot of the standard eve image without Drive mounts. eve now checks the base runtime again after authored preparation, so a `prepare` callback that breaks it fails the build; existing sandboxes, resumes, custom images or sources, Drive mounts, and sandboxes without a prepared snapshot keep their setup checks. Vercel templates rebuild once so every snapshot has passed the new check.
47
+ - 39a8b4c: A session whose sandbox is gone (for example after a removed Docker container, a deleted Vercel Sandbox, or a deleted just-bash session directory) now starts a fresh sandbox on its next `ctx.getSandbox()`. Previously every sandbox call in that session failed with the same resume error until the session ended. Thanks @bradhallett for reporting this in #5113 and @moinulmoin for the just-bash case in #4440.
48
+ - bb4afff: New sessions start their first model step sooner, and later turns no longer wait for their cancellation hooks to register before their first step. Thanks @Lukavyi for reporting the startup latency in #876.
49
+ - 798a91e: The Linq channel now rejects inbound webhooks with a 401 whenever its webhook verifier returns any falsy value, including the `null` that `vercelOidc()` returns for a missing or invalid token. Previously only `false` rejected a request, so Vercel Connect setups without a `signingSecret` accepted unsigned webhooks.
50
+ - aaae448: Self-hosted `eve start` servers now reject requests to `/.well-known/workflow/v1/flow` that did not come from the server's own workflow queue, so a client can no longer forge a workflow delivery with a chosen run context or principal. Startup always recovers pending and running local workflow runs through the authenticated queue, ignoring `WORKFLOW_LOCAL_RECOVER_ACTIVE_RUNS`; queue deliveries must stay on the process that enqueued them.
51
+ - 9d1998f: Export `agentWithModel` for `agent/tools/agent.ts` to opt into a root-copy tool whose model-facing input selects the AI Gateway model for each task.
52
+ - cbc87ae: OpenAPI connection tool calls now follow redirects only within the base URL's origin. A redirect to another origin is returned as the tool result, with its target in `location`, instead of followed, so credentials in custom headers, such as an `apiKey` security scheme's header, no longer reach the redirect target. A same-origin redirect loop now fails after 10 hops with an explicit error.
53
+ - 7a908f5: Compaction summaries now run on the AI SDK model instance set as `compaction.model`. Before, a direct model instance there was ignored and summaries ran on the agent's top-level `model`.
54
+ - 84daf59: Compiles now prune `node_modules/.cache/eve/authored-modules` in the background, deleting cached bundles that no running eve process can still import, so the directory no longer grows without bound locally or in persisted Vercel build caches. Thanks @ryantbrown for reporting this in #847 and @kevludwig for reporting the Vercel build-cache impact.
55
+ - 9bd75df: `server-only` and `client-only` imports now load as empty modules in every eve bundle, so tools, channels, workflow steps, and shared workspace packages that import them build and boot without `--conditions=react-server` or a direct dependency. Thanks @jakeleventhal for the original implementation in #3752.
56
+ - b9f984c: Update the bundled Workflow runtime to reduce redundant history reads during concurrent hook registration and avoid unnecessary input/output reads when resuming hooks. Include replay-ordering fixes and the local-world fix for deliveries that race a session handoff.
57
+ - f5b36b3: Repair orphaned local tool calls in saved history before the next model request with an explicit unknown-outcome error. The repair never reruns tools or moves recorded results, and leaves provider-executed calls, approval requests and duplicate call IDs alone.
58
+ - 1fe0d91: Dynamic skills with supporting files are written into a sandbox that eve recreates after the old one was gone, at the start of the next turn. Before, the recreated sandbox got the same identity as the old one, so its skills were missing their files until the skill changed.
59
+ - b3ede07: The Linq and Photon channels' default webhook verification now only accepts Vercel OIDC tokens from the same project and environment.
60
+ - 00aa593: eve now runs every sandbox provider, including `DefaultSandbox`, directly on the public `defineSandboxProvider()` contract, and calls `connection.close()` when the step that opened a connection ends, so the next step resumes through a new connection. Server shutdown stops only connections eve still holds, so a custom provider that defines `close()` and runs remote compute should bound idle compute itself, for example with an idle timeout.
61
+ - c3bbae4: Relative symlinks in an agent's `sandbox/workspace/` files, in skill packages, and in sandbox templates now stay relative in build output and in each sandbox session. Before, eve rewrote them as absolute host paths: `just-bash` sessions rejected them with `EACCES ... resolves outside sandbox`, and they did not resolve inside Docker, microsandbox, or remote sandboxes.
62
+ - 00aa593: Custom sandbox providers can declare `workspaceRoot` on a connection, and eve resolves relative paths, the default working directory, `resolvePath(".")`, and build-time workspace seeding from it; built-in providers keep `/workspace`. The `read_file`, `write_file`, `glob`, and `grep` tools now accept paths relative to the workspace root, and the workspace and skills prompt sections no longer name `/workspace`.
63
+ - db18149: `eve start` and the `withEve` production server for Next.js now fail fast with a clear "port is already in use" error when another process holds the port, instead of reporting a server they did not start and leaving the built server running in the background. Thanks @KingAmo for reporting this in #4938.
64
+ - 9d804f2: A sandbox that was stopped and then ended no longer stays registered for server shutdown, so long-running eve servers stop accumulating ended sessions and shutdown no longer stops their connections again.
65
+ - f1656a5: Tools can now hand the model a file by URL. `toolOutputPart.fileUrl(url, { mediaType })` from `eve/tools` returns a `{ type: "file", data: { type: "url", url } }` content part from `toModelOutput`, so a large file such as a presigned PDF link reaches the model without being base64-encoded, staged into the sandbox, or stored in session history. Only `https:` URLs are accepted, and the URL must stay readable for the rest of the session because every later model call sends it again.
66
+ - ea3a387: Calling `prewarm()` on an existing session can now prepare an idle owner on the Vercel deployment accepting the request before the next message. Apps can trigger it when typing starts; it preserves the session, history, stream, and expiry, and does not block Send or run the model.
67
+
68
+ Preparation uses the existing `POST /eve/v1/session/:sessionId` endpoint with no body or `{}`. Requests with messages or input responses keep their existing behavior.
69
+ - 07dbdef: Each start or resume of a `workflow` tool program may now run up to 30 seconds of JavaScript and take up to 5 minutes in total, and time spent waiting for child agents counts toward neither limit.
70
+ - dd0aac6: A `"use step"` helper in a workflow tool can now call `ctx.getSandbox()` to open the sandbox of the session that called the tool, on any sandbox provider, so a task can prepare files the session's later tool calls read. When the session had not recorded its sandbox when it called the tool, the step opens it with the owning session's sandbox definition; the step never owns the sandbox, and the session removes it when the session ends.
71
+
72
+ ## 0.82.0
73
+
74
+ ### Minor Changes
75
+
76
+ - c543585: Breaking: replace `limits.maxInputTokensPerSession`, `limits.maxOutputTokensPerSession` and `limits.maxTokenCostUsdPerSession` with one `limits.sessionUsage` function. It receives the session's `total` usage and its `window` since the last approved continuation, and returns `true` when the limit is reached; Continue starts a new window. The default is 40M new input tokens (input minus cache reads) per window. Subagents now check their own window with their own `sessionUsage` or the root agent's instead of receiving a share of the parent's remaining quota. Sessions that can't ask now fail with `SESSION_USAGE_LIMIT_REACHED`, replacing `SESSION_TOKEN_LIMIT_REACHED` and `SESSION_TOKEN_COST_LIMIT_REACHED`.
77
+
78
+ ### Patch Changes
79
+
80
+ - baf3030: Attach the agent trace session ID to auto-instrumented child spans on Vercel so Agent Runs can include network and other third-party spans in a session trace.
81
+ - 91b3183: The session input-token limit now counts only new input (uncached input plus cache writes). Cache reads no longer count toward the limit, the grant after Continue, or the quota shared with subagents, so long cache-heavy sessions stop hitting continuation prompts for replaying their own history. Usage telemetry still reports raw input and cache totals. Providers that report no cache details count exactly as before.
82
+ - 8aba0f6: Allow authored workflow tools to select an AI Gateway model when they open a local session with `ctx.agent()`. The child keeps the target agent's other configuration, and the selected model applies for the session's lifetime.
83
+ - 0aea7fc: `eve eval` now runs while an `eve dev` session for the same agent is open, instead of failing with "A dev server is already running for this eve agent." The eval server keeps its runtime generations, local Workflow data, and server record in a per-run directory under `.eve/eval-servers/`, so it never swaps or prunes the dev session's state.
84
+ - a9f5065: Channel and session sends and responses now accept `idempotencyKey` to ignore retries across replay and owner handoffs. Photon supplies message IDs automatically; deduplication requires a shared Workflow World and only covers keys in the session's recent-key window.
85
+ - 6752c95: Fix a workflow tool task running twice when the session was interrupted while publishing `task.started`, for example during a slow `task.started` hook. The session now records each task's run before it publishes the event, so a retry only publishes `task.started` again and never starts a second run.
86
+ - 964a41f: `limits.sessionTimeoutMs` is now an idle timeout: the window restarts each time a turn settles, so a session in active use no longer ends 30 days after it was created. Idle sessions still complete when the window elapses, and the next channel message at their address starts a fresh session as before.
87
+ - dd8c231: Linq and Photon iMessage channels now tell the model when a message is a reply, and include the text of the message it quotes.
88
+ - cf824a8: The Photon and Linq channels can now pass tapbacks to the agent with a new `onTapback` hook, which can also answer the approval or question posted in the message the tapback is on, for example approving with a like. `channel.tapbackTool()` gives the model a tool that reacts to the latest message with a standard tapback or any emoji. Tapbacks stay ignored unless you opt in.
89
+ - 743b498: `eve start --no-schedules` and `EVE_SCHEDULES_DISABLED=1` start a server that does not fire authored cron schedules, so only one process runs them when you scale out.
90
+ - b34844b: Channel `send()`, channel message hooks, and a new `create()` on channel addresses accept `history` to add prior user and assistant messages, such as a stored transcript, as real turns. `create()` starts a session that waits for its first message and reports with `created` whether it did. A new `history.imported` stream event publishes added messages; the default client reducer renders them, and `transcriptReducer()` includes them. Slack `threadContext` now adds earlier replies as history when a message starts the thread's session; later messages keep the existing transcript.
91
+ - e40d7d7: `eve build` and `eve dev` now evaluate a module shared by several tools, channels, or other authored files once per compile instead of once per importing file. Compile memory now grows with the code an agent actually has, not with the number of files that import it, so agents with many tools over a shared SDK or workspace package no longer run out of memory on smaller build machines. Authored modules transpiled to CommonJS with an `__esModule` marker, such as a `tools/*.cjs` file with `exports.default = …`, now also compile and run correctly instead of resolving to the whole `exports` object. On Windows, CommonJS authored modules can now `require()` eve and other external packages.
92
+ - 62d3227: Skip the final Slack reply when the message that started the turn was deleted, instead of letting Slack post it as a top-level channel message.
93
+ - ee5e8e9: Self-hosted `eve build` output now carries a build identity derived from its contents. eve exposes it to Workflow Worlds as `WORKFLOW_DEPLOYMENT_ID` unless that variable is already set, and records it in `eve build --profile` reports.
94
+ - 7b8a520: Fix unnecessary `eve dev` runtime-generation changes when Nitro installs newer Rolldown versions. No-op rebuilds and environment-only reloads now keep the active runtime snapshot unchanged instead of treating bundler debug comments as runtime changes.
95
+
3
96
  ## 0.81.1
4
97
 
5
98
  ### Patch Changes
package/NOTICE CHANGED
@@ -4,7 +4,7 @@ Copyright 2026 Vercel, Inc. and contributors
4
4
  This product includes software developed at Vercel, Inc.
5
5
  (https://vercel.com/).
6
6
 
7
- The bundled code-mode runtime includes run, Copyright 2023 Vercel, Inc.,
7
+ The bundled workflow program runtime is run, Copyright 2023 Vercel, Inc.,
8
8
  licensed under the Apache License, Version 2.0.
9
9
 
10
10
  run embeds devalue 5.8.2, quickjs-wasi 3.6.0, and QuickJS under the MIT
@@ -4,27 +4,46 @@ import { type ChannelDeliverySource } from "#channel/delivery-metadata.js";
4
4
  import type { SendPayload } from "#channel/routes.js";
5
5
  import { type Session } from "#channel/session.js";
6
6
  import type { CancelTurnResult, ClearSessionResult, CompactSessionResult, ResetSessionResult, Runtime, SessionAuthContext, SessionCallback, TurnPolicy } from "#channel/types.js";
7
+ interface BaseChannelAddressCreateOptions {
8
+ readonly auth: SessionAuthContext | null;
9
+ readonly history?: SendPayload["history"];
10
+ readonly initiatorAuth?: SessionAuthContext | null;
11
+ readonly title?: string;
12
+ }
13
+ type ChannelAddressCreateOptions<TState = undefined> = [TState] extends [undefined] ? BaseChannelAddressCreateOptions : BaseChannelAddressCreateOptions & {
14
+ readonly state?: Partial<TState>;
15
+ };
7
16
  interface BaseChannelAddressDeliveryOptions {
17
+ readonly idempotencyKey?: string;
8
18
  readonly auth: SessionAuthContext | null;
9
19
  readonly callback?: SessionCallback;
10
20
  readonly initiatorAuth?: SessionAuthContext | null;
11
21
  readonly title?: string;
12
22
  readonly turnPolicy?: TurnPolicy;
13
23
  }
24
+ /**
25
+ * Result of `create()`. `created` is `false` when another session already owned the address, or
26
+ * won it concurrently; that session is returned unchanged and any `history` was not added.
27
+ */
28
+ export interface ChannelCreateResult {
29
+ readonly created: boolean;
30
+ readonly session: Session;
31
+ }
14
32
  /** Delivery options for a channel address whose continuation token is already bound. */
15
33
  export type ChannelAddressDeliveryOptions<TState = undefined> = [TState] extends [undefined] ? BaseChannelAddressDeliveryOptions : BaseChannelAddressDeliveryOptions & {
16
34
  readonly state?: Partial<TState>;
17
35
  };
18
36
  /**
19
37
  * Dynamic handle for whichever durable session currently owns one channel-local address.
20
- * Only {@link send} may create a session: when the address is unowned, or in
21
- * place of a stranded session that another eve version built. Sends to a session whose
38
+ * Only {@link create} and {@link send} may create a session: when the address is unowned, and
39
+ * `send` also in place of a stranded session that another eve version built. Sends to a session whose
22
40
  * owner is only unavailable throw `SessionStrandedError` and deliver nothing.
23
41
  * Responses to an address no session holds throw `SessionNotActiveError`.
24
42
  */
25
43
  interface ChannelAddress<TState = undefined> {
26
44
  readonly continuationToken: string;
27
45
  deliver(input: SendPayload, options: ChannelAddressDeliveryOptions<TState>): Promise<Session>;
46
+ create(options: ChannelAddressCreateOptions<TState>): Promise<ChannelCreateResult>;
28
47
  send(message: string | UserContent, options: ChannelAddressDeliveryOptions<TState>): Promise<Session>;
29
48
  respond(inputResponses: SendPayload["inputResponses"], options: ChannelAddressDeliveryOptions<TState>): Promise<Session>;
30
49
  cancel(options?: {
@@ -1 +1 @@
1
- import{createSession,sessionCallbackToTurnCaller}from"#channel/session.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{normalizeSendInput,serializeFilePartsInMessage}from"#channel/send-input.js";import{SessionNotActiveError}from"#channel/session-not-active-error.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{isReservedSessionCommandToken}from"#execution/session-inbox/address.js";function createChannelAddress(e){let t=e.metadata??{},n=`${e.channelName}:${e.continuationToken}`;if(isReservedSessionCommandToken(n))throw Error(`Channel address "${n}" uses eve's reserved session namespace.`);return{continuationToken:e.continuationToken,async deliver(r,i){let a=t.channelKind!==void 0&&t.channelName!==void 0?createChannelDeliveryMetadata(t):void 0,o=normalizeSendInput(r),s=sessionCallbackToTurnCaller(i.callback),c={auth:i.auth,delivery:a,kind:`send`,payload:{...o,message:serializeFilePartsInMessage(o.message)},requestId:t.requestId,turnPolicy:o.message===void 0?void 0:i.turnPolicy??e.turnPolicy??DEFAULT_TURN_POLICY},l=s===void 0?c:{...c,caller:s},u=i.state,d={adapter:u===void 0?e.adapter:{...e.adapter,state:{...e.adapter.state,...u}},auth:i.auth,capabilities:{requestInput:!0},callback:i.callback,channelName:e.channelName,continuationConflictCommand:l,continuationToken:n,delivery:a,initiatorAuth:i.initiatorAuth,input:{context:o.context,message:serializeFilePartsInMessage(o.message)??``,outputSchema:o.outputSchema,state:o.state},requestId:t.requestId,title:i.title},toSession=n=>createSession(n,e.runtime,{...t,turnPolicy:e.turnPolicy}),f=await e.runtime.dispatchContinuation({command:l,continuationToken:n,successor:d});if(f.status===`accepted`)return toSession(f.sessionId);if(o.inputResponses&&o.inputResponses.length>0)throw new SessionNotActiveError;return toSession((await e.runtime.createSession(d)).sessionId)},async send(e,t){return await this.deliver({message:e},t)},async respond(e,t){if(e===void 0||e.length===0)throw Error(`respond() requires at least one input response.`);return await this.deliver({inputResponses:e},t)},async cancel(t){return await e.runtime.dispatchContinuation({command:{kind:`cancel`,turnId:t?.turnId},continuationToken:n})},async compact(){return await e.runtime.dispatchContinuation({command:{kind:`compact`},continuationToken:n})},async clear(){return await e.runtime.dispatchContinuation({command:{kind:`clear`},continuationToken:n})},async reset(t){return await e.runtime.dispatchContinuation({command:{kind:`reset`,reason:t?.reason},continuationToken:n})},async resolveSession(){let r=await e.runtime.resolveContinuation(n);return r===void 0?void 0:createSession(r.sessionId,e.runtime,{...t,turnPolicy:e.turnPolicy})}}}function createChannelAddressFn(e){return t=>createChannelAddress({...e,continuationToken:t})}export{createChannelAddress,createChannelAddressFn};
1
+ import{createSession,sessionCallbackToTurnCaller}from"#channel/session.js";import{validateDeliveryIdempotencyKey}from"#channel/delivery-idempotency.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{normalizeSendInput,serializeFilePartsInMessage}from"#channel/send-input.js";import{SessionNotActiveError}from"#channel/session-not-active-error.js";import{SessionStrandedError,describeStrandedSession}from"#channel/session-stranded-error.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{isReservedSessionCommandToken}from"#execution/session-inbox/address.js";import{validateSessionHistory}from"#shared/session-history.js";function createChannelAddress(e){let t=e.metadata??{},n=`${e.channelName}:${e.continuationToken}`;if(isReservedSessionCommandToken(n))throw Error(`Channel address "${n}" uses eve's reserved session namespace.`);return{continuationToken:e.continuationToken,async deliver(r,i){validateDeliveryIdempotencyKey(i.idempotencyKey);let a=t.channelKind!==void 0&&t.channelName!==void 0?createChannelDeliveryMetadata(t):void 0,o=withValidatedHistory(normalizeSendInput(r)),s=sessionCallbackToTurnCaller(i.callback),c={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:a,kind:`send`,payload:{...o,message:serializeFilePartsInMessage(o.message)},requestId:t.requestId,turnPolicy:o.message===void 0?void 0:i.turnPolicy??e.turnPolicy??DEFAULT_TURN_POLICY},l=s===void 0?c:{...c,caller:s},u=i.state,d=u===void 0?e.adapter:{...e.adapter,state:{...e.adapter.state,...u}},f={idempotencyKey:i.idempotencyKey,adapter:d,auth:i.auth,capabilities:{requestInput:!0},callback:i.callback,channelName:e.channelName,continuationConflictCommand:l,continuationToken:n,delivery:a,initiatorAuth:i.initiatorAuth,input:{context:o.context,history:o.history,message:serializeFilePartsInMessage(o.message)??``,outputSchema:o.outputSchema,state:o.state},requestId:t.requestId,title:i.title},toSession=n=>createSession(n,e.runtime,{...t,turnPolicy:e.turnPolicy}),p=await e.runtime.dispatchContinuation({command:l,continuationToken:n,successor:f});if(p.status===`accepted`)return toSession(p.sessionId);if(o.inputResponses&&o.inputResponses.length>0)throw new SessionNotActiveError;return toSession((await e.runtime.createSession(f)).sessionId)},async create(r){let i=validateSessionHistory(r.history),toSession=n=>createSession(n,e.runtime,{...t,turnPolicy:e.turnPolicy}),a;try{a=await e.runtime.resolveContinuation(n,{runnable:!0})}catch(e){throw SessionStrandedError.is(e)?new SessionStrandedError(e.owner,describeStrandedSession(e.owner,`Call reset() on the address, then create() again to start a session from your history.`)):e}if(a!==void 0)return{created:!1,session:toSession(a.sessionId)};let o=r.state,s=await e.runtime.createSession({adapter:o===void 0?e.adapter:{...e.adapter,state:{...e.adapter.state,...o}},auth:r.auth,capabilities:{requestInput:!0},channelName:e.channelName,continuationToken:n,initiatorAuth:r.initiatorAuth,input:i===void 0?{}:{history:i},requestId:t.requestId,title:r.title}),c=await waitForContinuationOwner(e.runtime,n,s.sessionId);return{created:c.sessionId===s.sessionId,session:toSession(c.sessionId)}},async send(e,t){return await this.deliver({message:e},t)},async respond(e,t){if(e===void 0||e.length===0)throw Error(`respond() requires at least one input response.`);return await this.deliver({inputResponses:e},t)},async cancel(t){return await e.runtime.dispatchContinuation({command:{kind:`cancel`,turnId:t?.turnId},continuationToken:n})},async compact(){return await e.runtime.dispatchContinuation({command:{kind:`compact`},continuationToken:n})},async clear(){return await e.runtime.dispatchContinuation({command:{kind:`clear`},continuationToken:n})},async reset(t){return await e.runtime.dispatchContinuation({command:{kind:`reset`,reason:t?.reason},continuationToken:n})},async resolveSession(){let r=await e.runtime.resolveContinuation(n);return r===void 0?void 0:createSession(r.sessionId,e.runtime,{...t,turnPolicy:e.turnPolicy})}}}function createChannelAddressFn(e){return t=>createChannelAddress({...e,continuationToken:t})}function withValidatedHistory(e){let{history:t,...n}=e,r=validateSessionHistory(t);return r===void 0?n:{...n,history:r}}const CREATE_CLAIM_TIMEOUT_MS=15e3;async function waitForContinuationOwner(e,t,n){let r=Date.now()+CREATE_CLAIM_TIMEOUT_MS;for(let i=25;;i=Math.min(i*2,500)){let a=await e.resolveContinuation(t);if(a!==void 0)return a;if(Date.now()+i>r)throw Error(`create() started session "${n}" for "${t}", but no session claimed the address within ${CREATE_CLAIM_TIMEOUT_MS/1e3}s. Call resolveSession() on the address to find its owner once one does.`);await new Promise(e=>setTimeout(e,i))}}export{createChannelAddress,createChannelAddressFn};
@@ -1,14 +1,25 @@
1
1
  import type { UserContent } from "ai";
2
2
  import type { ChannelAdapter } from "#channel/adapter.js";
3
3
  import type { ChannelDeliverySource } from "#channel/delivery-metadata.js";
4
+ import { type ChannelCreateResult } from "#channel/channel-address.js";
5
+ export type { ChannelCreateResult } from "#channel/channel-address.js";
4
6
  import type { Session } from "#channel/session.js";
5
7
  import type { CancelTurnResult, ClearSessionResult, CompactSessionResult, ResetSessionResult, Runtime, SessionAuthContext, SessionCallback, TurnPolicy } from "#channel/types.js";
6
8
  import { type InputResponse, type StrictInputResponses } from "#shared/input.js";
7
9
  import type { JsonObject } from "#shared/json.js";
10
+ import type { SessionHistoryMessage } from "#shared/session-history.js";
8
11
  interface BaseChannelSendOptions {
12
+ /** Stable delivery identity, deduplicated within this session's recent-key window. */
13
+ readonly idempotencyKey?: string;
9
14
  readonly auth: SessionAuthContext | null;
10
15
  readonly callback?: SessionCallback;
11
16
  readonly context?: readonly string[];
17
+ /**
18
+ * Prior conversation added as user and assistant turns before this
19
+ * message and its `context`. Seeds a session this send creates, or
20
+ * extends the history of the session that owns the address.
21
+ */
22
+ readonly history?: readonly SessionHistoryMessage[];
12
23
  readonly initiatorAuth?: SessionAuthContext | null;
13
24
  /** JSON Schema for a structured final answer, as on `Session.send()`. */
14
25
  readonly outputSchema?: JsonObject;
@@ -20,16 +31,37 @@ export type ChannelSendOptions<TState = undefined> = [TState] extends [undefined
20
31
  readonly state: TState;
21
32
  };
22
33
  interface BaseChannelRespondOptions<TState = undefined> {
34
+ /** Stable delivery identity, with the same scope and retention as `send()`. */
35
+ readonly idempotencyKey?: string;
23
36
  readonly auth: SessionAuthContext | null;
24
37
  readonly context?: readonly string[];
25
38
  readonly state?: Partial<TState>;
26
39
  }
27
40
  /** Options for answering pending input requests at an existing continuation address. */
28
41
  export type ChannelRespondOptions<TState = undefined> = BaseChannelRespondOptions<TState>;
42
+ interface BaseChannelCreateOptions {
43
+ readonly auth: SessionAuthContext | null;
44
+ /** Prior conversation the session starts with; it joins history with the first message. */
45
+ readonly history?: readonly SessionHistoryMessage[];
46
+ readonly initiatorAuth?: SessionAuthContext | null;
47
+ readonly title?: string;
48
+ }
49
+ /** Options for creating a session at a channel-local address without running a turn. */
50
+ export type ChannelCreateOptions<TState = undefined> = [TState] extends [undefined] ? BaseChannelCreateOptions : BaseChannelCreateOptions & {
51
+ readonly state: TState;
52
+ };
29
53
  /** Dynamic handle for whichever session currently owns one channel-local address. */
30
54
  export interface ChannelSource<TState = undefined> {
31
55
  /** Starts or resumes a turn with a user message. May create a session. */
32
56
  send(message: string | UserContent, options: ChannelSendOptions<TState>): Promise<Session>;
57
+ /**
58
+ * Creates a session that waits for its first message, without running a
59
+ * turn. When another session owns the address, or claims it concurrently,
60
+ * returns that session unchanged with `created: false`; its `history` was not
61
+ * added. Throws `SessionStrandedError` when the owner is stranded; reset the
62
+ * address, then create again.
63
+ */
64
+ create(options: ChannelCreateOptions<TState>): Promise<ChannelCreateResult>;
33
65
  /** Answers pending input requests. Never creates a session. */
34
66
  respond<const TResponses extends readonly InputResponse[]>(inputResponses: StrictInputResponses<TResponses>, options: ChannelRespondOptions<TState>): Promise<Session>;
35
67
  /** Cooperatively cancels the active turn without creating a session. */
@@ -62,4 +94,3 @@ export declare function createChannelOperations<TState = undefined>(input: {
62
94
  readonly runtime: Runtime;
63
95
  readonly turnPolicy?: TurnPolicy;
64
96
  }): ChannelReceiveContext<TState>;
65
- export {};
@@ -1 +1 @@
1
- import{attachInputText,readInputText}from"#internal/input-text.js";import{createChannelAddressFn}from"#channel/channel-address.js";import{parseInputResponses}from"#shared/input.js";function createChannelOperations(e){let t=createChannelAddressFn(e);return{from(e){let n=t(e);return{async send(e,t){return await n.deliver(attachInputText({context:t.context,message:e,outputSchema:t.outputSchema,state:t.state},readInputText(t)),t)},async respond(e,t){if(e.length===0)throw Error(`respond() requires at least one input response.`);let r=parseInputResponses(e);return await n.deliver({context:t.context,inputResponses:r,state:t.state},t)},async cancel(e){return await n.cancel(e)},async compact(){return await n.compact()},async clear(){return await n.clear()},async reset(e){return await n.reset(e)}}},async resolveSession(e){return await t(e).resolveSession()}}}export{createChannelOperations};
1
+ import{attachInputText,readInputText}from"#internal/input-text.js";import{createChannelAddressFn}from"#channel/channel-address.js";import{parseInputResponses}from"#shared/input.js";function createChannelOperations(e){let t=createChannelAddressFn(e);return{from(e){let n=t(e);return{async send(e,t){return await n.deliver(attachInputText({context:t.context,history:t.history,message:e,outputSchema:t.outputSchema,state:t.state},readInputText(t)),t)},async create(e){return await n.create(e)},async respond(e,t){if(e.length===0)throw Error(`respond() requires at least one input response.`);let r=parseInputResponses(e);return await n.deliver({context:t.context,inputResponses:r,state:t.state},t)},async cancel(e){return await n.cancel(e)},async compact(){return await n.compact()},async clear(){return await n.clear()},async reset(e){return await n.reset(e)}}},async resolveSession(e){return await t(e).resolveSession()}}}export{createChannelOperations};
@@ -0,0 +1,4 @@
1
+ /** Maximum number of distinct delivery keys remembered by one logical session. */
2
+ export declare const DELIVERY_IDEMPOTENCY_WINDOW = 1024;
3
+ export declare const MAX_DELIVERY_IDEMPOTENCY_KEY_LENGTH = 256;
4
+ export declare function validateDeliveryIdempotencyKey(key: unknown): asserts key is string | undefined;
@@ -0,0 +1 @@
1
+ const DELIVERY_IDEMPOTENCY_WINDOW=1024,MAX_DELIVERY_IDEMPOTENCY_KEY_LENGTH=256;function validateDeliveryIdempotencyKey(e){if(e!==void 0&&(typeof e!=`string`||e.length===0||e.length>256))throw Error(`idempotencyKey must be a nonempty string of at most 256 characters.`)}export{DELIVERY_IDEMPOTENCY_WINDOW,MAX_DELIVERY_IDEMPOTENCY_KEY_LENGTH,validateDeliveryIdempotencyKey};
@@ -7,4 +7,9 @@ type AuthorizationRequired = AuthorizationRequiredStreamEvent["data"];
7
7
  * `attemptId`, so one attempt completing never hides another still pending.
8
8
  */
9
9
  export declare function findPendingAuthorization(session: Pick<Session, "getEventStream">, matches: (event: AuthorizationRequired) => boolean): Promise<AuthorizationRequired | undefined>;
10
+ /** Identifies one sign-in attempt: a connection name and its `attemptId`. */
11
+ export declare function attemptKey(event: {
12
+ readonly attemptId?: string;
13
+ readonly name: string;
14
+ }): string;
10
15
  export {};
@@ -1 +1 @@
1
- async function findPendingAuthorization(e,t){let n=new Map,r=(await e.getEventStream({follow:!1,startIndex:-500})).getReader();try{for(;;){let e=await r.read();if(e.done)break;let i=e.value;if(i.type===`authorization.required`&&t(i.data)){let e=attemptKey(i.data);n.delete(e),n.set(e,i.data)}else i.type===`authorization.completed`&&n.delete(attemptKey(i.data))}}finally{await r.cancel().catch(()=>{})}return[...n.values()].at(-1)}function attemptKey(e){return JSON.stringify([e.name,e.attemptId??null])}export{findPendingAuthorization};
1
+ async function findPendingAuthorization(e,t){let n=new Map,r=(await e.getEventStream({follow:!1,startIndex:-500})).getReader();try{for(;;){let e=await r.read();if(e.done)break;let i=e.value;if(i.type===`authorization.required`&&t(i.data)){let e=attemptKey(i.data);n.delete(e),n.set(e,i.data)}else i.type===`authorization.completed`&&n.delete(attemptKey(i.data))}}finally{await r.cancel().catch(()=>{})}return[...n.values()].at(-1)}function attemptKey(e){return JSON.stringify([e.name,e.attemptId??null])}export{attemptKey,findPendingAuthorization};
@@ -5,6 +5,7 @@ import type { InvokeToolFn } from "#channel/invoke-tool.js";
5
5
  import type { InputResponse } from "#shared/input.js";
6
6
  import type { Session } from "#channel/session.js";
7
7
  import type { JsonObject } from "#shared/json.js";
8
+ import type { SessionHistoryMessage } from "#shared/session-history.js";
8
9
  import type { ChannelMethod } from "#public/definitions/channel.js";
9
10
  import type { AgentDescription, AgentSkillFileDescription } from "#channel/agent-description.js";
10
11
  type WebSocketHeaders = Headers | readonly (readonly [string, string])[] | Record<string, string>;
@@ -65,6 +66,11 @@ export interface SendPayload {
65
66
  * message and persists it across the session.
66
67
  */
67
68
  readonly context?: readonly string[];
69
+ /**
70
+ * Prior conversation added as user and assistant turns before this
71
+ * delivery's `context` and message.
72
+ */
73
+ readonly history?: readonly SessionHistoryMessage[];
68
74
  /**
69
75
  * Run-scoped JSON schema the turn's result must match.
70
76
  */
@@ -6,6 +6,7 @@ import type { CancelTurnResult, ClearSessionResult, CompactSessionResult, GetEve
6
6
  import type { SessionAuth } from "#context/keys.js";
7
7
  import { type InputResponse, type StrictInputResponses } from "#shared/input.js";
8
8
  import type { JsonObject } from "#shared/json.js";
9
+ import { type SessionHistoryMessage } from "#shared/session-history.js";
9
10
  /** Immutable-ID handle for one exact durable session. */
10
11
  export interface Session {
11
12
  readonly id: string;
@@ -21,6 +22,8 @@ export interface Session {
21
22
  cancel(options?: {
22
23
  turnId?: string;
23
24
  }): Promise<CancelTurnResult>;
25
+ /** Prepares an idle session on the deployment accepting this request, without a model turn. */
26
+ prewarm(): Promise<import("#protocol/prewarm-session.js").PrewarmSessionResult>;
24
27
  /** Queues compaction on this exact session ID. */
25
28
  compact(): Promise<CompactSessionResult>;
26
29
  /** Queues a context clear on this exact session ID. */
@@ -38,6 +41,8 @@ export interface Session {
38
41
  getStreamTailIndex(): Promise<number>;
39
42
  }
40
43
  interface SessionDeliveryOptions {
44
+ /** Stable delivery identity, deduplicated within this session's recent-key window. */
45
+ readonly idempotencyKey?: string;
41
46
  readonly auth: SessionAuthContext | null;
42
47
  /** Public callback destination for a delegated continuation turn. */
43
48
  readonly callback?: SessionCallback;
@@ -46,6 +51,8 @@ interface SessionDeliveryOptions {
46
51
  }
47
52
  /** Options for sending a message through a fixed session handle. */
48
53
  export type SessionSendOptions = SessionDeliveryOptions & {
54
+ /** Prior conversation added as user and assistant turns before this message and its `context`. */
55
+ readonly history?: readonly SessionHistoryMessage[];
49
56
  /** Initial workflow title for a prewarmed session. */
50
57
  readonly title?: string;
51
58
  readonly turnPolicy?: TurnPolicy;
@@ -1 +1 @@
1
- import{attachClientContext,readClientContext}from"#internal/client-context.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{serializeFilePartsInMessage}from"#channel/send-input.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{parseInputResponses}from"#shared/input.js";import{AuthKey,ContinuationHookTokensKey,ContinuationTokenKey,InitiatorAuthKey,SessionIdKey}from"#context/keys.js";import{toChannelLocalContinuationToken}from"#shared/continuation-token.js";function createSession(e,t,n={}){return{id:e,async send(r,i){let a=createDelivery(n),o=sessionCallbackToTurnCaller(i.callback),s=attachClientContext({message:serializeFilePartsInMessage(r)},readClientContext(i));i.context!==void 0&&(s.context=i.context),i.outputSchema!==void 0&&(s.outputSchema=i.outputSchema);let c={auth:i.auth,delivery:a,kind:`send`,payload:s,requestId:n.requestId,turnPolicy:i.turnPolicy??n.turnPolicy??DEFAULT_TURN_POLICY,title:i.title};return await t.dispatchSession({command:o===void 0?c:{...c,caller:o},sessionId:e})},async respond(r,i){if(r.length===0)throw Error(`respond() requires at least one input response.`);let a=parseInputResponses(r),o=sessionCallbackToTurnCaller(i.callback),s=createDelivery(n),c=attachClientContext({inputResponses:a},readClientContext(i));i.context!==void 0&&(c.context=i.context),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={auth:i.auth,delivery:s,kind:`send`,payload:c,requestId:n.requestId};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async cancel(n){let r={kind:`cancel`};return n?.turnId!==void 0&&(r.turnId=n.turnId),await t.dispatchSession({command:r,sessionId:e})},async compact(){return await t.dispatchSession({command:{kind:`compact`},sessionId:e})},async clear(){return await t.dispatchSession({command:{kind:`clear`},sessionId:e})},async reset(n){return await t.dispatchSession({command:{kind:`reset`,reason:n?.reason},sessionId:e})},async getEventStream(n){return t.getEventStream(e,n)},async getStreamTailIndex(){return t.getStreamTailIndex(e)}}}function createAttachSessionFn(e,t={}){return n=>createSession(n,e,t)}function createDelivery(e){return e.channelKind!==void 0&&e.channelName!==void 0?createChannelDeliveryMetadata(e):void 0}function buildSessionHandle(e){return{get id(){return e.get(SessionIdKey)??``},get auth(){return{current:e.get(AuthKey)??null,initiator:e.get(InitiatorAuthKey)??null}},get continuation(){let t=e.get(ContinuationTokenKey);if(t!==void 0&&t.length!==0)return{token:toChannelLocalContinuationToken(t),alias(n){if(n.length===0)throw Error(`A session alias requires a nonempty token.`);let r=namespaceContinuationToken(t,n);t!==r&&(e.set(ContinuationHookTokensKey,e=>{let n=e??[t];return n.includes(r)?n:[...n,r]}),e.set(ContinuationTokenKey,r))}}}}}function namespaceContinuationToken(e,t){let n=e.indexOf(`:`);if(n<=0)throw Error(`Cannot set session continuation token without an existing namespaced continuation token. Start the session with a placeholder continuationToken.`);return`${e.slice(0,n+1)}${t}`}function sessionCallbackToTurnCaller(e){return e===void 0?void 0:{callId:e.callId,replyTo:{kind:`callback`,token:e.token,url:e.url},subagentName:e.subagentName}}export{buildSessionHandle,createAttachSessionFn,createSession,sessionCallbackToTurnCaller};
1
+ import{attachClientContext,readClientContext}from"#internal/client-context.js";import{validateDeliveryIdempotencyKey}from"#channel/delivery-idempotency.js";import{createChannelDeliveryMetadata}from"#channel/delivery-metadata.js";import{serializeFilePartsInMessage}from"#channel/send-input.js";import{DEFAULT_TURN_POLICY}from"#channel/types.js";import{validateSessionHistory}from"#shared/session-history.js";import{parseInputResponses}from"#shared/input.js";import{AuthKey,ContinuationHookTokensKey,ContinuationTokenKey,InitiatorAuthKey,SessionIdKey}from"#context/keys.js";import{toChannelLocalContinuationToken}from"#shared/continuation-token.js";function createSession(e,t,n={}){return{id:e,async send(r,i){validateDeliveryIdempotencyKey(i.idempotencyKey);let a=createDelivery(n),o=sessionCallbackToTurnCaller(i.callback),s=validateSessionHistory(i.history),c=attachClientContext({message:serializeFilePartsInMessage(r)},readClientContext(i));i.context!==void 0&&(c.context=i.context),s!==void 0&&(c.history=s),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:a,kind:`send`,payload:c,requestId:n.requestId,turnPolicy:i.turnPolicy??n.turnPolicy??DEFAULT_TURN_POLICY,title:i.title};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async respond(r,i){if(validateDeliveryIdempotencyKey(i.idempotencyKey),r.length===0)throw Error(`respond() requires at least one input response.`);let a=parseInputResponses(r),o=sessionCallbackToTurnCaller(i.callback),s=createDelivery(n),c=attachClientContext({inputResponses:a},readClientContext(i));i.context!==void 0&&(c.context=i.context),i.outputSchema!==void 0&&(c.outputSchema=i.outputSchema);let l={idempotencyKey:i.idempotencyKey,auth:i.auth,delivery:s,kind:`send`,payload:c,requestId:n.requestId};return await t.dispatchSession({command:o===void 0?l:{...l,caller:o},sessionId:e})},async cancel(n){let r={kind:`cancel`};return n?.turnId!==void 0&&(r.turnId=n.turnId),await t.dispatchSession({command:r,sessionId:e})},async prewarm(){return await t.dispatchSession({command:{kind:`prewarm`,targetDeploymentId:n.acceptedDeploymentId},sessionId:e})},async compact(){return await t.dispatchSession({command:{kind:`compact`},sessionId:e})},async clear(){return await t.dispatchSession({command:{kind:`clear`},sessionId:e})},async reset(n){return await t.dispatchSession({command:{kind:`reset`,reason:n?.reason},sessionId:e})},async getEventStream(n){return t.getEventStream(e,n)},async getStreamTailIndex(){return t.getStreamTailIndex(e)}}}function createAttachSessionFn(e,t={}){return n=>createSession(n,e,t)}function createDelivery(e){return e.channelKind!==void 0&&e.channelName!==void 0?createChannelDeliveryMetadata(e):void 0}function buildSessionHandle(e){return{get id(){return e.get(SessionIdKey)??``},get auth(){return{current:e.get(AuthKey)??null,initiator:e.get(InitiatorAuthKey)??null}},get continuation(){let t=e.get(ContinuationTokenKey);if(t!==void 0&&t.length!==0)return{token:toChannelLocalContinuationToken(t),alias(n){if(n.length===0)throw Error(`A session alias requires a nonempty token.`);let r=namespaceContinuationToken(t,n);t!==r&&(e.set(ContinuationHookTokensKey,e=>{let n=e??[t];return n.includes(r)?n:[...n,r]}),e.set(ContinuationTokenKey,r))}}}}}function namespaceContinuationToken(e,t){let n=e.indexOf(`:`);if(n<=0)throw Error(`Cannot set session continuation token without an existing namespaced continuation token. Start the session with a placeholder continuationToken.`);return`${e.slice(0,n+1)}${t}`}function sessionCallbackToTurnCaller(e){return e===void 0?void 0:{callId:e.callId,replyTo:{kind:`callback`,token:e.token,url:e.url},subagentName:e.subagentName}}export{buildSessionHandle,createAttachSessionFn,createSession,sessionCallbackToTurnCaller};
@@ -6,8 +6,8 @@ import type { CancelTurnResult as ProtocolCancelTurnResult } from "#protocol/can
6
6
  import type { RuntimeSubagentChildResult, RuntimeSubagentDispatchFailure, RuntimeToolResultActionResult } from "#shared/action-types.js";
7
7
  import type { InputRequest, InputResponse } from "#shared/input.js";
8
8
  import type { ChannelAdapter } from "#channel/adapter.js";
9
- import type { AgentLimitsDefinition } from "#shared/agent-definition.js";
10
9
  import type { JsonObject } from "#shared/json.js";
10
+ import type { SessionHistoryMessage } from "#shared/session-history.js";
11
11
  import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
12
12
  import type { ForwardedTraceAssertion } from "#shared/forwarded-trace-policy.js";
13
13
  import type { ConversationContext } from "#shared/conversation-context.js";
@@ -15,7 +15,6 @@ import type { StubScope } from "#tool-stubs/types.js";
15
15
  export type { ContextAccessor } from "#context/key.js";
16
16
  export type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
17
17
  import type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
18
- export type RunSessionLimits = Pick<AgentLimitsDefinition, "maxInputTokensPerSession" | "maxOutputTokensPerSession" | "maxTokenCostUsdPerSession">;
19
18
  /** Identifies the session turn to cancel. */
20
19
  export interface CancelTurnInput {
21
20
  readonly sessionId: string;
@@ -155,6 +154,8 @@ export interface DeliverPayload {
155
154
  readonly inputResponses?: readonly InputResponse[];
156
155
  readonly message?: string | UserContent;
157
156
  readonly context?: readonly string[];
157
+ /** Prior conversation added as user and assistant turns before this delivery's input. */
158
+ readonly history?: readonly SessionHistoryMessage[];
158
159
  readonly outputSchema?: JsonObject;
159
160
  readonly [key: string]: unknown;
160
161
  }
@@ -164,6 +165,7 @@ export type TurnPolicy = "steer" | "queue";
164
165
  export declare const DEFAULT_TURN_POLICY: TurnPolicy;
165
166
  /** One command accepted by a durable session inbox. */
166
167
  export type SessionCommand = {
168
+ readonly idempotencyKey?: string;
167
169
  readonly auth?: SessionAuthContext | null;
168
170
  readonly caller?: TurnCaller;
169
171
  /** Initial workflow title when delivering to a prewarmed session. */
@@ -177,6 +179,9 @@ export type SessionCommand = {
177
179
  } | {
178
180
  readonly kind: "cancel";
179
181
  readonly turnId?: string;
182
+ } | {
183
+ readonly kind: "prewarm";
184
+ readonly targetDeploymentId?: string;
180
185
  } | {
181
186
  readonly kind: "compact";
182
187
  } | {
@@ -202,6 +207,8 @@ export type ResetSessionResult = {
202
207
  readonly status: "no_active_session";
203
208
  };
204
209
  export type SessionCommandResult<TCommand extends SessionCommand = SessionCommand> = TCommand extends {
210
+ readonly kind: "prewarm";
211
+ } ? import("#protocol/prewarm-session.js").PrewarmSessionResult : TCommand extends {
205
212
  readonly kind: "send";
206
213
  } ? SessionSendCommandResult : TCommand extends {
207
214
  readonly kind: "cancel";
@@ -230,6 +237,7 @@ export interface DispatchSessionInput<TCommand extends SessionCommand = SessionC
230
237
  * metadata so both cross the durable hook boundary outside adapter-owned data.
231
238
  */
232
239
  export interface DeliverHookPayload {
240
+ readonly idempotencyKey?: string;
233
241
  readonly schedule?: import("#context/session-schedule.js").SessionSchedule;
234
242
  /** Initial workflow title; ignored once session initialization has run. */
235
243
  readonly title?: string;
@@ -371,6 +379,8 @@ export interface SessionCapabilities {
371
379
  * subagent tool wrapper).
372
380
  */
373
381
  export interface RunInput {
382
+ /** Optional stable identity of the initial delivery, scoped to this logical session. */
383
+ readonly idempotencyKey?: string;
374
384
  /**
375
385
  * @internal Set by the server after it authorizes tool stubs.
376
386
  * Local subagents match rules qualified by their full path, such as researcher/list_tasks.
@@ -456,6 +466,8 @@ export interface RunInput {
456
466
  /** Omitted only when creating a conversation session before its first turn. */
457
467
  readonly message?: string | UserContent;
458
468
  readonly context?: readonly string[];
469
+ /** Prior conversation; with no message, it waits for the first message's turn. */
470
+ readonly history?: readonly SessionHistoryMessage[];
459
471
  readonly outputSchema?: JsonObject;
460
472
  /** Channel payload state for the first delivery, as later deliveries carry it. */
461
473
  readonly state?: unknown;
@@ -470,13 +482,6 @@ export interface RunInput {
470
482
  * because trace state is scoped to one session's context.
471
483
  */
472
484
  readonly parentTraceContext?: SessionTraceContext;
473
- /**
474
- * Runtime-supplied session limits. Delegated local subagents use this to
475
- * carry the parent's remaining quota and delegation caps with the same limit
476
- * fields authors configure on agents; `false` means no inherited token cap
477
- * for that axis.
478
- */
479
- readonly limits?: RunSessionLimits;
480
485
  /** Framework-owned metadata for a protocol-neutral external invocation. */
481
486
  readonly externalInvocation?: {
482
487
  readonly continuationToken: string;
@@ -551,9 +556,12 @@ export interface Runtime {
551
556
  /**
552
557
  * Resolves the session that currently owns a continuation token without
553
558
  * delivering input or starting a run. Returns `undefined` when no session
554
- * owns the token.
559
+ * owns the token. With `runnable`, throws `SessionStrandedError` when the
560
+ * owner is stranded and can run nothing.
555
561
  */
556
- resolveContinuation(continuationToken: string): Promise<{
562
+ resolveContinuation(continuationToken: string, options?: {
563
+ readonly runnable?: boolean;
564
+ }): Promise<{
557
565
  sessionId: string;
558
566
  } | undefined>;
559
567
  /**