eve 0.67.1 → 0.67.2

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 (562) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/src/channel/channel-address.d.ts +2 -2
  3. package/dist/src/channel/compiled-channel.d.ts +3 -2
  4. package/dist/src/channel/cross-channel-receive.d.ts +1 -18
  5. package/dist/src/channel/cross-channel-receive.js +1 -1
  6. package/dist/src/channel/forwarded-principal.d.ts +3 -2
  7. package/dist/src/channel/resolve-text.d.ts +2 -1
  8. package/dist/src/channel/schedule.d.ts +2 -2
  9. package/dist/src/channel/session-callback.d.ts +2 -1
  10. package/dist/src/channel/types.d.ts +0 -7
  11. package/dist/src/cli/acp/command.d.ts +2 -1
  12. package/dist/src/cli/agent-command.d.ts +2 -1
  13. package/dist/src/cli/agent-detection.d.ts +0 -1
  14. package/dist/src/cli/agent-detection.js +1 -1
  15. package/dist/src/cli/application-command.d.ts +2 -1
  16. package/dist/src/cli/application-root.d.ts +3 -6
  17. package/dist/src/cli/application-root.js +1 -1
  18. package/dist/src/cli/commands/init-target.d.ts +1 -1
  19. package/dist/src/cli/commands/init-telemetry.d.ts +2 -1
  20. package/dist/src/cli/commands/registry-declared-setups.d.ts +2 -1
  21. package/dist/src/cli/commands/registry-install-transaction.d.ts +0 -13
  22. package/dist/src/cli/commands/registry-install-transaction.js +1 -1
  23. package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
  24. package/dist/src/cli/commands/registry-presentation.d.ts +0 -1
  25. package/dist/src/cli/commands/registry-presentation.js +1 -1
  26. package/dist/src/cli/commands/registry-project.d.ts +2 -1
  27. package/dist/src/cli/commands/registry.d.ts +0 -4
  28. package/dist/src/cli/commands/registry.js +1 -1
  29. package/dist/src/cli/commands/setup-headless.d.ts +2 -1
  30. package/dist/src/cli/commands/vercel-non-interactive.d.ts +2 -1
  31. package/dist/src/cli/dev/diagnostic-dump.d.ts +0 -2
  32. package/dist/src/cli/dev/diagnostic-dump.js +1 -1
  33. package/dist/src/cli/dev/diagnostic-sink.d.ts +3 -2
  34. package/dist/src/cli/dev/tui/agent-header.d.ts +2 -1
  35. package/dist/src/cli/dev/tui/argument-typeahead.d.ts +2 -1
  36. package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +2 -1
  37. package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +2 -1
  38. package/dist/src/cli/dev/tui/errors.d.ts +2 -7
  39. package/dist/src/cli/dev/tui/errors.js +1 -1
  40. package/dist/src/cli/dev/tui/flow-drawer.d.ts +2 -1
  41. package/dist/src/cli/dev/tui/line-editor.d.ts +1 -1
  42. package/dist/src/cli/dev/tui/mcp-connection-status.d.ts +2 -1
  43. package/dist/src/cli/dev/tui/message-queue.d.ts +4 -3
  44. package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -1
  45. package/dist/src/cli/dev/tui/provider-picker.d.ts +3 -2
  46. package/dist/src/cli/dev/tui/question-panel.d.ts +2 -1
  47. package/dist/src/cli/dev/tui/registry-result-message.d.ts +3 -4
  48. package/dist/src/cli/dev/tui/registry-result-message.js +1 -1
  49. package/dist/src/cli/dev/tui/remote-connection-probe.d.ts +3 -2
  50. package/dist/src/cli/dev/tui/setup-panel.d.ts +2 -2
  51. package/dist/src/cli/dev/tui/setup-selection-input.d.ts +2 -2
  52. package/dist/src/cli/dev/tui/status-line.d.ts +2 -1
  53. package/dist/src/cli/dev/tui/stream-format.d.ts +3 -2
  54. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -2
  55. package/dist/src/cli/dev/tui/theme.d.ts +1 -1
  56. package/dist/src/cli/dev/tui/tool-block-groups.d.ts +3 -2
  57. package/dist/src/cli/dev/tui/tool-presentation.d.ts +2 -1
  58. package/dist/src/cli/dev/tui/traces/trace-content.d.ts +0 -9
  59. package/dist/src/cli/dev/tui/traces/trace-content.js +1 -1
  60. package/dist/src/cli/dev/tui/traces/trace-view.d.ts +3 -2
  61. package/dist/src/cli/dev/tui/traces/trace-viewer-session.d.ts +2 -1
  62. package/dist/src/cli/dev/tui/traces/trace-viewer-state.d.ts +2 -3
  63. package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
  64. package/dist/src/cli/dev/ui-options.d.ts +3 -2
  65. package/dist/src/cli/dev/url-target.d.ts +2 -1
  66. package/dist/src/cli/invoke/command.d.ts +0 -11
  67. package/dist/src/cli/invoke/command.js +1 -1
  68. package/dist/src/cli/invoke/result.d.ts +1 -1
  69. package/dist/src/cli/telemetry/index.d.ts +0 -6
  70. package/dist/src/cli/telemetry/preference.d.ts +2 -1
  71. package/dist/src/cli/ui/alt-screen.d.ts +3 -2
  72. package/dist/src/cli/ui/live-region.d.ts +3 -2
  73. package/dist/src/cli/ui/output.d.ts +1 -1
  74. package/dist/src/client/eve-agent-store-helpers.d.ts +0 -1
  75. package/dist/src/client/eve-agent-store-helpers.js +1 -1
  76. package/dist/src/client/message-action-parts.d.ts +2 -1
  77. package/dist/src/client/session-utils.d.ts +3 -2
  78. package/dist/src/compiled/.vendor-stamp.json +6 -6
  79. package/dist/src/compiled/@workflow/core/index.js +2 -2
  80. package/dist/src/compiled/@workflow/core/private.js +1 -1
  81. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +4 -3
  82. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +23 -0
  83. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  84. package/dist/src/compiled/@workflow/core/runtime/hook-wake.d.ts +69 -36
  85. package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +25 -22
  86. package/dist/src/compiled/@workflow/core/runtime/run-spec-version.d.ts +16 -0
  87. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +59 -1
  88. package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +3 -2
  89. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +34 -12
  90. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  91. package/dist/src/compiled/@workflow/core/serialization.d.ts +7 -2
  92. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  93. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +29 -0
  94. package/dist/src/compiled/@workflow/core/types.d.ts +1 -0
  95. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  96. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  97. package/dist/src/compiled/@workflow/errors/index.d.ts +13 -0
  98. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  99. package/dist/src/compiled/@workflow/world/events.d.ts +14 -4
  100. package/dist/src/compiled/@workflow/world/index.d.ts +2 -2
  101. package/dist/src/compiled/@workflow/world/interfaces.d.ts +2 -1
  102. package/dist/src/compiled/@workflow/world/shared.d.ts +24 -0
  103. package/dist/src/compiled/@workflow/world/spec-version.d.ts +23 -0
  104. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  105. package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
  106. package/dist/src/compiled/_chunks/workflow/{attribute-changes-DzJovO_f.js → attribute-changes-D721NpZv.js} +3 -3
  107. package/dist/src/compiled/_chunks/workflow/{dist-BQSf8Hax.js → dist-BUFGAKRb.js} +1 -1
  108. package/dist/src/compiled/_chunks/workflow/dist-CaNNONeg.js +3 -0
  109. package/dist/src/compiled/_chunks/workflow/{frames-qKc30rjg.js → frames-Dr9fHWdo.js} +2 -2
  110. package/dist/src/compiled/_chunks/workflow/{global-BQnKzRXo.js → global-DKbOgrts.js} +1 -1
  111. package/dist/src/compiled/_chunks/workflow/helpers-DkKxg_yn.js +1 -0
  112. package/dist/src/compiled/_chunks/workflow/logger-D4GJNTk4.js +14 -0
  113. package/dist/src/compiled/_chunks/workflow/resume-hook-uTW-jBYz.js +1 -0
  114. package/dist/src/compiled/_chunks/workflow/run-5DmiMN9b.js +1 -0
  115. package/dist/src/compiled/_chunks/workflow/serialization-CNIYl1D3.js +3 -0
  116. package/dist/src/compiled/_chunks/workflow/sleep-DFKgN7UG.js +1 -0
  117. package/dist/src/compiled/_chunks/workflow/wait-until-3_1djUuL.js +1 -0
  118. package/dist/src/compiled/_chunks/workflow/{ws-transport-BrsMYqJg.js → ws-transport--rYOVIaf.js} +1 -1
  119. package/dist/src/compiler/artifacts.d.ts +4 -27
  120. package/dist/src/compiler/artifacts.js +1 -1
  121. package/dist/src/compiler/compile-agent.d.ts +2 -1
  122. package/dist/src/compiler/compile-agent.js +1 -1
  123. package/dist/src/compiler/diagnostics.d.ts +0 -11
  124. package/dist/src/compiler/diagnostics.js +1 -1
  125. package/dist/src/compiler/manifest.d.ts +0 -4
  126. package/dist/src/compiler/module-map.d.ts +1 -5
  127. package/dist/src/compiler/module-map.js +1 -1
  128. package/dist/src/compiler/normalize-agent-config.js +1 -1
  129. package/dist/src/compiler/normalize-connection.d.ts +2 -1
  130. package/dist/src/compiler/normalize-instructions.d.ts +2 -6
  131. package/dist/src/compiler/normalize-instructions.js +1 -1
  132. package/dist/src/compiler/normalize-manifest-helpers.d.ts +0 -1
  133. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  134. package/dist/src/compiler/normalize-manifest.js +1 -1
  135. package/dist/src/compiler/normalize-skill.d.ts +2 -1
  136. package/dist/src/compiler/project-sources.d.ts +0 -14
  137. package/dist/src/compiler/project-sources.js +1 -1
  138. package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
  139. package/dist/src/compiler/source-graph.d.ts +1 -2
  140. package/dist/src/compiler/source-graph.js +1 -1
  141. package/dist/src/context/build-base-tool-context.d.ts +2 -1
  142. package/dist/src/context/dynamic-tool-lifecycle.d.ts +0 -4
  143. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  144. package/dist/src/context/dynamic-tool-metadata.d.ts +0 -1
  145. package/dist/src/context/dynamic-tool-metadata.js +1 -1
  146. package/dist/src/context/memory-lifecycle.d.ts +0 -8
  147. package/dist/src/context/memory-lifecycle.js +1 -1
  148. package/dist/src/discover/connections.d.ts +0 -15
  149. package/dist/src/discover/connections.js +1 -1
  150. package/dist/src/discover/diagnostics.d.ts +0 -8
  151. package/dist/src/discover/diagnostics.js +1 -1
  152. package/dist/src/discover/discover-agent.js +1 -1
  153. package/dist/src/discover/discover-subagent.d.ts +0 -1
  154. package/dist/src/discover/discover-subagent.js +1 -1
  155. package/dist/src/discover/extensions.d.ts +3 -10
  156. package/dist/src/discover/extensions.js +1 -1
  157. package/dist/src/discover/filesystem.d.ts +5 -9
  158. package/dist/src/discover/filesystem.js +1 -1
  159. package/dist/src/discover/grammar.d.ts +0 -46
  160. package/dist/src/discover/grammar.js +1 -1
  161. package/dist/src/discover/manifest.d.ts +5 -4
  162. package/dist/src/discover/memory.d.ts +0 -1
  163. package/dist/src/discover/memory.js +1 -1
  164. package/dist/src/discover/named-source-directory.js +1 -1
  165. package/dist/src/discover/project-source.d.ts +2 -1
  166. package/dist/src/discover/project.js +1 -1
  167. package/dist/src/discover/sandbox.js +1 -1
  168. package/dist/src/discover/skills.d.ts +0 -4
  169. package/dist/src/discover/skills.js +1 -1
  170. package/dist/src/evals/cli/eval-client.d.ts +2 -1
  171. package/dist/src/evals/judge.d.ts +2 -1
  172. package/dist/src/evals/runner/execute-task.d.ts +1 -1
  173. package/dist/src/evals/types.d.ts +1 -1
  174. package/dist/src/eve-channel/support.d.ts +1 -3
  175. package/dist/src/eve-channel/support.js +1 -1
  176. package/dist/src/execution/dynamic-workflow/schema.d.ts +2 -1
  177. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  178. package/dist/src/execution/effective-agent-config.d.ts +2 -1
  179. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -5
  180. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  181. package/dist/src/execution/history-view.d.ts +2 -1
  182. package/dist/src/execution/node-step.d.ts +3 -2
  183. package/dist/src/execution/sandbox/active-handles.d.ts +2 -4
  184. package/dist/src/execution/sandbox/active-handles.js +1 -1
  185. package/dist/src/execution/sandbox/bash.d.ts +2 -1
  186. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  187. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -6
  188. package/dist/src/execution/sandbox/bindings/immutable-resources.js +1 -1
  189. package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +3 -2
  190. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -1
  191. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
  192. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +1 -1
  193. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -3
  194. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
  195. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -1
  196. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
  197. package/dist/src/execution/sandbox/bindings/vercel.d.ts +1 -1
  198. package/dist/src/execution/sandbox/dockerfile.d.ts +0 -1
  199. package/dist/src/execution/sandbox/dockerfile.js +1 -1
  200. package/dist/src/execution/sandbox/ensure.d.ts +2 -1
  201. package/dist/src/execution/sandbox/ensure.js +1 -1
  202. package/dist/src/execution/sandbox/prewarm.d.ts +1 -18
  203. package/dist/src/execution/sandbox/prewarm.js +1 -1
  204. package/dist/src/execution/sandbox/require-sandbox.d.ts +0 -11
  205. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  206. package/dist/src/execution/sandbox/truncate-output.d.ts +2 -5
  207. package/dist/src/execution/sandbox/truncate-output.js +2 -2
  208. package/dist/src/execution/session/admission.d.ts +3 -2
  209. package/dist/src/execution/session/event-sink.d.ts +2 -1
  210. package/dist/src/execution/session/finalization.d.ts +2 -1
  211. package/dist/src/execution/session/handoff.d.ts +3 -2
  212. package/dist/src/execution/session/route-selected-delivery.d.ts +2 -1
  213. package/dist/src/execution/session/timeout-control.d.ts +2 -1
  214. package/dist/src/execution/session-activity.d.ts +0 -3
  215. package/dist/src/execution/session-activity.js +1 -1
  216. package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
  217. package/dist/src/execution/session.d.ts +3 -2
  218. package/dist/src/execution/stable-workflow-names.d.ts +0 -6
  219. package/dist/src/execution/stable-workflow-names.js +1 -1
  220. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  221. package/dist/src/execution/tools/ask-question-workflow.js +1 -1
  222. package/dist/src/execution/tools/connection-search.js +1 -1
  223. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  224. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +2 -1
  225. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +4 -3
  226. package/dist/src/execution/tools/workflow/background.d.ts +2 -6
  227. package/dist/src/execution/tools/workflow/background.js +1 -1
  228. package/dist/src/execution/tools/workflow/owner-channels.d.ts +1 -1
  229. package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +2 -1
  230. package/dist/src/execution/web-fetch/execute.d.ts +2 -2
  231. package/dist/src/execution/web-fetch/request.d.ts +2 -1
  232. package/dist/src/extensions/code/extension/lib/computer-use-driver-source.d.ts +0 -2
  233. package/dist/src/extensions/code/extension/lib/computer-use-driver-source.js +57 -57
  234. package/dist/src/extensions/code/extension/lib/computer-use.d.ts +1 -1
  235. package/dist/src/extensions/code/extension/lib/generated-paths.d.ts +2 -1
  236. package/dist/src/extensions/code/extension/lib/grep-search.d.ts +5 -5
  237. package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
  238. package/dist/src/extensions/code/extension/lib/guidelines.d.ts +2 -1
  239. package/dist/src/extensions/code/extension/lib/patch.d.ts +3 -2
  240. package/dist/src/extensions/code/extension/lib/prwatch-github.d.ts +1 -2
  241. package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
  242. package/dist/src/extensions/code/extension/lib/prwatch-registry.d.ts +2 -1
  243. package/dist/src/framework/host-inventory.d.ts +3 -2
  244. package/dist/src/harness/approval-candidates.d.ts +4 -3
  245. package/dist/src/harness/approval-delivery-coordinator.d.ts +2 -1
  246. package/dist/src/harness/compaction-prompt.d.ts +2 -1
  247. package/dist/src/harness/coordination.d.ts +0 -4
  248. package/dist/src/harness/coordination.js +1 -1
  249. package/dist/src/harness/input-requests.d.ts +1 -10
  250. package/dist/src/harness/input-requests.js +1 -1
  251. package/dist/src/harness/pending-input-batches.d.ts +0 -5
  252. package/dist/src/harness/pending-input-batches.js +1 -1
  253. package/dist/src/harness/provider-tools.d.ts +2 -1
  254. package/dist/src/harness/session-limit-continuation.d.ts +0 -4
  255. package/dist/src/harness/session-limit-continuation.js +1 -1
  256. package/dist/src/harness/session-usage-limits.d.ts +2 -1
  257. package/dist/src/harness/tool-loop.js +1 -1
  258. package/dist/src/harness/tool-model-output.d.ts +2 -1
  259. package/dist/src/harness/turn-client-context.d.ts +2 -1
  260. package/dist/src/instrumentation/state.d.ts +2 -2
  261. package/dist/src/internal/agent-name.d.ts +0 -2
  262. package/dist/src/internal/agent-name.js +1 -1
  263. package/dist/src/internal/application/build-profile.d.ts +2 -2
  264. package/dist/src/internal/application/dev-environment.d.ts +2 -8
  265. package/dist/src/internal/application/dev-environment.js +1 -1
  266. package/dist/src/internal/application/output-publication.d.ts +1 -1
  267. package/dist/src/internal/application/package.js +1 -1
  268. package/dist/src/internal/application/paths.d.ts +0 -5
  269. package/dist/src/internal/application/paths.js +1 -1
  270. package/dist/src/internal/application/tsconfig-dependencies.d.ts +0 -16
  271. package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
  272. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  273. package/dist/src/internal/authored-definition/source-identity.d.ts +1 -1
  274. package/dist/src/internal/authored-module-map-loader.js +1 -1
  275. package/dist/src/internal/bundler/extension-scope-plugin.d.ts +2 -1
  276. package/dist/src/internal/bundler/nitro-rolldown.d.ts +0 -11
  277. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  278. package/dist/src/internal/eve-project-root.d.ts +0 -3
  279. package/dist/src/internal/eve-project-root.js +1 -1
  280. package/dist/src/internal/external-resources-snapshot.d.ts +1 -1
  281. package/dist/src/internal/external-resources.d.ts +0 -1
  282. package/dist/src/internal/external-resources.js +1 -1
  283. package/dist/src/internal/helpers/markdown.js +1 -1
  284. package/dist/src/internal/invocation/metadata.d.ts +1 -1
  285. package/dist/src/internal/materialized-authored-modules.d.ts +2 -1
  286. package/dist/src/internal/mcp/protected-resource.d.ts +2 -1
  287. package/dist/src/internal/mcp/streamable-http-server.d.ts +4 -5
  288. package/dist/src/internal/mcp/streamable-http-server.js +1 -1
  289. package/dist/src/internal/model-catalog.d.ts +2 -1
  290. package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +0 -4
  291. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  292. package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +0 -1
  293. package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
  294. package/dist/src/internal/nitro/development-generation.d.ts +0 -1
  295. package/dist/src/internal/nitro/development-generation.js +1 -1
  296. package/dist/src/internal/nitro/host/channel-routes.d.ts +1 -1
  297. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -1
  298. package/dist/src/internal/nitro/host/dev-host-candidate.d.ts +2 -1
  299. package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +1 -1
  300. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  301. package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +1 -1
  302. package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
  303. package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +2 -1
  304. package/dist/src/internal/nitro/routes/channel-route-context.d.ts +1 -1
  305. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -1
  306. package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -1
  307. package/dist/src/internal/vercel/assemble-eve-services.d.ts +3 -2
  308. package/dist/src/internal/vercel/eve-service-contribution.d.ts +2 -3
  309. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  310. package/dist/src/internal/vercel/project-link.d.ts +2 -1
  311. package/dist/src/internal/vercel/project-link.js +1 -1
  312. package/dist/src/internal/workflow/development-world-codec.d.ts +2 -1
  313. package/dist/src/internal/workflow/world-compatibility.d.ts +2 -1
  314. package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -9
  315. package/dist/src/internal/workflow-bundle/builder-support.js +2 -3
  316. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +0 -1
  317. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
  318. package/dist/src/protocol/activity.d.ts +3 -3
  319. package/dist/src/protocol/activity.js +1 -1
  320. package/dist/src/protocol/baggage.d.ts +2 -2
  321. package/dist/src/protocol/cancel-turn.d.ts +0 -2
  322. package/dist/src/protocol/event-dedupe.d.ts +2 -1
  323. package/dist/src/protocol/event-id.d.ts +0 -6
  324. package/dist/src/protocol/event-id.js +1 -1
  325. package/dist/src/protocol/traceparent.d.ts +2 -1
  326. package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -4
  327. package/dist/src/public/channels/chat-sdk/audience.js +1 -1
  328. package/dist/src/public/channels/discord/discordChannel.d.ts +1 -1
  329. package/dist/src/public/channels/github/api.d.ts +2 -12
  330. package/dist/src/public/channels/github/api.js +1 -1
  331. package/dist/src/public/channels/github/auth.d.ts +0 -9
  332. package/dist/src/public/channels/github/auth.js +1 -1
  333. package/dist/src/public/channels/github/binding.d.ts +3 -2
  334. package/dist/src/public/channels/github/checkout.d.ts +3 -3
  335. package/dist/src/public/channels/github/defaults.d.ts +3 -2
  336. package/dist/src/public/channels/github/githubChannel.d.ts +1 -1
  337. package/dist/src/public/channels/github/limits.d.ts +0 -2
  338. package/dist/src/public/channels/github/limits.js +2 -2
  339. package/dist/src/public/channels/github/pr-context.d.ts +2 -3
  340. package/dist/src/public/channels/github/pr-context.js +1 -1
  341. package/dist/src/public/channels/github/state.d.ts +2 -1
  342. package/dist/src/public/channels/github/verify.d.ts +2 -1
  343. package/dist/src/public/channels/linear/defaults.d.ts +2 -1
  344. package/dist/src/public/channels/linear/inbound-images.d.ts +2 -1
  345. package/dist/src/public/channels/slack/app-manifest.d.ts +3 -4
  346. package/dist/src/public/channels/slack/app-manifest.js +1 -1
  347. package/dist/src/public/channels/slack/inbound.d.ts +2 -1
  348. package/dist/src/public/channels/slack/model-context.d.ts +0 -18
  349. package/dist/src/public/channels/slack/model-context.js +1 -1
  350. package/dist/src/public/channels/slack/privacy.d.ts +2 -1
  351. package/dist/src/public/channels/slack/verify.d.ts +1 -1
  352. package/dist/src/public/channels/teams/teamsChannel.d.ts +1 -1
  353. package/dist/src/public/channels/telegram/audience.d.ts +2 -3
  354. package/dist/src/public/channels/telegram/audience.js +1 -1
  355. package/dist/src/public/channels/telegram/telegramChannel.d.ts +1 -1
  356. package/dist/src/public/channels/twilio/defaults.d.ts +0 -7
  357. package/dist/src/public/channels/twilio/defaults.js +1 -1
  358. package/dist/src/public/channels/twilio/routing.d.ts +2 -1
  359. package/dist/src/public/channels/twilio/twilioChannel.d.ts +1 -1
  360. package/dist/src/public/definitions/channel.d.ts +1 -1
  361. package/dist/src/public/index.js +1 -1
  362. package/dist/src/public/memory/file/provider.js +1 -1
  363. package/dist/src/public/models/openai/chatgpt/model.d.ts +2 -1
  364. package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +1 -1
  365. package/dist/src/public/nuxt/dev-server.d.ts +3 -2
  366. package/dist/src/public/skills/index.js +1 -1
  367. package/dist/src/public/sveltekit/dev-server.d.ts +3 -2
  368. package/dist/src/public/tools/index.js +1 -1
  369. package/dist/src/runtime/compiled-artifacts-source.d.ts +0 -4
  370. package/dist/src/runtime/compiled-artifacts-source.js +1 -1
  371. package/dist/src/runtime/connections/instance-identity.d.ts +0 -3
  372. package/dist/src/runtime/connections/instance-identity.js +1 -1
  373. package/dist/src/runtime/connections/mcp-tracing.d.ts +1 -6
  374. package/dist/src/runtime/connections/mcp-tracing.js +1 -1
  375. package/dist/src/runtime/connections/openapi-client.d.ts +1 -1
  376. package/dist/src/runtime/connections/scoped-authorization.d.ts +0 -9
  377. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  378. package/dist/src/runtime/hooks/registry.d.ts +0 -7
  379. package/dist/src/runtime/hooks/registry.js +1 -1
  380. package/dist/src/runtime/loaders/artifact-paths.d.ts +2 -1
  381. package/dist/src/runtime/loaders/bundled-artifacts.d.ts +0 -1
  382. package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
  383. package/dist/src/runtime/resolve-agent.d.ts +2 -2
  384. package/dist/src/runtime/resolve-agent.js +1 -1
  385. package/dist/src/runtime/resolve-dynamic-tool.d.ts +0 -16
  386. package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
  387. package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +1 -2
  388. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  389. package/dist/src/runtime/schedules/register.d.ts +0 -4
  390. package/dist/src/runtime/schedules/register.js +1 -1
  391. package/dist/src/self-modification/credentials.d.ts +1 -4
  392. package/dist/src/self-modification/credentials.js +1 -1
  393. package/dist/src/self-modification/filesystem.d.ts +0 -1
  394. package/dist/src/self-modification/filesystem.js +1 -1
  395. package/dist/src/self-modification/git-workspace.d.ts +0 -3
  396. package/dist/src/self-modification/git-workspace.js +1 -1
  397. package/dist/src/self-modification/github-publisher.d.ts +2 -1
  398. package/dist/src/self-modification/migration.d.ts +0 -1
  399. package/dist/src/self-modification/migration.js +1 -1
  400. package/dist/src/self-modification/mode.d.ts +2 -1
  401. package/dist/src/self-modification/proposal.d.ts +0 -2
  402. package/dist/src/self-modification/proposal.js +2 -2
  403. package/dist/src/self-modification/setup.js +1 -1
  404. package/dist/src/services/dev-client/agent-info-probe.d.ts +2 -1
  405. package/dist/src/services/dev-client/request-headers.d.ts +1 -1
  406. package/dist/src/setup/ai-gateway-api-key.d.ts +2 -1
  407. package/dist/src/setup/append-env.d.ts +3 -2
  408. package/dist/src/setup/ask.d.ts +3 -3
  409. package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -1
  410. package/dist/src/setup/boxes/deploy-project.d.ts +4 -3
  411. package/dist/src/setup/boxes/link-project.d.ts +2 -1
  412. package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -1
  413. package/dist/src/setup/boxes/select-model.d.ts +0 -1
  414. package/dist/src/setup/boxes/select-model.js +1 -1
  415. package/dist/src/setup/cli/option-row.d.ts +1 -1
  416. package/dist/src/setup/cli/prompt-ui.d.ts +0 -10
  417. package/dist/src/setup/cli/prompt-ui.js +1 -1
  418. package/dist/src/setup/cli/rail-log.d.ts +0 -2
  419. package/dist/src/setup/cli/rail-log.js +2 -2
  420. package/dist/src/setup/connect-provisioning.d.ts +2 -1
  421. package/dist/src/setup/connection-connector.d.ts +2 -1
  422. package/dist/src/setup/flows/link.d.ts +2 -1
  423. package/dist/src/setup/flows/model-login.d.ts +1 -1
  424. package/dist/src/setup/flows/model-source-change.js +1 -1
  425. package/dist/src/setup/flows/registry-session.d.ts +3 -2
  426. package/dist/src/setup/integrations/discord/api.d.ts +2 -1
  427. package/dist/src/setup/integrations/discord/connect.d.ts +3 -3
  428. package/dist/src/setup/integrations/discord/connect.js +1 -1
  429. package/dist/src/setup/integrations/discord/setup.d.ts +2 -1
  430. package/dist/src/setup/integrations/file-memory/vercel.d.ts +1 -1
  431. package/dist/src/setup/integrations/github/connect.d.ts +3 -3
  432. package/dist/src/setup/integrations/github/connect.js +1 -1
  433. package/dist/src/setup/integrations/github/setup.d.ts +1 -1
  434. package/dist/src/setup/integrations/linear/connect.d.ts +2 -2
  435. package/dist/src/setup/integrations/linear/connect.js +1 -1
  436. package/dist/src/setup/integrations/linear/setup.d.ts +1 -1
  437. package/dist/src/setup/integrations/linq/connect.d.ts +3 -4
  438. package/dist/src/setup/integrations/linq/connect.js +1 -1
  439. package/dist/src/setup/integrations/linq/management.d.ts +2 -1
  440. package/dist/src/setup/integrations/linq/setup.d.ts +1 -9
  441. package/dist/src/setup/integrations/linq/setup.js +1 -1
  442. package/dist/src/setup/integrations/photon/connect.d.ts +5 -7
  443. package/dist/src/setup/integrations/photon/connect.js +1 -1
  444. package/dist/src/setup/integrations/photon/management.d.ts +5 -4
  445. package/dist/src/setup/integrations/photon/setup-flow.d.ts +2 -1
  446. package/dist/src/setup/integrations/registry.d.ts +0 -2
  447. package/dist/src/setup/integrations/registry.js +1 -1
  448. package/dist/src/setup/integrations/runner.d.ts +3 -2
  449. package/dist/src/setup/integrations/shared/scaffold.d.ts +2 -1
  450. package/dist/src/setup/integrations/shared/vercel-project.d.ts +2 -1
  451. package/dist/src/setup/integrations/shopify/setup.d.ts +2 -1
  452. package/dist/src/setup/integrations/teams/connect.d.ts +3 -3
  453. package/dist/src/setup/integrations/teams/connect.js +1 -1
  454. package/dist/src/setup/integrations/teams/setup.d.ts +2 -1
  455. package/dist/src/setup/integrations/web/setup.d.ts +2 -1
  456. package/dist/src/setup/primitives/pm/process-result.d.ts +2 -1
  457. package/dist/src/setup/primitives/pm/shared.d.ts +2 -1
  458. package/dist/src/setup/primitives/process-output.d.ts +2 -1
  459. package/dist/src/setup/quit-guard.d.ts +3 -2
  460. package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -1
  461. package/dist/src/setup/scaffold/create/project.js +1 -1
  462. package/dist/src/setup/scaffold/files.d.ts +2 -1
  463. package/dist/src/setup/scaffold/update/channels.d.ts +0 -1
  464. package/dist/src/setup/scaffold/workspace-glob.d.ts +0 -1
  465. package/dist/src/setup/scaffold/workspace-glob.js +1 -1
  466. package/dist/src/setup/scaffold/workspace-root.d.ts +2 -1
  467. package/dist/src/setup/slack-connect-create.d.ts +1 -1
  468. package/dist/src/setup/slack-connect-lifecycle.d.ts +5 -5
  469. package/dist/src/setup/slack-connect.d.ts +0 -4
  470. package/dist/src/setup/slack-connect.js +1 -1
  471. package/dist/src/setup/slackbot.d.ts +3 -3
  472. package/dist/src/setup/slackbot.js +1 -1
  473. package/dist/src/setup/vercel-project-api.d.ts +1 -1
  474. package/dist/src/setup/vercel-project.d.ts +3 -18
  475. package/dist/src/setup/vercel-project.js +0 -0
  476. package/dist/src/shared/action-types.d.ts +1 -58
  477. package/dist/src/shared/action-types.js +1 -1
  478. package/dist/src/shared/agent-definition.d.ts +0 -3
  479. package/dist/src/shared/agent-turn-outcome.d.ts +1 -3
  480. package/dist/src/shared/agent-turn-outcome.js +1 -1
  481. package/dist/src/shared/chatgpt-model.d.ts +0 -1
  482. package/dist/src/shared/chatgpt-model.js +1 -1
  483. package/dist/src/shared/conversation-context.d.ts +2 -1
  484. package/dist/src/shared/extension-package-contract.d.ts +2 -1
  485. package/dist/src/shared/forwarded-trace-policy.d.ts +3 -2
  486. package/dist/src/shared/gateway-service-tier.d.ts +2 -1
  487. package/dist/src/shared/memory-state.d.ts +0 -8
  488. package/dist/src/shared/memory-state.js +1 -1
  489. package/dist/src/shared/sandbox-environment.d.ts +0 -1
  490. package/dist/src/shared/sandbox-environment.js +1 -1
  491. package/dist/src/shared/skill-package.d.ts +0 -5
  492. package/dist/src/shared/skill-package.js +1 -1
  493. package/dist/src/shared/token-usage.d.ts +0 -7
  494. package/dist/src/shared/token-usage.js +1 -1
  495. package/dist/src/shared/ulid.d.ts +2 -8
  496. package/dist/src/shared/ulid.js +1 -1
  497. package/dist/src/shared/vercel-project.d.ts +2 -1
  498. package/dist/src/shared/vercel-services.d.ts +2 -2
  499. package/dist/src/shared/workflow-sandbox.d.ts +0 -7
  500. package/dist/src/source-change/agent-config-ast.d.ts +2 -1
  501. package/dist/src/source-change/agent-config-string-path.d.ts +2 -2
  502. package/dist/src/source-change/apply-agent-model-settings.d.ts +2 -1
  503. package/dist/src/source-change/apply-model-selection.d.ts +2 -1
  504. package/dist/src/source-change/static-source-change.d.ts +4 -3
  505. package/dist/src/subagents/invocation.d.ts +1 -1
  506. package/dist/src/subagents/tool.d.ts +2 -1
  507. package/dist/src/tools/definition.d.ts +0 -3
  508. package/dist/src/tools/durable-callbacks.d.ts +1 -2
  509. package/dist/src/tools/durable-callbacks.js +1 -1
  510. package/dist/src/tools/framework/agent.js +1 -1
  511. package/dist/src/tools/framework/task-cancel.d.ts +1 -1
  512. package/dist/src/tools/native-definition.d.ts +2 -1
  513. package/dist/src/tracing/agent-action-instrumentation.d.ts +2 -1
  514. package/dist/src/tracing/agent-memory-instrumentation.d.ts +2 -1
  515. package/dist/src/tracing/agent-otel-provider.d.ts +2 -1
  516. package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
  517. package/dist/src/tracing/agent-span-id-generator.js +1 -1
  518. package/dist/src/tracing/agent-tool-instrumentation.d.ts +2 -1
  519. package/dist/src/tracing/agent-tool-span-context.d.ts +3 -2
  520. package/dist/src/tracing/agent-trace-state.d.ts +0 -24
  521. package/dist/src/tracing/agent-trace-state.js +1 -1
  522. package/dist/src/tracing/batch-span-processor.d.ts +2 -1
  523. package/dist/src/tracing/local-trace-analysis.d.ts +4 -3
  524. package/dist/src/tracing/local-trace-discovery-index.d.ts +0 -2
  525. package/dist/src/tracing/local-trace-discovery-index.js +1 -1
  526. package/dist/src/tracing/local-trace-query.d.ts +2 -1
  527. package/dist/src/tracing/local-trace-retention.d.ts +4 -4
  528. package/dist/src/tracing/telemetry-budget.d.ts +0 -1
  529. package/dist/src/tracing/telemetry-budget.js +1 -1
  530. package/package.json +8 -8
  531. package/dist/src/cli/commands/channel-add-conflicts.d.ts +0 -21
  532. package/dist/src/cli/commands/channel-add-conflicts.js +0 -1
  533. package/dist/src/cli/commands/registry-search-presentation.d.ts +0 -16
  534. package/dist/src/cli/commands/registry-search-presentation.js +0 -6
  535. package/dist/src/compiled/_chunks/workflow/dist-BfMqXLK3.js +0 -3
  536. package/dist/src/compiled/_chunks/workflow/helpers-CNMO7zB1.js +0 -1
  537. package/dist/src/compiled/_chunks/workflow/logger-BCEj9caG.js +0 -14
  538. package/dist/src/compiled/_chunks/workflow/resume-hook-QS_cMwHn.js +0 -1
  539. package/dist/src/compiled/_chunks/workflow/run-CA5wWV2S.js +0 -1
  540. package/dist/src/compiled/_chunks/workflow/serialization-CJ265vSe.js +0 -3
  541. package/dist/src/compiled/_chunks/workflow/sleep-CBn94Ayv.js +0 -1
  542. package/dist/src/compiled/_chunks/workflow/wait-until-Bo2U6ON9.js +0 -1
  543. package/dist/src/compiler/compile-from-memory.d.ts +0 -44
  544. package/dist/src/compiler/compile-from-memory.js +0 -1
  545. package/dist/src/execution/connection-auth-tool-result.d.ts +0 -2
  546. package/dist/src/execution/connection-auth-tool-result.js +0 -1
  547. package/dist/src/internal/process/pnpm.d.ts +0 -28
  548. package/dist/src/internal/process/pnpm.js +0 -1
  549. package/dist/src/public/channels/slack/api-encoding.d.ts +0 -5
  550. package/dist/src/public/channels/slack/api-encoding.js +0 -1
  551. package/dist/src/public/definitions/instrumentation.d.ts +0 -1
  552. package/dist/src/public/definitions/instrumentation.js +0 -1
  553. package/dist/src/public/models/openai/chatgpt/unsigned-jwt.d.ts +0 -5
  554. package/dist/src/public/models/openai/chatgpt/unsigned-jwt.js +0 -1
  555. package/dist/src/sandbox/backends/probes.d.ts +0 -7
  556. package/dist/src/sandbox/backends/probes.js +0 -1
  557. package/dist/src/setup/channel-add-conflicts.d.ts +0 -28
  558. package/dist/src/setup/channel-add-conflicts.js +0 -1
  559. package/dist/src/setup/primitives/run-pnpm.d.ts +0 -1
  560. package/dist/src/setup/primitives/run-pnpm.js +0 -1
  561. package/dist/src/shared/dispatch-action.d.ts +0 -30
  562. package/dist/src/shared/dispatch-action.js +0 -1
