eve 0.55.0 → 0.57.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 (683) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/src/channel/adapter-context.d.ts +1 -1
  3. package/dist/src/channel/adapter.d.ts +2 -2
  4. package/dist/src/channel/audience.d.ts +3 -3
  5. package/dist/src/channel/channel-address.js +1 -1
  6. package/dist/src/channel/conversation-context.d.ts +4 -2
  7. package/dist/src/channel/conversation-context.js +1 -1
  8. package/dist/src/channel/session.d.ts +4 -3
  9. package/dist/src/channel/session.js +1 -1
  10. package/dist/src/channel/types.d.ts +7 -4
  11. package/dist/src/chunks/{use-eve-agent-D-KQzzyW.js → use-eve-agent-C2APNCdP.js} +45 -22
  12. package/dist/src/chunks/{use-eve-agent-CxPlg0KL.js → use-eve-agent-D0YnDLi_.js} +45 -22
  13. package/dist/src/cli/commands/init.d.ts +2 -6
  14. package/dist/src/cli/commands/init.js +1 -1
  15. package/dist/src/cli/commands/registry-metadata.d.ts +0 -18
  16. package/dist/src/cli/commands/registry-metadata.js +1 -1
  17. package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
  18. package/dist/src/cli/commands/registry.js +1 -1
  19. package/dist/src/cli/commands/trace-detail.js +1 -1
  20. package/dist/src/cli/dev/environment.js +1 -1
  21. package/dist/src/cli/dev/run-interactive-ui.js +1 -1
  22. package/dist/src/cli/dev/tui/agent-header.js +1 -1
  23. package/dist/src/cli/dev/tui/blocks.d.ts +3 -6
  24. package/dist/src/cli/dev/tui/blocks.js +3 -3
  25. package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
  26. package/dist/src/cli/dev/tui/markdown.d.ts +8 -1
  27. package/dist/src/cli/dev/tui/markdown.js +7 -7
  28. package/dist/src/cli/dev/tui/message-queue.d.ts +11 -7
  29. package/dist/src/cli/dev/tui/message-queue.js +1 -1
  30. package/dist/src/cli/dev/tui/model-editor.d.ts +1 -1
  31. package/dist/src/cli/dev/tui/model-editor.js +1 -1
  32. package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +0 -3
  33. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  34. package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
  35. package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
  36. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  37. package/dist/src/cli/dev/tui/remote-auth-result.js +1 -1
  38. package/dist/src/cli/dev/tui/remote-auth.js +1 -1
  39. package/dist/src/cli/dev/tui/remote-startup.d.ts +10 -0
  40. package/dist/src/cli/dev/tui/remote-startup.js +1 -0
  41. package/dist/src/cli/dev/tui/runner.d.ts +16 -19
  42. package/dist/src/cli/dev/tui/runner.js +3 -1
  43. package/dist/src/cli/dev/tui/setup-commands.d.ts +7 -13
  44. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  45. package/dist/src/cli/dev/tui/setup-issues.d.ts +1 -1
  46. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  47. package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -17
  48. package/dist/src/cli/dev/tui/setup-panel.js +5 -6
  49. package/dist/src/cli/dev/tui/status-line.d.ts +1 -8
  50. package/dist/src/cli/dev/tui/status-line.js +1 -1
  51. package/dist/src/cli/dev/tui/steering-stream.d.ts +15 -0
  52. package/dist/src/cli/dev/tui/steering-stream.js +1 -0
  53. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +8 -3
  54. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  55. package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +2 -2
  56. package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
  57. package/dist/src/cli/dev/tui/theme.d.ts +0 -2
  58. package/dist/src/cli/dev/tui/theme.js +1 -1
  59. package/dist/src/cli/dev/tui/tui.d.ts +4 -1
  60. package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -2
  61. package/dist/src/cli/dev/tui/vercel-status.js +1 -1
  62. package/dist/src/cli/run.js +1 -1
  63. package/dist/src/cli/telemetry/index.d.ts +1 -1
  64. package/dist/src/cli/telemetry/index.js +1 -1
  65. package/dist/src/cli/ui/terminal-text.js +1 -1
  66. package/dist/src/client/agent-info-schema.d.ts +2 -57
  67. package/dist/src/client/agent-info-schema.js +1 -1
  68. package/dist/src/client/eve-agent-store-state.d.ts +19 -0
  69. package/dist/src/client/eve-agent-store.js +1 -1
  70. package/dist/src/client/ndjson.d.ts +2 -0
  71. package/dist/src/client/ndjson.js +3 -3
  72. package/dist/src/client/open-stream.d.ts +1 -0
  73. package/dist/src/client/open-stream.js +1 -1
  74. package/dist/src/compiled/.vendor-stamp.json +1 -1
  75. package/dist/src/compiled/@workflow/core/index.js +2 -2
  76. package/dist/src/compiled/@workflow/core/private.js +1 -1
  77. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -0
  78. package/dist/src/compiled/@workflow/core/runtime.js +2 -2
  79. package/dist/src/compiled/@workflow/core/serialization.js +1 -0
  80. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  81. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  82. package/dist/src/compiled/@workflow/world-vercel/index.js +2 -2
  83. package/dist/src/compiled/_chunks/workflow/attribute-changes-DTFAjP0J.js +6 -0
  84. package/dist/src/compiled/_chunks/workflow/{dist-PLkAQ-U7.js → dist-C5KCXSdI.js} +1 -1
  85. package/dist/src/compiled/_chunks/workflow/{frames-BvATzM2t.js → frames-DJw9L4rO.js} +3 -3
  86. package/dist/src/compiled/_chunks/workflow/global-DFW-hO6M.js +1 -0
  87. package/dist/src/compiled/_chunks/workflow/helpers-ClCA9Lmc.js +1 -0
  88. package/dist/src/compiled/_chunks/workflow/logger-D6vwIEf9.js +13 -0
  89. package/dist/src/compiled/_chunks/workflow/resume-hook-_baK8jaT.js +1 -0
  90. package/dist/src/compiled/_chunks/workflow/run-CRdL17z4.js +1 -0
  91. package/dist/src/compiled/_chunks/workflow/serialization-CWYPL4Eq.js +3 -0
  92. package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +1 -0
  93. package/dist/src/compiled/_chunks/workflow/wait-until-DyIt9lEx.js +1 -0
  94. package/dist/src/compiled/_chunks/workflow/{ws-transport-CVezyWwZ.js → ws-transport-Dl5FG4Sw.js} +1 -1
  95. package/dist/src/compiler/extension-compatibility.d.ts +27 -8
  96. package/dist/src/compiler/extension-compatibility.js +1 -1
  97. package/dist/src/compiler/manifest.d.ts +12 -11
  98. package/dist/src/compiler/manifest.js +1 -1
  99. package/dist/src/compiler/normalize-manifest.js +1 -1
  100. package/dist/src/compiler/normalize-tool.d.ts +0 -3
  101. package/dist/src/compiler/normalize-tool.js +1 -1
  102. package/dist/src/compiler/validate-artifact.js +1 -1
  103. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  104. package/dist/src/context/keys.d.ts +5 -1
  105. package/dist/src/context/keys.js +1 -1
  106. package/dist/src/eve-channel/audience.d.ts +2 -2
  107. package/dist/src/eve-channel/audience.js +1 -1
  108. package/dist/src/eve-channel/index.js +1 -1
  109. package/dist/src/eve-channel/request.js +4 -3
  110. package/dist/src/eve-channel/types.d.ts +5 -5
  111. package/dist/src/execution/activity-cohort.js +1 -1
  112. package/dist/src/execution/activity-collector.js +1 -1
  113. package/dist/src/execution/authorization-callback-match.d.ts +2 -1
  114. package/dist/src/execution/authorization-callback-match.js +1 -1
  115. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  116. package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -1
  117. package/dist/src/execution/cancelled-model-call-batch.d.ts +1 -1
  118. package/dist/src/execution/connections/callback-route.d.ts +1 -11
  119. package/dist/src/execution/connections/callback-route.js +1 -1
  120. package/dist/src/execution/continuation-conflict-step.d.ts +0 -1
  121. package/dist/src/execution/continuation-conflict-step.js +1 -1
  122. package/dist/src/execution/coordination-dispatch-shared.d.ts +1 -1
  123. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  124. package/dist/src/execution/coordination-dispatch-step.d.ts +2 -2
  125. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  126. package/dist/src/execution/create-session-step.d.ts +1 -1
  127. package/dist/src/execution/create-session-step.js +1 -1
  128. package/dist/src/execution/durable-session-store.d.ts +10 -49
  129. package/dist/src/execution/durable-session-store.js +1 -1
  130. package/dist/src/execution/dynamic-workflow/program-step.d.ts +21 -0
  131. package/dist/src/execution/dynamic-workflow/program-step.js +1 -0
  132. package/dist/src/execution/dynamic-workflow/schema.d.ts +36 -0
  133. package/dist/src/execution/dynamic-workflow/schema.js +1 -0
  134. package/dist/src/execution/dynamic-workflow/security-step.d.ts +3 -0
  135. package/dist/src/execution/dynamic-workflow/security-step.js +1 -0
  136. package/dist/src/execution/dynamic-workflow/tool.d.ts +8 -0
  137. package/dist/src/execution/dynamic-workflow/tool.js +1 -0
  138. package/dist/src/execution/dynamic-workflow/workflow.d.ts +10 -0
  139. package/dist/src/execution/dynamic-workflow/workflow.js +1 -0
  140. package/dist/src/execution/eve-workflow-attributes.d.ts +2 -17
  141. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  142. package/dist/src/execution/hook-ownership.d.ts +2 -4
  143. package/dist/src/execution/hook-ownership.js +1 -1
  144. package/dist/src/execution/legacy-session/authorization.d.ts +9 -0
  145. package/dist/src/execution/legacy-session/authorization.js +1 -0
  146. package/dist/src/execution/legacy-session/completion-step.d.ts +10 -0
  147. package/dist/src/execution/legacy-session/completion-step.js +1 -0
  148. package/dist/src/execution/legacy-session/inbox.d.ts +24 -0
  149. package/dist/src/execution/legacy-session/inbox.js +1 -0
  150. package/dist/src/execution/legacy-session/input.d.ts +19 -0
  151. package/dist/src/execution/legacy-session/input.js +1 -0
  152. package/dist/src/execution/legacy-session/interrupt-step.d.ts +3 -0
  153. package/dist/src/execution/legacy-session/interrupt-step.js +1 -0
  154. package/dist/src/execution/legacy-session/prepare-step.d.ts +24 -0
  155. package/dist/src/execution/legacy-session/prepare-step.js +1 -0
  156. package/dist/src/execution/legacy-session/snapshot.d.ts +12 -0
  157. package/dist/src/execution/legacy-session/snapshot.js +1 -0
  158. package/dist/src/execution/legacy-session/turn-workflow.d.ts +8 -0
  159. package/dist/src/execution/legacy-session/turn-workflow.js +1 -0
  160. package/dist/src/execution/model-call-batching.d.ts +1 -0
  161. package/dist/src/execution/model-call-batching.js +1 -1
  162. package/dist/src/execution/node-step.d.ts +1 -5
  163. package/dist/src/execution/node-step.js +1 -1
  164. package/dist/src/execution/proxied-deliver-step.d.ts +2 -20
  165. package/dist/src/execution/proxied-deliver-step.js +1 -1
  166. package/dist/src/execution/reconcile-session-continuation-token.d.ts +1 -1
  167. package/dist/src/execution/report-dropped-wire-payload-step.d.ts +1 -1
  168. package/dist/src/execution/route-child-delivery.d.ts +2 -2
  169. package/dist/src/execution/route-child-delivery.js +1 -1
  170. package/dist/src/execution/runtime-context.js +1 -1
  171. package/dist/src/execution/sandbox/bindings/eve-image.js +1 -1
  172. package/dist/src/execution/session/accepted-deployment.d.ts +3 -0
  173. package/dist/src/execution/session/accepted-deployment.js +1 -0
  174. package/dist/src/execution/session/admission.d.ts +38 -0
  175. package/dist/src/execution/session/admission.js +1 -0
  176. package/dist/src/execution/session/entry-input.d.ts +42 -0
  177. package/dist/src/execution/session/entry-input.js +1 -0
  178. package/dist/src/execution/session/entry.d.ts +13 -0
  179. package/dist/src/execution/session/entry.js +1 -0
  180. package/dist/src/execution/session/event-sink.d.ts +31 -0
  181. package/dist/src/execution/session/event-sink.js +1 -0
  182. package/dist/src/execution/session/finalization.d.ts +33 -0
  183. package/dist/src/execution/session/finalization.js +1 -0
  184. package/dist/src/execution/session/handoff-steps.d.ts +22 -0
  185. package/dist/src/execution/session/handoff-steps.js +1 -0
  186. package/dist/src/execution/session/handoff.d.ts +69 -0
  187. package/dist/src/execution/session/handoff.js +1 -0
  188. package/dist/src/execution/session/hook-tokens.d.ts +11 -0
  189. package/dist/src/execution/session/hook-tokens.js +1 -0
  190. package/dist/src/execution/session/input-queue.d.ts +72 -0
  191. package/dist/src/execution/session/input-queue.js +1 -0
  192. package/dist/src/execution/session/next-input.d.ts +32 -0
  193. package/dist/src/execution/session/next-input.js +1 -0
  194. package/dist/src/execution/{pending-turn-state.d.ts → session/pending-turn-state.d.ts} +0 -1
  195. package/dist/src/execution/{pending-turn-state.js → session/pending-turn-state.js} +1 -1
  196. package/dist/src/execution/session/program.d.ts +47 -0
  197. package/dist/src/execution/session/program.js +1 -0
  198. package/dist/src/execution/session/route-selected-delivery.d.ts +9 -0
  199. package/dist/src/execution/session/route-selected-delivery.js +1 -0
  200. package/dist/src/execution/session/state-cursor.d.ts +31 -0
  201. package/dist/src/execution/session/state-cursor.js +1 -0
  202. package/dist/src/execution/{session-timeout-control.d.ts → session/timeout-control.d.ts} +1 -1
  203. package/dist/src/execution/session/timeout-control.js +1 -0
  204. package/dist/src/execution/{session-timeout-steps.d.ts → session/timeout-steps.d.ts} +3 -2
  205. package/dist/src/execution/session/timeout-steps.js +1 -0
  206. package/dist/src/execution/{session-timeout-workflow.d.ts → session/timeout-workflow.d.ts} +3 -1
  207. package/dist/src/execution/session/timeout-workflow.js +1 -0
  208. package/dist/src/execution/session/timeout.d.ts +3 -0
  209. package/dist/src/execution/session/timeout.js +1 -0
  210. package/dist/src/execution/session/turn-step-result.d.ts +4 -0
  211. package/dist/src/execution/session/turn-step-result.js +1 -0
  212. package/dist/src/execution/session/turn-step-types.d.ts +68 -0
  213. package/dist/src/execution/session/turn-step-types.js +1 -0
  214. package/dist/src/execution/{workflow-steps.d.ts → session/turn-step.d.ts} +1 -2
  215. package/dist/src/execution/session/turn-step.js +1 -0
  216. package/dist/src/execution/session/turn.d.ts +31 -0
  217. package/dist/src/execution/session/turn.js +1 -0
  218. package/dist/src/execution/session-inbox/address.d.ts +21 -0
  219. package/dist/src/execution/session-inbox/address.js +1 -0
  220. package/dist/src/execution/session-inbox/inbox.d.ts +54 -0
  221. package/dist/src/execution/session-inbox/inbox.js +1 -0
  222. package/dist/src/execution/session-inbox/protocol.d.ts +10 -0
  223. package/dist/src/execution/session-inbox/protocol.js +1 -0
  224. package/dist/src/execution/session-inbox/release-step.d.ts +5 -0
  225. package/dist/src/execution/session-inbox/release-step.js +1 -0
  226. package/dist/src/execution/session-inbox/resume.d.ts +21 -0
  227. package/dist/src/execution/session-inbox/resume.js +1 -0
  228. package/dist/src/execution/{turn-workflow-tool-run.d.ts → session-workflow-tool-run.d.ts} +2 -2
  229. package/dist/src/execution/session-workflow-tool-run.js +1 -0
  230. package/dist/src/execution/session.d.ts +0 -1
  231. package/dist/src/execution/session.js +2 -2
  232. package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -2
  233. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  234. package/dist/src/execution/skills/instructions.js +1 -1
  235. package/dist/src/execution/stable-workflow-names.d.ts +1 -1
  236. package/dist/src/execution/stable-workflow-names.js +1 -1
  237. package/dist/src/execution/task-input-response-route.js +1 -1
  238. package/dist/src/execution/tasks/child/steps.d.ts +1 -1
  239. package/dist/src/execution/tasks/child/steps.js +1 -1
  240. package/dist/src/execution/tasks/child/workflow.js +1 -1
  241. package/dist/src/execution/tasks/parent/delegate.d.ts +7 -0
  242. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  243. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  244. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  245. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  246. package/dist/src/execution/terminal-session-completion-step.d.ts +1 -1
  247. package/dist/src/execution/terminal-session-event.d.ts +1 -1
  248. package/dist/src/execution/terminal-session-event.js +1 -1
  249. package/dist/src/execution/terminal-session-failure-step.d.ts +1 -1
  250. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  251. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  252. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  253. package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
  254. package/dist/src/execution/tools/subagent/emit-called-step.d.ts +1 -1
  255. package/dist/src/execution/tools/subagent/emit-called-step.js +1 -1
  256. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -1
  257. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
  258. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +6 -0
  259. package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
  260. package/dist/src/execution/tools/subagent/invoke-step.d.ts +2 -0
  261. package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
  262. package/dist/src/execution/tools/subagent/steer.d.ts +13 -0
  263. package/dist/src/execution/tools/subagent/steer.js +1 -0
  264. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +1 -1
  265. package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
  266. package/dist/src/execution/tools/subagent/task-cancel.js +1 -1
  267. package/dist/src/execution/tools/workflow/ask.d.ts +0 -9
  268. package/dist/src/execution/tools/workflow/ask.js +1 -1
  269. package/dist/src/execution/tools/workflow/body.d.ts +0 -2
  270. package/dist/src/execution/tools/workflow/body.js +1 -1
  271. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +1 -1
  272. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
  273. package/dist/src/execution/tools/workflow/messages.d.ts +0 -1
  274. package/dist/src/execution/tools/workflow/messages.js +1 -1
  275. package/dist/src/execution/tools/workflow/owner.d.ts +3 -1
  276. package/dist/src/execution/tools/workflow/owner.js +1 -1
  277. package/dist/src/execution/tools/workflow/resume-hook-step.d.ts +1 -1
  278. package/dist/src/execution/tools/workflow/step-context.d.ts +0 -1
  279. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  280. package/dist/src/execution/tools/workflow/step.js +1 -1
  281. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  282. package/dist/src/execution/workflow-runtime.d.ts +15 -18
  283. package/dist/src/execution/workflow-runtime.js +1 -1
  284. package/dist/src/harness/advertised-tools.d.ts +0 -3
  285. package/dist/src/harness/advertised-tools.js +1 -1
  286. package/dist/src/harness/authorization.d.ts +5 -37
  287. package/dist/src/harness/authorization.js +1 -1
  288. package/dist/src/harness/compaction.js +1 -1
  289. package/dist/src/harness/coordination.js +1 -1
  290. package/dist/src/harness/emission-state.d.ts +1 -0
  291. package/dist/src/harness/emission.js +1 -1
  292. package/dist/src/harness/generation-steering.d.ts +22 -0
  293. package/dist/src/harness/generation-steering.js +1 -0
  294. package/dist/src/harness/messages.d.ts +1 -1
  295. package/dist/src/harness/messages.js +1 -1
  296. package/dist/src/harness/prompt-cache.js +1 -1
  297. package/dist/src/harness/proxy-input-requests.d.ts +1 -1
  298. package/dist/src/harness/proxy-input-requests.js +1 -1
  299. package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
  300. package/dist/src/harness/semantic-errors/signals.js +1 -1
  301. package/dist/src/harness/session-limit-enforcement.js +1 -1
  302. package/dist/src/harness/tool-loop.js +2 -2
  303. package/dist/src/harness/types.d.ts +2 -21
  304. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  305. package/dist/src/instrumentation/channel-delivery.js +1 -1
  306. package/dist/src/instrumentation/content.js +1 -1
  307. package/dist/src/instrumentation/lifecycle.d.ts +6 -7
  308. package/dist/src/instrumentation/native-events.d.ts +2 -0
  309. package/dist/src/instrumentation/native-events.js +1 -1
  310. package/dist/src/instrumentation/runtime.js +1 -1
  311. package/dist/src/instrumentation/session-context.d.ts +2 -0
  312. package/dist/src/instrumentation/session-context.js +1 -1
  313. package/dist/src/internal/application/compiled-artifacts.js +3 -2
  314. package/dist/src/internal/application/package.js +1 -1
  315. package/dist/src/internal/authored-definition/connection.js +1 -1
  316. package/dist/src/internal/authored-definition/schema-backed.d.ts +3 -4
  317. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  318. package/dist/src/internal/gateway.d.ts +1 -0
  319. package/dist/src/internal/gateway.js +1 -1
  320. package/dist/src/internal/model-auth/api-key.d.ts +7 -0
  321. package/dist/src/internal/model-auth/api-key.js +1 -0
  322. package/dist/src/internal/model-auth/available-models.d.ts +2 -0
  323. package/dist/src/internal/model-auth/available-models.js +1 -0
  324. package/dist/src/internal/model-auth/development-broker-client.d.ts +3 -0
  325. package/dist/src/internal/model-auth/development-broker-client.js +1 -0
  326. package/dist/src/internal/model-auth/development-broker-protocol.d.ts +12 -0
  327. package/dist/src/internal/model-auth/development-broker-protocol.js +1 -0
  328. package/dist/src/internal/model-auth/development-broker-server.d.ts +4 -0
  329. package/dist/src/internal/model-auth/development-broker-server.js +1 -0
  330. package/dist/src/internal/model-auth/gateway-credential.d.ts +2 -0
  331. package/dist/src/internal/model-auth/gateway-credential.js +1 -0
  332. package/dist/src/internal/model-auth/store.d.ts +16 -0
  333. package/dist/src/internal/model-auth/store.js +1 -0
  334. package/dist/src/internal/model-auth/transport.d.ts +6 -0
  335. package/dist/src/internal/model-auth/transport.js +1 -0
  336. package/dist/src/internal/model-auth/vercel-cli.d.ts +7 -0
  337. package/dist/src/internal/model-auth/vercel-cli.js +1 -0
  338. package/dist/src/internal/model-auth/vercel-team.d.ts +3 -0
  339. package/dist/src/internal/model-auth/vercel-team.js +1 -0
  340. package/dist/src/internal/model-auth/vercel.d.ts +13 -0
  341. package/dist/src/internal/model-auth/vercel.js +1 -0
  342. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  343. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  344. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  345. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  346. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  347. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  348. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  349. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  350. package/dist/src/internal/nitro/routes/info.js +1 -1
  351. package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -0
  352. package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
  353. package/dist/src/internal/vercel/api-resource.d.ts +4 -0
  354. package/dist/src/internal/vercel/api-resource.js +1 -0
  355. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  356. package/dist/src/internal/vercel/vercel-services-config.d.ts +2 -0
  357. package/dist/src/internal/vercel/vercel-services-config.js +1 -1
  358. package/dist/src/internal/workflow/development-world-client.js +1 -1
  359. package/dist/src/internal/workflow/development-world-server.js +1 -1
  360. package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +1 -1
  361. package/dist/src/internal/workflow/runtime.d.ts +1 -6
  362. package/dist/src/internal/workflow/runtime.js +1 -1
  363. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +4 -0
  364. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -0
  365. package/dist/src/protocol/activity.js +1 -1
  366. package/dist/src/protocol/message.d.ts +8 -0
  367. package/dist/src/protocol/message.js +2 -2
  368. package/dist/src/protocol/routes.d.ts +0 -2
  369. package/dist/src/protocol/routes.js +1 -1
  370. package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -2
  371. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  372. package/dist/src/public/channels/index.d.ts +1 -1
  373. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  374. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  375. package/dist/src/public/channels/telegram/audience.d.ts +2 -2
  376. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  377. package/dist/src/public/connections/index.d.ts +1 -1
  378. package/dist/src/public/definitions/channel.d.ts +2 -2
  379. package/dist/src/public/definitions/channel.js +1 -1
  380. package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
  381. package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
  382. package/dist/src/public/models/anthropic/index.d.ts +3 -0
  383. package/dist/src/public/models/anthropic/index.js +1 -0
  384. package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -1
  385. package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -1
  386. package/dist/src/public/models/openai/chatgpt/oauth.js +1 -1
  387. package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
  388. package/dist/src/public/models/openai/index.d.ts +4 -2
  389. package/dist/src/public/models/openai/index.js +1 -1
  390. package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
  391. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
  392. package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
  393. package/dist/src/public/tools/workflow.d.ts +1 -4
  394. package/dist/src/public/tools/workflow.js +1 -1
  395. package/dist/src/public/vercel/index.d.ts +2 -1
  396. package/dist/src/public/vercel/index.js +1 -1
  397. package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
  398. package/dist/src/runtime/agent/resolve-model.js +1 -1
  399. package/dist/src/runtime/connections/authorization-tokens.d.ts +2 -4
  400. package/dist/src/runtime/connections/principal.d.ts +6 -6
  401. package/dist/src/runtime/connections/principal.js +1 -1
  402. package/dist/src/runtime/prompt/compose.js +1 -1
  403. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  404. package/dist/src/runtime/resolve-agent.js +1 -1
  405. package/dist/src/runtime/resolve-tool.js +1 -1
  406. package/dist/src/runtime/tools/registry.js +1 -1
  407. package/dist/src/runtime/types.d.ts +3 -9
  408. package/dist/src/self-modification/agent.js +1 -1
  409. package/dist/src/self-modification/extension/classify-registry-item.d.ts +3 -3
  410. package/dist/src/self-modification/extension/classify-registry-item.js +1 -1
  411. package/dist/src/self-modification/extension/tools/search_registry.d.ts +1 -7
  412. package/dist/src/self-modification/extension/tools/search_registry.js +1 -1
  413. package/dist/src/self-modification/setup.d.ts +9 -3
  414. package/dist/src/self-modification/setup.js +2 -2
  415. package/dist/src/setup/cli/option-row.d.ts +2 -1
  416. package/dist/src/setup/cli/option-row.js +1 -1
  417. package/dist/src/setup/cli/prompt-ui.d.ts +2 -0
  418. package/dist/src/setup/cli/prompt-ui.js +1 -1
  419. package/dist/src/setup/cli/select-state.d.ts +1 -1
  420. package/dist/src/setup/cli/select-state.js +1 -1
  421. package/dist/src/setup/flows/chatgpt-auth.js +1 -1
  422. package/dist/src/setup/flows/deploy.d.ts +4 -9
  423. package/dist/src/setup/flows/deploy.js +1 -1
  424. package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
  425. package/dist/src/setup/flows/install-vercel-cli.d.ts +2 -3
  426. package/dist/src/setup/flows/login.d.ts +3 -1
  427. package/dist/src/setup/flows/login.js +1 -1
  428. package/dist/src/setup/flows/model-login-connection.d.ts +36 -0
  429. package/dist/src/setup/flows/model-login-connection.js +1 -0
  430. package/dist/src/setup/flows/model-login-progress.d.ts +7 -0
  431. package/dist/src/setup/flows/model-login-progress.js +1 -0
  432. package/dist/src/setup/flows/model-login.d.ts +22 -0
  433. package/dist/src/setup/flows/model-login.js +1 -0
  434. package/dist/src/setup/flows/model-source-change.d.ts +7 -0
  435. package/dist/src/setup/flows/model-source-change.js +1 -1
  436. package/dist/src/setup/flows/model.d.ts +6 -24
  437. package/dist/src/setup/flows/model.js +1 -1
  438. package/dist/src/setup/flows/registry.d.ts +3 -19
  439. package/dist/src/setup/flows/registry.js +1 -1
  440. package/dist/src/setup/flows/vercel-model-login.d.ts +5 -0
  441. package/dist/src/setup/flows/vercel-model-login.js +1 -0
  442. package/dist/src/setup/integrations/self-modification/setup.d.ts +2 -0
  443. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  444. package/dist/src/setup/project-resolution.js +1 -1
  445. package/dist/src/setup/prompter.d.ts +3 -1
  446. package/dist/src/setup/provider-settings.d.ts +19 -6
  447. package/dist/src/setup/provider-settings.js +1 -1
  448. package/dist/src/setup/scaffold/create/project.js +6 -2
  449. package/dist/src/setup/vercel-project.js +0 -0
  450. package/dist/src/setup/with-spinner.d.ts +1 -1
  451. package/dist/src/setup/with-spinner.js +1 -1
  452. package/dist/src/shared/action-types.js +1 -1
  453. package/dist/src/shared/agent-definition.d.ts +6 -4
  454. package/dist/src/shared/channel-definition.d.ts +2 -2
  455. package/dist/src/shared/chatgpt-model.d.ts +2 -2
  456. package/dist/src/shared/chatgpt-model.js +1 -1
  457. package/dist/src/shared/connection-types.d.ts +20 -7
  458. package/dist/src/shared/conversation-context.d.ts +15 -0
  459. package/dist/src/shared/model-connection.d.ts +17 -0
  460. package/dist/src/shared/model-connection.js +1 -0
  461. package/dist/src/shared/model-endpoint-status.d.ts +2 -1
  462. package/dist/src/shared/model-helper.d.ts +26 -0
  463. package/dist/src/shared/model-helper.js +1 -0
  464. package/dist/src/shared/package-version.d.ts +2 -0
  465. package/dist/src/shared/package-version.js +1 -0
  466. package/dist/src/shared/validate-authorization.js +1 -1
  467. package/dist/src/shared/vercel-services.d.ts +1 -0
  468. package/dist/src/shared/vercel-services.js +1 -1
  469. package/dist/src/shared/workflow-sandbox.d.ts +18 -12
  470. package/dist/src/shared/workflow-sandbox.js +1 -1
  471. package/dist/src/source-change/agent-config-ast.d.ts +6 -0
  472. package/dist/src/source-change/agent-config-ast.js +1 -1
  473. package/dist/src/source-change/apply-model-selection.d.ts +3 -1
  474. package/dist/src/source-change/apply-model-selection.js +1 -2
  475. package/dist/src/source-change/static-source-change.js +1 -1
  476. package/dist/src/subagents/callback-route.js +1 -1
  477. package/dist/src/subagents/event-proxy-step.d.ts +3 -3
  478. package/dist/src/subagents/event-proxy-step.js +1 -1
  479. package/dist/src/subagents/handle-dispatch.d.ts +12 -2
  480. package/dist/src/subagents/handle-dispatch.js +1 -1
  481. package/dist/src/subagents/handles/operation-id.d.ts +1 -1
  482. package/dist/src/subagents/handles/query.d.ts +0 -6
  483. package/dist/src/subagents/handles/query.js +1 -1
  484. package/dist/src/subagents/handles/state-key.d.ts +1 -1
  485. package/dist/src/subagents/handles/store.d.ts +1 -1
  486. package/dist/src/subagents/handles/store.js +1 -1
  487. package/dist/src/subagents/hitl-proxy.d.ts +1 -1
  488. package/dist/src/subagents/parent-notification.d.ts +2 -2
  489. package/dist/src/subagents/parent-result.d.ts +1 -1
  490. package/dist/src/subagents/remote-dispatch.d.ts +1 -1
  491. package/dist/src/subagents/remote-dispatch.js +1 -1
  492. package/dist/src/subagents/start-local.js +1 -1
  493. package/dist/src/subagents/tool.js +1 -1
  494. package/dist/src/svelte/index.js +1 -1
  495. package/dist/src/svelte/use-eve-agent.js +1 -1
  496. package/dist/src/tasks/session-index.d.ts +11 -0
  497. package/dist/src/tasks/session-index.js +1 -1
  498. package/dist/src/tasks/types.d.ts +1 -1
  499. package/dist/src/tools/auth.d.ts +5 -6
  500. package/dist/src/tools/provided/workflow.d.ts +12 -0
  501. package/dist/src/tools/provided/workflow.js +1 -0
  502. package/dist/src/tools/workflow-program-input.d.ts +6 -0
  503. package/dist/src/tools/workflow-program-input.js +1 -0
  504. package/dist/src/tracing/agent-otel-provider.js +2 -2
  505. package/dist/src/tracing/agent-otel-runtime-context.d.ts +2 -1
  506. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  507. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  508. package/dist/src/tracing/agent-otel-usage.js +1 -1
  509. package/dist/src/tracing/agent-span-contract.d.ts +1 -0
  510. package/dist/src/tracing/agent-span-contract.js +1 -1
  511. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  512. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  513. package/dist/src/tracing/agent-trace-state.d.ts +2 -0
  514. package/dist/src/tracing/content-attributes.js +1 -1
  515. package/dist/src/tracing/local-instrumentation-runtime.d.ts +1 -1
  516. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  517. package/dist/src/vue/index.js +1 -1
  518. package/dist/src/vue/use-eve-agent.js +1 -1
  519. package/docs/agent-config.md +23 -23
  520. package/docs/channels/chat-sdk.mdx +11 -2
  521. package/docs/channels/custom.mdx +32 -16
  522. package/docs/channels/eve.mdx +21 -19
  523. package/docs/channels/linear.mdx +7 -3
  524. package/docs/channels/linq.mdx +1 -1
  525. package/docs/channels/overview.mdx +17 -2
  526. package/docs/channels/photon.mdx +4 -1
  527. package/docs/channels/slack.mdx +12 -2
  528. package/docs/concepts/execution-model-and-durability.mdx +62 -13
  529. package/docs/concepts/sessions-runs-and-streaming.md +14 -5
  530. package/docs/connections/mcp.mdx +4 -1
  531. package/docs/connections/openapi.mdx +8 -2
  532. package/docs/connections/overview.mdx +16 -13
  533. package/docs/getting-started.mdx +8 -4
  534. package/docs/guides/deployment/self-hosting.md +1 -1
  535. package/docs/guides/deployment/vercel.mdx +3 -3
  536. package/docs/guides/dev-tui.md +58 -31
  537. package/docs/guides/dynamic-capabilities.md +4 -4
  538. package/docs/guides/frontend/overview.mdx +3 -1
  539. package/docs/guides/hooks.md +1 -1
  540. package/docs/guides/instrumentation/meta.json +5 -0
  541. package/docs/guides/instrumentation/otel.mdx +149 -0
  542. package/docs/guides/instrumentation/overview.md +199 -0
  543. package/docs/guides/instrumentation/providers.mdx +169 -0
  544. package/docs/guides/meta.json +0 -1
  545. package/docs/guides/remote-agents.md +19 -21
  546. package/docs/install-integrations.mdx +2 -4
  547. package/docs/memory/custom-provider.md +1 -1
  548. package/docs/patterns/multi-tenant-auth.md +3 -3
  549. package/docs/protocols/acp.md +1 -1
  550. package/docs/reference/cli.md +16 -16
  551. package/docs/reference/telemetry.md +1 -1
  552. package/docs/reference/typescript-api.md +21 -14
  553. package/docs/sandbox.mdx +3 -3
  554. package/docs/subagents/index.mdx +4 -4
  555. package/docs/tools/workflows.mdx +57 -2
  556. package/docs/tutorial/how-it-runs.mdx +1 -1
  557. package/package.json +6 -1
  558. package/dist/src/cli/commands/init-repl.d.ts +0 -80
  559. package/dist/src/cli/commands/init-repl.js +0 -1
  560. package/dist/src/cli/commands/init-self-modification.d.ts +0 -7
  561. package/dist/src/cli/commands/init-self-modification.js +0 -1
  562. package/dist/src/cli/commands/registry-package.d.ts +0 -52
  563. package/dist/src/cli/commands/registry-package.js +0 -1
  564. package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +0 -12
  565. package/dist/src/cli/dev/tui/prompt-placeholder.js +0 -1
  566. package/dist/src/cli/dev/tui/remote-auth-command.d.ts +0 -11
  567. package/dist/src/cli/dev/tui/remote-auth-command.js +0 -3
  568. package/dist/src/compiled/_chunks/workflow/attribute-changes-BAcgmlXp.js +0 -20
  569. package/dist/src/compiled/_chunks/workflow/private-CFJkQA7R.js +0 -1
  570. package/dist/src/compiled/_chunks/workflow/resume-hook-BEHe0Uut.js +0 -1
  571. package/dist/src/compiled/_chunks/workflow/run-ChHLjaCt.js +0 -1
  572. package/dist/src/compiled/_chunks/workflow/sleep-BB2HuVie.js +0 -1
  573. package/dist/src/execution/accepted-delivery-deployment.d.ts +0 -7
  574. package/dist/src/execution/accepted-delivery-deployment.js +0 -1
  575. package/dist/src/execution/dispatch-turn-step.d.ts +0 -5
  576. package/dist/src/execution/dispatch-turn-step.js +0 -1
  577. package/dist/src/execution/durable-session-migrations/chain.d.ts +0 -38
  578. package/dist/src/execution/durable-session-migrations/chain.js +0 -1
  579. package/dist/src/execution/durable-session-migrations/snapshot.d.ts +0 -6
  580. package/dist/src/execution/durable-session-migrations/snapshot.js +0 -1
  581. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.d.ts +0 -12
  582. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.js +0 -1
  583. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +0 -2
  584. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +0 -1
  585. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +0 -88
  586. package/dist/src/execution/durable-session-migrations/turn-workflow.js +0 -1
  587. package/dist/src/execution/forward-turn-cancellation-step.d.ts +0 -6
  588. package/dist/src/execution/forward-turn-cancellation-step.js +0 -1
  589. package/dist/src/execution/forward-turn-delivery-step.d.ts +0 -6
  590. package/dist/src/execution/forward-turn-delivery-step.js +0 -1
  591. package/dist/src/execution/inline-turn.d.ts +0 -31
  592. package/dist/src/execution/inline-turn.js +0 -1
  593. package/dist/src/execution/next-driver-action.d.ts +0 -93
  594. package/dist/src/execution/parked-delivery-wait.d.ts +0 -54
  595. package/dist/src/execution/parked-delivery-wait.js +0 -1
  596. package/dist/src/execution/session-command-inbox.d.ts +0 -52
  597. package/dist/src/execution/session-command-inbox.js +0 -1
  598. package/dist/src/execution/session-command-token.d.ts +0 -6
  599. package/dist/src/execution/session-command-token.js +0 -1
  600. package/dist/src/execution/session-state-cursor.d.ts +0 -25
  601. package/dist/src/execution/session-state-cursor.js +0 -1
  602. package/dist/src/execution/session-timeout-control.js +0 -1
  603. package/dist/src/execution/session-timeout-steps.js +0 -1
  604. package/dist/src/execution/session-timeout-workflow.js +0 -1
  605. package/dist/src/execution/session-timeout.d.ts +0 -2
  606. package/dist/src/execution/session-timeout.js +0 -1
  607. package/dist/src/execution/turn-cancellation-control.d.ts +0 -30
  608. package/dist/src/execution/turn-cancellation-control.js +0 -1
  609. package/dist/src/execution/turn-cancellation-token.d.ts +0 -10
  610. package/dist/src/execution/turn-cancellation-token.js +0 -1
  611. package/dist/src/execution/turn-control-protocol.d.ts +0 -36
  612. package/dist/src/execution/turn-control-protocol.js +0 -1
  613. package/dist/src/execution/turn-control-receiver.d.ts +0 -54
  614. package/dist/src/execution/turn-control-receiver.js +0 -1
  615. package/dist/src/execution/turn-dispatch.d.ts +0 -39
  616. package/dist/src/execution/turn-dispatch.js +0 -1
  617. package/dist/src/execution/turn-execution-cursor.d.ts +0 -49
  618. package/dist/src/execution/turn-execution-cursor.js +0 -1
  619. package/dist/src/execution/turn-workflow-tool-run.js +0 -1
  620. package/dist/src/execution/turn-workflow.d.ts +0 -13
  621. package/dist/src/execution/turn-workflow.js +0 -1
  622. package/dist/src/execution/wire/session-inbox-contract.d.ts +0 -38
  623. package/dist/src/execution/wire/session-inbox-contract.js +0 -1
  624. package/dist/src/execution/wire/session-inbox-encoder.d.ts +0 -47
  625. package/dist/src/execution/wire/session-inbox-encoder.js +0 -1
  626. package/dist/src/execution/wire/session-inbox-resume.d.ts +0 -12
  627. package/dist/src/execution/wire/session-inbox-resume.js +0 -1
  628. package/dist/src/execution/wire/session-inbox-wire.d.ts +0 -29
  629. package/dist/src/execution/wire/session-inbox-wire.js +0 -1
  630. package/dist/src/execution/wire/session-inbox-wire.v0.d.ts +0 -5
  631. package/dist/src/execution/wire/session-inbox-wire.v0.js +0 -1
  632. package/dist/src/execution/wire/session-inbox-wire.v1.d.ts +0 -237
  633. package/dist/src/execution/wire/session-inbox-wire.v1.js +0 -1
  634. package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
  635. package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +0 -1
  636. package/dist/src/execution/wire/session-inbox-wire.v2.d.ts +0 -478
  637. package/dist/src/execution/wire/session-inbox-wire.v2.js +0 -1
  638. package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +0 -3
  639. package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +0 -1
  640. package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +0 -480
  641. package/dist/src/execution/wire/session-inbox-wire.v3.js +0 -1
  642. package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +0 -3
  643. package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +0 -1
  644. package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +0 -267
  645. package/dist/src/execution/wire/session-inbox-wire.v4.js +0 -1
  646. package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +0 -3
  647. package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +0 -1
  648. package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +0 -341
  649. package/dist/src/execution/wire/session-inbox-wire.v5.js +0 -1
  650. package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +0 -3
  651. package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +0 -1
  652. package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +0 -341
  653. package/dist/src/execution/wire/session-inbox-wire.v6.js +0 -1
  654. package/dist/src/execution/wire/session-inbox-wire.v7.d.ts +0 -342
  655. package/dist/src/execution/wire/session-inbox-wire.v7.js +0 -1
  656. package/dist/src/execution/workflow-entry-crash.d.ts +0 -39
  657. package/dist/src/execution/workflow-entry-crash.js +0 -1
  658. package/dist/src/execution/workflow-entry-finalization.d.ts +0 -28
  659. package/dist/src/execution/workflow-entry-finalization.js +0 -1
  660. package/dist/src/execution/workflow-entry.d.ts +0 -37
  661. package/dist/src/execution/workflow-entry.js +0 -1
  662. package/dist/src/execution/workflow-steps.js +0 -1
  663. package/dist/src/harness/workflow-continuation-security.d.ts +0 -5
  664. package/dist/src/harness/workflow-continuation-security.js +0 -1
  665. package/dist/src/harness/workflow-interrupt-state.d.ts +0 -20
  666. package/dist/src/harness/workflow-interrupt-state.js +0 -1
  667. package/dist/src/harness/workflow-lifecycle.d.ts +0 -32
  668. package/dist/src/harness/workflow-lifecycle.js +0 -1
  669. package/dist/src/harness/workflow-sandbox.d.ts +0 -28
  670. package/dist/src/harness/workflow-sandbox.js +0 -2
  671. package/dist/src/harness/workflow-subagent-limit.d.ts +0 -28
  672. package/dist/src/harness/workflow-subagent-limit.js +0 -1
  673. package/dist/src/harness/workflow-task-state.d.ts +0 -9
  674. package/dist/src/harness/workflow-task-state.js +0 -1
  675. package/dist/src/harness/workflow-tool-description.d.ts +0 -22
  676. package/dist/src/harness/workflow-tool-description.js +0 -37
  677. package/dist/src/subagents/handles/rebase.d.ts +0 -4
  678. package/dist/src/subagents/handles/rebase.js +0 -1
  679. package/dist/src/tools/workflow.d.ts +0 -37
  680. package/dist/src/tools/workflow.js +0 -1
  681. package/docs/guides/instrumentation-providers.md +0 -249
  682. package/docs/guides/instrumentation.md +0 -453
  683. /package/dist/src/{execution/next-driver-action.js → client/eve-agent-store-state.js} +0 -0
