eve 0.56.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 (559) hide show
  1. package/CHANGELOG.md +40 -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/channel-address.js +1 -1
  5. package/dist/src/channel/session.d.ts +4 -3
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +7 -4
  8. package/dist/src/chunks/{use-eve-agent-RUGSwq8b.js → use-eve-agent-C2APNCdP.js} +45 -12
  9. package/dist/src/chunks/{use-eve-agent-CMdMlS7Y.js → use-eve-agent-D0YnDLi_.js} +45 -12
  10. package/dist/src/cli/commands/init.d.ts +2 -6
  11. package/dist/src/cli/commands/init.js +1 -1
  12. package/dist/src/cli/commands/trace-detail.js +1 -1
  13. package/dist/src/cli/dev/environment.js +1 -1
  14. package/dist/src/cli/dev/run-interactive-ui.js +1 -1
  15. package/dist/src/cli/dev/tui/agent-header.js +1 -1
  16. package/dist/src/cli/dev/tui/blocks.d.ts +1 -6
  17. package/dist/src/cli/dev/tui/blocks.js +1 -1
  18. package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
  19. package/dist/src/cli/dev/tui/message-queue.d.ts +11 -7
  20. package/dist/src/cli/dev/tui/message-queue.js +1 -1
  21. package/dist/src/cli/dev/tui/model-editor.d.ts +1 -1
  22. package/dist/src/cli/dev/tui/model-editor.js +1 -1
  23. package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +0 -3
  24. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  25. package/dist/src/cli/dev/tui/prompt-commands.d.ts +1 -1
  26. package/dist/src/cli/dev/tui/prompt-commands.js +1 -1
  27. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  28. package/dist/src/cli/dev/tui/remote-auth-result.js +1 -1
  29. package/dist/src/cli/dev/tui/remote-auth.js +1 -1
  30. package/dist/src/cli/dev/tui/remote-startup.d.ts +10 -0
  31. package/dist/src/cli/dev/tui/remote-startup.js +1 -0
  32. package/dist/src/cli/dev/tui/runner.d.ts +12 -18
  33. package/dist/src/cli/dev/tui/runner.js +3 -1
  34. package/dist/src/cli/dev/tui/setup-commands.d.ts +7 -13
  35. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  36. package/dist/src/cli/dev/tui/setup-issues.d.ts +1 -1
  37. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  38. package/dist/src/cli/dev/tui/setup-panel.d.ts +5 -17
  39. package/dist/src/cli/dev/tui/setup-panel.js +5 -6
  40. package/dist/src/cli/dev/tui/status-line.d.ts +1 -8
  41. package/dist/src/cli/dev/tui/status-line.js +1 -1
  42. package/dist/src/cli/dev/tui/steering-stream.d.ts +15 -0
  43. package/dist/src/cli/dev/tui/steering-stream.js +1 -0
  44. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -2
  45. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  46. package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +2 -2
  47. package/dist/src/cli/dev/tui/test/mock-terminal.js +1 -1
  48. package/dist/src/cli/dev/tui/theme.d.ts +0 -2
  49. package/dist/src/cli/dev/tui/theme.js +1 -1
  50. package/dist/src/cli/dev/tui/vercel-status.d.ts +4 -2
  51. package/dist/src/cli/dev/tui/vercel-status.js +1 -1
  52. package/dist/src/cli/run.js +1 -1
  53. package/dist/src/cli/telemetry/index.d.ts +1 -1
  54. package/dist/src/cli/telemetry/index.js +1 -1
  55. package/dist/src/client/agent-info-schema.d.ts +2 -0
  56. package/dist/src/client/agent-info-schema.js +1 -1
  57. package/dist/src/client/eve-agent-store-state.d.ts +19 -0
  58. package/dist/src/client/eve-agent-store.js +1 -1
  59. package/dist/src/client/ndjson.d.ts +2 -0
  60. package/dist/src/client/ndjson.js +3 -3
  61. package/dist/src/client/open-stream.d.ts +1 -0
  62. package/dist/src/client/open-stream.js +1 -1
  63. package/dist/src/compiled/.vendor-stamp.json +1 -1
  64. package/dist/src/compiled/@workflow/core/index.js +2 -2
  65. package/dist/src/compiled/@workflow/core/private.js +1 -1
  66. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -0
  67. package/dist/src/compiled/@workflow/core/runtime.js +2 -2
  68. package/dist/src/compiled/@workflow/core/serialization.js +1 -0
  69. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  70. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  71. package/dist/src/compiled/@workflow/world-vercel/index.js +2 -2
  72. package/dist/src/compiled/_chunks/workflow/attribute-changes-DTFAjP0J.js +6 -0
  73. package/dist/src/compiled/_chunks/workflow/{dist-PLkAQ-U7.js → dist-C5KCXSdI.js} +1 -1
  74. package/dist/src/compiled/_chunks/workflow/{frames-BvATzM2t.js → frames-DJw9L4rO.js} +3 -3
  75. package/dist/src/compiled/_chunks/workflow/global-DFW-hO6M.js +1 -0
  76. package/dist/src/compiled/_chunks/workflow/helpers-ClCA9Lmc.js +1 -0
  77. package/dist/src/compiled/_chunks/workflow/logger-D6vwIEf9.js +13 -0
  78. package/dist/src/compiled/_chunks/workflow/resume-hook-_baK8jaT.js +1 -0
  79. package/dist/src/compiled/_chunks/workflow/run-CRdL17z4.js +1 -0
  80. package/dist/src/compiled/_chunks/workflow/serialization-CWYPL4Eq.js +3 -0
  81. package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +1 -0
  82. package/dist/src/compiled/_chunks/workflow/wait-until-DyIt9lEx.js +1 -0
  83. package/dist/src/compiled/_chunks/workflow/{ws-transport-CVezyWwZ.js → ws-transport-Dl5FG4Sw.js} +1 -1
  84. package/dist/src/compiler/extension-compatibility.d.ts +15 -6
  85. package/dist/src/compiler/extension-compatibility.js +1 -1
  86. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  87. package/dist/src/context/keys.d.ts +3 -1
  88. package/dist/src/context/keys.js +1 -1
  89. package/dist/src/eve-channel/index.js +1 -1
  90. package/dist/src/eve-channel/request.js +4 -3
  91. package/dist/src/execution/activity-cohort.js +1 -1
  92. package/dist/src/execution/activity-collector.js +1 -1
  93. package/dist/src/execution/authorization-callback-match.d.ts +2 -1
  94. package/dist/src/execution/authorization-callback-match.js +1 -1
  95. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  96. package/dist/src/execution/cancel-indexed-session-tasks-step.js +1 -1
  97. package/dist/src/execution/cancelled-model-call-batch.d.ts +1 -1
  98. package/dist/src/execution/connections/callback-route.d.ts +1 -11
  99. package/dist/src/execution/connections/callback-route.js +1 -1
  100. package/dist/src/execution/continuation-conflict-step.d.ts +0 -1
  101. package/dist/src/execution/continuation-conflict-step.js +1 -1
  102. package/dist/src/execution/coordination-dispatch-shared.d.ts +1 -1
  103. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  104. package/dist/src/execution/create-session-step.d.ts +1 -1
  105. package/dist/src/execution/durable-session-store.d.ts +10 -48
  106. package/dist/src/execution/durable-session-store.js +1 -1
  107. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  108. package/dist/src/execution/eve-workflow-attributes.d.ts +0 -16
  109. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  110. package/dist/src/execution/hook-ownership.d.ts +2 -4
  111. package/dist/src/execution/hook-ownership.js +1 -1
  112. package/dist/src/execution/legacy-session/authorization.d.ts +9 -0
  113. package/dist/src/execution/legacy-session/authorization.js +1 -0
  114. package/dist/src/execution/legacy-session/completion-step.d.ts +10 -0
  115. package/dist/src/execution/legacy-session/completion-step.js +1 -0
  116. package/dist/src/execution/legacy-session/inbox.d.ts +24 -0
  117. package/dist/src/execution/legacy-session/inbox.js +1 -0
  118. package/dist/src/execution/legacy-session/input.d.ts +19 -0
  119. package/dist/src/execution/legacy-session/input.js +1 -0
  120. package/dist/src/execution/legacy-session/interrupt-step.d.ts +3 -0
  121. package/dist/src/execution/legacy-session/interrupt-step.js +1 -0
  122. package/dist/src/execution/legacy-session/prepare-step.d.ts +24 -0
  123. package/dist/src/execution/legacy-session/prepare-step.js +1 -0
  124. package/dist/src/execution/legacy-session/snapshot.d.ts +12 -0
  125. package/dist/src/execution/legacy-session/snapshot.js +1 -0
  126. package/dist/src/execution/legacy-session/turn-workflow.d.ts +8 -0
  127. package/dist/src/execution/legacy-session/turn-workflow.js +1 -0
  128. package/dist/src/execution/model-call-batching.d.ts +1 -0
  129. package/dist/src/execution/model-call-batching.js +1 -1
  130. package/dist/src/execution/node-step.d.ts +1 -0
  131. package/dist/src/execution/node-step.js +1 -1
  132. package/dist/src/execution/proxied-deliver-step.d.ts +2 -20
  133. package/dist/src/execution/proxied-deliver-step.js +1 -1
  134. package/dist/src/execution/reconcile-session-continuation-token.d.ts +1 -1
  135. package/dist/src/execution/report-dropped-wire-payload-step.d.ts +1 -1
  136. package/dist/src/execution/route-child-delivery.d.ts +2 -2
  137. package/dist/src/execution/route-child-delivery.js +1 -1
  138. package/dist/src/execution/runtime-context.js +1 -1
  139. package/dist/src/execution/sandbox/bindings/eve-image.js +1 -1
  140. package/dist/src/execution/session/accepted-deployment.d.ts +3 -0
  141. package/dist/src/execution/session/accepted-deployment.js +1 -0
  142. package/dist/src/execution/session/admission.d.ts +38 -0
  143. package/dist/src/execution/session/admission.js +1 -0
  144. package/dist/src/execution/session/entry-input.d.ts +42 -0
  145. package/dist/src/execution/session/entry-input.js +1 -0
  146. package/dist/src/execution/session/entry.d.ts +13 -0
  147. package/dist/src/execution/session/entry.js +1 -0
  148. package/dist/src/execution/session/event-sink.d.ts +31 -0
  149. package/dist/src/execution/session/event-sink.js +1 -0
  150. package/dist/src/execution/session/finalization.d.ts +33 -0
  151. package/dist/src/execution/session/finalization.js +1 -0
  152. package/dist/src/execution/session/handoff-steps.d.ts +22 -0
  153. package/dist/src/execution/session/handoff-steps.js +1 -0
  154. package/dist/src/execution/session/handoff.d.ts +69 -0
  155. package/dist/src/execution/session/handoff.js +1 -0
  156. package/dist/src/execution/session/hook-tokens.d.ts +11 -0
  157. package/dist/src/execution/session/hook-tokens.js +1 -0
  158. package/dist/src/execution/session/input-queue.d.ts +72 -0
  159. package/dist/src/execution/session/input-queue.js +1 -0
  160. package/dist/src/execution/session/next-input.d.ts +32 -0
  161. package/dist/src/execution/session/next-input.js +1 -0
  162. package/dist/src/execution/{pending-turn-state.d.ts → session/pending-turn-state.d.ts} +0 -1
  163. package/dist/src/execution/{pending-turn-state.js → session/pending-turn-state.js} +1 -1
  164. package/dist/src/execution/session/program.d.ts +47 -0
  165. package/dist/src/execution/session/program.js +1 -0
  166. package/dist/src/execution/session/route-selected-delivery.d.ts +9 -0
  167. package/dist/src/execution/session/route-selected-delivery.js +1 -0
  168. package/dist/src/execution/session/state-cursor.d.ts +31 -0
  169. package/dist/src/execution/session/state-cursor.js +1 -0
  170. package/dist/src/execution/{session-timeout-control.d.ts → session/timeout-control.d.ts} +1 -1
  171. package/dist/src/execution/session/timeout-control.js +1 -0
  172. package/dist/src/execution/{session-timeout-steps.d.ts → session/timeout-steps.d.ts} +3 -2
  173. package/dist/src/execution/session/timeout-steps.js +1 -0
  174. package/dist/src/execution/{session-timeout-workflow.d.ts → session/timeout-workflow.d.ts} +3 -1
  175. package/dist/src/execution/session/timeout-workflow.js +1 -0
  176. package/dist/src/execution/session/timeout.d.ts +3 -0
  177. package/dist/src/execution/session/timeout.js +1 -0
  178. package/dist/src/execution/session/turn-step-result.d.ts +4 -0
  179. package/dist/src/execution/session/turn-step-result.js +1 -0
  180. package/dist/src/execution/session/turn-step-types.d.ts +68 -0
  181. package/dist/src/execution/session/turn-step-types.js +1 -0
  182. package/dist/src/execution/{workflow-steps.d.ts → session/turn-step.d.ts} +1 -2
  183. package/dist/src/execution/session/turn-step.js +1 -0
  184. package/dist/src/execution/session/turn.d.ts +31 -0
  185. package/dist/src/execution/session/turn.js +1 -0
  186. package/dist/src/execution/session-inbox/address.d.ts +21 -0
  187. package/dist/src/execution/session-inbox/address.js +1 -0
  188. package/dist/src/execution/session-inbox/inbox.d.ts +54 -0
  189. package/dist/src/execution/session-inbox/inbox.js +1 -0
  190. package/dist/src/execution/session-inbox/protocol.d.ts +10 -0
  191. package/dist/src/execution/session-inbox/protocol.js +1 -0
  192. package/dist/src/execution/session-inbox/release-step.d.ts +5 -0
  193. package/dist/src/execution/session-inbox/release-step.js +1 -0
  194. package/dist/src/execution/session-inbox/resume.d.ts +21 -0
  195. package/dist/src/execution/session-inbox/resume.js +1 -0
  196. package/dist/src/execution/{turn-workflow-tool-run.d.ts → session-workflow-tool-run.d.ts} +2 -2
  197. package/dist/src/execution/session-workflow-tool-run.js +1 -0
  198. package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -2
  199. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  200. package/dist/src/execution/skills/instructions.js +1 -1
  201. package/dist/src/execution/stable-workflow-names.d.ts +1 -1
  202. package/dist/src/execution/stable-workflow-names.js +1 -1
  203. package/dist/src/execution/task-input-response-route.js +1 -1
  204. package/dist/src/execution/tasks/child/steps.d.ts +1 -1
  205. package/dist/src/execution/tasks/child/steps.js +1 -1
  206. package/dist/src/execution/tasks/child/workflow.js +1 -1
  207. package/dist/src/execution/tasks/parent/delegate.js +1 -1
  208. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  209. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
  210. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  211. package/dist/src/execution/terminal-session-completion-step.d.ts +1 -1
  212. package/dist/src/execution/terminal-session-event.d.ts +1 -1
  213. package/dist/src/execution/terminal-session-event.js +1 -1
  214. package/dist/src/execution/terminal-session-failure-step.d.ts +1 -1
  215. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  216. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  217. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  218. package/dist/src/execution/tools/subagent/accept-event-step.js +1 -1
  219. package/dist/src/execution/tools/subagent/emit-called-step.d.ts +1 -1
  220. package/dist/src/execution/tools/subagent/emit-called-step.js +1 -1
  221. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -1
  222. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
  223. package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +6 -0
  224. package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
  225. package/dist/src/execution/tools/subagent/invoke-step.js +1 -1
  226. package/dist/src/execution/tools/subagent/steer.d.ts +13 -0
  227. package/dist/src/execution/tools/subagent/steer.js +1 -0
  228. package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +1 -1
  229. package/dist/src/execution/tools/subagent/task-agent-requests.js +1 -1
  230. package/dist/src/execution/tools/subagent/task-cancel.js +1 -1
  231. package/dist/src/execution/tools/workflow/ask.d.ts +0 -9
  232. package/dist/src/execution/tools/workflow/ask.js +1 -1
  233. package/dist/src/execution/tools/workflow/body.d.ts +0 -2
  234. package/dist/src/execution/tools/workflow/body.js +1 -1
  235. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.d.ts +1 -1
  236. package/dist/src/execution/tools/workflow/emit-workflow-tool-run-report-step.js +1 -1
  237. package/dist/src/execution/tools/workflow/messages.d.ts +0 -1
  238. package/dist/src/execution/tools/workflow/messages.js +1 -1
  239. package/dist/src/execution/tools/workflow/owner.d.ts +3 -1
  240. package/dist/src/execution/tools/workflow/owner.js +1 -1
  241. package/dist/src/execution/tools/workflow/resume-hook-step.d.ts +1 -1
  242. package/dist/src/execution/tools/workflow/step-context.d.ts +0 -1
  243. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  244. package/dist/src/execution/tools/workflow/step.js +1 -1
  245. package/dist/src/execution/tools/workflow/workflow.js +1 -1
  246. package/dist/src/execution/workflow-runtime.d.ts +15 -18
  247. package/dist/src/execution/workflow-runtime.js +1 -1
  248. package/dist/src/harness/authorization.d.ts +5 -37
  249. package/dist/src/harness/authorization.js +1 -1
  250. package/dist/src/harness/compaction.js +1 -1
  251. package/dist/src/harness/coordination.js +1 -1
  252. package/dist/src/harness/emission-state.d.ts +1 -0
  253. package/dist/src/harness/emission.js +1 -1
  254. package/dist/src/harness/generation-steering.d.ts +22 -0
  255. package/dist/src/harness/generation-steering.js +1 -0
  256. package/dist/src/harness/messages.d.ts +1 -1
  257. package/dist/src/harness/messages.js +1 -1
  258. package/dist/src/harness/prompt-cache.js +1 -1
  259. package/dist/src/harness/proxy-input-requests.d.ts +1 -1
  260. package/dist/src/harness/proxy-input-requests.js +1 -1
  261. package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
  262. package/dist/src/harness/semantic-errors/signals.js +1 -1
  263. package/dist/src/harness/session-limit-enforcement.js +1 -1
  264. package/dist/src/harness/tool-loop.js +2 -2
  265. package/dist/src/harness/types.d.ts +2 -0
  266. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  267. package/dist/src/instrumentation/channel-delivery.js +1 -1
  268. package/dist/src/instrumentation/lifecycle.d.ts +1 -0
  269. package/dist/src/instrumentation/native-events.js +1 -1
  270. package/dist/src/internal/application/compiled-artifacts.js +3 -2
  271. package/dist/src/internal/application/package.js +1 -1
  272. package/dist/src/internal/gateway.d.ts +1 -0
  273. package/dist/src/internal/gateway.js +1 -1
  274. package/dist/src/internal/model-auth/api-key.d.ts +7 -0
  275. package/dist/src/internal/model-auth/api-key.js +1 -0
  276. package/dist/src/internal/model-auth/available-models.d.ts +2 -0
  277. package/dist/src/internal/model-auth/available-models.js +1 -0
  278. package/dist/src/internal/model-auth/development-broker-client.d.ts +3 -0
  279. package/dist/src/internal/model-auth/development-broker-client.js +1 -0
  280. package/dist/src/internal/model-auth/development-broker-protocol.d.ts +12 -0
  281. package/dist/src/internal/model-auth/development-broker-protocol.js +1 -0
  282. package/dist/src/internal/model-auth/development-broker-server.d.ts +4 -0
  283. package/dist/src/internal/model-auth/development-broker-server.js +1 -0
  284. package/dist/src/internal/model-auth/gateway-credential.d.ts +2 -0
  285. package/dist/src/internal/model-auth/gateway-credential.js +1 -0
  286. package/dist/src/internal/model-auth/store.d.ts +16 -0
  287. package/dist/src/internal/model-auth/store.js +1 -0
  288. package/dist/src/internal/model-auth/transport.d.ts +6 -0
  289. package/dist/src/internal/model-auth/transport.js +1 -0
  290. package/dist/src/internal/model-auth/vercel-cli.d.ts +7 -0
  291. package/dist/src/internal/model-auth/vercel-cli.js +1 -0
  292. package/dist/src/internal/model-auth/vercel-team.d.ts +3 -0
  293. package/dist/src/internal/model-auth/vercel-team.js +1 -0
  294. package/dist/src/internal/model-auth/vercel.d.ts +13 -0
  295. package/dist/src/internal/model-auth/vercel.js +1 -0
  296. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  297. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  298. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  299. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  300. package/dist/src/internal/nitro/routes/info.js +1 -1
  301. package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -0
  302. package/dist/src/internal/resolve-model-endpoint-status.js +1 -1
  303. package/dist/src/internal/vercel/api-resource.d.ts +4 -0
  304. package/dist/src/internal/vercel/api-resource.js +1 -0
  305. package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
  306. package/dist/src/internal/vercel/vercel-services-config.d.ts +2 -0
  307. package/dist/src/internal/vercel/vercel-services-config.js +1 -1
  308. package/dist/src/internal/workflow/development-world-client.js +1 -1
  309. package/dist/src/internal/workflow/development-world-server.js +1 -1
  310. package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +1 -1
  311. package/dist/src/internal/workflow/runtime.d.ts +1 -6
  312. package/dist/src/internal/workflow/runtime.js +1 -1
  313. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +4 -0
  314. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -0
  315. package/dist/src/protocol/activity.js +1 -1
  316. package/dist/src/protocol/message.d.ts +8 -0
  317. package/dist/src/protocol/message.js +2 -2
  318. package/dist/src/protocol/routes.d.ts +0 -2
  319. package/dist/src/protocol/routes.js +1 -1
  320. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  321. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  322. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  323. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  324. package/dist/src/public/definitions/channel.d.ts +1 -1
  325. package/dist/src/public/definitions/channel.js +1 -1
  326. package/dist/src/public/models/anthropic/index.d.ts +3 -0
  327. package/dist/src/public/models/anthropic/index.js +1 -0
  328. package/dist/src/public/models/openai/chatgpt/codex-app-server.js +1 -1
  329. package/dist/src/public/models/openai/chatgpt/credential-store.js +1 -1
  330. package/dist/src/public/models/openai/chatgpt/oauth.js +1 -1
  331. package/dist/src/public/models/openai/chatgpt/transport.js +1 -1
  332. package/dist/src/public/models/openai/index.d.ts +4 -2
  333. package/dist/src/public/models/openai/index.js +1 -1
  334. package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
  335. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +1 -1
  336. package/dist/src/public/sandbox/vercel-sandbox.d.ts +1 -1
  337. package/dist/src/public/vercel/index.d.ts +2 -1
  338. package/dist/src/public/vercel/index.js +1 -1
  339. package/dist/src/runtime/agent/resolve-model.js +1 -1
  340. package/dist/src/runtime/prompt/compose.js +1 -1
  341. package/dist/src/runtime/tools/registry.js +1 -1
  342. package/dist/src/self-modification/agent.js +1 -1
  343. package/dist/src/self-modification/setup.d.ts +9 -3
  344. package/dist/src/self-modification/setup.js +2 -2
  345. package/dist/src/setup/cli/option-row.d.ts +2 -1
  346. package/dist/src/setup/cli/option-row.js +1 -1
  347. package/dist/src/setup/cli/prompt-ui.d.ts +2 -0
  348. package/dist/src/setup/cli/prompt-ui.js +1 -1
  349. package/dist/src/setup/cli/select-state.d.ts +1 -1
  350. package/dist/src/setup/cli/select-state.js +1 -1
  351. package/dist/src/setup/flows/chatgpt-auth.js +1 -1
  352. package/dist/src/setup/flows/deploy.d.ts +4 -9
  353. package/dist/src/setup/flows/deploy.js +1 -1
  354. package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
  355. package/dist/src/setup/flows/install-vercel-cli.d.ts +2 -3
  356. package/dist/src/setup/flows/login.d.ts +3 -1
  357. package/dist/src/setup/flows/login.js +1 -1
  358. package/dist/src/setup/flows/model-login-connection.d.ts +36 -0
  359. package/dist/src/setup/flows/model-login-connection.js +1 -0
  360. package/dist/src/setup/flows/model-login-progress.d.ts +7 -0
  361. package/dist/src/setup/flows/model-login-progress.js +1 -0
  362. package/dist/src/setup/flows/model-login.d.ts +22 -0
  363. package/dist/src/setup/flows/model-login.js +1 -0
  364. package/dist/src/setup/flows/model-source-change.d.ts +7 -0
  365. package/dist/src/setup/flows/model-source-change.js +1 -1
  366. package/dist/src/setup/flows/model.d.ts +6 -24
  367. package/dist/src/setup/flows/model.js +1 -1
  368. package/dist/src/setup/flows/registry.d.ts +3 -19
  369. package/dist/src/setup/flows/registry.js +1 -1
  370. package/dist/src/setup/flows/vercel-model-login.d.ts +5 -0
  371. package/dist/src/setup/flows/vercel-model-login.js +1 -0
  372. package/dist/src/setup/integrations/self-modification/setup.d.ts +2 -0
  373. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  374. package/dist/src/setup/project-resolution.js +1 -1
  375. package/dist/src/setup/prompter.d.ts +3 -1
  376. package/dist/src/setup/provider-settings.d.ts +19 -6
  377. package/dist/src/setup/provider-settings.js +1 -1
  378. package/dist/src/setup/scaffold/create/project.js +1 -1
  379. package/dist/src/setup/vercel-project.js +0 -0
  380. package/dist/src/setup/with-spinner.d.ts +1 -1
  381. package/dist/src/setup/with-spinner.js +1 -1
  382. package/dist/src/shared/action-types.js +1 -1
  383. package/dist/src/shared/agent-definition.d.ts +6 -4
  384. package/dist/src/shared/chatgpt-model.d.ts +2 -2
  385. package/dist/src/shared/chatgpt-model.js +1 -1
  386. package/dist/src/shared/model-connection.d.ts +17 -0
  387. package/dist/src/shared/model-connection.js +1 -0
  388. package/dist/src/shared/model-endpoint-status.d.ts +2 -1
  389. package/dist/src/shared/model-helper.d.ts +26 -0
  390. package/dist/src/shared/model-helper.js +1 -0
  391. package/dist/src/shared/package-version.d.ts +2 -0
  392. package/dist/src/shared/package-version.js +1 -0
  393. package/dist/src/shared/vercel-services.d.ts +1 -0
  394. package/dist/src/shared/vercel-services.js +1 -1
  395. package/dist/src/source-change/agent-config-ast.d.ts +6 -0
  396. package/dist/src/source-change/agent-config-ast.js +1 -1
  397. package/dist/src/source-change/apply-model-selection.d.ts +3 -1
  398. package/dist/src/source-change/apply-model-selection.js +1 -2
  399. package/dist/src/source-change/static-source-change.js +1 -1
  400. package/dist/src/subagents/callback-route.js +1 -1
  401. package/dist/src/subagents/event-proxy-step.d.ts +3 -3
  402. package/dist/src/subagents/event-proxy-step.js +1 -1
  403. package/dist/src/subagents/handle-dispatch.d.ts +12 -2
  404. package/dist/src/subagents/handle-dispatch.js +1 -1
  405. package/dist/src/subagents/handles/operation-id.d.ts +1 -1
  406. package/dist/src/subagents/handles/query.d.ts +0 -6
  407. package/dist/src/subagents/handles/query.js +1 -1
  408. package/dist/src/subagents/handles/state-key.d.ts +1 -1
  409. package/dist/src/subagents/handles/store.d.ts +1 -1
  410. package/dist/src/subagents/handles/store.js +1 -1
  411. package/dist/src/subagents/hitl-proxy.d.ts +1 -1
  412. package/dist/src/subagents/parent-notification.d.ts +2 -2
  413. package/dist/src/subagents/parent-result.d.ts +1 -1
  414. package/dist/src/subagents/remote-dispatch.d.ts +1 -1
  415. package/dist/src/subagents/remote-dispatch.js +1 -1
  416. package/dist/src/subagents/start-local.js +1 -1
  417. package/dist/src/subagents/tool.js +1 -1
  418. package/dist/src/svelte/index.js +1 -1
  419. package/dist/src/svelte/use-eve-agent.js +1 -1
  420. package/dist/src/tasks/session-index.js +1 -1
  421. package/dist/src/tasks/types.d.ts +1 -1
  422. package/dist/src/tracing/agent-otel-provider.js +2 -2
  423. package/dist/src/tracing/agent-otel-usage.js +1 -1
  424. package/dist/src/tracing/agent-span-contract.d.ts +1 -0
  425. package/dist/src/tracing/agent-span-contract.js +1 -1
  426. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  427. package/dist/src/vue/index.js +1 -1
  428. package/dist/src/vue/use-eve-agent.js +1 -1
  429. package/docs/agent-config.md +22 -22
  430. package/docs/channels/chat-sdk.mdx +4 -2
  431. package/docs/channels/custom.mdx +16 -10
  432. package/docs/channels/eve.mdx +3 -1
  433. package/docs/channels/linq.mdx +1 -1
  434. package/docs/channels/overview.mdx +4 -2
  435. package/docs/channels/photon.mdx +4 -1
  436. package/docs/channels/slack.mdx +3 -1
  437. package/docs/concepts/execution-model-and-durability.mdx +62 -13
  438. package/docs/concepts/sessions-runs-and-streaming.md +14 -5
  439. package/docs/getting-started.mdx +7 -3
  440. package/docs/guides/deployment/vercel.mdx +1 -1
  441. package/docs/guides/dev-tui.md +54 -27
  442. package/docs/guides/frontend/overview.mdx +3 -1
  443. package/docs/guides/instrumentation/meta.json +1 -0
  444. package/docs/memory/custom-provider.md +1 -1
  445. package/docs/protocols/acp.md +1 -1
  446. package/docs/reference/cli.md +2 -2
  447. package/docs/reference/telemetry.md +1 -1
  448. package/docs/reference/typescript-api.md +12 -5
  449. package/docs/sandbox.mdx +3 -3
  450. package/docs/subagents/index.mdx +2 -2
  451. package/docs/tools/workflows.mdx +1 -1
  452. package/docs/tutorial/how-it-runs.mdx +1 -1
  453. package/package.json +6 -1
  454. package/dist/src/cli/commands/init-repl.d.ts +0 -80
  455. package/dist/src/cli/commands/init-repl.js +0 -1
  456. package/dist/src/cli/commands/init-self-modification.d.ts +0 -7
  457. package/dist/src/cli/commands/init-self-modification.js +0 -1
  458. package/dist/src/cli/dev/tui/prompt-placeholder.d.ts +0 -12
  459. package/dist/src/cli/dev/tui/prompt-placeholder.js +0 -1
  460. package/dist/src/cli/dev/tui/remote-auth-command.d.ts +0 -11
  461. package/dist/src/cli/dev/tui/remote-auth-command.js +0 -3
  462. package/dist/src/compiled/_chunks/workflow/attribute-changes-BAcgmlXp.js +0 -20
  463. package/dist/src/compiled/_chunks/workflow/private-CFJkQA7R.js +0 -1
  464. package/dist/src/compiled/_chunks/workflow/resume-hook-BEHe0Uut.js +0 -1
  465. package/dist/src/compiled/_chunks/workflow/run-ChHLjaCt.js +0 -1
  466. package/dist/src/compiled/_chunks/workflow/sleep-BB2HuVie.js +0 -1
  467. package/dist/src/execution/accepted-delivery-deployment.d.ts +0 -7
  468. package/dist/src/execution/accepted-delivery-deployment.js +0 -1
  469. package/dist/src/execution/dispatch-turn-step.d.ts +0 -5
  470. package/dist/src/execution/dispatch-turn-step.js +0 -1
  471. package/dist/src/execution/durable-session-migrations/chain.d.ts +0 -38
  472. package/dist/src/execution/durable-session-migrations/chain.js +0 -1
  473. package/dist/src/execution/durable-session-migrations/snapshot.d.ts +0 -6
  474. package/dist/src/execution/durable-session-migrations/snapshot.js +0 -1
  475. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.d.ts +0 -12
  476. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.js +0 -1
  477. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.d.ts +0 -2
  478. package/dist/src/execution/durable-session-migrations/turn-workflow-v1-to-v2.js +0 -1
  479. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +0 -88
  480. package/dist/src/execution/durable-session-migrations/turn-workflow.js +0 -1
  481. package/dist/src/execution/forward-turn-cancellation-step.d.ts +0 -6
  482. package/dist/src/execution/forward-turn-cancellation-step.js +0 -1
  483. package/dist/src/execution/forward-turn-delivery-step.d.ts +0 -6
  484. package/dist/src/execution/forward-turn-delivery-step.js +0 -1
  485. package/dist/src/execution/inline-turn.d.ts +0 -31
  486. package/dist/src/execution/inline-turn.js +0 -1
  487. package/dist/src/execution/next-driver-action.d.ts +0 -85
  488. package/dist/src/execution/parked-delivery-wait.d.ts +0 -54
  489. package/dist/src/execution/parked-delivery-wait.js +0 -1
  490. package/dist/src/execution/session-command-inbox.d.ts +0 -52
  491. package/dist/src/execution/session-command-inbox.js +0 -1
  492. package/dist/src/execution/session-command-token.d.ts +0 -6
  493. package/dist/src/execution/session-command-token.js +0 -1
  494. package/dist/src/execution/session-state-cursor.d.ts +0 -25
  495. package/dist/src/execution/session-state-cursor.js +0 -1
  496. package/dist/src/execution/session-timeout-control.js +0 -1
  497. package/dist/src/execution/session-timeout-steps.js +0 -1
  498. package/dist/src/execution/session-timeout-workflow.js +0 -1
  499. package/dist/src/execution/session-timeout.d.ts +0 -2
  500. package/dist/src/execution/session-timeout.js +0 -1
  501. package/dist/src/execution/turn-cancellation-control.d.ts +0 -30
  502. package/dist/src/execution/turn-cancellation-control.js +0 -1
  503. package/dist/src/execution/turn-cancellation-token.d.ts +0 -10
  504. package/dist/src/execution/turn-cancellation-token.js +0 -1
  505. package/dist/src/execution/turn-control-protocol.d.ts +0 -36
  506. package/dist/src/execution/turn-control-protocol.js +0 -1
  507. package/dist/src/execution/turn-control-receiver.d.ts +0 -54
  508. package/dist/src/execution/turn-control-receiver.js +0 -1
  509. package/dist/src/execution/turn-dispatch.d.ts +0 -39
  510. package/dist/src/execution/turn-dispatch.js +0 -1
  511. package/dist/src/execution/turn-execution-cursor.d.ts +0 -49
  512. package/dist/src/execution/turn-execution-cursor.js +0 -1
  513. package/dist/src/execution/turn-workflow-tool-run.js +0 -1
  514. package/dist/src/execution/turn-workflow.d.ts +0 -13
  515. package/dist/src/execution/turn-workflow.js +0 -1
  516. package/dist/src/execution/wire/session-inbox-contract.d.ts +0 -38
  517. package/dist/src/execution/wire/session-inbox-contract.js +0 -1
  518. package/dist/src/execution/wire/session-inbox-encoder.d.ts +0 -47
  519. package/dist/src/execution/wire/session-inbox-encoder.js +0 -1
  520. package/dist/src/execution/wire/session-inbox-resume.d.ts +0 -12
  521. package/dist/src/execution/wire/session-inbox-resume.js +0 -1
  522. package/dist/src/execution/wire/session-inbox-wire.d.ts +0 -29
  523. package/dist/src/execution/wire/session-inbox-wire.js +0 -1
  524. package/dist/src/execution/wire/session-inbox-wire.v0.d.ts +0 -5
  525. package/dist/src/execution/wire/session-inbox-wire.v0.js +0 -1
  526. package/dist/src/execution/wire/session-inbox-wire.v1.d.ts +0 -237
  527. package/dist/src/execution/wire/session-inbox-wire.v1.js +0 -1
  528. package/dist/src/execution/wire/session-inbox-wire.v2-migration.d.ts +0 -2
  529. package/dist/src/execution/wire/session-inbox-wire.v2-migration.js +0 -1
  530. package/dist/src/execution/wire/session-inbox-wire.v2.d.ts +0 -478
  531. package/dist/src/execution/wire/session-inbox-wire.v2.js +0 -1
  532. package/dist/src/execution/wire/session-inbox-wire.v2.migration.d.ts +0 -3
  533. package/dist/src/execution/wire/session-inbox-wire.v2.migration.js +0 -1
  534. package/dist/src/execution/wire/session-inbox-wire.v3.d.ts +0 -480
  535. package/dist/src/execution/wire/session-inbox-wire.v3.js +0 -1
  536. package/dist/src/execution/wire/session-inbox-wire.v3.migration.d.ts +0 -3
  537. package/dist/src/execution/wire/session-inbox-wire.v3.migration.js +0 -1
  538. package/dist/src/execution/wire/session-inbox-wire.v4.d.ts +0 -267
  539. package/dist/src/execution/wire/session-inbox-wire.v4.js +0 -1
  540. package/dist/src/execution/wire/session-inbox-wire.v4.migration.d.ts +0 -3
  541. package/dist/src/execution/wire/session-inbox-wire.v4.migration.js +0 -1
  542. package/dist/src/execution/wire/session-inbox-wire.v5.d.ts +0 -341
  543. package/dist/src/execution/wire/session-inbox-wire.v5.js +0 -1
  544. package/dist/src/execution/wire/session-inbox-wire.v5.migration.d.ts +0 -3
  545. package/dist/src/execution/wire/session-inbox-wire.v5.migration.js +0 -1
  546. package/dist/src/execution/wire/session-inbox-wire.v6.d.ts +0 -341
  547. package/dist/src/execution/wire/session-inbox-wire.v6.js +0 -1
  548. package/dist/src/execution/wire/session-inbox-wire.v7.d.ts +0 -342
  549. package/dist/src/execution/wire/session-inbox-wire.v7.js +0 -1
  550. package/dist/src/execution/workflow-entry-crash.d.ts +0 -39
  551. package/dist/src/execution/workflow-entry-crash.js +0 -1
  552. package/dist/src/execution/workflow-entry-finalization.d.ts +0 -28
  553. package/dist/src/execution/workflow-entry-finalization.js +0 -1
  554. package/dist/src/execution/workflow-entry.d.ts +0 -37
  555. package/dist/src/execution/workflow-entry.js +0 -1
  556. package/dist/src/execution/workflow-steps.js +0 -1
  557. package/dist/src/subagents/handles/rebase.d.ts +0 -4
  558. package/dist/src/subagents/handles/rebase.js +0 -1
  559. /package/dist/src/{execution/next-driver-action.js → client/eve-agent-store-state.js} +0 -0