@@ -1,14 +1,14 @@
1
1
  import type { AuthorizationRequiredStreamEvent, MessageStreamEvent, TurnFailureStreamEvent, UnstampedMessageStreamEvent } from "#protocol/message.js";
2
2
  import type { InputRequest } from "#shared/input.js";
3
3
  /** A connection authorization challenge that remains unresolved at a turn boundary. */
4
- export interface PendingAuthorization {
4
+ interface PendingAuthorization {
5
5
  readonly authorization?: AuthorizationRequiredStreamEvent["data"]["authorization"];
6
6
  readonly description: string;
7
7
  readonly name: string;
8
8
  readonly webhookUrl?: string;
9
9
  }
10
10
  /** Canonical projection of the lifecycle state represented by one turn's events. */
11
- export interface TurnEventSummary {
11
+ interface TurnEventSummary {
12
12
  readonly boundary: UnstampedMessageStreamEvent | undefined;
13
13
  readonly failure: TurnFailureStreamEvent | undefined;
14
14
  readonly inputRequests: readonly InputRequest[];
@@ -21,3 +21,4 @@ export declare function summarizeTurnEvents(events: readonly UnstampedMessageStr
21
21
  /** Collects one segment of an event stream through its current-turn boundary. */
22
22
  export declare function collectTurnEvents(stream: AsyncIterable<UnstampedMessageStreamEvent>): Promise<readonly UnstampedMessageStreamEvent[]>;
23
23
  export declare function updatePendingAuthorizations(pending: Set<string>, event: MessageStreamEvent): void;
24
+ export {};
@@ -47,16 +47,16 @@
47
47
  "@vercel/otel": "2.1.3",
48
48
  "@vercel/sandbox": "3.3.0",
49
49
  "@vercel/sdk": "1.28.8",
50
- "@workflow/core": "5.0.0-beta.56",
51
- "@workflow/errors": "5.0.0-beta.23",
50
+ "@workflow/core": "5.0.0-beta.57",
51
+ "@workflow/errors": "5.0.0-beta.24",
52
52
  "@workflow/serde": "5.0.0-beta.2",
53
- "@workflow/world": "5.0.0-beta.38",
54
- "@workflow/world-local": "5.0.0-beta.47",
55
- "@workflow/world-vercel": "5.0.0-beta.51",
53
+ "@workflow/world": "5.0.0-beta.39",
54
+ "@workflow/world-local": "5.0.0-beta.48",
55
+ "@workflow/world-vercel": "5.0.0-beta.52",
56
56
  "zod": "4.5.4",
57
57
  "zod-validation-error": "5.0.0"
58
58
  },
59
- "scriptHash": "175f2363880eee924053e04383385b7692b92db4c87f947c473f4ef1d2f7e8d0",
59
+ "scriptHash": "1e89a7356b687014be1b3dd2000b50976522132468554b4609c30d6182915242",
60
60
  "toolVersions": {
61
61
  "rolldown": "1.2.9",
62
62
  "typescript": "7.0.2"
@@ -1,2 +1,2 @@
1
- import"../../_chunks/workflow/dist-BQSf8Hax.js";import{An as e,Kn as t,Vn as n}from"../../_chunks/workflow/logger-BCEj9caG.js";import{d as r,i}from"../../_chunks/workflow/dist-BfMqXLK3.js";import{G as a,W as o,b as s,ct as c,i as l,it as u,lt as d,nt as f,rt as p,st as m,tt as h,ut as g,w as _}from"../../_chunks/workflow/serialization-CJ265vSe.js";import{a as v,i as y,r as b,t as x}from"../../_chunks/workflow/attribute-changes-DzJovO_f.js";import{n as S}from"../../_chunks/workflow/resume-hook-QS_cMwHn.js";import{t as C}from"../../_chunks/workflow/sleep-CBn94Ayv.js";function w(e){y(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,w)}function T(e){y(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,T)}function E({schema:e}={}){function t(e){y(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await S(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
2
- `)}`)}return await S(t,r.value)}}}async function D(e,n={}){let r=a.getStore(),o=r?.workflowMetadata?.workflowRunId;if(!o)throw new i(`setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let s={type:`step`,stepId:r.stepMetadata.stepId,attempt:r.stepMetadata.attempt},c=x(e,n,s);if(c.length!==0){if(r.runReadyBarrier)try{await r.runReadyBarrier}catch{}await(await t()).events.create(o,{eventType:`attr_set`,specVersion:8,eventData:{changes:c,writer:s,...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}}function O(){let e=a.getStore();return e||b(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,O),e.stepMetadata}function k(){let e=a.getStore();return e||v(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,k),e.workflowMetadata}function A(t={}){let r=a.getStore();r||v(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,A);let{namespace:i}=t,y=r.workflowMetadata.workflowRunId,b=o(y,i);r.writables??=new Map;let x=r.writables,S=x.get(b);if(S)return S.writable;let C=h();C.deferReleaseSettlement=r.streamStates!==void 0;let w=_(s(globalThis,r.ops,y,r.encryptionKey,!0,r.runReadyBarrier),r.encryptionKey),T=new l(y,b,r.runReadyBarrier);r.streamStates??=[],r.streamStates.push(C),r.ops.push(C.promise),f(w.readable,T,C).catch(()=>{});let E=u(w.writable,C);return p(E,C),Object.defineProperty(E,m,{value:b,writable:!1}),Object.defineProperty(E,g,{value:y,writable:!1}),r.workflowDeploymentId&&Object.defineProperty(E,c,{value:r.workflowDeploymentId,writable:!1}),e(r.encryptionKey)&&Object.defineProperty(E,d,{value:n(r.encryptionKey.keyPair.publicKey),writable:!1}),x.set(b,{writable:E,state:C}),E}export{i as FatalError,r as RetryableError,w as createHook,T as createWebhook,E as defineHook,O as getStepMetadata,k as getWorkflowMetadata,A as getWritable,D as setAttributes,C as sleep};
1
+ import"../../_chunks/workflow/dist-BUFGAKRb.js";import{Fn as e,Kn as t,Zn as n}from"../../_chunks/workflow/logger-D4GJNTk4.js";import{d as r,i}from"../../_chunks/workflow/dist-CaNNONeg.js";import{G as a,W as o,b as s,ct as c,i as l,it as u,lt as d,nt as f,rt as p,st as m,tt as h,ut as g,w as _}from"../../_chunks/workflow/serialization-CNIYl1D3.js";import{a as v,i as y,r as b,t as x}from"../../_chunks/workflow/attribute-changes-D721NpZv.js";import{n as S}from"../../_chunks/workflow/resume-hook-uTW-jBYz.js";import{t as C}from"../../_chunks/workflow/sleep-DFKgN7UG.js";function w(e){y(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,w)}function T(e){y(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,T)}function E({schema:e}={}){function t(e){y(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await S(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
2
+ `)}`)}return await S(t,r.value)}}}async function D(e,t={}){let r=a.getStore(),o=r?.workflowMetadata?.workflowRunId;if(!o)throw new i(`setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let s={type:`step`,stepId:r.stepMetadata.stepId,attempt:r.stepMetadata.attempt},c=x(e,t,s);if(c.length!==0){if(r.runReadyBarrier)try{await r.runReadyBarrier}catch{}await(await n()).events.create(o,{eventType:`attr_set`,specVersion:8,eventData:{changes:c,writer:s,...t.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}})}}function O(){let e=a.getStore();return e||b(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,O),e.stepMetadata}function k(){let e=a.getStore();return e||v(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,k),e.workflowMetadata}function A(n={}){let r=a.getStore();r||v(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,A);let{namespace:i}=n,y=r.workflowMetadata.workflowRunId,b=o(y,i);r.writables??=new Map;let x=r.writables,S=x.get(b);if(S)return S.writable;let C=h();C.deferReleaseSettlement=r.streamStates!==void 0;let w=_(s(globalThis,r.ops,y,r.encryptionKey,!0,r.runReadyBarrier),r.encryptionKey),T=new l(y,b,r.runReadyBarrier);r.streamStates??=[],r.streamStates.push(C),r.ops.push(C.promise),f(w.readable,T,C).catch(()=>{});let E=u(w.writable,C);return p(E,C),Object.defineProperty(E,m,{value:b,writable:!1}),Object.defineProperty(E,g,{value:y,writable:!1}),r.workflowDeploymentId&&Object.defineProperty(E,c,{value:r.workflowDeploymentId,writable:!1}),e(r.encryptionKey)&&Object.defineProperty(E,d,{value:t(r.encryptionKey.keyPair.publicKey),writable:!1}),x.set(b,{writable:E,state:C}),E}export{i as FatalError,r as RetryableError,w as createHook,T as createWebhook,E as defineHook,O as getStepMetadata,k as getWorkflowMetadata,A as getWritable,D as setAttributes,C as sleep};
@@ -1 +1 @@
1
- import{A as e}from"../../_chunks/workflow/dist-BfMqXLK3.js";import{i as t,n}from"../../_chunks/workflow/global-BQnKzRXo.js";const r=Symbol.for(`@workflow/core//registeredSteps`),i=globalThis,a=i[r]??=new Map,o=new Set([`__builtin_response_array_buffer`,`__builtin_response_json`,`__builtin_response_text`]);function s(e){let t=e.split(`//`);if(t.length!==3||t[0]!==`step`)return[];let n=t[1],r=t[2],i=new Set,a=e=>{e!==n&&i.add(e)};if(n.startsWith(`./workflows/`)){let e=n.slice(2);a(`./example/${e}`),a(`./src/${e}`)}else if(n.startsWith(`./example/workflows/`)){let e=n.slice(10);a(`./${e}`),a(`./src/${e}`)}else if(n.startsWith(`./src/workflows/`)){let e=n.slice(6);a(`./${e}`),a(`./example/${e}`)}return Array.from(i,e=>`step//${e}//${r}`)}function c(e){if(o.has(e)){for(let[t,n]of a.entries())if(t.endsWith(`//${e}`))return n}}function l(e,t){a.set(e,t),t.stepId=e}function u(e){let t=a.get(e);if(t)return t;for(let t of s(e)){let e=a.get(t);if(e)return e}let n=c(e);if(n)return n}const d={hook:[`hook`,`wait`,`step`],wait:[`hook`,`step`],step:[`wait`,`hook`,`step`]};function f(e,t,n,r){return n>=t||!d[e].includes(r.kind)?!1:!(e===`step`&&!r.armed)}function p(e,t,n,r){let i=r.get(t);if(i!==void 0)return i;let a=m(e,t,n,r);return r.set(t,a),a}function m(e,t,n,r){if(!n.armed)return!1;for(let[i,a]of e)if(f(n.kind,t,i,a)&&!p(e,i,a,r))return!1;return!0}function h(){return process.env.WORKFLOW_LOG_ORDER_DRAWS!==`0`}function g(e){return e===0&&typeof setImmediate==`function`?new Promise(e=>setImmediate(e)):new Promise(t=>setTimeout(t,e))}async function _(e,t){for(;;){let n=e.mintCount??0,r=e.pendingDeliveries;if(await g(await e.promiseQueue.then(()=>!1,()=>!0)?50:0),(e.mintCount??0)!==n||r!==0||e.pendingDeliveries!==0)continue;let i=!1;for(let[n,r]of e.pendingDeliveryBarriers??[])if(n<t&&r.armed){i=!0;break}if(!i)return}}async function v(e,t,n){if(t===void 0||!e.pendingDeliveryBarriers)return;let r=e.pendingDeliveryBarriers,i=[];for(let[e,a]of r)f(n,t,e,a)&&i.push(a.released);if(i.length>0&&await Promise.all(i),h()){await _(e,t);return}i.length>0&&await new Promise(e=>setTimeout(e,0))}function y(n,r,i,a){let o=!1,s=()=>!o&&(o=!0,n.advanceClock?.(a.deliveredAt),!0),c=n.pendingDeliveryBarriers;if(!c||r===void 0)return{markDelivered:()=>{s()},arm:()=>{}};let l=a=>{if(c.has(r))throw new e(`Delivery barrier already registered at event index ${r}`);let{promise:o,resolve:s}=t(),l={kind:i,released:o,armed:a,retired:!1,retire:()=>{l.retired||(l.retired=!0,c.get(r)===l&&c.delete(r),s())}};return c.set(r,l),x(n),l},u=l(a.armed??!0);return{markDelivered:()=>{s()&&u.retire()},arm:()=>{if(!o){if(u.retired){u=l(!0);return}if(c.get(r)!==u)throw new e(`Delivery barrier lost ownership of event index ${r}`);u.armed=!0}}}}const b=new WeakSet;function x(e){let t=e.pendingDeliveryBarriers;if(!t||b.has(e))return;b.add(e);let n=()=>{setTimeout(i,0)},r=()=>{setTimeout(i,50)},i=()=>{if(t.size===0){b.delete(e);return}if(!S(e)){e.promiseQueue.then(n,r);return}for(;t.size>0&&S(e);){let e,n;for(let[r,i]of t)(e===void 0||r<e)&&(e=r,n=i);n?.retire()}setTimeout(i,0)};setTimeout(i,0)}function S(e){return e.pendingDeliveries===0&&!C(e)}function C(e){let t=e.pendingDeliveryBarriers;if(!t||t.size===0)return!1;let n=new Map;for(let[e,r]of t)if(p(t,e,r,n))return!0;return!1}function w(e){return e.pendingDeliveries===0&&(!e.pendingDeliveryBarriers||e.pendingDeliveryBarriers.size===0)}function T(e,t){let n=()=>{w(e)?t():e.promiseQueue.then(()=>{setTimeout(n,0)})};setTimeout(n,0)}function E(e){let t=e.suspensionGeneration;T(e,()=>{t===e.suspensionGeneration&&e.onWorkflowError(new n(e.invocationsQueue,e.globalThis))})}export{v as awaitEarlierDeliveries,u as getStepFunction,C as hasParkedCommittedDelivery,w as isDeliveryIdle,y as registerDeliveryBarrier,l as registerStepFunction,T as scheduleWhenIdle,E as scheduleWorkflowSuspension};
1
+ import{A as e}from"../../_chunks/workflow/dist-CaNNONeg.js";import{i as t,n}from"../../_chunks/workflow/global-DKbOgrts.js";const r=Symbol.for(`@workflow/core//registeredSteps`),i=globalThis,a=i[r]??=new Map,o=new Set([`__builtin_response_array_buffer`,`__builtin_response_json`,`__builtin_response_text`]);function s(e){let t=e.split(`//`);if(t.length!==3||t[0]!==`step`)return[];let n=t[1],r=t[2],i=new Set,a=e=>{e!==n&&i.add(e)};if(n.startsWith(`./workflows/`)){let e=n.slice(2);a(`./example/${e}`),a(`./src/${e}`)}else if(n.startsWith(`./example/workflows/`)){let e=n.slice(10);a(`./${e}`),a(`./src/${e}`)}else if(n.startsWith(`./src/workflows/`)){let e=n.slice(6);a(`./${e}`),a(`./example/${e}`)}return Array.from(i,e=>`step//${e}//${r}`)}function c(e){if(o.has(e)){for(let[t,n]of a.entries())if(t.endsWith(`//${e}`))return n}}function l(e,t){a.set(e,t),t.stepId=e}function u(e){let t=a.get(e);if(t)return t;for(let t of s(e)){let e=a.get(t);if(e)return e}let n=c(e);if(n)return n}const d={hook:[`hook`,`wait`,`step`],wait:[`hook`,`step`],step:[`wait`,`hook`,`step`]};function f(e,t,n,r){return n>=t||!d[e].includes(r.kind)?!1:!(e===`step`&&!r.armed)}function p(e,t,n,r){let i=r.get(t);if(i!==void 0)return i;let a=m(e,t,n,r);return r.set(t,a),a}function m(e,t,n,r){if(!n.armed)return!1;for(let[i,a]of e)if(f(n.kind,t,i,a)&&!p(e,i,a,r))return!1;return!0}function h(){return process.env.WORKFLOW_LOG_ORDER_DRAWS!==`0`}function g(e){return e===0&&typeof setImmediate==`function`?new Promise(e=>setImmediate(e)):new Promise(t=>setTimeout(t,e))}async function _(e,t){for(;;){let n=e.mintCount??0,r=e.pendingDeliveries;if(await g(await e.promiseQueue.then(()=>!1,()=>!0)?50:0),(e.mintCount??0)!==n||r!==0||e.pendingDeliveries!==0)continue;let i=!1;for(let[n,r]of e.pendingDeliveryBarriers??[])if(n<t&&r.armed){i=!0;break}if(!i)return}}async function v(e,t,n){if(t===void 0||!e.pendingDeliveryBarriers)return;let r=e.pendingDeliveryBarriers,i=[];for(let[e,a]of r)f(n,t,e,a)&&i.push(a.released);if(i.length>0&&await Promise.all(i),h()){await _(e,t);return}i.length>0&&await new Promise(e=>setTimeout(e,0))}function y(n,r,i,a){let o=!1,s=()=>!o&&(o=!0,n.advanceClock?.(a.deliveredAt),!0),c=n.pendingDeliveryBarriers;if(!c||r===void 0)return{markDelivered:()=>{s()},arm:()=>{}};let l=a=>{if(c.has(r))throw new e(`Delivery barrier already registered at event index ${r}`);let{promise:o,resolve:s}=t(),l={kind:i,released:o,armed:a,retired:!1,retire:()=>{l.retired||(l.retired=!0,c.get(r)===l&&c.delete(r),s())}};return c.set(r,l),x(n),l},u=l(a.armed??!0);return{markDelivered:()=>{s()&&u.retire()},arm:()=>{if(!o){if(u.retired){u=l(!0);return}if(c.get(r)!==u)throw new e(`Delivery barrier lost ownership of event index ${r}`);u.armed=!0}}}}const b=new WeakSet;function x(e){let t=e.pendingDeliveryBarriers;if(!t||b.has(e))return;b.add(e);let n=()=>{setTimeout(i,0)},r=()=>{setTimeout(i,50)},i=()=>{if(t.size===0){b.delete(e);return}if(!S(e)){e.promiseQueue.then(n,r);return}for(;t.size>0&&S(e);){let e,n;for(let[r,i]of t)(e===void 0||r<e)&&(e=r,n=i);n?.retire()}setTimeout(i,0)};setTimeout(i,0)}function S(e){return e.pendingDeliveries===0&&!C(e)}function C(e){let t=e.pendingDeliveryBarriers;if(!t||t.size===0)return!1;let n=new Map;for(let[e,r]of t)if(p(t,e,r,n))return!0;return!1}function w(e){return e.pendingDeliveries===0&&(!e.pendingDeliveryBarriers||e.pendingDeliveryBarriers.size===0)}function T(e,t){let n=()=>{w(e)?t():e.promiseQueue.then(()=>{setTimeout(n,0)})};setTimeout(n,0)}function E(e){let t=e.suspensionGeneration;T(e,()=>{t===e.suspensionGeneration&&e.onWorkflowError(new n(e.invocationsQueue,e.globalThis))})}export{v as awaitEarlierDeliveries,u as getStepFunction,C as hasParkedCommittedDelivery,w as isDeliveryIdle,y as registerDeliveryBarrier,l as registerStepFunction,T as scheduleWhenIdle,E as scheduleWorkflowSuspension};
@@ -126,9 +126,10 @@ export declare function isResilientStepDispatchEnabled(): boolean;
126
126
  * `world.events.createBatch` call (one durable write, per-event outcomes)
127
127
  * instead of one write per event. Only engages when the World implements the
128
128
  * optional `events.createBatch` AND the run is on slot identity
129
- * (specVersion >= 6) AND the suspension carries no attribute/hook writes and
130
- * no resilient step dispatch. Everything else keeps the single-event path
131
- * byte-for-byte.
129
+ * (specVersion >= 6) AND the suspension carries no attribute writes and no
130
+ * resilient step dispatch. Hook writes in the same suspension go through the
131
+ * single-event path concurrently with the batch. Everything else keeps the
132
+ * single-event path byte-for-byte.
132
133
  *
133
134
  * Reads `process.env.WORKFLOW_BATCH_TRANSITIONS` lazily. Default **ON**;
134
135
  * disabled only by an explicit `'0'` / `'false'` (case-insensitive), the
@@ -46,6 +46,14 @@ export interface HealthCheckResult {
46
46
  * which fails that gate closed.
47
47
  */
48
48
  hookResumeInputVersion?: number;
49
+ /**
50
+ * The format the responding deployment answered in, set whenever it
51
+ * answered: `'text'` for the plain-text reply of deployments that predate
52
+ * the versioned JSON response (spec 3), `'json'` otherwise. A JSON reply
53
+ * proves the responder runs spec 3 or later even when its `specVersion`
54
+ * field is missing or malformed.
55
+ */
56
+ format?: 'json' | 'text';
49
57
  }
50
58
  /**
51
59
  * Checks if the given message is a health check payload.
@@ -113,6 +121,21 @@ export declare function appendUniqueEvents(target: Event[], events: readonly Eve
113
121
  * than a reconstruction.
114
122
  */
115
123
  export declare function insertEventByEventId(target: Event[], event: Event): void;
124
+ /**
125
+ * How replay reads the event log. Replay recomputes every step's arguments by
126
+ * re-running workflow code and never reads the recorded ones (a step reads its
127
+ * input from the step entity), so replay reads let the World leave them out.
128
+ * For a workflow passing growing state into its steps, they are the part of
129
+ * the log that grows quadratically.
130
+ */
131
+ export declare const REPLAY_RESOLVE_DATA: "skip-step-inputs";
132
+ /**
133
+ * Params for a write whose inline delta (`sinceCursor`) is folded into a
134
+ * replay log: that delta is read the way replay reads the log. The created
135
+ * event and `step` entity are unaffected, so a write that asks for no delta
136
+ * is left exactly as it was.
137
+ */
138
+ export declare function withReplayDelta(params: CreateEventParams | undefined): CreateEventParams | undefined;
116
139
  /**
117
140
  * Loads workflow run events by iterating through all pages of paginated
118
141
  * results. Events are returned in chronological (ascending) order for
@@ -1 +1 @@
1
- import{C as e,E as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S,w as C,x as w,y as T}from"../../../_chunks/workflow/helpers-CNMO7zB1.js";export{b as SLOT_GAP_RECHECK_ATTEMPTS,h as absorbSkippedSlotReport,v as appendEventLog,f as appendUniqueEvents,a as findEventSlotGap,g as getQueueOverhead,y as getWorkflowQueueName,s as handleHealthCheckMessage,p as healthCheck,x as insertEventByEventId,c as isSlotGapCheckEnabled,l as loadWorkflowRunEvents,_ as maxEventSlot,m as memoizeEncryptionKey,d as mergeReportedEvents,u as parseHealthCheckPayload,i as preconditionEventDelta,S as queueMessage,T as queueMessages,o as resolveRunEncryptionKey,w as rootRunIdFrom,n as runDispatchContext,e as settleEventSlotGap,C as slotSnapshotParams,r as stepDispatchIdempotencyKey,t as withHealthCheck};
1
+ import{C as e,D as t,E as n,O as r,S as i,T as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,v as w,w as T,x as E,y as D}from"../../../_chunks/workflow/helpers-DkKxg_yn.js";export{S as REPLAY_RESOLVE_DATA,_ as SLOT_GAP_RECHECK_ATTEMPTS,b as absorbSkippedSlotReport,m as appendEventLog,s as appendUniqueEvents,v as findEventSlotGap,x as getQueueOverhead,l as getWorkflowQueueName,h as handleHealthCheckMessage,C as healthCheck,u as insertEventByEventId,d as isSlotGapCheckEnabled,y as loadWorkflowRunEvents,g as maxEventSlot,p as memoizeEncryptionKey,f as mergeReportedEvents,o as parseHealthCheckPayload,w as preconditionEventDelta,D as queueMessage,c as queueMessages,E as resolveRunEncryptionKey,i as rootRunIdFrom,e as runDispatchContext,T as settleEventSlotGap,a as slotSnapshotParams,n as stepDispatchIdempotencyKey,t as withHealthCheck,r as withReplayDelta};
@@ -33,9 +33,11 @@ export declare function publishHookWakeWithRetry(publish: () => Promise<unknown>
33
33
  * Same durability contract as `resumeHook()`'s wake: the row is durable
34
34
  * before this runs, the publish is retried on transport-shaped failures, and
35
35
  * a publish that still fails is logged rather than failing the claimer —
36
- * nothing of the claimer's is wrong, and the victim reads the row on its
37
- * next invocation for any reason. The idempotency key is the claimer's hook
38
- * id, so a claimer retrying its creation republishes at most one wake.
36
+ * nothing of the claimer's is wrong, every later replay of the claimer inside
37
+ * the republish window tries again ({@link forcedCreationsOwingWake}), and
38
+ * the victim reads the row on its next invocation for any reason. The
39
+ * idempotency key is the claimer's hook id, so those republishes collapse
40
+ * into one wake.
39
41
  *
40
42
  * Skipped when the victim is the claimer itself (a run taking over its own
41
43
  * earlier hook is already running) and when the World recorded no
@@ -44,46 +46,77 @@ export declare function publishHookWakeWithRetry(publish: () => Promise<unknown>
44
46
  */
45
47
  export declare function publishForceClaimVictimWake(world: World, claimerRunId: string, hook: Pick<Hook, 'hookId' | 'claimedFrom'>): Promise<'published' | 'skipped' | 'failed'>;
46
48
  /**
47
- * The forced hook creation whose victim wake this run still owes, if any: the
48
- * forced `hook_created` is the last event the run's own replay appended.
49
+ * How long after a forced `hook_created` a replay of the claimer keeps
50
+ * republishing its victim's wake: 24 hours, measured from the row's
51
+ * `createdAt`.
52
+ *
53
+ * The bound has to outlast every redelivery of the invocation that journaled
54
+ * the creation, because that redelivery is the replay that must repay a wake
55
+ * the invocation died before publishing. A queue message is retained for 24
56
+ * hours from its send and the creation is written after the send, so any such
57
+ * redelivery arrives within 24 hours of the creation. The same 24 hours is the
58
+ * Vercel queue's idempotency window (`min(retention, 24h)`), so every
59
+ * republish inside it collapses, under `hook-force-claim-<hookId>`, into the
60
+ * one wake that was (or now is) delivered. Past it a republish would be a
61
+ * genuinely new message, which is what the bound saves. world-postgres
62
+ * remembers a completed key in-process to the same effect; world-local
63
+ * dedupes a key only while its message is in flight, so there a republish can
64
+ * deliver the victim one more replay, which reads nothing new.
65
+ */
66
+ export declare const FORCE_CLAIM_WAKE_REPUBLISH_WINDOW_MS: number;
67
+ /**
68
+ * The forced hook creations whose victim wake this run may still owe: every
69
+ * forced `hook_created` (one carrying `forceClaimedFrom`) in the log whose
70
+ * `createdAt` is within {@link FORCE_CLAIM_WAKE_REPUBLISH_WINDOW_MS} of
71
+ * `nowMs`.
49
72
  *
50
73
  * A forced creation is followed by a wake of the run it took the token from.
51
74
  * If the invocation died between the two, the creation is in the log and the
52
- * victim was never told; the row itself is the durable record of that debt.
53
- * As long as it is the last event THIS RUN wrote, the run has made no progress
54
- * since, so the invocation that should have woken the victim did not finish,
55
- * and the replay republishes (under the hook's idempotency key, so a wake that
56
- * did go out is not duplicated). The first event the run appends after it
57
- * ends the republishing.
75
+ * victim was never told; the row itself is the durable record of that debt,
76
+ * and nothing records that the wake went out. So the replay does not try to
77
+ * infer it: it republishes for every recent forced creation, and the hook's
78
+ * idempotency key collapses a wake that did go out (a duplicate that slips
79
+ * past a World's dedupe is one harmless replay of the victim).
58
80
  *
59
- * "This run wrote" matters: a delivery appends `hook_received` to this log
60
- * from another request, a sealed-log World appends `noop`, and a LATER
61
- * claimer taking the token from this run appends
62
- * `hook_disposed{forceClaimedBy}`. None is progress of this run — the model
63
- * (`ForceWakeOnce.cfg`'s sibling trace) has a delivery land between the crash
64
- * and the retry, and a rule that looked at the bare tail would then never
65
- * wake the victim. The foreign disposal is the chain case: this run took the
66
- * token from A, died before waking A, and was itself taken from by C. Its own
67
- * wake (from C) is the very invocation that must repay A's — the run's own
68
- * `hook_disposed` (a `dispose()` in its code) IS its progress and still ends
69
- * the debt, but a row another run put here does not. Both engines call this
70
- * on the log they loaded for the invocation, before writing anything.
81
+ * The rule reads nothing written after the creation, which is what makes it
82
+ * sound. Any row can land between the creation and the wake: a step, wait,
83
+ * attribute or other hook row the same suspension writes concurrently
84
+ * (neither engine holds those for the wake), a step or wait terminal from
85
+ * another invocation, a delivery's `hook_received`, a sealed-log `noop`, or a
86
+ * later claimer's `hook_disposed{forceClaimedBy}` taking the token from this
87
+ * run. None of them says the wake was published. The last is the chain case:
88
+ * this run took the token from A, died before waking A, and was taken from by
89
+ * C; C's wake of this run is the invocation that repays A's.
71
90
  *
72
- * Reading only the last own row is sound because both engines keep every
73
- * other write of the invocation off that tail until the wake is out: a token
74
- * group holding a forced creation runs first, one group at a time, publishing
75
- * its wake before its next write, and nothing else is dispatched until those
76
- * groups have settled. Were a sibling hook's creation (or, in QuickJS, a step
77
- * or wait) allowed to land concurrently, a crash before the publish would
78
- * leave that row last and hide the debt.
91
+ * The time is the row's `createdAt`, never one decoded from its event id (a
92
+ * slot-numbered id carries none). Under slot identity it is the writer's
93
+ * client clock, clamped by the World to at most an hour ahead of its own, so
94
+ * skew moves the window's edge by at most that much; a creation dated ahead of
95
+ * `nowMs` counts as recent, and one whose time cannot be read is treated as
96
+ * recent too, erring toward a wake rather than a stranded victim.
79
97
  */
80
- export declare function forcedCreationOwingWake(events: readonly Event[] | undefined): (Event & {
98
+ export declare function forcedCreationsOwingWake(events: readonly Event[] | undefined, nowMs?: number): (Event & {
81
99
  eventType: 'hook_created';
82
- }) | undefined;
100
+ })[];
83
101
  /**
84
- * Republish the wake {@link forcedCreationOwingWake} says is owed. Shared by
85
- * the node:vm suspension handler and the QuickJS entrypoint so the two engines
86
- * cannot drift on the durability contract.
102
+ * Republish the wakes {@link forcedCreationsOwingWake} says may be owed.
103
+ * Shared by the node:vm suspension handler and the QuickJS entrypoint so the
104
+ * two engines cannot drift on the durability contract.
105
+ *
106
+ * `alreadyWoken` is the invocation's record of the hooks whose victim wake it
107
+ * has already published or attempted, the forced creations it made itself
108
+ * included: an engine that replays more than once per invocation passes the
109
+ * same set every time, so each hook costs one send per invocation. Hooks this
110
+ * call publishes are added to it.
111
+ *
112
+ * Self-claims and victims with no recorded `workflowName` are skipped
113
+ * silently: the creating invocation already logged the latter, and a replay
114
+ * repeating it would say nothing new. Never rejects; a publish that fails
115
+ * after its retries is logged, and the next replay inside the window tries
116
+ * again.
87
117
  */
88
- export declare function republishOwedForceClaimVictimWake(world: World, runId: string, events: readonly Event[] | undefined): Promise<void>;
118
+ export declare function republishOwedForceClaimVictimWakes(world: World, runId: string, events: readonly Event[] | undefined, options?: {
119
+ alreadyWoken?: Set<string>;
120
+ nowMs?: number;
121
+ }): Promise<void>;
89
122
  //# sourceMappingURL=hook-wake.d.ts.map
@@ -1,40 +1,39 @@
1
1
  import { WorkflowRunFailedError } from '#compiled/@workflow/errors/index.js';
2
2
  import type { PayloadKey } from '../serialization/encryption.js';
3
3
  import { Run } from './run.js';
4
- /**
5
- * Parameters passed to an {@link WorkflowLifecycleHooks.onRunCompleted}
6
- * handler.
7
- */
8
- export interface RunCompletedHookParams {
9
- /** The workflow name, available without fetching the run. */
4
+ interface RunHookParams {
5
+ /**
6
+ * The machine-readable workflow identifier, such as
7
+ * `workflow//./src/workflows/order//processOrder`, available without a read.
8
+ * Unlike this string, `run.workflowName` is a Promise that fetches metadata.
9
+ */
10
10
  workflowName: string;
11
11
  /**
12
- * The completed run. The instance hydrates lazily, so reading
12
+ * The transitioned run. The instance hydrates lazily, so reading
13
13
  * `run.returnValue` (or any other accessor) fetches from the backend only
14
14
  * when the handler actually uses it.
15
15
  */
16
16
  run: Run<unknown>;
17
17
  }
18
+ /** Parameters passed to an {@link WorkflowLifecycleHooks.onRunCompleted} handler. */
19
+ export interface RunCompletedHookParams extends RunHookParams {
20
+ }
18
21
  /**
19
22
  * Parameters passed to an {@link WorkflowLifecycleHooks.onRunFailed}
20
23
  * handler.
21
24
  */
22
- export interface RunFailedHookParams {
23
- /** The workflow name, available without fetching the run. */
24
- workflowName: string;
25
- /**
26
- * The failed run. The instance hydrates lazily, so accessors fetch from
27
- * the backend only when the handler actually uses them.
28
- */
29
- run: Run<unknown>;
25
+ export interface RunFailedHookParams extends RunHookParams {
30
26
  /**
31
- * The failure, in the same shape `run.returnValue` rejects with: a
32
- * `WorkflowRunFailedError` whose `errorCode` carries the failure
33
- * classification (e.g. `USER_ERROR`, `RUNTIME_ERROR`) and whose `cause` is
27
+ * The persisted failure hydrated for reporting. Unlike `run.returnValue`,
28
+ * readable streams load only when consumed and abort signals reflect their
29
+ * persisted state without live subscriptions. Writable streams retain their
30
+ * normal forwarding setup.
31
+ *
32
+ * This `WorkflowRunFailedError` has an `errorCode` carrying the failure
33
+ * classification (e.g. `USER_ERROR`, `RUNTIME_ERROR`). Its `cause` is
34
34
  * the hydrated persisted value (registered Error subclass identity preserved).
35
- * Streams are read only when consumed; abort signals reflect their persisted
36
- * state without live subscriptions. If hydration fails, `cause` is a generic
37
- * Error, matching `run.returnValue`'s fallback.
35
+ * If hydration fails, `cause` is a generic Error, matching
36
+ * `run.returnValue`'s fallback.
38
37
  */
39
38
  error: WorkflowRunFailedError;
40
39
  }
@@ -65,11 +64,14 @@ export interface WorkflowLifecycleHooks {
65
64
  * CLI or dashboard) do not fire handlers in the app.
66
65
  * - Handlers are fire-and-forget: they cannot delay or change the run's
67
66
  * outcome, and a throwing handler is logged and swallowed. On Vercel,
68
- * `waitUntil` keeps the invocation alive. On other hosts handlers run
67
+ * `waitUntil` keeps the invocation alive for handlers and background stream
68
+ * operations from the hydrated failure. On other hosts handlers run
69
69
  * detached, and freezing serverless hosts may not let them finish.
70
70
  * - Reporting is best effort: callbacks are not retried if the invocation
71
71
  * dies before they finish. Use the event log as the system of record.
72
72
  * - Multiple registrations are allowed; handlers run in registration order.
73
+ * Registrations are not deduplicated. Unregister the previous hooks before
74
+ * registering again during hot reload or module re-evaluation.
73
75
  *
74
76
  * @returns A function that unregisters these hooks.
75
77
  */
@@ -87,4 +89,5 @@ export declare function dispatchRunCompletedHooks(runId: string, workflowName: s
87
89
  * @param errorCode - The classification written to the event's `errorCode`.
88
90
  */
89
91
  export declare function dispatchRunFailedHooks(runId: string, workflowName: string, error: unknown, encryptionKey: PayloadKey | undefined, errorCode: string): void;
92
+ export {};
90
93
  //# sourceMappingURL=lifecycle-hooks.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The spec version to stamp on an event written to a run by a process that may
3
+ * not be the one executing it: the run's own version when it is lower than this
4
+ * SDK's.
5
+ *
6
+ * The runtime executing a run reads every event in its log, and one built
7
+ * against a lower spec version (an older deployment, or another SDK) rejects an
8
+ * event stamped above what it supports. The Python SDK rejects the run's whole
9
+ * event log over a single such event. Capped at this SDK's version too, since
10
+ * that is the newest format this SDK can write.
11
+ *
12
+ * `whenUnknown` is used for a run with no recorded version. It defaults to this
13
+ * SDK's; callers that treat such a run as legacy pass `SPEC_VERSION_LEGACY`.
14
+ */
15
+ export declare function specVersionForRunWrite(runSpecVersion: number | undefined, whenUnknown?: number): number;
16
+ //# sourceMappingURL=run-spec-version.d.ts.map
@@ -1,5 +1,53 @@
1
1
  import type { RunRetention, World } from '#compiled/@workflow/world/index.js';
2
+ import { type HealthCheckResult } from './helpers.js';
2
3
  import { Run } from './run.js';
4
+ /**
5
+ * Where a run's stamped spec version came from, recorded on the `start()`
6
+ * span so "why is this run on spec N?" is answerable without reading code.
7
+ */
8
+ export type SpecVersionSource = 'same-deployment' | 'explicit' | 'probe' | 'probe-unversioned' | 'probe-malformed' | 'probe-miss' | 'no-probe-channel';
9
+ /**
10
+ * The spec version to stamp on a run that another deployment will execute.
11
+ *
12
+ * A run's spec version is a promise about the runtime that reads and writes
13
+ * its event log, and for a cross-deployment start that is the target, not
14
+ * this caller. The capability probe runs inside the target and reports the
15
+ * version the target itself mints (which already honours the target's own
16
+ * `WORKFLOW_SEALED_LOG` switch), so that is the answer, capped at what this
17
+ * caller's World mints: the caller writes `run_created` and the arguments,
18
+ * and must never stamp a version it could not have written itself.
19
+ *
20
+ * When the target does not report a usable version:
21
+ *
22
+ * - a plain-text reply predates the versioned JSON health response, which
23
+ * arrived with spec 3 (CBOR queue transport), so it is stamped as
24
+ * event-sourced: such a target cannot read a CBOR `runInput`.
25
+ * - a JSON reply without a usable `specVersion` still proves the target is
26
+ * at spec 3 or later, so it is stamped with CBOR queue transport rather
27
+ * than losing it (and resilient start with it) to a malformed field.
28
+ * - a probe that times out, or no probe channel at all, is a guess.
29
+ * `SPEC_VERSION_SUPPORTS_SLOT_IDENTITY` is the lowest version a v5 runtime
30
+ * can execute on the Vercel World (it requires slot event ids), so it is
31
+ * the only floor that keeps same-major targets working. It is NOT safe for
32
+ * an older-major target such as `stable` (spec 3): that target rejects the
33
+ * run when it picks it up. No single floor serves both, which is why the
34
+ * probe budget is generous; the miss is logged and recorded on the span.
35
+ *
36
+ * Once executors attest their version on `run_started` and the backend
37
+ * raises a run to it (vercel/workflow#4366, vercel/workflow-server#1044), a
38
+ * v5 target heals an under-stamped run, and this miss floor may drop, but
39
+ * only once the raise is enabled on the whole server fleet AND every v5
40
+ * target a caller can reach attests its version (a published beta that does
41
+ * not would be stamped below slot identity and fail). Even then a floor
42
+ * below `SPEC_VERSION_SUPPORTS_ATTRIBUTES` would refuse `attributes` on every
43
+ * miss. Tracked in vercel/workflow#4401.
44
+ *
45
+ * Exported for tests.
46
+ */
47
+ export declare function resolveCrossDeploymentSpecVersion(probe: Pick<HealthCheckResult, 'healthy' | 'specVersion' | 'format'> | undefined, callerSpecVersion: number): {
48
+ specVersion: number;
49
+ source: SpecVersionSource;
50
+ };
3
51
  /**
4
52
  * Reset the `deploymentId: 'latest'` no-op warn-once guard. Test-only,
5
53
  * exported so unit tests can exercise the warn path across `start()` calls.
@@ -7,6 +55,12 @@ import { Run } from './run.js';
7
55
  * @internal
8
56
  */
9
57
  export declare function _resetLatestNoOpWarnForTests(): void;
58
+ /**
59
+ * Reset the cross-deployment probe-miss warn-once guard. Test-only.
60
+ *
61
+ * @internal
62
+ */
63
+ export declare function _resetProbeMissWarnForTests(): void;
10
64
  export interface StartOptionsBase {
11
65
  /**
12
66
  * The world to use for the workflow run creation,
@@ -14,7 +68,11 @@ export interface StartOptionsBase {
14
68
  */
15
69
  world?: World;
16
70
  /**
17
- * The spec version to use for the workflow run. Defaults to the latest version.
71
+ * The spec version to use for the workflow run. Defaults to the spec
72
+ * version of the deployment that will execute the run: the configured
73
+ * World's for a same-deployment start, and for a cross-deployment start
74
+ * (`deploymentId` naming another deployment) the version the target
75
+ * reports on its capability probe, capped at the configured World's.
18
76
  */
19
77
  specVersion?: number;
20
78
  /**
@@ -160,8 +160,9 @@ export declare function computeStepLatencyTracking(params: {
160
160
  /** See {@link StepLatencyTracking.preStepBlockingMs}. */
161
161
  preStepBlockingMs: number;
162
162
  /**
163
- * The accumulator's value as of the suspension that wrote the run's first
164
- * attr_set (its hook phase runs before its attr writes). When the
163
+ * The accumulator's value as of the start of the suspension that wrote the
164
+ * run's first attr_set (that suspension's hook writes run alongside its attr
165
+ * writes, so the hook time it reports falls after the attr commit). When the
165
166
  * measurement ends at the attr write, only hook time from before that
166
167
  * point may be subtracted; later hook writes fall outside the measured
167
168
  * window. Undefined when no attr suspension happened in this invocation
@@ -84,6 +84,15 @@ export interface SuspensionHandlerParams {
84
84
  * keep the everything-durable-at-return behavior.
85
85
  */
86
86
  allowDeferredBatchWork?: boolean;
87
+ /**
88
+ * The invocation's record of hooks whose force-claim victim wake it has
89
+ * already published or attempted, whether as the forced creation's own wake
90
+ * or as a replay's republish (see `republishOwedForceClaimVictimWakes`). The
91
+ * caller passes one set for the whole invocation so a run that suspends more
92
+ * than once per invocation sends each hook's wake once, not once per
93
+ * suspension. Omitted, every suspension republishes on its own.
94
+ */
95
+ forceClaimVictimWakes?: Set<string>;
87
96
  }
88
97
  /**
89
98
  * Result of handling a suspension. Returns pending step items so the caller
@@ -200,9 +209,13 @@ export interface SuspensionHandlerResult {
200
209
  };
201
210
  /**
202
211
  * Whether a hook create committed a `hook_conflict` — the token was already
203
- * claimed, so this run's hook was never created and the workflow must
204
- * observe the conflict before anything else this suspension scheduled runs.
205
- * The caller answers it by advancing the workflow over the committed event.
212
+ * claimed, so this run's hook was never created. The caller answers it by
213
+ * advancing the workflow over the committed event before it dispatches or
214
+ * runs the steps this suspension scheduled. Those steps were written
215
+ * alongside the hook create, not after it, so their `step_created` events
216
+ * (and, on the batched path, their step messages and any pre-claimed inline
217
+ * pairs in {@link inlineClaims}) may already be out: work the workflow
218
+ * started concurrently with the hook is not held back by its conflict.
206
219
  */
207
220
  hasHookConflict: boolean;
208
221
  /** Whether a `hook.getConflict()` awaiter needs the workflow to continue immediately */
@@ -243,7 +256,8 @@ export interface SuspensionHandlerResult {
243
256
  * folded in (see `hookDeltaCursor` below), and nothing else in this
244
257
  * suspension wrote an event. False whenever a read is needed first: no
245
258
  * delta was asked for or returned, it was truncated, or a step / wait /
246
- * attribute / abort write landed above it and is therefore not in it.
259
+ * attribute / abort write (single or batched) also committed and may not be
260
+ * in it.
247
261
  *
248
262
  * Indifferent to which event the create committed: the delta is the slice
249
263
  * of the log after the caller's cursor either way, so it carries a
@@ -261,10 +275,12 @@ export interface SuspensionHandlerResult {
261
275
  */
262
276
  hasHookEvents: boolean;
263
277
  /**
264
- * Wall-clock ms spent committing this suspension's `hook_created` events
265
- * (0 when it created none). The caller accumulates this across iterations
266
- * and subtracts it from the TTFS latency measurement, so time spent
267
- * durably creating the user's hooks doesn't count as runtime overhead.
278
+ * Wall-clock ms this suspension spent blocked on nothing but committing its
279
+ * `hook_created` events (0 when it created none): the stretch the hook
280
+ * writes outlasted every other write, since until then the suspension was
281
+ * waiting on those too. The caller accumulates this across iterations and
282
+ * subtracts it from the TTFS latency measurement, so time spent durably
283
+ * creating the user's hooks doesn't count as runtime overhead.
268
284
  */
269
285
  hookCreationMs: number;
270
286
  /** Exact number of workflow-code executions observed during serialization. */
@@ -281,9 +297,15 @@ export interface SuspensionSerializationBlocker extends GuestCodeExecution {
281
297
  * Creates events for all operations but does NOT queue step messages; returns the pending
282
298
  * steps so the caller can decide which to execute inline vs queue to background.
283
299
  *
284
- * Processing order:
285
- * 1. Hooks are processed first to prevent race conditions with webhook receivers
286
- * 2. Step events and wait events are created in parallel
300
+ * Every write is issued concurrently: hook creations and disposals (in code
301
+ * order per token, then abort deliveries), step and wait events (batched where
302
+ * the World supports it), and attribute events.
303
+ *
304
+ * Hooks are not written ahead of the steps created alongside them. A step
305
+ * started in the same suspension as a hook can therefore run before that hook
306
+ * is registered; a workflow that needs the hook registered first (say, a step
307
+ * that hands the token to something that resumes it at once) awaits
308
+ * `hook.getConflict()` before calling the step.
287
309
  */
288
- export declare function handleSuspension({ suspension, world, run, span, requestId, eventLog, runReadyBarrier, replayRecoveryReporter, stepDispatch, ownerMessageId, allowDeferredBatchWork, }: SuspensionHandlerParams): Promise<SuspensionHandlerResult>;
310
+ export declare function handleSuspension({ suspension, world, run, span, requestId, eventLog, runReadyBarrier, replayRecoveryReporter, stepDispatch, ownerMessageId, allowDeferredBatchWork, forceClaimVictimWakes, }: SuspensionHandlerParams): Promise<SuspensionHandlerResult>;
289
311
  //# sourceMappingURL=suspension-handler.d.ts.map