@@ -0,0 +1,69 @@
1
+ import type { SessionCapabilities } from "#channel/types.js";
2
+ import type { DurableSessionState } from "#execution/durable-session-store.js";
3
+ import type { SessionInboxHandle, SessionInboxPayload } from "#execution/session-inbox/inbox.js";
4
+ import type { TurnSelection } from "#execution/session/input-queue.js";
5
+ import type { WorkflowEntryResult } from "#execution/session/entry-input.js";
6
+ import type { AgentWorkflowRetentionDefinition } from "#shared/agent-definition.js";
7
+ import type { RunMode } from "#shared/run-mode.js";
8
+ /**
9
+ * Cross-deployment checkpoint contract. The successor may run a different eve
10
+ * build than the owner that produced it; bump when any field changes shape so
11
+ * an incompatible successor rejects the handoff instead of misreading state.
12
+ */
13
+ export declare const SESSION_CHECKPOINT_VERSION = 4;
14
+ /** Everything a successor needs to continue an idle session. Hooks are derived from the state. */
15
+ export interface SessionCheckpoint {
16
+ readonly version: typeof SESSION_CHECKPOINT_VERSION;
17
+ readonly capabilities?: SessionCapabilities;
18
+ readonly mode: RunMode;
19
+ readonly retention?: AgentWorkflowRetentionDefinition;
20
+ readonly serializedContext: Record<string, unknown>;
21
+ readonly sessionState: DurableSessionState;
22
+ readonly sessionTimeoutMs: number | false;
23
+ }
24
+ export type SessionOwnerActivation = {
25
+ readonly kind: "active";
26
+ } | {
27
+ readonly kind: "failed";
28
+ readonly error: unknown;
29
+ /** Commands accepted by partial successor claims before startup failed. */
30
+ readonly payloads: readonly SessionInboxPayload[];
31
+ };
32
+ export type SessionTransferOutcome = {
33
+ readonly kind: "transferred";
34
+ } | {
35
+ readonly kind: "retained";
36
+ readonly reason: "same-deployment" | "missing-deployment" | "not-idle" | "busy" | "accepted-during-release" | "activation-failed";
37
+ };
38
+ export interface SessionHandoffInput {
39
+ readonly checkpoint: Omit<SessionCheckpoint, "serializedContext" | "sessionState" | "version">;
40
+ readonly deploymentId: string;
41
+ readonly inbox: SessionInboxHandle;
42
+ readonly isInitialOwner: boolean;
43
+ readonly sessionId: string;
44
+ }
45
+ export declare function sessionAnchorToken(sessionId: string): string;
46
+ /**
47
+ * The sole boundary for moving an idle session to another exact deployment.
48
+ * Constructed once per owner; `tryTransfer()` is attempted per eligible selection.
49
+ * When the upstream atomic hook-handoff primitive lands, only this class changes.
50
+ */
51
+ export declare class SessionHandoff {
52
+ private readonly input;
53
+ private anchor;
54
+ constructor(input: SessionHandoffInput);
55
+ /**
56
+ * Attempts to move the session to the selected delivery's deployment. The
57
+ * outcome states whether the successor activated or this owner retained the
58
+ * session. Candidate failures recover locally rather than escaping.
59
+ */
60
+ tryTransfer(selection: TurnSelection, state: Pick<SessionCheckpoint, "serializedContext" | "sessionState">): Promise<SessionTransferOutcome>;
61
+ /** After a transfer, the original run parks until the final owner reports the session result. */
62
+ awaitAnchoredResult(): Promise<WorkflowEntryResult>;
63
+ disposeAnchor(): Promise<void>;
64
+ /** Starts the candidate and waits for it to activate or fail. */
65
+ private startAndActivate;
66
+ /** Reclaims the exact hook set and replays payloads accepted while it was released. */
67
+ private recover;
68
+ private ensureAnchor;
69
+ }
@@ -0,0 +1 @@
1
+ import{sessionHandoffMarkerToken}from"#execution/session-inbox/address.js";import{startSessionOwnerStep}from"#execution/workflow-runtime.js";import{createHook,getWorkflowMetadata}from"#compiled/@workflow/core/index.js";import{claimHookOwnership,disposeHook}from"#execution/hook-ownership.js";import{sessionHookTokens}from"#execution/session/hook-tokens.js";import{isSessionIdleForHandoffStep}from"#execution/session/handoff-steps.js";import{readAcceptedDeploymentId}from"#execution/session/accepted-deployment.js";const SESSION_CHECKPOINT_VERSION=4;function sessionAnchorToken(e){return`${e}:anchor`}var SessionHandoff=class{input;anchor;constructor(e){this.input=e}async tryTransfer(e,t){let{deploymentId:n,inbox:r}=this.input,i=readAcceptedDeploymentId(e.delivery);if(i===void 0)return{kind:`retained`,reason:`missing-deployment`};if(i===n)return{kind:`retained`,reason:`same-deployment`};if(!e.handoffEligible)return{kind:`retained`,reason:`busy`};if(!await isSessionIdleForHandoffStep(t))return{kind:`retained`,reason:`not-idle`};let a={...this.input.checkpoint,...t,version:4},o=sessionHookTokens(t);await this.ensureAnchor();let s=o.map(e=>createHook({token:sessionHandoffMarkerToken(e)}));await Promise.all(s.map(e=>claimHookOwnership(e)));try{let t=await r.release();if(t.length>0)return await this.recover(o,t),{kind:`retained`,reason:`accepted-during-release`};let n=[];try{let t=await this.startAndActivate(a,e.delivery,i);if(t.kind===`active`)return{kind:`transferred`};n=t.payloads}catch{}return await this.recover(o,n),{kind:`retained`,reason:`activation-failed`}}finally{await Promise.all(s.map(e=>disposeHook(e)))}}async awaitAnchoredResult(){if(this.anchor===void 0)throw Error(`Session anchor was never claimed.`);try{return await this.anchor}finally{await this.disposeAnchor()}}async disposeAnchor(){if(this.anchor===void 0)return;let e=this.anchor;this.anchor=void 0,await disposeHook(e)}async startAndActivate(e,t,n){let r=createHook({token:`${getWorkflowMetadata().workflowRunId}:handoff`});await claimHookOwnership(r);try{return await startSessionOwnerStep({activationToken:r.token,anchorRunId:this.input.sessionId,checkpoint:e,delivery:t,targetDeploymentId:n}),await r}finally{await disposeHook(r)}}async recover(e,t){await this.input.inbox.claimSessionHooks(e),this.input.inbox.restore(t)}async ensureAnchor(){this.input.isInitialOwner&&this.anchor===void 0&&(this.anchor=createHook({token:sessionAnchorToken(this.input.sessionId)}),await claimHookOwnership(this.anchor))}};export{SESSION_CHECKPOINT_VERSION,SessionHandoff,sessionAnchorToken};
@@ -0,0 +1,11 @@
1
+ import type { DurableSessionState } from "#execution/durable-session-store.js";
2
+ /**
3
+ * Every hook a session answers to, derived from its committed state: the
4
+ * stable command inbox plus each continuation alias a channel handler
5
+ * selected. This is the one source of truth for claims at boot, at every
6
+ * state transition, and across a deployment handoff.
7
+ */
8
+ export declare function sessionHookTokens(input: {
9
+ readonly serializedContext: Record<string, unknown>;
10
+ readonly sessionState: Pick<DurableSessionState, "continuationToken" | "sessionId">;
11
+ }): readonly string[];
@@ -0,0 +1 @@
1
+ import{sessionCommandHookToken}from"#execution/session-inbox/address.js";import{ContinuationHookTokensKey}from"#context/keys.js";function sessionHookTokens(e){let t=e.serializedContext[ContinuationHookTokensKey.name],n=new Set([sessionCommandHookToken(e.sessionState.sessionId)]);if(Array.isArray(t))for(let e of t)typeof e==`string`&&e.length>0&&n.add(e);return e.sessionState.continuationToken!==``&&n.add(e.sessionState.continuationToken),[...n]}export{sessionHookTokens};
@@ -0,0 +1,72 @@
1
+ import type { DeliverHookPayload, DeliverPayload } from "#channel/types.js";
2
+ import type { getSessionTaskCohorts } from "#tasks/session-task-cohorts.js";
3
+ export type SessionControl = "clear" | "compact" | "expired" | "reset";
4
+ type TaskCohorts = ReturnType<typeof getSessionTaskCohorts>;
5
+ export interface DeliveryAdmission {
6
+ readonly delivery: DeliverHookPayload;
7
+ readonly sequence: number;
8
+ }
9
+ export interface TurnSelection {
10
+ readonly delivery: DeliverHookPayload;
11
+ /**
12
+ * True only for a lone, callerless conversational delivery that arrived
13
+ * while nothing else was pending. Such a delivery may move the session to
14
+ * the deployment that accepted it.
15
+ */
16
+ readonly handoffEligible: boolean;
17
+ readonly kind: "turn";
18
+ /** Sequences of every admission folded into this turn. */
19
+ readonly sequences: readonly number[];
20
+ }
21
+ export type SessionInputSelection = TurnSelection | {
22
+ readonly control: SessionControl;
23
+ readonly kind: "control";
24
+ } | {
25
+ readonly kind: "authorization-resume";
26
+ readonly payloads: readonly DeliverPayload[];
27
+ };
28
+ /**
29
+ * Ordered, admitted session input, plus the idempotency and cancellation
30
+ * facts for task deliveries this owner has seen. Entries are private; callers
31
+ * receive typed admission and selection values. Everything here is rebuilt
32
+ * deterministically on replay, and a successor never inherits it because
33
+ * handoff requires every indexed task to be terminal.
34
+ */
35
+ export declare class SessionInputQueue {
36
+ private readonly entries;
37
+ private readonly cancelledTaskIds;
38
+ private readonly seenTaskDeliveryIds;
39
+ private nextSequence;
40
+ get pendingCount(): number;
41
+ /** Admits a delivery unless it repeats or belongs to a cancelled task. */
42
+ enqueueDelivery(delivery: DeliverHookPayload): DeliveryAdmission | undefined;
43
+ /** A caller's own task id counts as seen so its echo is not admitted twice. */
44
+ rememberTask(taskId: string): void;
45
+ isTaskCancelled(taskId: string): boolean;
46
+ enqueueControl(control: SessionControl): void;
47
+ /** Keeps one payload per authorization attempt; a repeated callback for the same attempt is dropped. */
48
+ enqueueAuthorization(payloads: readonly DeliverPayload[]): void;
49
+ delivery(sequence: number): DeliverHookPayload | undefined;
50
+ replaceDelivery(sequence: number, delivery: DeliverHookPayload | undefined): void;
51
+ /** Drops queued notifications from a cancelled task and refuses later ones. */
52
+ cancelTask(taskId: string): void;
53
+ takeSteering(admitted: ReadonlySet<number>, callerCallId: string | undefined): TurnSelection | undefined;
54
+ takeNext(cohorts: TaskCohorts, options?: {
55
+ readonly deferDeliveries?: boolean;
56
+ /**
57
+ * Attempt ids of the open authorization challenge. Callbacks for other
58
+ * attempts are stale and dropped; once every expected attempt has
59
+ * reported, the collected payloads resume the challenge ahead of
60
+ * ordinary input.
61
+ */
62
+ readonly expectedAttemptIds?: ReadonlySet<string>;
63
+ /** Sequence of a delivery admitted while nothing else was pending. */
64
+ readonly freshSequence?: number;
65
+ }): SessionInputSelection | undefined;
66
+ private nextActionableIndex;
67
+ private takeSelectionAt;
68
+ private isCancelledTaskDelivery;
69
+ private retain;
70
+ }
71
+ export declare function isSteeringDelivery(delivery: DeliverHookPayload, callerCallId: string | undefined): boolean;
72
+ export {};
@@ -0,0 +1 @@
1
+ import{jsonValuesEqual}from"#shared/json.js";import{coalesceDeliveries}from"#harness/messages.js";var SessionInputQueue=class{entries=[];cancelledTaskIds=new Set;seenTaskDeliveryIds=new Set;nextSequence=0;get pendingCount(){return this.entries.length}enqueueDelivery(e){let t=taskDeliveryId(e);if(t!==void 0){if(this.seenTaskDeliveryIds.has(t)||this.isCancelledTaskDelivery(t))return;this.seenTaskDeliveryIds.add(t)}let n={delivery:e,sequence:this.nextSequence++};return this.entries.push({...n,kind:`delivery`}),n}rememberTask(e){this.seenTaskDeliveryIds.add(e)}isTaskCancelled(e){return this.cancelledTaskIds.has(e)}enqueueControl(e){this.entries.push({control:e,kind:`control`,sequence:this.nextSequence++})}enqueueAuthorization(e){for(let t of e){let e=authorizationAttemptId(t);e!==void 0&&(this.entries.some(t=>t.kind===`authorization`&&t.attemptId===e)||this.entries.push({attemptId:e,kind:`authorization`,payload:t,sequence:this.nextSequence++}))}}delivery(e){return this.entries.find(t=>t.kind===`delivery`&&t.sequence===e)?.delivery}replaceDelivery(e,t){let n=this.entries.findIndex(t=>t.kind===`delivery`&&t.sequence===e);if(!(n<0)){if(t===void 0){this.entries.splice(n,1);return}this.entries[n]={delivery:t,kind:`delivery`,sequence:e}}}cancelTask(e){this.cancelledTaskIds.add(e),this.retain(t=>t.kind!==`delivery`||!isTaskDelivery(t.delivery,t=>t===e||t.startsWith(`${e}:`)))}takeSteering(e,t){let n=this.entries.filter(n=>n.kind===`delivery`&&e.has(n.sequence)&&isSteeringDelivery(n.delivery,t));if(n.length!==0)return this.retain(e=>e.kind!==`delivery`||!n.includes(e)),{delivery:combine(n),handoffEligible:!1,kind:`turn`,sequences:n.map(({sequence:e})=>e)}}takeNext(e,t){let n=t?.expectedAttemptIds??new Set;if(this.retain(e=>e.kind!==`authorization`||n.has(e.attemptId)),n.size>0){let e=new Map(this.entries.flatMap(e=>e.kind===`authorization`?[[e.attemptId,e.payload]]:[]));if([...n].every(t=>e.has(t)))return this.retain(e=>e.kind!==`authorization`),{kind:`authorization-resume`,payloads:[...n].map(t=>e.get(t))}}let r=this.nextActionableIndex(e,t?.deferDeliveries===!0);if(!(r<0))return this.takeSelectionAt(r,e,t?.freshSequence)}nextActionableIndex(e,t){let n=this.entries.filter(e=>e.kind===`delivery`),r=new Set(n.flatMap(({delivery:e})=>{let t=completionTaskId(e);return t===void 0?[]:[t]})),i=new Set;for(let[t,n]of e)!n.settled&&!r.has(t)&&!this.cancelledTaskIds.has(t)&&i.add(n.cohortId);return this.entries.findIndex(n=>{if(n.kind===`control`)return!0;if(n.kind===`authorization`||t)return!1;let r=completionCohort(n.delivery,e);return r===void 0||!i.has(r)})}takeSelectionAt(e,t,n){let r=this.entries[e];if(r.kind!==`delivery`)return this.entries.splice(e,1),r.kind===`control`?{control:r.control,kind:`control`}:{kind:`authorization-resume`,payloads:[r.payload]};let i=completionCohort(r.delivery,t);if(i!==void 0){let r=this.entries.findLastIndex(e=>e.kind===`delivery`&&completionCohort(e.delivery,t)===i),a=this.entries.findIndex((n,i)=>i>e&&i<r&&(n.kind!==`delivery`||completionCohort(n.delivery,t)===void 0));if(a>=0)return this.takeSelectionAt(a,t,n)}let a=this.entries.splice(e,1)[0];if(a.kind!==`delivery`)throw Error(`Selected a non-delivery entry as a turn.`);let o=[a],s=completionCohort(a.delivery,t);if(s!==void 0){let e=this.entries.filter(e=>e.kind===`delivery`&&completionCohort(e.delivery,t)===s);o.push(...e),this.retain(e=>e.kind!==`delivery`||completionCohort(e.delivery,t)!==s)}else{let t=a.delivery.auth!=null&&a.delivery.auth.principalType!==`anonymous`,n=a.delivery.caller;for(;this.entries.length>e;){let r=this.entries[e];if(r?.kind!==`delivery`||a.delivery.taskDeliveryId!==void 0||r.delivery.taskDeliveryId!==void 0||!t||!jsonValuesEqual(a.delivery.auth,r.delivery.auth)||n!==void 0&&r.delivery.caller!==void 0)break;o.push(this.entries.splice(e,1)[0]),n??=r.delivery.caller}}let c=o.map(({sequence:e})=>e),l=combine(o);return{delivery:l,handoffEligible:c.length===1&&c[0]===n&&l.caller===void 0&&taskDeliveryId(l)===void 0&&this.entries.length===0,kind:`turn`,sequences:c}}isCancelledTaskDelivery(e){for(let t of this.cancelledTaskIds)if(e===t||e.startsWith(`${t}:`))return!0;return!1}retain(e){let t=this.entries.filter(e);this.entries.splice(0,this.entries.length,...t)}};function isSteeringDelivery(e,t){return e.taskDeliveryId===void 0&&(e.turnPolicy??`steer`)===`steer`&&(e.caller===void 0||e.caller.callId===t)}function combine(e){return e.length===1?e[0].delivery:coalesceDeliveries(e.map(({delivery:e})=>e))}function authorizationAttemptId(e){let t=e.authorizationCallback;return typeof t?.attemptId==`string`?t.attemptId:void 0}function taskDeliveryId(e){return e.taskDeliveryId??e.caller?.taskId}function isTaskDelivery(e,t){let n=taskDeliveryId(e);return n!==void 0&&t(n)}function completionCohort(e,t){let n=completionTaskId(e);return n===void 0?void 0:t.get(n)?.cohortId}function completionTaskId(e){if(e.caller===void 0&&e.taskDeliveryId?.endsWith(`:ready:completed`))return e.taskDeliveryId.slice(0,-16)}export{SessionInputQueue,isSteeringDelivery};
@@ -0,0 +1,32 @@
1
+ import type { DeliverPayload } from "#channel/types.js";
2
+ import type { SessionControl, SessionInputQueue, TurnSelection } from "#execution/session/input-queue.js";
3
+ import type { SessionInboxReader } from "#execution/session-inbox/inbox.js";
4
+ import type { SessionStateCursor } from "#execution/session/state-cursor.js";
5
+ import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js";
6
+ export type NextTurnInstruction = {
7
+ readonly kind: "workflow";
8
+ readonly message: WorkflowToolRunMessage;
9
+ } | {
10
+ readonly kind: "authorization-resume";
11
+ readonly payloads: readonly DeliverPayload[];
12
+ } | {
13
+ readonly kind: SessionControl;
14
+ } | {
15
+ readonly kind: "closed";
16
+ } | {
17
+ readonly kind: "cancel-turn";
18
+ } | TurnSelection;
19
+ /**
20
+ * Waits for the next input the parked owner must act on. While an
21
+ * authorization challenge is open, its callbacks collect in the queue and
22
+ * resume the challenge once every expected attempt has reported; ordinary
23
+ * deliveries keep starting turns in the meantime. Fully routed descendant
24
+ * deliveries leave nothing for the parent, so the wait continues.
25
+ */
26
+ export declare function nextTurnDelivery(input: {
27
+ readonly inbox: SessionInboxReader;
28
+ readonly cursor: SessionStateCursor;
29
+ readonly deferDeliveries?: boolean;
30
+ readonly expectedAttemptIds?: ReadonlySet<string>;
31
+ readonly queue: SessionInputQueue;
32
+ }): Promise<NextTurnInstruction>;
@@ -0,0 +1 @@
1
+ import{routeSelectedDelivery}from"#execution/session/route-selected-delivery.js";import{admitSessionInboxPayload,applySessionCancellation}from"#execution/session/admission.js";import{getSessionTaskCohorts}from"#tasks/session-task-cohorts.js";async function nextTurnDelivery(e){let{inbox:t,cursor:n,queue:r}=e,i;for(;;){let a=r.takeNext(getSessionTaskCohorts(n.sessionState.snapshot.session.state),{deferDeliveries:e.deferDeliveries,expectedAttemptIds:e.expectedAttemptIds,freshSequence:t.hasPending()?void 0:i});if(a?.kind===`control`)return{kind:a.control};if(a?.kind===`authorization-resume`)return a;if(a?.kind===`turn`){let e=await routeSelectedDelivery(a,n);if(e.kind===`cancel-turn`)return e;if(e.kind===`consumed`)continue;return e}let o=r.pendingCount===0,s=await t.next();if(s===void 0)return{kind:`closed`};let c=await admitSessionInboxPayload(s,e);switch(i=o&&c.kind===`delivery`?c.admission.sequence:void 0,c.kind){case`workflow`:return{kind:`workflow`,message:c.message};case`cancel`:await applySessionCancellation(c.command,e)}}}export{nextTurnDelivery};
@@ -2,7 +2,6 @@ import type { HarnessSession } from "#harness/types.js";
2
2
  /** Derives the workflow fields used to select the next action at the park boundary. */