@@ -1,267 +0,0 @@
1
- import { z } from "#compiled/zod/index.js";
2
- import type { DeliverHookPayload, SessionCommand, SessionTimeoutHookPayload } from "#channel/types.js";
3
- import type { TaskView } from "#tasks/types.js";
4
- /** Version 4 replaces executor-specific task envelopes with typed workflow-run requests. */
5
- export declare const sessionInboxWireV4Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
- auth: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7
- attributes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
8
- authenticator: z.ZodString;
9
- issuer: z.ZodOptional<z.ZodString>;
10
- principalId: z.ZodString;
11
- principalType: z.ZodString;
12
- subject: z.ZodOptional<z.ZodString>;
13
- }, z.core.$strict>>>;
14
- kind: z.ZodLiteral<"deliver">;
15
- requestId: z.ZodOptional<z.ZodString>;
16
- taskDeliveryId: z.ZodOptional<z.ZodString>;
17
- turnPolicy: z.ZodOptional<z.ZodEnum<{
18
- queue: "queue";
19
- steer: "steer";
20
- }>>;
21
- caller: z.ZodOptional<z.ZodObject<{
22
- callId: z.ZodString;
23
- replyTo: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
- kind: z.ZodLiteral<"hook">;
25
- token: z.ZodString;
26
- }, z.core.$strict>, z.ZodObject<{
27
- kind: z.ZodLiteral<"callback">;
28
- token: z.ZodString;
29
- url: z.ZodString;
30
- }, z.core.$strict>], "kind">;
31
- subagentName: z.ZodString;
32
- taskId: z.ZodOptional<z.ZodString>;
33
- activityObserver: z.ZodOptional<z.ZodObject<{
34
- sink: z.ZodObject<{
35
- url: z.ZodString;
36
- version: z.ZodLiteral<1>;
37
- }, z.core.$strict>;
38
- workIdentity: z.ZodOptional<z.ZodObject<{
39
- callId: z.ZodOptional<z.ZodString>;
40
- id: z.ZodString;
41
- kind: z.ZodEnum<{
42
- "remote-agent": "remote-agent";
43
- "root-turn": "root-turn";
44
- subagent: "subagent";
45
- task: "task";
46
- }>;
47
- name: z.ZodOptional<z.ZodString>;
48
- parentId: z.ZodOptional<z.ZodString>;
49
- rootSessionId: z.ZodString;
50
- rootTurnId: z.ZodString;
51
- sessionId: z.ZodOptional<z.ZodString>;
52
- turnId: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strict>>;
54
- }, z.core.$strict>>;
55
- }, z.core.$strict>>;
56
- deliveryMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
- channelKind: z.ZodString;
58
- channelName: z.ZodString;
59
- deliveryId: z.ZodString;
60
- payloadIndex: z.ZodNumber;
61
- requestId: z.ZodOptional<z.ZodString>;
62
- requestTraceContext: z.ZodOptional<z.ZodObject<{
63
- spanId: z.ZodString;
64
- traceFlags: z.ZodNumber;
65
- traceId: z.ZodString;
66
- }, z.core.$strict>>;
67
- acceptedDeploymentId: z.ZodOptional<z.ZodString>;
68
- }, z.core.$strict>>>;
69
- payload: z.ZodObject<{
70
- context: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
- inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
- optionId: z.ZodOptional<z.ZodString>;
73
- requestId: z.ZodString;
74
- text: z.ZodOptional<z.ZodString>;
75
- }, z.core.$strict>>>;
76
- message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
77
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
78
- text: z.ZodString;
79
- type: z.ZodLiteral<"text">;
80
- }, z.core.$strict>, z.ZodObject<{
81
- image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
82
- mediaType: z.ZodOptional<z.ZodString>;
83
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
84
- type: z.ZodLiteral<"image">;
85
- }, z.core.$strict>, z.ZodObject<{
86
- data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
87
- filename: z.ZodOptional<z.ZodString>;
88
- mediaType: z.ZodString;
89
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
90
- type: z.ZodLiteral<"file">;
91
- }, z.core.$strict>], "type">>]>>;
92
- outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
93
- task: z.ZodOptional<z.ZodObject<{
94
- agentRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
- replyTo: z.ZodString;
96
- request: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
- input: z.ZodObject<{
98
- agentId: z.ZodOptional<z.ZodString>;
99
- message: z.ZodString;
100
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
101
- target: z.ZodString;
102
- }, z.core.$strict>;
103
- invocationId: z.ZodString;
104
- kind: z.ZodLiteral<"agent-invoke">;
105
- }, z.core.$strict>, z.ZodObject<{
106
- kind: z.ZodLiteral<"agent-settled">;
107
- result: z.ZodObject<{
108
- backgroundTask: z.ZodOptional<z.ZodObject<{
109
- status: z.ZodLiteral<"working">;
110
- taskId: z.ZodString;
111
- }, z.core.$strict>>;
112
- callId: z.ZodString;
113
- isError: z.ZodOptional<z.ZodBoolean>;
114
- kind: z.ZodLiteral<"subagent-result">;
115
- origin: z.ZodLiteral<"child">;
116
- outcome: z.ZodType<import("../../shared/agent-turn-outcome.ts").AgentTurnOutcome, unknown, z.core.$ZodTypeInternals<import("../../shared/agent-turn-outcome.ts").AgentTurnOutcome, unknown>>;
117
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
118
- subagentName: z.ZodString;
119
- usage: z.ZodOptional<z.ZodObject<{
120
- cacheReadTokens: z.ZodNumber;
121
- cacheWriteTokens: z.ZodNumber;
122
- inputTokens: z.ZodNumber;
123
- outputTokens: z.ZodNumber;
124
- }, z.core.$strip>>;
125
- }, z.core.$strict>;
126
- }, z.core.$strict>], "kind">;
127
- taskId: z.ZodString;
128
- }, z.core.$strict>>>;
129
- authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
- hookPayload: z.ZodObject<{
131
- callId: z.ZodString;
132
- childSessionId: z.ZodString;
133
- event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
134
- kind: z.ZodLiteral<"subagent-authorization-event">;
135
- subagentName: z.ZodString;
136
- }, z.core.$strict>;
137
- taskId: z.ZodString;
138
- }, z.core.$strict>>>;
139
- inputRequests: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
140
- replyTo: z.ZodString;
141
- sequence: z.ZodNumber;
142
- stepIndex: z.ZodNumber;
143
- taskId: z.ZodString;
144
- turnId: z.ZodString;
145
- request: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
146
- }, z.core.$loose>, z.ZodObject<{
147
- replyTo: z.ZodString;
148
- sequence: z.ZodNumber;
149
- stepIndex: z.ZodNumber;
150
- taskId: z.ZodString;
151
- turnId: z.ZodString;
152
- requests: z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>;
153
- }, z.core.$loose>]>>>;
154
- views: z.ZodOptional<z.ZodArray<z.ZodType<TaskView, unknown, z.core.$ZodTypeInternals<TaskView, unknown>>>>;
155
- }, z.core.$strict>>;
156
- }, z.core.$loose>;
157
- payloads: z.ZodArray<z.ZodObject<{
158
- context: z.ZodOptional<z.ZodArray<z.ZodString>>;
159
- inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
160
- optionId: z.ZodOptional<z.ZodString>;
161
- requestId: z.ZodString;
162
- text: z.ZodOptional<z.ZodString>;
163
- }, z.core.$strict>>>;
164
- message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
165
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
166
- text: z.ZodString;
167
- type: z.ZodLiteral<"text">;
168
- }, z.core.$strict>, z.ZodObject<{
169
- image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
170
- mediaType: z.ZodOptional<z.ZodString>;
171
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
172
- type: z.ZodLiteral<"image">;
173
- }, z.core.$strict>, z.ZodObject<{
174
- data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
175
- filename: z.ZodOptional<z.ZodString>;
176
- mediaType: z.ZodString;
177
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
178
- type: z.ZodLiteral<"file">;
179
- }, z.core.$strict>], "type">>]>>;
180
- outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
181
- task: z.ZodOptional<z.ZodObject<{
182
- agentRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
183
- replyTo: z.ZodString;
184
- request: z.ZodDiscriminatedUnion<[z.ZodObject<{
185
- input: z.ZodObject<{
186
- agentId: z.ZodOptional<z.ZodString>;
187
- message: z.ZodString;
188
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
189
- target: z.ZodString;
190
- }, z.core.$strict>;
191
- invocationId: z.ZodString;
192
- kind: z.ZodLiteral<"agent-invoke">;
193
- }, z.core.$strict>, z.ZodObject<{
194
- kind: z.ZodLiteral<"agent-settled">;
195
- result: z.ZodObject<{
196
- backgroundTask: z.ZodOptional<z.ZodObject<{
197
- status: z.ZodLiteral<"working">;
198
- taskId: z.ZodString;
199
- }, z.core.$strict>>;
200
- callId: z.ZodString;
201
- isError: z.ZodOptional<z.ZodBoolean>;
202
- kind: z.ZodLiteral<"subagent-result">;
203
- origin: z.ZodLiteral<"child">;
204
- outcome: z.ZodType<import("../../shared/agent-turn-outcome.ts").AgentTurnOutcome, unknown, z.core.$ZodTypeInternals<import("../../shared/agent-turn-outcome.ts").AgentTurnOutcome, unknown>>;
205
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
206
- subagentName: z.ZodString;
207
- usage: z.ZodOptional<z.ZodObject<{
208
- cacheReadTokens: z.ZodNumber;
209
- cacheWriteTokens: z.ZodNumber;
210
- inputTokens: z.ZodNumber;
211
- outputTokens: z.ZodNumber;
212
- }, z.core.$strip>>;
213
- }, z.core.$strict>;
214
- }, z.core.$strict>], "kind">;
215
- taskId: z.ZodString;
216
- }, z.core.$strict>>>;
217
- authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
- hookPayload: z.ZodObject<{
219
- callId: z.ZodString;
220
- childSessionId: z.ZodString;
221
- event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
222
- kind: z.ZodLiteral<"subagent-authorization-event">;
223
- subagentName: z.ZodString;
224
- }, z.core.$strict>;
225
- taskId: z.ZodString;
226
- }, z.core.$strict>>>;
227
- inputRequests: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
228
- replyTo: z.ZodString;
229
- sequence: z.ZodNumber;
230
- stepIndex: z.ZodNumber;
231
- taskId: z.ZodString;
232
- turnId: z.ZodString;
233
- request: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
234
- }, z.core.$loose>, z.ZodObject<{
235
- replyTo: z.ZodString;
236
- sequence: z.ZodNumber;
237
- stepIndex: z.ZodNumber;
238
- taskId: z.ZodString;
239
- turnId: z.ZodString;
240
- requests: z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>;
241
- }, z.core.$loose>]>>>;
242
- views: z.ZodOptional<z.ZodArray<z.ZodType<TaskView, unknown, z.core.$ZodTypeInternals<TaskView, unknown>>>>;
243
- }, z.core.$strict>>;
244
- }, z.core.$loose>>;
245
- version: z.ZodLiteral<4>;
246
- }, z.core.$strict>, z.ZodObject<{
247
- kind: z.ZodLiteral<"session-timeout">;
248
- version: z.ZodLiteral<4>;
249
- }, z.core.$strict>, z.ZodObject<{
250
- kind: z.ZodLiteral<"clear">;
251
- version: z.ZodLiteral<4>;
252
- }, z.core.$strict>, z.ZodObject<{
253
- kind: z.ZodLiteral<"compact">;
254
- version: z.ZodLiteral<4>;
255
- }, z.core.$strict>, z.ZodObject<{
256
- kind: z.ZodLiteral<"reset">;
257
- reason: z.ZodOptional<z.ZodString>;
258
- version: z.ZodLiteral<4>;
259
- }, z.core.$strict>, z.ZodObject<{
260
- kind: z.ZodLiteral<"cancel">;
261
- taskId: z.ZodOptional<z.ZodString>;
262
- turnId: z.ZodOptional<z.ZodString>;
263
- version: z.ZodLiteral<4>;
264
- }, z.core.$strict>], "kind">;
265
- export type SessionInboxWireV4 = z.infer<typeof sessionInboxWireV4Schema>;
266
- /** Builds and validates one complete version-4 wire value. */
267
- export declare function encodeSessionCommandV4(command: DeliverHookPayload | SessionCommand | SessionTimeoutHookPayload): SessionInboxWireV4;
@@ -1 +0,0 @@
1
- import{z}from"#compiled/zod/index.js";import{formatValidationError}from"#runtime/validation.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{SessionInboxWireError}from"#execution/wire/session-inbox-contract.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{sessionInboxWireV3Schema}from"#execution/wire/session-inbox-wire.v3.js";import{tokenUsageSchema}from"#shared/token-usage.js";import{runtimeSubagentChildResultSchema}from"#shared/action-types.js";const taskMetadataSchema=z.object({agentId:z.string().optional(),kind:z.string(),mode:z.enum([`local`,`remote`]).optional(),name:z.string()}).strict(),taskViewBase={executor:z.object({binding:z.object({data:z.record(z.string(),jsonValueSchema),kind:z.string()}).strict().optional()}).strict().optional(),metadata:taskMetadataSchema,taskId:z.string(),usage:tokenUsageSchema.optional()},taskViewSchema=z.discriminatedUnion(`status`,[z.object({...taskViewBase,status:z.literal(`working`)}).strict(),z.object({...taskViewBase,inputRequests:z.array(jsonValueSchema),status:z.literal(`input_required`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`result`)}).strict(),status:z.literal(`completed`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`error`)}).strict(),status:z.literal(`failed`)}).strict(),z.object({...taskViewBase,status:z.literal(`cancelled`)}).strict()]),eventCoordinateSchema=z.number().int().nonnegative(),taskInputRequestBase={replyTo:z.string(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,taskId:z.string(),turnId:z.string()},taskInputRequestSchema=z.union([z.object({...taskInputRequestBase,request:jsonValueSchema}).loose(),z.object({...taskInputRequestBase,requests:z.array(jsonValueSchema)}).loose()]),agentInvocationInputSchema=z.object({agentId:z.string().optional(),message:z.string(),outputSchema:z.record(z.string(),jsonValueSchema).optional(),target:z.string()}).strict(),taskAgentRequestSchema=z.object({replyTo:z.string(),request:z.discriminatedUnion(`kind`,[z.object({input:agentInvocationInputSchema,invocationId:z.string(),kind:z.literal(`agent-invoke`)}).strict(),z.object({kind:z.literal(`agent-settled`),result:runtimeSubagentChildResultSchema}).strict()]),taskId:z.string()}).strict(),subagentAuthorizationEventHookPayloadSchema=z.object({callId:z.string(),childSessionId:z.string(),event:z.custom(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`Expected an object.`),kind:z.literal(`subagent-authorization-event`),subagentName:z.string()}).strict(),taskAuthorizationEventSchema=z.object({hookPayload:subagentAuthorizationEventHookPayloadSchema,taskId:z.string()}).strict(),taskPayloadV4Schema=z.object({agentRequests:z.array(taskAgentRequestSchema).optional(),authorizationEvents:z.array(taskAuthorizationEventSchema).optional(),inputRequests:z.array(taskInputRequestSchema).optional(),views:z.array(taskViewSchema).optional()}).strict(),v3=sessionInboxWireV3Schema.options,v3Deliver=v3[0],deliverPayloadV4Schema=v3Deliver.shape.payload.extend({task:taskPayloadV4Schema.optional()}),version=z.literal(4),sessionInboxWireV4Schema=z.discriminatedUnion(`kind`,[v3Deliver.extend({payload:deliverPayloadV4Schema,payloads:z.array(deliverPayloadV4Schema),version}),v3[1].extend({version}),v3[2].extend({version}),v3[3].extend({version}),v3[4].extend({version}),v3[5].extend({version})]);function encodeSessionCommandV4(e){let t=e.kind===`send`?{auth:e.auth,caller:e.caller,deliveryMetadata:e.delivery===void 0?void 0:[{...e.delivery,payloadIndex:0}],kind:`deliver`,payload:e.payload,payloads:[e.payload],requestId:e.requestId,taskDeliveryId:e.taskDeliveryId,turnPolicy:e.turnPolicy,version:4}:e.kind===`deliver`?{...e,payload:coalesceDeliverPayloads(e.payloads),version:4}:{...e,version:4},n=sessionInboxWireV4Schema.safeParse(t);if(!n.success)throw new SessionInboxWireError(`Produced a session inbox payload that does not match wire version 4: ${formatValidationError(n.error)}`);return n.data}export{encodeSessionCommandV4,sessionInboxWireV4Schema};
@@ -1,3 +0,0 @@
1
- import type { VersionMigration } from "#execution/durable-session-migrations/chain.js";
2
- /** Translates v3 task envelopes into typed workflow-run requests. */
3
- export declare const sessionInboxWireV3Migration: VersionMigration;
@@ -1 +0,0 @@
1
- import{isObject}from"#shared/guards.js";const sessionInboxWireV3Migration={from:3,migrate(e){if(!isObject(e))throw Error(`session inbox wire v3 value is not an object.`);return e.kind===`deliver`?{...e,payload:migratePayload(e.payload),payloads:Array.isArray(e.payloads)?e.payloads.map(migratePayload):e.payloads,version:4}:{...e,version:4}},to:4};function migratePayload(e){if(!isObject(e)||!isObject(e.task))return e;let t=e.task;return{...e,task:{agentRequests:t.agentRequests,authorizationEvents:t.authorizationEvents,inputRequests:migrateInputRequests(t.inputRequests),views:Array.isArray(t.views)?t.views.map(migrateTaskView):t.views}}}function migrateInputRequests(e){if(Array.isArray(e))return e.flatMap(e=>{if(!isObject(e))return[];if(`request`in e||`requests`in e)return[e];if(!isObject(e.hookPayload)||typeof e.taskId!=`string`)return[];let t=e.hookPayload,n=t.event;return typeof t.childContinuationToken!=`string`||!isObject(n)||!Array.isArray(n.requests)||typeof n.sequence!=`number`||typeof n.stepIndex!=`number`||typeof n.turnId!=`string`?[]:n.requests.map(r=>({...e,replyTo:t.childContinuationToken,request:r,sequence:n.sequence,stepIndex:n.stepIndex,taskId:e.taskId,turnId:n.turnId}))})}function migrateTaskView(e){return!isObject(e)||!isObject(e.executor)?e:{...e,executor:e.executor.binding===void 0?void 0:{binding:e.executor.binding}}}export{sessionInboxWireV3Migration};
@@ -1,341 +0,0 @@
1
- import { z } from "#compiled/zod/index.js";
2
- import type { DeliverHookPayload, SessionCommand, SessionTimeoutHookPayload } from "#channel/types.js";
3
- import type { TaskView } from "#tasks/types.js";
4
- /** Version 5 adds model token cost to delegated usage reports. */
5
- export declare const sessionInboxWireV5Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
- auth: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7
- attributes: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
8
- authenticator: z.ZodString;
9
- issuer: z.ZodOptional<z.ZodString>;
10
- principalId: z.ZodString;
11
- principalType: z.ZodString;
12
- subject: z.ZodOptional<z.ZodString>;
13
- }, z.core.$strict>>>;
14
- kind: z.ZodLiteral<"deliver">;
15
- requestId: z.ZodOptional<z.ZodString>;
16
- taskDeliveryId: z.ZodOptional<z.ZodString>;
17
- turnPolicy: z.ZodOptional<z.ZodEnum<{
18
- queue: "queue";
19
- steer: "steer";
20
- }>>;
21
- caller: z.ZodOptional<z.ZodObject<{
22
- callId: z.ZodString;
23
- replyTo: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
- kind: z.ZodLiteral<"hook">;
25
- token: z.ZodString;
26
- }, z.core.$strict>, z.ZodObject<{
27
- kind: z.ZodLiteral<"callback">;
28
- token: z.ZodString;
29
- url: z.ZodString;
30
- }, z.core.$strict>], "kind">;
31
- subagentName: z.ZodString;
32
- taskId: z.ZodOptional<z.ZodString>;
33
- activityObserver: z.ZodOptional<z.ZodObject<{
34
- sink: z.ZodObject<{
35
- url: z.ZodString;
36
- version: z.ZodLiteral<1>;
37
- }, z.core.$strict>;
38
- workIdentity: z.ZodOptional<z.ZodObject<{
39
- callId: z.ZodOptional<z.ZodString>;
40
- id: z.ZodString;
41
- kind: z.ZodEnum<{
42
- "remote-agent": "remote-agent";
43
- "root-turn": "root-turn";
44
- subagent: "subagent";
45
- task: "task";
46
- }>;
47
- name: z.ZodOptional<z.ZodString>;
48
- parentId: z.ZodOptional<z.ZodString>;
49
- rootSessionId: z.ZodString;
50
- rootTurnId: z.ZodString;
51
- sessionId: z.ZodOptional<z.ZodString>;
52
- turnId: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strict>>;
54
- }, z.core.$strict>>;
55
- }, z.core.$strict>>;
56
- deliveryMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
- channelKind: z.ZodString;
58
- channelName: z.ZodString;
59
- deliveryId: z.ZodString;
60
- payloadIndex: z.ZodNumber;
61
- requestId: z.ZodOptional<z.ZodString>;
62
- requestTraceContext: z.ZodOptional<z.ZodObject<{
63
- spanId: z.ZodString;
64
- traceFlags: z.ZodNumber;
65
- traceId: z.ZodString;
66
- }, z.core.$strict>>;
67
- acceptedDeploymentId: z.ZodOptional<z.ZodString>;
68
- }, z.core.$strict>>>;
69
- payload: z.ZodObject<{
70
- context: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
- inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
- optionId: z.ZodOptional<z.ZodString>;
73
- requestId: z.ZodString;
74
- text: z.ZodOptional<z.ZodString>;
75
- }, z.core.$strict>>>;
76
- message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
77
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
78
- text: z.ZodString;
79
- type: z.ZodLiteral<"text">;
80
- }, z.core.$strict>, z.ZodObject<{
81
- image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
82
- mediaType: z.ZodOptional<z.ZodString>;
83
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
84
- type: z.ZodLiteral<"image">;
85
- }, z.core.$strict>, z.ZodObject<{
86
- data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
87
- filename: z.ZodOptional<z.ZodString>;
88
- mediaType: z.ZodString;
89
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
90
- type: z.ZodLiteral<"file">;
91
- }, z.core.$strict>], "type">>]>>;
92
- outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
93
- task: z.ZodOptional<z.ZodObject<{
94
- agentRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
- replyTo: z.ZodString;
96
- request: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
- input: z.ZodObject<{
98
- agentId: z.ZodOptional<z.ZodString>;
99
- message: z.ZodString;
100
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
101
- target: z.ZodString;
102
- }, z.core.$strict>;
103
- invocationId: z.ZodString;
104
- kind: z.ZodLiteral<"agent-invoke">;
105
- }, z.core.$strict>, z.ZodObject<{
106
- kind: z.ZodLiteral<"agent-settled">;
107
- result: z.ZodObject<{
108
- backgroundTask: z.ZodOptional<z.ZodObject<{
109
- status: z.ZodLiteral<"working">;
110
- taskId: z.ZodString;
111
- }, z.core.$strict>>;
112
- callId: z.ZodString;
113
- isError: z.ZodOptional<z.ZodBoolean>;
114
- kind: z.ZodLiteral<"subagent-result">;
115
- origin: z.ZodLiteral<"child">;
116
- outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
- kind: z.ZodLiteral<"parked">;
118
- result: z.ZodDiscriminatedUnion<[z.ZodObject<{
119
- kind: z.ZodLiteral<"succeeded">;
120
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
121
- }, z.core.$strict>, z.ZodObject<{
122
- error: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
123
- kind: z.ZodLiteral<"failed">;
124
- }, z.core.$strict>, z.ZodObject<{
125
- kind: z.ZodLiteral<"cancelled">;
126
- }, z.core.$strict>], "kind">;
127
- usageDelta: z.ZodObject<{
128
- cacheReadTokens: z.ZodNumber;
129
- cacheWriteTokens: z.ZodNumber;
130
- inputTokens: z.ZodNumber;
131
- outputTokens: z.ZodNumber;
132
- costUsd: z.ZodOptional<z.ZodNumber>;
133
- }, z.core.$strip>;
134
- }, z.core.$strict>, z.ZodObject<{
135
- kind: z.ZodLiteral<"terminal">;
136
- result: z.ZodDiscriminatedUnion<[z.ZodObject<{
137
- kind: z.ZodLiteral<"succeeded">;
138
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
139
- }, z.core.$strict>, z.ZodObject<{
140
- error: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
141
- kind: z.ZodLiteral<"failed">;
142
- }, z.core.$strict>, z.ZodObject<{
143
- kind: z.ZodLiteral<"cancelled">;
144
- }, z.core.$strict>], "kind">;
145
- usageDelta: z.ZodObject<{
146
- cacheReadTokens: z.ZodNumber;
147
- cacheWriteTokens: z.ZodNumber;
148
- inputTokens: z.ZodNumber;
149
- outputTokens: z.ZodNumber;
150
- costUsd: z.ZodOptional<z.ZodNumber>;
151
- }, z.core.$strip>;
152
- }, z.core.$strict>], "kind">;
153
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
154
- subagentName: z.ZodString;
155
- usage: z.ZodOptional<z.ZodObject<{
156
- cacheReadTokens: z.ZodNumber;
157
- cacheWriteTokens: z.ZodNumber;
158
- inputTokens: z.ZodNumber;
159
- outputTokens: z.ZodNumber;
160
- costUsd: z.ZodOptional<z.ZodNumber>;
161
- }, z.core.$strip>>;
162
- }, z.core.$strict>;
163
- }, z.core.$strict>], "kind">;
164
- taskId: z.ZodString;
165
- }, z.core.$strict>>>;
166
- authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
167
- hookPayload: z.ZodObject<{
168
- callId: z.ZodString;
169
- childSessionId: z.ZodString;
170
- event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
171
- kind: z.ZodLiteral<"subagent-authorization-event">;
172
- subagentName: z.ZodString;
173
- }, z.core.$strict>;
174
- taskId: z.ZodString;
175
- }, z.core.$strict>>>;
176
- inputRequests: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
177
- replyTo: z.ZodString;
178
- sequence: z.ZodNumber;
179
- stepIndex: z.ZodNumber;
180
- taskId: z.ZodString;
181
- turnId: z.ZodString;
182
- request: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
183
- }, z.core.$loose>, z.ZodObject<{
184
- replyTo: z.ZodString;
185
- sequence: z.ZodNumber;
186
- stepIndex: z.ZodNumber;
187
- taskId: z.ZodString;
188
- turnId: z.ZodString;
189
- requests: z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>;
190
- }, z.core.$loose>]>>>;
191
- views: z.ZodOptional<z.ZodArray<z.ZodType<TaskView, unknown, z.core.$ZodTypeInternals<TaskView, unknown>>>>;
192
- }, z.core.$strict>>;
193
- }, z.core.$loose>;
194
- payloads: z.ZodArray<z.ZodObject<{
195
- context: z.ZodOptional<z.ZodArray<z.ZodString>>;
196
- inputResponses: z.ZodOptional<z.ZodArray<z.ZodObject<{
197
- optionId: z.ZodOptional<z.ZodString>;
198
- requestId: z.ZodString;
199
- text: z.ZodOptional<z.ZodString>;
200
- }, z.core.$strict>>>;
201
- message: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
202
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
203
- text: z.ZodString;
204
- type: z.ZodLiteral<"text">;
205
- }, z.core.$strict>, z.ZodObject<{
206
- image: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
207
- mediaType: z.ZodOptional<z.ZodString>;
208
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
209
- type: z.ZodLiteral<"image">;
210
- }, z.core.$strict>, z.ZodObject<{
211
- data: z.ZodCustom<URL | import("ai").DataContent, URL | import("ai").DataContent>;
212
- filename: z.ZodOptional<z.ZodString>;
213
- mediaType: z.ZodString;
214
- providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>>;
215
- type: z.ZodLiteral<"file">;
216
- }, z.core.$strict>], "type">>]>>;
217
- outputSchema: z.ZodOptional<z.ZodType<import("../../shared/json.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonObject, unknown>>>;
218
- task: z.ZodOptional<z.ZodObject<{
219
- agentRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
220
- replyTo: z.ZodString;
221
- request: z.ZodDiscriminatedUnion<[z.ZodObject<{
222
- input: z.ZodObject<{
223
- agentId: z.ZodOptional<z.ZodString>;
224
- message: z.ZodString;
225
- outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>>;
226
- target: z.ZodString;
227
- }, z.core.$strict>;
228
- invocationId: z.ZodString;
229
- kind: z.ZodLiteral<"agent-invoke">;
230
- }, z.core.$strict>, z.ZodObject<{
231
- kind: z.ZodLiteral<"agent-settled">;
232
- result: z.ZodObject<{
233
- backgroundTask: z.ZodOptional<z.ZodObject<{
234
- status: z.ZodLiteral<"working">;
235
- taskId: z.ZodString;
236
- }, z.core.$strict>>;
237
- callId: z.ZodString;
238
- isError: z.ZodOptional<z.ZodBoolean>;
239
- kind: z.ZodLiteral<"subagent-result">;
240
- origin: z.ZodLiteral<"child">;
241
- outcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
242
- kind: z.ZodLiteral<"parked">;
243
- result: z.ZodDiscriminatedUnion<[z.ZodObject<{
244
- kind: z.ZodLiteral<"succeeded">;
245
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
246
- }, z.core.$strict>, z.ZodObject<{
247
- error: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
248
- kind: z.ZodLiteral<"failed">;
249
- }, z.core.$strict>, z.ZodObject<{
250
- kind: z.ZodLiteral<"cancelled">;
251
- }, z.core.$strict>], "kind">;
252
- usageDelta: z.ZodObject<{
253
- cacheReadTokens: z.ZodNumber;
254
- cacheWriteTokens: z.ZodNumber;
255
- inputTokens: z.ZodNumber;
256
- outputTokens: z.ZodNumber;
257
- costUsd: z.ZodOptional<z.ZodNumber>;
258
- }, z.core.$strip>;
259
- }, z.core.$strict>, z.ZodObject<{
260
- kind: z.ZodLiteral<"terminal">;
261
- result: z.ZodDiscriminatedUnion<[z.ZodObject<{
262
- kind: z.ZodLiteral<"succeeded">;
263
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
264
- }, z.core.$strict>, z.ZodObject<{
265
- error: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
266
- kind: z.ZodLiteral<"failed">;
267
- }, z.core.$strict>, z.ZodObject<{
268
- kind: z.ZodLiteral<"cancelled">;
269
- }, z.core.$strict>], "kind">;
270
- usageDelta: z.ZodObject<{
271
- cacheReadTokens: z.ZodNumber;
272
- cacheWriteTokens: z.ZodNumber;
273
- inputTokens: z.ZodNumber;
274
- outputTokens: z.ZodNumber;
275
- costUsd: z.ZodOptional<z.ZodNumber>;
276
- }, z.core.$strip>;
277
- }, z.core.$strict>], "kind">;
278
- output: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
279
- subagentName: z.ZodString;
280
- usage: z.ZodOptional<z.ZodObject<{
281
- cacheReadTokens: z.ZodNumber;
282
- cacheWriteTokens: z.ZodNumber;
283
- inputTokens: z.ZodNumber;
284
- outputTokens: z.ZodNumber;
285
- costUsd: z.ZodOptional<z.ZodNumber>;
286
- }, z.core.$strip>>;
287
- }, z.core.$strict>;
288
- }, z.core.$strict>], "kind">;
289
- taskId: z.ZodString;
290
- }, z.core.$strict>>>;
291
- authorizationEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
292
- hookPayload: z.ZodObject<{
293
- callId: z.ZodString;
294
- childSessionId: z.ZodString;
295
- event: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
296
- kind: z.ZodLiteral<"subagent-authorization-event">;
297
- subagentName: z.ZodString;
298
- }, z.core.$strict>;
299
- taskId: z.ZodString;
300
- }, z.core.$strict>>>;
301
- inputRequests: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
302
- replyTo: z.ZodString;
303
- sequence: z.ZodNumber;
304
- stepIndex: z.ZodNumber;
305
- taskId: z.ZodString;
306
- turnId: z.ZodString;
307
- request: z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>;
308
- }, z.core.$loose>, z.ZodObject<{
309
- replyTo: z.ZodString;
310
- sequence: z.ZodNumber;
311
- stepIndex: z.ZodNumber;
312
- taskId: z.ZodString;
313
- turnId: z.ZodString;
314
- requests: z.ZodArray<z.ZodType<import("../../shared/json.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("../../shared/json.ts").JsonValue, unknown>>>;
315
- }, z.core.$loose>]>>>;
316
- views: z.ZodOptional<z.ZodArray<z.ZodType<TaskView, unknown, z.core.$ZodTypeInternals<TaskView, unknown>>>>;
317
- }, z.core.$strict>>;
318
- }, z.core.$loose>>;
319
- version: z.ZodLiteral<5>;
320
- }, z.core.$strict>, z.ZodObject<{
321
- kind: z.ZodLiteral<"session-timeout">;
322
- version: z.ZodLiteral<5>;
323
- }, z.core.$strict>, z.ZodObject<{
324
- kind: z.ZodLiteral<"clear">;
325
- version: z.ZodLiteral<5>;
326
- }, z.core.$strict>, z.ZodObject<{
327
- kind: z.ZodLiteral<"compact">;
328
- version: z.ZodLiteral<5>;
329
- }, z.core.$strict>, z.ZodObject<{
330
- kind: z.ZodLiteral<"reset">;
331
- reason: z.ZodOptional<z.ZodString>;
332
- version: z.ZodLiteral<5>;
333
- }, z.core.$strict>, z.ZodObject<{
334
- kind: z.ZodLiteral<"cancel">;
335
- taskId: z.ZodOptional<z.ZodString>;
336
- turnId: z.ZodOptional<z.ZodString>;
337
- version: z.ZodLiteral<5>;
338
- }, z.core.$strict>], "kind">;
339
- export type SessionInboxWireV5 = z.infer<typeof sessionInboxWireV5Schema>;
340
- /** Builds and validates one complete version-5 wire value. */
341
- export declare function encodeSessionCommandV5(command: DeliverHookPayload | SessionCommand | SessionTimeoutHookPayload): SessionInboxWireV5;
@@ -1 +0,0 @@
1
- import{z}from"#compiled/zod/index.js";import{formatValidationError}from"#runtime/validation.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{SessionInboxWireError}from"#execution/wire/session-inbox-contract.js";import{coalesceDeliverPayloads}from"#execution/deliver-payloads.js";import{sessionInboxWireV3Schema}from"#execution/wire/session-inbox-wire.v3.js";import{tokenUsageWithCostSchema}from"#shared/token-usage.js";const taskMetadataSchema=z.object({agentId:z.string().optional(),kind:z.string(),mode:z.enum([`local`,`remote`]).optional(),name:z.string()}).strict(),taskViewBase={executor:z.object({binding:z.object({data:z.record(z.string(),jsonValueSchema),kind:z.string()}).strict().optional()}).strict().optional(),metadata:taskMetadataSchema,taskId:z.string(),usage:tokenUsageWithCostSchema.optional()},taskViewSchema=z.discriminatedUnion(`status`,[z.object({...taskViewBase,status:z.literal(`working`)}).strict(),z.object({...taskViewBase,inputRequests:z.array(jsonValueSchema),status:z.literal(`input_required`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`result`)}).strict(),status:z.literal(`completed`)}).strict(),z.object({...taskViewBase,lastOutput:z.object({data:jsonValueSchema,type:z.literal(`error`)}).strict(),status:z.literal(`failed`)}).strict(),z.object({...taskViewBase,status:z.literal(`cancelled`)}).strict()]),eventCoordinateSchema=z.number().int().nonnegative(),taskInputRequestBase={replyTo:z.string(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,taskId:z.string(),turnId:z.string()},taskInputRequestSchema=z.union([z.object({...taskInputRequestBase,request:jsonValueSchema}).loose(),z.object({...taskInputRequestBase,requests:z.array(jsonValueSchema)}).loose()]),agentInvocationInputSchema=z.object({agentId:z.string().optional(),message:z.string(),outputSchema:z.record(z.string(),jsonValueSchema).optional(),target:z.string()}).strict(),agentTurnResultSchema=z.discriminatedUnion(`kind`,[z.strictObject({kind:z.literal(`succeeded`),output:jsonValueSchema}),z.strictObject({error:jsonValueSchema,kind:z.literal(`failed`)}),z.strictObject({kind:z.literal(`cancelled`)})]),agentTurnOutcomeSchema=z.discriminatedUnion(`kind`,[z.strictObject({kind:z.literal(`parked`),result:agentTurnResultSchema,usageDelta:tokenUsageWithCostSchema}),z.strictObject({kind:z.literal(`terminal`),result:agentTurnResultSchema,usageDelta:tokenUsageWithCostSchema})]),runtimeSubagentChildResultSchema=z.object({backgroundTask:z.strictObject({status:z.literal(`working`),taskId:z.string()}).optional(),callId:z.string(),isError:z.boolean().optional(),kind:z.literal(`subagent-result`),origin:z.literal(`child`),outcome:agentTurnOutcomeSchema,output:jsonValueSchema,subagentName:z.string(),usage:tokenUsageWithCostSchema.optional()}).strict(),taskAgentRequestSchema=z.object({replyTo:z.string(),request:z.discriminatedUnion(`kind`,[z.object({input:agentInvocationInputSchema,invocationId:z.string(),kind:z.literal(`agent-invoke`)}).strict(),z.object({kind:z.literal(`agent-settled`),result:runtimeSubagentChildResultSchema}).strict()]),taskId:z.string()}).strict(),subagentAuthorizationEventHookPayloadSchema=z.object({callId:z.string(),childSessionId:z.string(),event:z.custom(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`Expected an object.`),kind:z.literal(`subagent-authorization-event`),subagentName:z.string()}).strict(),taskAuthorizationEventSchema=z.object({hookPayload:subagentAuthorizationEventHookPayloadSchema,taskId:z.string()}).strict(),taskPayloadV5Schema=z.object({agentRequests:z.array(taskAgentRequestSchema).optional(),authorizationEvents:z.array(taskAuthorizationEventSchema).optional(),inputRequests:z.array(taskInputRequestSchema).optional(),views:z.array(taskViewSchema).optional()}).strict(),v3=sessionInboxWireV3Schema.options,v3Deliver=v3[0],deliverPayloadV5Schema=v3Deliver.shape.payload.extend({task:taskPayloadV5Schema.optional()}),version=z.literal(5),sessionInboxWireV5Schema=z.discriminatedUnion(`kind`,[v3Deliver.extend({payload:deliverPayloadV5Schema,payloads:z.array(deliverPayloadV5Schema),version}),v3[1].extend({version}),v3[2].extend({version}),v3[3].extend({version}),v3[4].extend({version}),v3[5].extend({version})]);function encodeSessionCommandV5(e){let t=e.kind===`send`?{auth:e.auth,caller:e.caller,deliveryMetadata:e.delivery===void 0?void 0:[{...e.delivery,payloadIndex:0}],kind:`deliver`,payload:e.payload,payloads:[e.payload],requestId:e.requestId,taskDeliveryId:e.taskDeliveryId,turnPolicy:e.turnPolicy,version:5}:e.kind===`deliver`?{...e,payload:coalesceDeliverPayloads(e.payloads),version:5}:{...e,version:5},n=sessionInboxWireV5Schema.safeParse(t);if(!n.success)throw new SessionInboxWireError(`Produced a session inbox payload that does not match wire version 5: ${formatValidationError(n.error)}`);return n.data}export{encodeSessionCommandV5,sessionInboxWireV5Schema};