3
3
  export declare function derivePendingState(session: HarnessSession): {
4
4
  readonly authorizationAttemptIds?: readonly string[];
5
- readonly authorizationNames?: readonly string[];
6
5
  readonly hasPendingAuthorization: boolean;
7
6
  readonly hasPendingInputBatch: boolean;
8
7
  readonly pendingCoordinationCallIds?: readonly string[];
@@ -1 +1 @@
1
- import{getPendingCoordinationBatch}from"#harness/coordination.js";import{getPendingAuthorization}from"#harness/authorization.js";import{hasPendingInputBatch}from"#harness/input-requests.js";function derivePendingState(e){let t=getPendingCoordinationBatch(e.state),n=getPendingAuthorization(e.state),r={authorizationAttemptIds:n?.challenges.flatMap(e=>e.attemptId===void 0?[]:[e.attemptId]),authorizationNames:n?.challenges.map(e=>e.name),hasPendingAuthorization:n!==void 0,hasPendingInputBatch:hasPendingInputBatch(e.state)};return t===void 0?r:{...r,pendingCoordinationCallIds:[...t.runtimeActions,...t.tasks].map(e=>e.callId)}}export{derivePendingState};
1
+ import{getPendingCoordinationBatch}from"#harness/coordination.js";import{getPendingAuthorization}from"#harness/authorization.js";import{hasPendingInputBatch}from"#harness/input-requests.js";function derivePendingState(e){let t=getPendingCoordinationBatch(e.state),n=getPendingAuthorization(e.state),r={authorizationAttemptIds:n?.challenges.flatMap(e=>e.attemptId===void 0?[]:[e.attemptId]),hasPendingAuthorization:n!==void 0,hasPendingInputBatch:hasPendingInputBatch(e.state)};return t===void 0?r:{...r,pendingCoordinationCallIds:[...t.runtimeActions,...t.tasks].map(e=>e.callId)}}export{derivePendingState};
@@ -0,0 +1,47 @@
1
+ import type { DeliverHookPayload, SessionCapabilities, TurnCaller } from "#channel/types.js";
2
+ import type { AgentWorkflowRetentionDefinition } from "#shared/agent-definition.js";
3
+ import type { RunMode } from "#shared/run-mode.js";
4
+ import type { DurableSessionState } from "#execution/durable-session-store.js";
5
+ import { type SessionInboxHandle } from "#execution/session-inbox/inbox.js";
6
+ import type { WorkflowEntryResult } from "#execution/session/entry-input.js";
7
+ /**
8
+ * Who to tell when this owner exits. The original run anchors the public
9
+ * stream itself; a successor signals the original run. A `self` anchor may
10
+ * also name a `notify` step that runs with the final result, which lets an
11
+ * importer settle whatever predecessor still holds the stream open.
12
+ */
13
+ export type SessionAnchor = {
14
+ readonly kind: "self";
15
+ readonly notify?: (result: WorkflowEntryResult) => Promise<void>;
16
+ } | {
17
+ readonly kind: "successor";
18
+ };
19
+ export interface SessionBoot {
20
+ readonly anchor: SessionAnchor;
21
+ readonly caller: TurnCaller | undefined;
22
+ readonly capabilities?: SessionCapabilities;
23
+ readonly deploymentId: string;
24
+ readonly initialInput: DeliverHookPayload | undefined;
25
+ readonly mode: RunMode;
26
+ readonly retention?: AgentWorkflowRetentionDefinition;
27
+ readonly serializedContext: Record<string, unknown>;
28
+ readonly sessionId: string;
29
+ readonly sessionState: DurableSessionState;
30
+ readonly sessionTimeoutDeadline?: Date;
31
+ readonly sessionTimeoutMs: number | false;
32
+ readonly sessionWritable: WritableStream<Uint8Array>;
33
+ }
34
+ /** Runs an already prepared owner against its session's existing stream. */
35
+ export declare function runPreparedSession(boot: SessionBoot, inbox: SessionInboxHandle): Promise<WorkflowEntryResult>;
36
+ /**
37
+ * Terminal path for a boot that failed before the session loop could run.
38
+ * The caller is re-resolved from context because no turn ever bound it.
39
+ */
40
+ export declare function failSession(input: {
41
+ readonly error: unknown;
42
+ readonly mode: RunMode;
43
+ readonly serializedContext: Record<string, unknown>;
44
+ readonly sessionId: string;
45
+ readonly sessionState: DurableSessionState | undefined;
46
+ readonly sessionWritable: WritableStream<Uint8Array>;
47
+ }): Promise<never>;
@@ -0,0 +1 @@
1
+ import{settleCancelledTurnStep}from"#execution/settle-cancelled-turn-step.js";import"#execution/session-inbox/inbox.js";import{bindTurnCallerContextStep,notifyCancelledTaskCallerStep,notifyTurnCallerStep,resolveInitialTurnCallerStep}from"#subagents/parent-notification.js";import{signalSessionAnchorStep}from"#execution/session/handoff-steps.js";import{SessionHandoff,sessionAnchorToken}from"#execution/session/handoff.js";import{nextTurnDelivery}from"#execution/session/next-input.js";import{cancelDescendantTurnsStep}from"#execution/cancel-descendant-turns-step.js";import{SessionInputQueue}from"#execution/session/input-queue.js";import{SessionExecution}from"#execution/session/turn.js";import{SessionStateCursor}from"#execution/session/state-cursor.js";import{finalizeSession}from"#execution/session/finalization.js";import{createSessionTimeoutControl}from"#execution/session/timeout-control.js";function createSafeOuterWorkflowError(){let e=Error(`Agent workflow failed. Inspect the private session trace for details.`);return e.name=`EveWorkflowFailure`,e}async function runPreparedSession(e,t){let n=new SessionStateCursor({inbox:t,sessionWritable:e.sessionWritable,serializedContext:e.serializedContext,sessionState:e.sessionState}),r={caller:e.caller,terminalEmitted:!1},i=new SessionHandoff({checkpoint:{capabilities:e.capabilities,mode:e.mode,retention:e.retention,sessionTimeoutMs:e.sessionTimeoutMs},deploymentId:e.deploymentId,inbox:t,isInitialOwner:e.anchor.kind===`self`,sessionId:e.sessionId}),a={output:``,isError:!0};try{let o;try{o=await runSessionLoop(e,{cursor:n,handoff:i,inbox:t,progress:r})}finally{await t.dispose()}return o.kind===`transferred`?e.anchor.kind===`self`?(a=await i.awaitAnchoredResult(),a):{output:``}:(a=await finalizeSession(o.outcome,{caller:r.caller,cursor:n,mode:e.mode,sessionWritable:e.sessionWritable}),r.terminalEmitted=!0,a)}catch(t){throw r.terminalEmitted||await finalizeSession({error:t,kind:`failed`,turnId:r.turnId},{caller:r.caller,cursor:n,mode:e.mode,sessionWritable:e.sessionWritable}),createSafeOuterWorkflowError()}finally{await reportResultToAnchor(e,a,i)}}async function failSession(e){let t;try{t=await resolveInitialTurnCallerStep({serializedContext:e.serializedContext})}catch{}throw await finalizeSession({error:e.error,kind:`failed`},{caller:t,cursor:{serializedContext:e.serializedContext,sessionState:e.sessionState},mode:e.mode,sessionWritable:e.sessionWritable}),createSafeOuterWorkflowError()}async function reportResultToAnchor(e,t,n){switch(e.anchor.kind){case`self`:await n.disposeAnchor(),await e.anchor.notify?.(t);return;case`successor`:await signalSessionAnchorStep({result:t,token:sessionAnchorToken(e.sessionId)});return}}async function runSessionLoop(e,t){let{cursor:n,handoff:r,inbox:i,progress:a}=t,o=new SessionInputQueue,s=new SessionExecution({capabilities:e.capabilities,cursor:n,inbox:i,mode:e.mode,queue:o,sessionId:e.sessionId}),c=e.sessionTimeoutDeadline===void 0?void 0:createSessionTimeoutControl({deadline:e.sessionTimeoutDeadline,sessionId:e.sessionId}),nextParkedActivity=async t=>{for(;;){let r=await nextTurnDelivery({cursor:n,deferDeliveries:e.mode===`task`&&t.size>0,expectedAttemptIds:t,inbox:i,queue:o});if(r.kind!==`workflow`)return r;await s.handleWorkflowMessage(r.message)}},l=0,runTurn=async e=>{let t=a.caller;return t?.taskId!==void 0&&o.rememberTask(t.taskId),t!==void 0&&await n.apply({serializedContext:await bindTurnCallerContextStep({caller:t,serializedContext:n.serializedContext})}),a.turnId=`turn_${String(l++)}`,await s.runTurn(e)},settleCancelledTurn=async()=>{let t=await settleCancelledTurnStep({sessionWritable:e.sessionWritable,serializedContext:n.serializedContext,sessionState:n.sessionState});return await n.apply(t),a.caller=void 0,t};try{let[t,i]=await Promise.allSettled([runTurn(e.initialInput===void 0?void 0:{delivery:e.initialInput}),c?.start()]);if(i.status===`rejected`)throw i.reason;if(t.status===`rejected`)throw t.reason;let o=t.value;for(;;){if(o.kind===`done`)return{kind:`terminal`,outcome:{action:o,kind:`done`}};if(o.cancelled===!0){let t={caller:a.caller,sessionId:e.sessionId},n=await settleCancelledTurn();await notifyCancelledTaskCallerStep(n.usage===void 0?t:{...t,usage:n.usage})}else o.settled!==void 0&&(a.caller!==void 0&&await notifyTurnCallerStep({caller:a.caller,lifecycle:`parked`,sessionId:e.sessionId,settled:o.settled}),a.caller=void 0);let t=await nextParkedActivity(new Set(o.authorizationAttemptIds??[]));switch(t.kind){case`authorization-resume`:o=await runTurn({delivery:{kind:`deliver`,payloads:t.payloads}});continue;case`expired`:case`reset`:case`closed`:return{kind:`terminal`,outcome:{kind:`expired`}};case`clear`:case`compact`:o=await runTurn({control:t.kind});continue;case`cancel-turn`:await cancelDescendantTurnsStep({serializedContext:n.serializedContext,sessionState:n.sessionState}),await settleCancelledTurn(),o={...o,settled:void 0};continue;case`turn`:if((await r.tryTransfer(t,{serializedContext:n.serializedContext,sessionState:n.sessionState})).kind===`transferred`)return{kind:`transferred`};t.delivery.caller!==void 0&&(a.caller=t.delivery.caller),o=await runTurn({delivery:t.delivery});continue}}}finally{await c?.dispose()}}export{failSession,runPreparedSession};
@@ -0,0 +1,9 @@
1
+ import type { TurnSelection } from "#execution/session/input-queue.js";
2
+ import type { SessionStateCursor } from "#execution/session/state-cursor.js";
3
+ export type RoutedTurnSelection = {
4
+ readonly kind: "cancel-turn";
5
+ } | {
6
+ readonly kind: "consumed";
7
+ } | TurnSelection;
8
+ /** Routes one selected delivery exactly once, independent of active/parked mode. */
9
+ export declare function routeSelectedDelivery(selection: TurnSelection, cursor: SessionStateCursor): Promise<RoutedTurnSelection>;
@@ -0,0 +1 @@
1
+ import{routeDeliverToChildren}from"#execution/route-child-delivery.js";async function routeSelectedDelivery(e,t){let n=await routeDeliverToChildren({delivery:e.delivery,sessionWritable:t.sessionWritable,serializedContext:t.serializedContext,sessionState:t.sessionState});return await t.apply(n),n.kind===`cancel-turn`?{kind:`cancel-turn`}:n.remainder===void 0?{kind:`consumed`}:{...e,delivery:n.remainder}}export{routeSelectedDelivery};
@@ -0,0 +1,31 @@
1
+ import type { DurableSessionState } from "#execution/durable-session-store.js";
2
+ import type { SessionInboxOwnership } from "#execution/session-inbox/inbox.js";
3
+ import type { TurnStepInput, TurnStepPayload } from "#execution/session/turn-step-types.js";
4
+ /** A durable-state transition; absent fields keep the cursor's current value. */
5
+ export interface SessionStateTransition {
6
+ readonly serializedContext?: Record<string, unknown>;
7
+ readonly sessionState?: DurableSessionState;
8
+ }
9
+ /**
10
+ * The one mutable serialized-context / session-state pair owned by the
11
+ * workflow executing a session. Steps return transitions; the cursor adopts
12
+ * them and claims any continuation address a step introduced, so every hook
13
+ * the session answers to is registered before the next step runs.
14
+ */
15
+ export declare class SessionStateCursor {
16
+ readonly sessionWritable: WritableStream<Uint8Array>;
17
+ private readonly inbox;
18
+ private currentSerializedContext;
19
+ private currentSessionState;
20
+ constructor(input: {
21
+ readonly inbox: Pick<SessionInboxOwnership, "claimSessionHooks">;
22
+ readonly sessionWritable: WritableStream<Uint8Array>;
23
+ readonly serializedContext: Record<string, unknown>;
24
+ readonly sessionState: DurableSessionState;
25
+ });
26
+ get serializedContext(): Record<string, unknown>;
27
+ get sessionState(): DurableSessionState;
28
+ /** Applies a transition after claiming every continuation address it introduced. */
29
+ apply(transition: SessionStateTransition): Promise<void>;
30
+ createStepInput(input: TurnStepPayload | undefined, signals: Pick<TurnStepInput, "abortSignal" | "steeringSignal">): TurnStepInput;
31
+ }
@@ -0,0 +1 @@
1
+ import{sessionHookTokens}from"#execution/session/hook-tokens.js";var SessionStateCursor=class{sessionWritable;inbox;currentSerializedContext;currentSessionState;constructor(e){this.inbox=e.inbox,this.sessionWritable=e.sessionWritable,this.currentSerializedContext=e.serializedContext,this.currentSessionState=e.sessionState}get serializedContext(){return this.currentSerializedContext}get sessionState(){return this.currentSessionState}async apply(e){let t=e.serializedContext??this.currentSerializedContext,n=e.sessionState??this.currentSessionState;await this.inbox.claimSessionHooks(sessionHookTokens({serializedContext:t,sessionState:n})),this.currentSerializedContext=t,this.currentSessionState=n}createStepInput(e,t){return{...t,input:e,sessionWritable:this.sessionWritable,serializedContext:this.currentSerializedContext,sessionState:this.currentSessionState}}};export{SessionStateCursor};
@@ -6,5 +6,5 @@ export interface SessionTimeoutControl {
6
6
  /** Creates a timer controller for one stable session command inbox. */
7
7
  export declare function createSessionTimeoutControl(input: {
8
8
  readonly deadline: Date;
9
- readonly token: string;
9
+ readonly sessionId: string;
10
10
  }): SessionTimeoutControl;
@@ -0,0 +1 @@
1
+ import{sessionCommandHookToken}from"#execution/session-inbox/address.js";import{getWorkflowMetadata}from"#compiled/@workflow/core/index.js";import{cancelSessionTimeoutStep,startSessionTimeoutStep}from"#execution/session/timeout-steps.js";function createSessionTimeoutControl(e){let t;return{async dispose(){if(t===void 0)return;let e=t;t=void 0,await cancelSessionTimeoutStep({runId:e.runId})},async start(){t===void 0&&(t=await startSessionTimeoutStep({deadline:e.deadline,ownerRunId:getWorkflowMetadata().workflowRunId,token:sessionCommandHookToken(e.sessionId)}))}}}export{createSessionTimeoutControl};
@@ -1,10 +1,11 @@
1
- import type { SessionTimeoutWorkflowInput } from "#execution/session-timeout-workflow.js";
1
+ import type { SessionTimeoutWorkflowInput } from "#execution/session/timeout-workflow.js";
2
2
  /** Starts the durable timer that signals one session deadline. */
3
3
  export declare function startSessionTimeoutStep(input: SessionTimeoutWorkflowInput): Promise<{
4
4
  readonly runId: string;
5
5
  }>;
6
- /** Resumes the owning driver when its durable timer elapses. */
6
+ /** Resumes the owning session when its durable timer elapses. */
7
7
  export declare function signalSessionTimeoutStep(input: {
8
+ readonly ownerRunId: string;
8
9
  readonly token: string;
9
10
  }): Promise<void>;
10
11
  /** Cancels a timer whose session reached another terminal outcome first. */
@@ -0,0 +1 @@
1
+ import{walkCauseChain}from"#shared/errors.js";import{sessionTimeoutWorkflowReference,startWorkflowOnCurrentDeployment}from"#execution/workflow-runtime.js";import{cancelRun,getWorld}from"#internal/workflow/runtime.js";import{EntityConflictError,HookNotFoundError,RunExpiredError,WorkflowRunNotFoundError}from"#compiled/@workflow/errors/index.js";import{resumeSessionInbox}from"#execution/session-inbox/resume.js";async function startSessionTimeoutStep(e){"use step";return{runId:(await startWorkflowOnCurrentDeployment(sessionTimeoutWorkflowReference,[e])).runId}}async function signalSessionTimeoutStep(e){"use step";try{await resumeSessionInbox(e.token,{kind:`session-timeout`,ownerRunId:e.ownerRunId})}catch(e){if(!isInactiveTimeoutTarget(e))throw e}}async function cancelSessionTimeoutStep(e){"use step";try{await cancelRun(await getWorld(),e.runId,{cancelReason:`Session ended before its timeout`})}catch(e){if(!isInactiveTimeoutTarget(e))throw e}}function isInactiveTimeoutTarget(e){for(let t of walkCauseChain(e))if(HookNotFoundError.is(t)||WorkflowRunNotFoundError.is(t)||RunExpiredError.is(t)||EntityConflictError.is(t))return!0;return!1}export{cancelSessionTimeoutStep,signalSessionTimeoutStep,startSessionTimeoutStep};
@@ -1,6 +1,8 @@
1
1
  export interface SessionTimeoutWorkflowInput {
2
2
  readonly deadline: Date;
3
+ /** Owner run that armed the timer. */
4
+ readonly ownerRunId: string;
3
5
  readonly token: string;
4
6
  }
5
- /** Sleeps until the session deadline, then signals its driver. */
7
+ /** Sleeps until the session deadline, then signals its current owner. */
6
8
  export declare function sessionTimeoutWorkflow(input: SessionTimeoutWorkflowInput): Promise<void>;
@@ -0,0 +1 @@
1
+ import{sleep}from"#compiled/@workflow/core/index.js";import{signalSessionTimeoutStep}from"#execution/session/timeout-steps.js";async function sessionTimeoutWorkflow(e){"use workflow";await sleep(e.deadline),await signalSessionTimeoutStep({ownerRunId:e.ownerRunId,token:e.token})}sessionTimeoutWorkflow.workflowId=`workflow//eve//sessionTimeoutWorkflow`;export{sessionTimeoutWorkflow};
@@ -0,0 +1,3 @@
1
+ /** Default lifetime from creation or the latest successful ownership handoff. */
2
+ export declare const DEFAULT_SESSION_TIMEOUT_MS: number;
3
+ export declare function sessionTimeoutDeadline(timeoutMs: number | false, startedAtMs: number): Date | undefined;
@@ -0,0 +1 @@
1
+ const DEFAULT_SESSION_TIMEOUT_MS=2592e6;function sessionTimeoutDeadline(e,t){return e===!1?void 0:new Date(t+e)}export{DEFAULT_SESSION_TIMEOUT_MS,sessionTimeoutDeadline};
@@ -0,0 +1,4 @@
1
+ import type { DurableStepResult } from "#execution/session/turn-step-types.js";
2
+ import type { StepResult } from "#harness/types.js";
3
+ import type { RunMode } from "#shared/run-mode.js";
4
+ export declare function resolveSessionStepResult(stepResult: StepResult, nextSerializedContext: Record<string, unknown>, mode: RunMode, beforeStepContext: Record<string, unknown>): DurableStepResult;
@@ -0,0 +1 @@
1
+ import{createDurableSessionState}from"#execution/durable-session-store.js";import{preserveSerializedBackgroundTaskObservabilityState}from"#shared/serialized-observability-state.js";import{derivePendingState}from"#execution/session/pending-turn-state.js";import{hasPendingInputBatch}from"#harness/input-requests.js";import{getTurnUsageState,takeSessionUsageDelta,toUsage}from"#harness/turn-tag-state.js";function resolveSessionStepResult(e,t,n,r){let i=createDurableSessionState({session:e.session});if(e.steered)return{action:`steered`,serializedContext:t,sessionState:i};let a=e.backgroundTasks===void 0||e.backgroundTaskSession===void 0?{}:{backgroundTaskContext:preserveSerializedBackgroundTaskObservabilityState(r,t,e.backgroundTasks),backgroundTaskState:createDurableSessionState({session:e.backgroundTaskSession}),backgroundTasks:e.backgroundTasks};if(e.next!==null&&typeof e.next==`object`&&`done`in e.next){if(n===`task`&&hasPendingInputBatch(e.session.state))throw Error(`Task mode cannot complete while input requests remain pending.`);let r=getTurnUsageState(e.session.state)?.session;return{action:`done`,...a,output:e.next.output,isError:e.next.isError,serializedContext:t,sessionState:i,usage:r===void 0?void 0:toUsage(r),usageDelta:takeSessionUsageDelta(e.session).delta}}if(e.next===null){let n=derivePendingState(e.session);if(e.settledTurn!==void 0){let{delta:r,session:i}=takeSessionUsageDelta(e.session);return{action:`park`,...a,...n,serializedContext:t,sessionState:createDurableSessionState({session:i}),settled:{output:e.settledTurn.output,isError:e.settledTurn.isError,usage:r}}}return{action:`park`,...a,...n,serializedContext:t,sessionState:i}}return{action:`continue`,...a,serializedContext:t,sessionState:i}}export{resolveSessionStepResult};
@@ -0,0 +1,68 @@
1
+ import type { DeliverHookPayload } from "#channel/types.js";
2
+ import type { DurableSessionState } from "#execution/durable-session-store.js";
3
+ import type { SettledTurn, StepResult } from "#harness/types.js";
4
+ import type { RuntimeActionResult } from "#shared/action-types.js";
5
+ import type { TokenUsage } from "#shared/token-usage.js";
6
+ /** Trusted runtime-action results collected by the session owner. */
7
+ export interface RuntimeActionResultStepInput {
8
+ readonly acceptedAtMsByCallId?: Readonly<Record<string, number>>;
9
+ readonly results: readonly RuntimeActionResult[];
10
+ }
11
+ /**
12
+ * Everything one turn step may consume. A step can carry a delivery and a
13
+ * set of runtime results together: steering accepted while a blocking action
14
+ * was in flight is appended ahead of that action's result in the same step.
15
+ */
16
+ export interface TurnStepPayload {
17
+ readonly control?: "clear" | "compact";
18
+ readonly delivery?: DeliverHookPayload;
19
+ readonly runtimeResults?: RuntimeActionResultStepInput;
20
+ }
21
+ /** Input for one atomic, session-owner-executed turn step. */
22
+ export interface TurnStepInput {
23
+ readonly abortSignal?: AbortSignal;
24
+ readonly steeringSignal?: AbortSignal;
25
+ readonly input: TurnStepPayload | undefined;
26
+ readonly sessionWritable: WritableStream<Uint8Array>;
27
+ readonly serializedContext: Record<string, unknown>;
28
+ readonly sessionState: DurableSessionState;
29
+ }
30
+ interface DurableStepResultFields {
31
+ /** Pre-step context plus the observability state owned by committed background tasks. */
32
+ readonly backgroundTaskContext?: Record<string, unknown>;
33
+ readonly backgroundTaskState?: DurableSessionState;
34
+ readonly backgroundTasks?: StepResult["backgroundTasks"];
35
+ readonly serializedContext: Record<string, unknown>;
36
+ readonly sessionState: DurableSessionState;
37
+ }
38
+ /** Result returned by a session-mutating turn step. */
39
+ export type DurableStepResult = ({
40
+ readonly action: "continue" | "done";
41
+ readonly output?: unknown;
42
+ readonly isError?: boolean;
43
+ readonly usage?: TokenUsage;
44
+ readonly usageDelta?: TokenUsage;
45
+ } | {
46
+ readonly action: "cancelled" | "steered";
47
+ } | {
48
+ readonly action: "park";
49
+ readonly authorizationAttemptIds?: readonly string[];
50
+ readonly hasPendingAuthorization: boolean;
51
+ readonly hasPendingInputBatch: boolean;
52
+ readonly pendingCoordinationCallIds?: readonly string[];
53
+ readonly settled?: SettledTurn;
54
+ }) & DurableStepResultFields;
55
+ /** The only two ways a locally executed conversational turn can settle. */
56
+ export type TurnOutcome = {
57
+ readonly kind: "done";
58
+ readonly output: unknown;
59
+ readonly isError?: boolean;
60
+ readonly usage?: TokenUsage;
61
+ readonly usageDelta?: TokenUsage;
62
+ } | {
63
+ readonly authorizationAttemptIds?: readonly string[];
64
+ readonly cancelled?: true;
65
+ readonly kind: "park";
66
+ readonly settled?: SettledTurn;
67
+ };
68
+ export {};
@@ -0,0 +1 @@
1
+ export{};
@@ -1,5 +1,4 @@
1
- import type { DurableStepResult } from "#execution/next-driver-action.js";
2
- import type { TurnStepInput } from "#execution/durable-session-migrations/turn-workflow.js";
1
+ import type { DurableStepResult, TurnStepInput } from "#execution/session/turn-step-types.js";
3
2
  export type { TurnStepInput };
4
3
  /** Runs a bounded batch of harness model steps inside one durable `"use step"` boundary. */
5
4
  export declare function turnStep(rawInput: TurnStepInput): Promise<DurableStepResult>;
@@ -0,0 +1 @@
1
+ import{defaultDeliverResult}from"#channel/adapter.js";import{contextStorage}from"#context/container.js";import{AuthKey,CapabilitiesKey,ChannelDeliveryKey,HandleEventKey,ModeKey,SessionDynamicSubagentRuntimeRevisionKey,SessionDynamicToolRuntimeRevisionKey,StaticModelReferenceKey,TurnDeliveryIdsKey,TurnTaskDeliveryKey}from"#context/keys.js";import{createAuthorizationCompletedEvent,createSessionStartedEvent,createTurnStartedEvent}from"#protocol/message.js";import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{coalesceTurnInputs}from"#harness/messages.js";import{emitTurnPreamble,getHarnessEmissionState,isHarnessBetweenTurns,setHarnessEmissionState}from"#harness/emission.js";import{createWorkflowRuntime}from"#execution/workflow-runtime.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{refreshDynamicSessionSubagentsForRuntimeRevision}from"#context/dynamic-subagent-lifecycle.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession,refreshSessionFromTurnAgent}from"#execution/session.js";import{readRetainedBackgroundToolResult,runBackgroundStep}from"#execution/tasks/parent/tool-execution.js";import*as agentTraceState from"#tracing/agent-trace-context-store.js";import{activeTurnId}from"#harness/active-turn-id.js";import{derivePendingState}from"#execution/session/pending-turn-state.js";import{rebindMissingCompiledDynamicToolCallbacks,refreshDynamicSessionToolsForRuntimeRevision}from"#context/dynamic-tool-lifecycle.js";import{setChannelContext}from"#execution/channel-context.js";import{drainDynamicInstructionUserMessages,prepareDynamicInstructionPreamble}from"#context/dynamic-instruction-lifecycle.js";import*as activityCohort from"#execution/activity-cohort.js";import{CallbackBaseUrlKey,PendingAuthorizationResultKey,clearPendingAuthorization,getPendingAuthorization}from"#harness/authorization.js";import{bindSessionInstrumentation}from"#instrumentation/runtime.js";import{RuntimeActionSettlementTimesKey}from"#harness/runtime-action-settlement-state.js";import{matchAuthorizationCallbacks}from"#execution/authorization-callback-match.js";import{isTurnCancellation,throwIfTurnAborted}from"#harness/turn-cancellation.js";import{resolveSessionStepResult}from"#execution/session/turn-step-result.js";import{createSessionEventSink}from"#execution/session/event-sink.js";import{resolveWorkflowCallbackBaseUrl}from"#execution/workflow-callback-url.js";import{resolveEffectiveOutputSchema}from"#execution/effective-output-schema.js";import{buildRuntimeIdentity,createExecutionNodeStep}from"#execution/node-step.js";import{getBackgroundTaskDelivery,markBackgroundTaskStepInput,resolveInitiatingTaskContext,resolveTaskDeliveryContext}from"#tasks/delivery-context.js";import{prepareWorkflowPreambleTrace}from"#execution/workflow-trace-context.js";import{reconcileSessionContinuationToken}from"#execution/reconcile-session-continuation-token.js";import{createExecutionHistoryView}from"#execution/history-view.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{runModelCallBatch}from"#execution/model-call-batching.js";import{createCancelledModelCallBatchResult}from"#execution/cancelled-model-call-batch.js";function channelDeliveryErrorCode(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`&&t.length>0)return t}return`CHANNEL_DELIVERY_FAILED`}async function turnStep(e){"use step";return runSessionStep(e)}async function runSessionStep(e){let t=e.input?.delivery,n=t,r=e.input?.runtimeResults,i=readDurableSession(e.sessionState),a=await deserializeContext(e.serializedContext),o=a.require(ChannelKey),s=a.require(BundleKey),c=resolveEffectiveAgentRuntime(s,a);try{let{getWorkflowMetadata:e}=await import(`#compiled/@workflow/core/index.js`),t=e();typeof t.url==`string`&&a.set(CallbackBaseUrlKey,resolveWorkflowCallbackBaseUrl(t.url))}catch{}let l=getPendingAuthorization(i.state),u;if(l&&n!==void 0){let{matches:e,remainingPayloads:t}=matchAuthorizationCallbacks(l,n.payloads);if(n={...n,payloads:t},e.length>0){let r=activityCohort.restoreAuthorizationActivity({ctx:a,matches:e,pending:l}),o=e.map(e=>e.result);a.set(PendingAuthorizationResultKey,o),i={...i,state:clearPendingAuthorization(i.state,r)},u=e,t.length===0&&(n=void 0)}}let d=a.get(AuthKey);n?.auth!==void 0&&a.set(AuthKey,n.auth??null);let f=getBackgroundTaskDelivery(n),p=hydrateDurableSession({compactionOverrides:{thresholdPercent:c.thresholdPercent},durable:i,turnAgent:c.turnAgent}),m=createExecutionHistoryView(p),h=bindSessionInstrumentation({agentName:c.turnAgent.id,ctx:a,rootSessionId:p.rootSessionId??p.sessionId,sessionId:p.sessionId}),g=getHarnessEmissionState(p.state);t!==void 0&&await contextStorage.run(a,()=>h?.instrumentChannelDelivery({agentName:s.turnAgent.id,ctx:a,delivery:t,rootSessionId:p.rootSessionId??p.sessionId,sequence:g.sequence,sessionId:p.sessionId,turnId:activeTurnId(g)}));let failChannelDeliveries=async e=>{await contextStorage.run(a,()=>h?.instrumentChannelDelivery({ctx:a,error:e,errorCode:channelDeliveryErrorCode(e),includeTurn:!1,outcome:`failed`})),await h?.flush()},_=createSessionEventSink({abortSignal:e.abortSignal,adapter:o,bundle:s,ctx:a,effectiveAgent:c,instrumentation:h,isFirstTurn:g.sequence===0,sessionWritable:e.sessionWritable,sessionId:p.sessionId}),{adapterCtx:v,dynamicConnections:y,effectiveNode:b,handleEvent:x}=_;try{let S=n!==void 0&&!isHarnessBetweenTurns(p)?structuredClone(v.state):void 0,C;if(n!==void 0){let e=[];try{for(let t of n.payloads){let n=o.deliver?await o.deliver(t,v):defaultDeliverResult(t);n!=null&&e.push(f===void 0?n:markBackgroundTaskStepInput(n))}}catch(e){throw await failChannelDeliveries(e),e}C=e.length===0?void 0:e.reduce(coalesceTurnInputs)}let w=n!==void 0&&C===void 0&&!isHarnessBetweenTurns(p);if(w)d===void 0?a.delete(AuthKey):a.set(AuthKey,d),v.state=S;else if(t!==void 0&&a.set(TurnTaskDeliveryKey,`none`),t?.payloads.some(e=>e.message!==void 0)){let e=t.deliveryMetadata?.map(e=>e.deliveryId)??[];a.set(TurnDeliveryIdsKey,g.turnId?[...new Set([...a.get(TurnDeliveryIdsKey)??[],...e])]:e)}else!g.sessionStarted&&a.get(ChannelDeliveryKey)!==void 0&&a.set(TurnDeliveryIdsKey,[a.require(ChannelDeliveryKey).deliveryId]);r!==void 0&&(r.acceptedAtMsByCallId!==void 0&&a.set(RuntimeActionSettlementTimesKey,r.acceptedAtMsByCallId),C={...C,runtimeActionResults:r.results});let T;if(C!==void 0&&f!==void 0){let e=resolveTaskDeliveryContext({state:i.state,taskDeliveryId:f.taskDeliveryId});e!==void 0&&(a.set(TurnTaskDeliveryKey,e.phase),T=e.rootTurnId,C={...C,context:[...C.context??[],e.context]})}activityCohort.updateActivityRootForDelivery({activeTurnId:activeTurnId(g),ctx:a,delivery:w?void 0:t,sessionState:i.state,taskRootTurnId:T});let E=a.get(TurnTaskDeliveryKey);if(E===`none`||E===`initiating`){let e=resolveInitiatingTaskContext({state:i.state,turnId:activeTurnId(g)});e!==void 0&&a.set(TurnTaskDeliveryKey,e.phase)}if(t!==void 0){let e={...o,state:{...v.state}};setChannelContext(a,e)}if(n!==void 0&&C===void 0&&isHarnessBetweenTurns(p)){await contextStorage.run(a,()=>h?.instrumentChannelDelivery({ctx:a,includeTurn:!1,outcome:`completed`})),await h?.flush();let t=reconcileSessionContinuationToken(a,p),n=serializeContext(a),r=t===p?e.sessionState:createDurableSessionState({session:t});return{action:`park`,...derivePendingState(t),serializedContext:n,sessionState:r}}let D=s.subagentRegistry.dynamicResolvers??[],O=s.resolvedAgent.dynamicToolResolvers??[],k=buildRuntimeIdentity(b);try{let e=process.env.VERCEL_DEPLOYMENT_ID?.trim(),t=e?`deployment:${e}`:await resolveRuntimeCompiledArtifactsVersionedCacheKey(s.compiledArtifactsSource),n=g.sessionStarted;if(a.setVirtualContext(StaticModelReferenceKey,c.turnAgent.model??null),!n)a.set(SessionDynamicSubagentRuntimeRevisionKey,t),a.set(SessionDynamicToolRuntimeRevisionKey,t);else{let e=createSessionStartedEvent({runtime:k});await Promise.all([refreshDynamicSessionSubagentsForRuntimeRevision({ctx:a,resolvers:D,event:e,messages:m.initial.messages,runtimeRevision:t}),refreshDynamicSessionToolsForRuntimeRevision({ctx:a,resolvers:O,event:e,messages:m.initial.messages,runtimeRevision:t})]),await rebindMissingCompiledDynamicToolCallbacks({ctx:a,event:createTurnStartedEvent({sequence:g.sequence,turnId:activeTurnId(g)}),messages:m.initial.messages,resolvers:O})}}catch(e){throw await failChannelDeliveries(e),e}let A=a.require(ModeKey),j=s.resolvedAgent.config?.experimental?.workflow?.modelCallsPerStep??1,M=a.get(CapabilitiesKey),runHarnessStep=async(t,n)=>{let r=refreshSessionFromTurnAgent({compactionOverrides:{thresholdPercent:c.thresholdPercent},session:t,turnAgent:c.turnAgent});return createExecutionNodeStep({steeringSignal:e.steeringSignal,abortSignal:e.abortSignal,capabilities:M,clearOnly:e.input?.control===`clear`,compactOnly:e.input?.control===`compact`,createRuntime:createWorkflowRuntime,handleEvent:x,historyProjector:m.projector,historyView:m.prepare(r),instrumentation:h,mode:A,modelResolutionScope:{moduleMap:s.moduleMap,nodeId:s.nodeId},node:b})(r,n)},N,P;try{throwIfTurnAborted(e.abortSignal),P=await runModelCallBatch({steeringSignal:e.steeringSignal,initialInput:C,initialSession:p,modelCallsPerStep:j,runStep:async({firstCall:t,session:n,stepInput:r})=>{let i=await runBackgroundStep(a,n,async e=>{a.setVirtualContext(HandleEventKey,x),a.setVirtualContext(StaticModelReferenceKey,c.turnAgent.model??null);let n=t?resolveEffectiveOutputSchema({agentOutputSchema:c.turnAgent.outputSchema,input:C,mode:A,session:e}):e;if(await y.rehydrate(getHarnessEmissionState(n.state),k,isHarnessBetweenTurns(n)),t&&u){let e=getHarnessEmissionState(n.state);if(isHarnessBetweenTurns(n)){prepareDynamicInstructionPreamble(a,m.messages(n));let t=[],r=await prepareWorkflowPreambleTrace({emissionState:e,instrumentation:h});try{e=await emitTurnPreamble(x,{},e,k,r)}finally{t=drainDynamicInstructionUserMessages(a),n={...n,history:[...n.history,...t]}}n=setHarnessEmissionState(n,e)}for(let{authorization:t,result:n}of u){let r=l?.challenges.find(e=>e.attemptId===n.attemptId)?.candidateId;await x(createAuthorizationCompletedEvent({attemptId:n.attemptId,authorization:t,candidateId:r,name:n.name,outcome:`authorized`,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId}))}}return runHarnessStep(n,r)});return throwIfTurnAborted(e.abortSignal),N={result:i,serializedContext:serializeContext(a)},i}})}catch(t){if(!isTurnCancellation(t)&&e.abortSignal?.aborted!==!0)throw await failChannelDeliveries(t),t;let n=readRetainedBackgroundToolResult(a);return h?.rememberBackgroundTasks(n?.backgroundTasks??[]),createCancelledModelCallBatchResult({beforeBatchContext:e.serializedContext,checkpoint:N,ctx:a,initialSession:p,stepInput:C})}h?.rememberBackgroundTasks(P.backgroundTasks??[]);let F=reconcileSessionContinuationToken(a,P.session);agentTraceState.pruneAgentTraceState(a,F.sessionId,F.state);let I=serializeContext(a);P={...P,session:F};let L=resolveSessionStepResult(P,I,A,e.serializedContext);return L.action===`done`&&await _.close(),L}finally{_.release()}}export{turnStep};
@@ -0,0 +1,31 @@
1
+ import type { SessionCapabilities } from "#channel/types.js";
2
+ import { type SessionInputQueue } from "#execution/session/input-queue.js";
3
+ import type { SessionInboxReader } from "#execution/session-inbox/inbox.js";
4
+ import type { SessionStateCursor } from "#execution/session/state-cursor.js";
5
+ import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.js";
6
+ import type { TurnOutcome, TurnStepPayload } from "#execution/session/turn-step-types.js";
7
+ import type { RunMode } from "#shared/run-mode.js";
8
+ import type { RuntimeActionResult } from "#shared/action-types.js";
9
+ export interface SessionExecutionInput {
10
+ readonly capabilities?: SessionCapabilities;
11
+ readonly cursor: SessionStateCursor;
12
+ readonly inbox: SessionInboxReader;
13
+ readonly mode: RunMode;
14
+ readonly queue: SessionInputQueue;
15
+ readonly sessionId: string;
16
+ }
17
+ /**
18
+ * Executes conversational turns inside the owning session workflow: runs
19
+ * `turnStep`, services the inbox at committed boundaries, coordinates waits,
20
+ * and settles locally. There is no child run and no transport protocol.
21
+ */
22
+ export declare class SessionExecution {
23
+ private readonly input;
24
+ constructor(input: SessionExecutionInput);
25
+ get cursor(): SessionStateCursor;
26
+ runTurn(delivery: TurnStepPayload | undefined): Promise<TurnOutcome>;
27
+ private runTurnSteps;
28
+ handleWorkflowMessage(message: WorkflowToolRunMessage): Promise<RuntimeActionResult | undefined>;
29
+ private finishCancelledTurn;
30
+ private waitForRuntimeActionResults;
31
+ }
@@ -0,0 +1 @@
1
+ import{sessionCommandHookToken,sessionInboxHookToken}from"#execution/session-inbox/address.js";import{coalesceDeliveries}from"#harness/messages.js";import{getWorkflowMetadata}from"#compiled/@workflow/core/index.js";import{isInboxSubagentResultFromRecordedWorkflowToolRun,isInboxToolResultFromRecordedWorkflowToolRun}from"#harness/workflow-tool-runs.js";import{activeTurnId}from"#harness/active-turn-id.js";import{decodeSessionInboxPayload}from"#execution/session-inbox/protocol.js";import{isInboxSubagentResultFromRunningHandle}from"#subagents/handles/query.js";import{routeSelectedDelivery}from"#execution/session/route-selected-delivery.js";import{admitSessionInboxPayload,applySessionCancellation}from"#execution/session/admission.js";import{cancelDescendantTurnsStep}from"#execution/cancel-descendant-turns-step.js";import{isSteeringDelivery}from"#execution/session/input-queue.js";import{routeDeliverToChildren}from"#execution/route-child-delivery.js";import{TurnCancelledError}from"#harness/turn-cancellation.js";import{resolveWorkflowCallbackBaseUrl}from"#execution/workflow-callback-url.js";import{dispatchCoordinationStep}from"#execution/coordination-dispatch-step.js";import{acknowledgeDelegatedTasksStep}from"#execution/tasks/parent/delegate.js";import{handleWorkflowToolRunMessage}from"#execution/session-workflow-tool-run.js";import{turnStep}from"#execution/session/turn-step.js";import{resolveRuntimeActionResultsForCallIds}from"#runtime/actions/results.js";var SessionExecution=class{input;constructor(e){this.input=e}get cursor(){return this.input.cursor}async runTurn(e){let t=new ActiveTurn(this.input,e?.delivery?.caller?.callId);try{return await this.runTurnSteps(t,e)}finally{t.dispose()}}async runTurnSteps(e,t){let n=t;for(;;){let{cursor:t}=this.input,r=t.serializedContext,i=await turnStep(t.createStepInput(n,{abortSignal:e.signal,steeringSignal:e.steeringSignal})),a=i.action===`park`?i.pendingCoordinationCallIds:void 0,o=(i.backgroundTasks?.length??0)>0;if(o){if(i.backgroundTaskState===void 0)throw Error(`Background tasks were returned without their committed session state.`);await t.apply({serializedContext:i.backgroundTaskContext??r,sessionState:i.backgroundTaskState}),await acknowledgeDelegatedTasksStep({tasks:i.backgroundTasks??[]})}if(await t.apply({serializedContext:i.serializedContext,sessionState:i.action===`cancelled`||e.signal.aborted?i.backgroundTaskState??i.sessionState:i.sessionState}),await e.admitBoundary(),e.resetSteering(),i.action===`cancelled`||e.signal.aborted&&(a===void 0||o))return await this.finishCancelledTurn();if(i.action===`done`)return{isError:i.isError,kind:`done`,output:i.output??``,usage:i.usage,usageDelta:i.usageDelta};if(a!==void 0&&i.action===`park`){let r=await dispatchCoordinationStep({action:i.action,callbackBaseUrl:resolveWorkflowCallbackBaseUrl(getWorkflowMetadata().url),workflowToolRunOwner:{inbox:sessionInboxHookToken(sessionCommandHookToken(this.input.sessionId))},sessionWritable:t.sessionWritable,serializedContext:t.serializedContext,sessionState:t.sessionState}),o=r.results.length===0?void 0:Date.now();await t.apply(r),await acknowledgeDelegatedTasksStep({tasks:r.pendingTasks});let s=await this.waitForRuntimeActionResults({initialAcceptedAtMs:o,initialResults:r.results,pendingCallIds:a,turn:e});if(s===`cancelled`)return await this.finishCancelledTurn();n={delivery:await e.takeSteering(),runtimeResults:s};continue}if(i.action===`park`){if(!(i.hasPendingAuthorization||i.hasPendingInputBatch&&this.input.capabilities?.requestInput===!0||this.input.mode===`conversation`))throw Error("Task mode cannot wait for follow-up input (`next: null`).");return{authorizationAttemptIds:i.authorizationAttemptIds,kind:`park`,settled:i.settled}}let s=await e.takeSteering();n=s===void 0?void 0:{delivery:s}}}async handleWorkflowMessage(e){return await handleWorkflowToolRunMessage({callbackMetadataUrl:getWorkflowMetadata().url,cursor:this.input.cursor,message:e})}async finishCancelledTurn(){let{cursor:e}=this.input;return await cancelDescendantTurnsStep({serializedContext:e.serializedContext,sessionState:e.sessionState}),{cancelled:!0,kind:`park`}}async waitForRuntimeActionResults(e){let t=[...e.initialResults],n=new Map;if(e.initialAcceptedAtMs!==void 0)for(let r of t)n.set(r.callId,e.initialAcceptedAtMs);for(;;){let r=resolveRuntimeActionResultsForCallIds({pendingCallIds:e.pendingCallIds,results:t});if(r!==void 0)return{acceptedAtMsByCallId:Object.fromEntries(r.map(e=>[e.callId,n.get(e.callId)])),results:r};let i=await e.turn.nextRuntimeEvent();if(i===`cancelled`)return i;if(i.kind===`runtime-action-result`){let e=this.input.cursor.sessionState.snapshot.session.state,r=i.results.filter(t=>t.kind===`tool-result`?isInboxToolResultFromRecordedWorkflowToolRun(e,t):t.kind===`subagent-result`?t.origin===`child`&&isInboxSubagentResultFromRunningHandle(e,t)||isInboxSubagentResultFromRecordedWorkflowToolRun(e,t):!1);if(r.length>0){let e=Date.now();t.push(...r);for(let t of r)n.set(t.callId,e)}continue}let a=await this.handleWorkflowMessage(i.message);a!==void 0&&(t.push(a),n.set(a.callId,Date.now()))}}},ActiveTurn=class{admitted=new Set;routedToChildren=new Set;runtimeResults=[];controller=new AbortController;expectedTurnId;input;callerCallId;unsubscribe;unsubscribeDelivery;steeringController=new AbortController;constructor(e,t){this.input=e,this.callerCallId=t,this.expectedTurnId=activeTurnId(e.cursor.sessionState.emissionState),this.unsubscribe=e.inbox.onInterrupt(e=>{this.cancelsThisTurn(e)&&this.abort()}),this.unsubscribeDelivery=e.inbox.onDelivery(this.signalSteering)}signalSteering=e=>{let t;try{t=decodeSessionInboxPayload(e)}catch{return}t.kind===`deliver`&&isSteeringDelivery(t,this.callerCallId)&&!this.input.cursor.sessionState.hasProxyInputRequests&&t.payloads.some(e=>e.message!==void 0&&e.inputResponses===void 0&&e.task===void 0)&&this.steeringController.abort()};get signal(){return this.controller.signal}dispose(){this.unsubscribe(),this.unsubscribeDelivery()}get steeringSignal(){return this.steeringController.signal}resetSteering(){this.steeringController.signal.aborted&&(this.unsubscribeDelivery(),this.steeringController=new AbortController,this.unsubscribeDelivery=this.input.inbox.onDelivery(this.signalSteering))}async admitBoundary(){let e=this.input.inbox.drain();for(let t of e)await this.admit(t)}async takeSteering(){let e=[];for(;;){let t=this.input.queue.takeSteering(this.admitted,this.callerCallId);if(t===void 0)break;for(let e of t.sequences)this.admitted.delete(e);let n=await routeSelectedDelivery(t,this.input.cursor);if(n.kind===`cancel-turn`){this.abort();break}n.kind===`turn`&&e.push(n.delivery)}if(e.length!==0)return e.length===1?e[0]:coalesceDeliveries(e)}async nextRuntimeEvent(){for(;;){if(this.signal.aborted)return`cancelled`;let e=this.runtimeResults.shift();if(e!==void 0)return e;let t=await this.input.inbox.next();if(t===void 0)throw Error(`Session inbox closed before runtime actions completed.`);await this.admit(t),await this.routeAdmittedToChildren()}}cancelsThisTurn(e){return e.kind===`reset`?!0:e.kind===`cancel`?e.turnId===void 0||e.turnId===this.expectedTurnId:!1}async admit(e){let t=await admitSessionInboxPayload(e,this.input);switch(t.kind){case`delivery`:this.admitted.add(t.admission.sequence);return;case`runtime-action-result`:this.runtimeResults.push({kind:`runtime-action-result`,results:t.payload.results});return;case`workflow`:this.runtimeResults.push({kind:`workflow`,message:t.message});return;case`cancel`:if(!this.cancelsThisTurn(e))return;await applySessionCancellation(t.command,this.input),this.abort();return;case`consumed`:return}}async routeAdmittedToChildren(){for(let e of this.admitted){if(this.routedToChildren.has(e))continue;let t=this.input.queue.delivery(e);if(t===void 0){this.admitted.delete(e);continue}this.routedToChildren.add(e);let n=await routeDeliverToChildren({delivery:t,sessionWritable:this.input.cursor.sessionWritable,serializedContext:this.input.cursor.serializedContext,sessionState:this.input.cursor.sessionState});if(await this.input.cursor.apply(n),n.kind===`cancel-turn`){this.input.queue.replaceDelivery(e,void 0),this.admitted.delete(e),this.abort();return}this.input.queue.replaceDelivery(e,n.remainder),n.remainder===void 0&&this.admitted.delete(e)}}abort(){this.controller.signal.aborted||this.controller.abort(new TurnCancelledError)}};export{SessionExecution};
@@ -0,0 +1,21 @@
1
+ /** Serialized-context key advertising a session's stable inbox. */
2
+ export declare const SESSION_INBOX_CONTEXT_KEY = "eve.sessionInbox";
3
+ /** Hook metadata key that keeps public identity separate from hook ownership. */
4
+ export declare const SESSION_INBOX_SESSION_ID_METADATA_KEY = "sessionId";
5
+ /** Stable inbox coordinates. The owner and deployment are intentionally absent. */
6
+ export interface SessionInboxAddress {
7
+ readonly sessionId: string;
8
+ }
9
+ export declare function isSessionInboxAddress(value: unknown): value is SessionInboxAddress;
10
+ /** Returns whether a token belongs to eve's framework-reserved session namespace. */
11
+ export declare function isReservedSessionCommandToken(token: string): boolean;
12
+ /** Logical stable command inbox token for a session. */
13
+ export declare function sessionCommandHookToken(sessionId: string): string;
14
+ /**
15
+ * Physical hook token for a logical session address. Applied exactly where a
16
+ * hook is created or resumed, so current-generation hooks stay disjoint from
17
+ * hooks owned by pre-cutover drivers that used the logical token directly.
18
+ */
19
+ export declare function sessionInboxHookToken(token: string): string;
20
+ /** Marker a releasing owner leaves so ingress can tell "handoff in progress" from "no session". */
21
+ export declare function sessionHandoffMarkerToken(token: string): string;
@@ -0,0 +1 @@
1
+ const SESSION_INBOX_CONTEXT_KEY=`eve.sessionInbox`,SESSION_INBOX_SESSION_ID_METADATA_KEY=`sessionId`;function isSessionInboxAddress(e){return typeof e==`object`&&!!e&&`sessionId`in e&&typeof e.sessionId==`string`&&e.sessionId.length>0&&!e.sessionId.includes(`:`)}function isReservedSessionCommandToken(e){return e.startsWith(`eve:session:`)||e.startsWith(`eve:inbox:`)}function sessionCommandHookToken(e){return`eve:session:${e}:inbox`}function sessionInboxHookToken(e){return`eve:inbox:v1:${e}`}function sessionHandoffMarkerToken(e){return`eve:inbox:handoff:${e}`}export{SESSION_INBOX_CONTEXT_KEY,SESSION_INBOX_SESSION_ID_METADATA_KEY,isReservedSessionCommandToken,isSessionInboxAddress,sessionCommandHookToken,sessionHandoffMarkerToken,sessionInboxHookToken};