eve 0.37.0 → 0.38.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 (410) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/src/channel/routes.d.ts +13 -3
  3. package/dist/src/channel/routes.js +1 -1
  4. package/dist/src/channel/session-callback.js +1 -1
  5. package/dist/src/channel/session.d.ts +2 -1
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +41 -0
  8. package/dist/src/chunks/{use-eve-agent-COmP-H8R.js → use-eve-agent-BbSsu99c.js} +79 -32
  9. package/dist/src/chunks/{use-eve-agent-CnppTEFk.js → use-eve-agent-Dt8Y5QtW.js} +78 -31
  10. package/dist/src/cli/acp/command.d.ts +2 -1
  11. package/dist/src/cli/acp/command.js +2 -2
  12. package/dist/src/cli/application-command.d.ts +8 -0
  13. package/dist/src/cli/application-command.js +1 -0
  14. package/dist/src/cli/application-root.d.ts +8 -0
  15. package/dist/src/cli/application-root.js +1 -0
  16. package/dist/src/cli/commands/build.d.ts +2 -1
  17. package/dist/src/cli/commands/build.js +1 -1
  18. package/dist/src/cli/commands/init-git.js +1 -1
  19. package/dist/src/cli/commands/init-recovery.d.ts +3 -0
  20. package/dist/src/cli/commands/init-recovery.js +3 -0
  21. package/dist/src/cli/commands/init-repl.js +1 -1
  22. package/dist/src/cli/commands/init-target.d.ts +21 -0
  23. package/dist/src/cli/commands/init-target.js +1 -0
  24. package/dist/src/cli/commands/init.js +1 -1
  25. package/dist/src/cli/commands/register-integration-commands.d.ts +2 -1
  26. package/dist/src/cli/commands/register-integration-commands.js +1 -1
  27. package/dist/src/cli/commands/register-project-commands.d.ts +2 -1
  28. package/dist/src/cli/commands/register-project-commands.js +1 -1
  29. package/dist/src/cli/commands/register-registry-commands.d.ts +2 -1
  30. package/dist/src/cli/commands/register-registry-commands.js +4 -1
  31. package/dist/src/cli/commands/registry-recovery.d.ts +14 -0
  32. package/dist/src/cli/commands/registry-recovery.js +1 -0
  33. package/dist/src/cli/commands/registry.d.ts +2 -5
  34. package/dist/src/cli/commands/registry.js +1 -1
  35. package/dist/src/cli/dev/diagnostic-dump.js +1 -1
  36. package/dist/src/cli/dev/environment.js +1 -1
  37. package/dist/src/cli/dev/tui/runner.d.ts +8 -0
  38. package/dist/src/cli/dev/tui/runner.js +1 -1
  39. package/dist/src/cli/dev/tui/subagent-pump.d.ts +27 -22
  40. package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
  41. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +16 -0
  42. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  43. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  44. package/dist/src/cli/invoke/command.d.ts +3 -2
  45. package/dist/src/cli/invoke/command.js +1 -1
  46. package/dist/src/cli/run.d.ts +3 -2
  47. package/dist/src/cli/run.js +3 -3
  48. package/dist/src/client/eve-agent-store.d.ts +15 -3
  49. package/dist/src/client/eve-agent-store.js +2 -2
  50. package/dist/src/client/message-response.d.ts +10 -2
  51. package/dist/src/client/message-response.js +1 -1
  52. package/dist/src/client/open-stream.d.ts +2 -0
  53. package/dist/src/client/open-stream.js +1 -1
  54. package/dist/src/client/session.js +1 -1
  55. package/dist/src/compiled/.vendor-stamp.json +5 -1
  56. package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
  57. package/dist/src/compiled/@chat-adapter/slack/index.js +25 -25
  58. package/dist/src/compiled/@modelcontextprotocol/server/LICENSE +216 -0
  59. package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +98 -0
  60. package/dist/src/compiled/@modelcontextprotocol/server/index.js +80 -0
  61. package/dist/src/compiled/@opentelemetry/api/index.js +1 -1
  62. package/dist/src/compiled/@opentelemetry/otlp-transformer/index.js +1 -1
  63. package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +61 -61
  64. package/dist/src/compiled/@vercel/oidc/index.js +14 -14
  65. package/dist/src/compiled/@vercel/otel/index.js +1 -1
  66. package/dist/src/compiled/@vercel/sandbox/index.js +1 -1
  67. package/dist/src/compiled/@workflow/core/index.js +1 -1
  68. package/dist/src/compiled/@workflow/core/private.js +1 -1
  69. package/dist/src/compiled/@workflow/core/runtime.js +2 -2
  70. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  71. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  72. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  73. package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
  74. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BoH7JsWp.js → attribute-changes-DZtQkszH.js} +1 -1
  75. package/dist/src/compiled/_chunks/workflow/chunk-5MU5Z6L3-B_3nkJFi.js +1 -0
  76. package/dist/src/compiled/_chunks/workflow/{chunk-NWCAEW5Y-Oxw40oRR.js → chunk-NWCAEW5Y-BgbcH0OK.js} +1 -1
  77. package/dist/src/compiled/_chunks/workflow/{dist-DlFv0aHY.js → dist-CPlyFOVo.js} +1 -1
  78. package/dist/src/compiled/_chunks/workflow/{dist-tJoQXAF6.js → dist-DpYyXbJv.js} +1 -1
  79. package/dist/src/compiled/_chunks/workflow/{dist-CRTn4Sg8.js → dist-xQXN70ED.js} +1 -1
  80. package/dist/src/compiled/_chunks/workflow/esm-seIr7a6j.js +1 -0
  81. package/dist/src/compiled/_chunks/workflow/{frames-CTpeJYEQ.js → frames-BBs-9k1d.js} +2 -2
  82. package/dist/src/compiled/_chunks/workflow/{functions-CeeNvKsq.js → functions-DAYiHNti.js} +1 -1
  83. package/dist/src/compiled/_chunks/workflow/{getMachineId-bsd-WEBNKY2R-CEYkx6Nv.js → getMachineId-bsd-WEBNKY2R-BTaxrQ52.js} +1 -1
  84. package/dist/src/compiled/_chunks/workflow/{getMachineId-darwin-LT47KAXP-DPwWlhif.js → getMachineId-darwin-LT47KAXP-DhYmwE_R.js} +1 -1
  85. package/dist/src/compiled/_chunks/workflow/{getMachineId-linux-LTVQO6VW-DAFXHwZp.js → getMachineId-linux-LTVQO6VW-Dru_L5ru.js} +1 -1
  86. package/dist/src/compiled/_chunks/workflow/{getMachineId-unsupported-UKWBA27G-BZKOI8mG.js → getMachineId-unsupported-UKWBA27G-DGfoqVW1.js} +1 -1
  87. package/dist/src/compiled/_chunks/workflow/{getMachineId-win-NLJKOPY6-r7_CJB5o.js → getMachineId-win-NLJKOPY6-CLM98q4X.js} +1 -1
  88. package/dist/src/compiled/_chunks/workflow/{private-tvMBynnC.js → private-UQtz8ZcW.js} +1 -1
  89. package/dist/src/compiled/_chunks/workflow/{resume-hook-BPQHjeY5.js → resume-hook-CYtSorp6.js} +1 -1
  90. package/dist/src/compiled/_chunks/workflow/{rolldown-runtime-DaDcL9Zw.js → rolldown-runtime-8V8biNmG.js} +1 -1
  91. package/dist/src/compiled/_chunks/workflow/{run-DQ5dOyjm.js → run-Cjo0A3NO.js} +1 -1
  92. package/dist/src/compiled/_chunks/workflow/{signal-exit-C8vsI6zj.js → signal-exit-o3IPQwwv.js} +1 -1
  93. package/dist/src/compiled/_chunks/workflow/sleep-C1P0OWBm.js +1 -0
  94. package/dist/src/compiled/_chunks/workflow/{token-DHD-q-fS.js → token-DGzfw-Vb.js} +1 -1
  95. package/dist/src/compiled/_chunks/workflow/{token-DtCUEpJs.js → token-DNbxVpeq.js} +1 -1
  96. package/dist/src/compiled/_chunks/workflow/token-util-BneBe0g5.js +27 -0
  97. package/dist/src/compiled/_chunks/workflow/{token-util-Ldar52H7.js → token-util-DjMgNdXS.js} +1 -1
  98. package/dist/src/compiled/_chunks/workflow/{undici-CUIybhQ2.js → undici-BBG5cZTy.js} +1 -1
  99. package/dist/src/compiled/_chunks/workflow/{wait-until-DK2lnH6U.js → wait-until-CT1ve8qB.js} +3 -3
  100. package/dist/src/compiled/_chunks/workflow/{wrapper-CMGju7QA.js → wrapper-CQNxP9mU.js} +3 -3
  101. package/dist/src/compiled/_chunks/workflow/{ws-transport-Csi6Cydc.js → ws-transport-beXxD0s_.js} +1 -1
  102. package/dist/src/compiled/env-runner/node-worker.js +1 -1
  103. package/dist/src/compiled/jose/index.js +1 -1
  104. package/dist/src/compiled/shadcn-registry/index.js +403 -403
  105. package/dist/src/compiler/artifacts.js +1 -1
  106. package/dist/src/compiler/compile-agent.js +2 -2
  107. package/dist/src/compiler/extension-compatibility.d.ts +20 -10
  108. package/dist/src/compiler/extension-compatibility.js +1 -1
  109. package/dist/src/compiler/manifest.js +1 -1
  110. package/dist/src/compiler/normalize-agent-config.js +1 -1
  111. package/dist/src/compiler/normalize-extension.d.ts +8 -5
  112. package/dist/src/compiler/normalize-extension.js +1 -1
  113. package/dist/src/compiler/normalize-manifest.js +1 -1
  114. package/dist/src/compiler/normalize-subagent.d.ts +1 -1
  115. package/dist/src/compiler/normalize-subagent.js +1 -1
  116. package/dist/src/context/serialized-dynamic-model-selection.d.ts +2 -0
  117. package/dist/src/context/serialized-dynamic-model-selection.js +1 -0
  118. package/dist/src/discover/discover-agent.js +1 -1
  119. package/dist/src/discover/extensions.d.ts +0 -6
  120. package/dist/src/discover/extensions.js +1 -1
  121. package/dist/src/evals/cli/eval.d.ts +1 -1
  122. package/dist/src/evals/cli/eval.js +1 -1
  123. package/dist/src/execution/agent-handle-dispatch.d.ts +15 -1
  124. package/dist/src/execution/agent-handle-dispatch.js +1 -1
  125. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  126. package/dist/src/execution/delegated-parent-notification.d.ts +17 -0
  127. package/dist/src/execution/delegated-parent-notification.js +1 -1
  128. package/dist/src/execution/deliver-payloads.js +1 -1
  129. package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +155 -0
  130. package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -0
  131. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +18 -14
  132. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  133. package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +7 -2
  134. package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -1
  135. package/dist/src/execution/effective-output-schema.d.ts +21 -0
  136. package/dist/src/execution/effective-output-schema.js +1 -0
  137. package/dist/src/execution/eve-workflow-attributes.d.ts +2 -0
  138. package/dist/src/execution/node-step.js +1 -1
  139. package/dist/src/execution/parked-delivery-wait.d.ts +8 -12
  140. package/dist/src/execution/parked-delivery-wait.js +1 -1
  141. package/dist/src/execution/{route-proxied-deliver-step.d.ts → proxied-deliver-step.d.ts} +7 -4
  142. package/dist/src/execution/proxied-deliver-step.js +1 -0
  143. package/dist/src/execution/remote-agent-dispatch.d.ts +32 -0
  144. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  145. package/dist/src/execution/remote-agent-route-url.d.ts +2 -0
  146. package/dist/src/execution/remote-agent-route-url.js +1 -0
  147. package/dist/src/execution/route-child-delivery.d.ts +2 -1
  148. package/dist/src/execution/route-child-delivery.js +1 -1
  149. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
  150. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  151. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
  152. package/dist/src/execution/sandbox/prewarm.js +1 -1
  153. package/dist/src/execution/session-callback-step.d.ts +11 -0
  154. package/dist/src/execution/session-callback-step.js +1 -1
  155. package/dist/src/execution/session-command-wire.js +1 -1
  156. package/dist/src/execution/session-state-cursor.d.ts +25 -0
  157. package/dist/src/execution/session-state-cursor.js +1 -0
  158. package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -0
  159. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  160. package/dist/src/execution/subagent-event-proxy-step.d.ts +15 -0
  161. package/dist/src/execution/subagent-event-proxy-step.js +1 -1
  162. package/dist/src/execution/subagent-hitl-proxy.d.ts +14 -7
  163. package/dist/src/execution/subagent-hitl-proxy.js +1 -1
  164. package/dist/src/execution/subagent-start-local.d.ts +29 -0
  165. package/dist/src/execution/subagent-start-local.js +1 -0
  166. package/dist/src/execution/subagent-start-remote.d.ts +23 -0
  167. package/dist/src/execution/subagent-start-remote.js +1 -0
  168. package/dist/src/execution/task-event-callback.d.ts +13 -0
  169. package/dist/src/execution/task-event-callback.js +1 -0
  170. package/dist/src/execution/task-input-capability.d.ts +4 -0
  171. package/dist/src/execution/task-input-capability.js +1 -0
  172. package/dist/src/execution/tasks/child/steps.d.ts +46 -0
  173. package/dist/src/execution/tasks/child/steps.js +1 -0
  174. package/dist/src/execution/tasks/child/workflow.d.ts +31 -0
  175. package/dist/src/execution/tasks/child/workflow.js +1 -0
  176. package/dist/src/execution/tasks/parent/agent-identity.d.ts +13 -0
  177. package/dist/src/execution/tasks/parent/agent-identity.js +1 -0
  178. package/dist/src/execution/tasks/parent/agent-views.d.ts +6 -0
  179. package/dist/src/execution/tasks/parent/agent-views.js +1 -0
  180. package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +37 -0
  181. package/dist/src/execution/tasks/parent/continuation-dispatch.js +1 -0
  182. package/dist/src/execution/tasks/parent/control-shared.d.ts +36 -0
  183. package/dist/src/execution/tasks/parent/control-shared.js +1 -0
  184. package/dist/src/execution/tasks/parent/delegate.d.ts +70 -0
  185. package/dist/src/execution/tasks/parent/delegate.js +1 -0
  186. package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +19 -0
  187. package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -0
  188. package/dist/src/execution/tasks/parent/dispatch.d.ts +33 -0
  189. package/dist/src/execution/tasks/parent/dispatch.js +1 -0
  190. package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +29 -0
  191. package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -0
  192. package/dist/src/execution/tasks/parent/run-parent.d.ts +72 -0
  193. package/dist/src/execution/tasks/parent/run-parent.js +1 -0
  194. package/dist/src/execution/tasks/parent/send.d.ts +25 -0
  195. package/dist/src/execution/tasks/parent/send.js +1 -0
  196. package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
  197. package/dist/src/execution/tasks/workflow-target.js +1 -0
  198. package/dist/src/execution/terminate-child-sessions-step.d.ts +1 -0
  199. package/dist/src/execution/terminate-child-sessions-step.js +1 -1
  200. package/dist/src/execution/turn-control-receiver.d.ts +10 -0
  201. package/dist/src/execution/turn-control-receiver.js +1 -1
  202. package/dist/src/execution/turn-dispatch.d.ts +2 -0
  203. package/dist/src/execution/turn-dispatch.js +1 -1
  204. package/dist/src/execution/turn-execution-cursor.d.ts +2 -8
  205. package/dist/src/execution/turn-execution-cursor.js +1 -1
  206. package/dist/src/execution/turn-workflow.js +1 -1
  207. package/dist/src/execution/workflow-callback-url.d.ts +5 -0
  208. package/dist/src/execution/workflow-callback-url.js +1 -1
  209. package/dist/src/execution/workflow-entry.js +1 -1
  210. package/dist/src/execution/workflow-runtime.d.ts +9 -0
  211. package/dist/src/execution/workflow-runtime.js +1 -1
  212. package/dist/src/execution/workflow-steps.d.ts +7 -21
  213. package/dist/src/execution/workflow-steps.js +1 -1
  214. package/dist/src/harness/advertised-tools.js +1 -1
  215. package/dist/src/harness/authorization.js +1 -1
  216. package/dist/src/harness/execute-tool.d.ts +7 -0
  217. package/dist/src/harness/handles/prompt.d.ts +12 -0
  218. package/dist/src/harness/handles/prompt.js +2 -1
  219. package/dist/src/harness/handles/query.js +1 -1
  220. package/dist/src/harness/handles/store.d.ts +9 -2
  221. package/dist/src/harness/handles/store.js +1 -1
  222. package/dist/src/harness/handles/transitions.d.ts +10 -1
  223. package/dist/src/harness/handles/transitions.js +1 -1
  224. package/dist/src/harness/instrumentation/providers.js +1 -1
  225. package/dist/src/harness/instrumentation/runtime-context.d.ts +2 -0
  226. package/dist/src/harness/instrumentation/runtime-context.js +1 -1
  227. package/dist/src/harness/instrumentation/runtime.d.ts +3 -1
  228. package/dist/src/harness/proxy-input-requests.d.ts +21 -4
  229. package/dist/src/harness/proxy-input-requests.js +1 -1
  230. package/dist/src/harness/runtime-actions.d.ts +2 -0
  231. package/dist/src/harness/runtime-actions.js +1 -1
  232. package/dist/src/harness/session-limit-enforcement.js +1 -1
  233. package/dist/src/harness/tool-loop.js +2 -2
  234. package/dist/src/harness/workflow-runtime-action-state.js +1 -1
  235. package/dist/src/internal/application/cache-metadata.js +1 -1
  236. package/dist/src/internal/application/compiled-artifacts.js +2 -2
  237. package/dist/src/internal/application/optional-package-install.js +1 -1
  238. package/dist/src/internal/application/output-publication-lock.js +1 -1
  239. package/dist/src/internal/application/package.js +1 -1
  240. package/dist/src/internal/application/paths.js +1 -1
  241. package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
  242. package/dist/src/internal/authored-definition/core.js +1 -1
  243. package/dist/src/internal/authored-module-evaluation-error.js +4 -4
  244. package/dist/src/internal/authored-module-loader.js +3 -3
  245. package/dist/src/internal/authored-package-boundary.js +1 -1
  246. package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
  247. package/dist/src/internal/bundler/extension-scope-plugin.js +1 -1
  248. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  249. package/dist/src/internal/instrumentation-layout.js +1 -1
  250. package/dist/src/internal/invocation/agent-invocation.d.ts +54 -0
  251. package/dist/src/internal/invocation/agent-invocation.js +1 -0
  252. package/dist/src/internal/invocation/attributes.d.ts +2 -0
  253. package/dist/src/internal/invocation/attributes.js +1 -0
  254. package/dist/src/internal/invocation/metadata.d.ts +9 -0
  255. package/dist/src/internal/invocation/metadata.js +1 -0
  256. package/dist/src/internal/invocation/workflow-execution.d.ts +32 -0
  257. package/dist/src/internal/invocation/workflow-execution.js +1 -0
  258. package/dist/src/internal/materialized-authored-modules.js +1 -1
  259. package/dist/src/internal/mcp/http-security.d.ts +12 -0
  260. package/dist/src/internal/mcp/http-security.js +1 -0
  261. package/dist/src/internal/mcp/protected-resource.d.ts +9 -0
  262. package/dist/src/internal/mcp/protected-resource.js +1 -0
  263. package/dist/src/internal/mcp/streamable-http-server.d.ts +51 -0
  264. package/dist/src/internal/mcp/streamable-http-server.js +1 -0
  265. package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
  266. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
  267. package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
  268. package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -1
  269. package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
  270. package/dist/src/internal/nitro/host/application-route-registry.d.ts +88 -0
  271. package/dist/src/internal/nitro/host/application-route-registry.js +1 -0
  272. package/dist/src/internal/nitro/host/build-application.js +1 -1
  273. package/dist/src/internal/nitro/host/build-extension.js +1 -1
  274. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
  275. package/dist/src/internal/nitro/host/channel-routes.d.ts +4 -11
  276. package/dist/src/internal/nitro/host/channel-routes.js +3 -3
  277. package/dist/src/internal/nitro/host/configure-nitro-routes.js +3 -3
  278. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  279. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  280. package/dist/src/internal/nitro/host/dev-runner.js +1 -1
  281. package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
  282. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  283. package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
  284. package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -1
  285. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  286. package/dist/src/internal/nitro/host/start-production-server.js +2 -2
  287. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
  288. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  289. package/dist/src/internal/nitro/routes/channel-route-context.d.ts +14 -0
  290. package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
  291. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -0
  292. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
  293. package/dist/src/internal/process/pnpm.js +1 -1
  294. package/dist/src/internal/vercel-agent-summary.d.ts +1 -1
  295. package/dist/src/internal/workflow/development-world-client.js +1 -1
  296. package/dist/src/internal/workflow/development-world-server.js +1 -1
  297. package/dist/src/internal/workflow-bundle/builder-support.d.ts +12 -8
  298. package/dist/src/internal/workflow-bundle/builder-support.js +8 -7
  299. package/dist/src/internal/workflow-bundle/builder.d.ts +1 -1
  300. package/dist/src/internal/workflow-bundle/builder.js +2 -3
  301. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  302. package/dist/src/protocol/message.d.ts +28 -0
  303. package/dist/src/protocol/message.js +2 -2
  304. package/dist/src/protocol/routes.d.ts +14 -0
  305. package/dist/src/protocol/routes.js +1 -1
  306. package/dist/src/public/channels/auth.d.ts +36 -0
  307. package/dist/src/public/channels/auth.js +1 -1
  308. package/dist/src/public/channels/discord/discordChannel.d.ts +2 -0
  309. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  310. package/dist/src/public/channels/eve.d.ts +2 -0
  311. package/dist/src/public/channels/eve.js +1 -1
  312. package/dist/src/public/channels/github/dispatch.js +1 -1
  313. package/dist/src/public/channels/github/githubChannel.d.ts +2 -0
  314. package/dist/src/public/channels/linear/linearChannel.d.ts +2 -0
  315. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  316. package/dist/src/public/channels/mcp.d.ts +19 -0
  317. package/dist/src/public/channels/mcp.js +1 -0
  318. package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +2 -0
  319. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  320. package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
  321. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  322. package/dist/src/public/channels/teams/teamsChannel.d.ts +2 -0
  323. package/dist/src/public/channels/teams/teamsChannel.js +1 -1
  324. package/dist/src/public/channels/telegram/telegramChannel.d.ts +2 -0
  325. package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
  326. package/dist/src/public/channels/twilio/twilioChannel.d.ts +2 -0
  327. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  328. package/dist/src/public/definitions/channel.d.ts +2 -2
  329. package/dist/src/public/definitions/channel.js +1 -1
  330. package/dist/src/public/instrumentation/index.d.ts +9 -3
  331. package/dist/src/public/next/server.js +1 -1
  332. package/dist/src/public/nuxt/dev-server.js +1 -1
  333. package/dist/src/public/sveltekit/dev-server.js +1 -1
  334. package/dist/src/react/use-eve-agent.d.ts +4 -4
  335. package/dist/src/react/use-eve-agent.js +1 -1
  336. package/dist/src/runtime/actions/types.d.ts +9 -0
  337. package/dist/src/runtime/actions/types.js +1 -1
  338. package/dist/src/runtime/agent/bootstrap.js +1 -1
  339. package/dist/src/runtime/connections/authorization-complete-page.js +70 -28
  340. package/dist/src/runtime/framework-channels/index.js +1 -1
  341. package/dist/src/runtime/framework-tools/index.js +1 -1
  342. package/dist/src/runtime/framework-tools/tasks.d.ts +95 -0
  343. package/dist/src/runtime/framework-tools/tasks.js +1 -0
  344. package/dist/src/runtime/prompt/compose.d.ts +1 -0
  345. package/dist/src/runtime/prompt/compose.js +1 -1
  346. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  347. package/dist/src/runtime/resolve-agent.js +1 -1
  348. package/dist/src/runtime/session-callback-route.js +1 -1
  349. package/dist/src/runtime/task-input-response-route.d.ts +5 -0
  350. package/dist/src/runtime/task-input-response-route.js +1 -0
  351. package/dist/src/services/inspect-application.js +1 -1
  352. package/dist/src/setup/primitives/pm/pnpm.js +2 -2
  353. package/dist/src/setup/primitives/run-vercel.js +1 -1
  354. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  355. package/dist/src/setup/scaffold/create/extension.js +1 -1
  356. package/dist/src/setup/scaffold/create/project.js +1 -1
  357. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  358. package/dist/src/setup/scaffold/create/web-template.js +8 -86
  359. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  360. package/dist/src/setup/scaffold/workspace-root.js +1 -1
  361. package/dist/src/shared/agent-definition.d.ts +7 -0
  362. package/dist/src/svelte/index.js +1 -1
  363. package/dist/src/svelte/use-eve-agent.d.ts +3 -3
  364. package/dist/src/svelte/use-eve-agent.js +1 -1
  365. package/dist/src/tasks/json.d.ts +88 -0
  366. package/dist/src/tasks/json.js +1 -0
  367. package/dist/src/tasks/session-index.d.ts +48 -0
  368. package/dist/src/tasks/session-index.js +1 -0
  369. package/dist/src/tasks/task-id.d.ts +34 -0
  370. package/dist/src/tasks/task-id.js +1 -0
  371. package/dist/src/tasks/transitions.d.ts +23 -0
  372. package/dist/src/tasks/transitions.js +1 -0
  373. package/dist/src/tasks/types.d.ts +295 -0
  374. package/dist/src/tasks/types.js +1 -0
  375. package/dist/src/tasks/wire.d.ts +26 -0
  376. package/dist/src/tasks/wire.js +1 -0
  377. package/dist/src/tracing/install-instrumentation-runtime.d.ts +2 -1
  378. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  379. package/dist/src/tracing/otel-declaration.d.ts +32 -3
  380. package/dist/src/tracing/otel-declaration.js +1 -1
  381. package/dist/src/tracing/otel-registration.js +1 -1
  382. package/dist/src/vue/index.js +1 -1
  383. package/dist/src/vue/use-eve-agent.d.ts +3 -3
  384. package/dist/src/vue/use-eve-agent.js +1 -1
  385. package/docs/channels/custom.mdx +1 -1
  386. package/docs/channels/discord.mdx +1 -1
  387. package/docs/channels/eve.mdx +15 -2
  388. package/docs/channels/github.mdx +1 -1
  389. package/docs/channels/linear.mdx +1 -1
  390. package/docs/channels/overview.mdx +1 -1
  391. package/docs/channels/photon.mdx +1 -1
  392. package/docs/channels/slack.mdx +1 -1
  393. package/docs/channels/teams.mdx +1 -1
  394. package/docs/channels/telegram.mdx +1 -1
  395. package/docs/channels/twilio.mdx +1 -1
  396. package/docs/extensions.md +10 -6
  397. package/docs/guides/client/streaming.mdx +7 -6
  398. package/docs/guides/frontend/overview.mdx +10 -8
  399. package/docs/guides/frontend/use-eve-agent-svelte.mdx +10 -10
  400. package/docs/guides/frontend/use-eve-agent-vue.mdx +10 -10
  401. package/docs/install-integrations.mdx +4 -0
  402. package/docs/reference/cli.md +1 -1
  403. package/docs/schedules.mdx +2 -2
  404. package/docs/tools/human-in-the-loop.md +3 -1
  405. package/package.json +7 -1
  406. package/dist/src/compiled/_chunks/workflow/chunk-5MU5Z6L3-CaJgXkVg.js +0 -1
  407. package/dist/src/compiled/_chunks/workflow/sleep-CzdoBiqy.js +0 -1
  408. package/dist/src/compiled/_chunks/workflow/src-Cj3P1ChQ.js +0 -1
  409. package/dist/src/compiled/_chunks/workflow/token-util-DNwIAn_u.js +0 -27
  410. package/dist/src/execution/route-proxied-deliver-step.js +0 -1
@@ -1 +1 @@
1
- import{i as e,t}from"./rolldown-runtime-DaDcL9Zw.js";var n=t(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{VercelOidcTokenError:()=>u}),t.exports=c(l);var u=class extends Error{constructor(e,t){super(e),this.name=`VercelOidcTokenError`,this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}};0&&(t.exports={VercelOidcTokenError:u})})),r=t(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>u,RefreshAccessTokenFailedError:()=>d}),t.exports=c(l);var u=class extends Error{constructor(){super(`No authentication found. Please log in with the Vercel CLI (vercel login).`),this.name=`AccessTokenMissingError`}},d=class extends Error{constructor(e){super(`Failed to refresh authentication token.`,{cause:e}),this.name=`RefreshAccessTokenFailedError`}};0&&(t.exports={AccessTokenMissingError:u,RefreshAccessTokenFailedError:d})})),i=t(((t,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{findRootDir:()=>y,getUserDataDir:()=>b}),r.exports=p(m);var h=f(e(`path`)),g=f(e(`fs`)),_=f(e(`os`)),v=n();function y(){try{let e=process.cwd();for(;e!==h.default.dirname(e);){let t=h.default.join(e,`.vercel`);if(g.default.existsSync(t))return e;e=h.default.dirname(e)}}catch{throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`)}return null}function b(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(_.default.platform()){case`darwin`:return h.default.join(_.default.homedir(),`Library/Application Support`);case`linux`:return h.default.join(_.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}0&&(r.exports={findRootDir:y,getUserDataDir:b})})),a=t(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!l.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:r(c(e)),d(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(i({},`__esModule`,{value:!0}),e),m={};u(m,{isValidAccessToken:()=>x,readAuthConfig:()=>y,writeAuthConfig:()=>b}),n.exports=p(m);var h=f(e(`fs`)),g=f(e(`path`)),_=s();function v(){let e=(0,_.getVercelDataDir)();if(!e)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return g.join(e,`auth.json`)}function y(){try{let e=v();if(!h.existsSync(e))return null;let t=h.readFileSync(e,`utf8`);return t?JSON.parse(t):null}catch{return null}}function b(e){let t=v(),n=g.dirname(t);h.existsSync(n)||h.mkdirSync(n,{mode:504,recursive:!0}),h.writeFileSync(t,JSON.stringify(e,null,2),{mode:384})}function x(e,t=0){if(!e.token)return!1;if(typeof e.expiresAt!=`number`)return!0;let n=Math.floor(Date.now()/1e3),r=t/1e3;return e.expiresAt>=n+r}0&&(n.exports={isValidAccessToken:x,readAuthConfig:y,writeAuthConfig:b})})),o=t(((t,n)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{processTokenResponse:()=>g,refreshTokenRequest:()=>h}),n.exports=l(u);var d=e(`os`);let f=`@vercel/oidc node-${process.version} ${(0,d.platform)()} (${(0,d.arch)()}) ${(0,d.hostname)()}`,p=null;async function m(){if(p)return p;let e=await fetch(`https://vercel.com/.well-known/openid-configuration`,{headers:{"user-agent":f}});if(!e.ok)throw Error(`Failed to discover OAuth endpoints`);let t=await e.json();if(!t||typeof t.token_endpoint!=`string`)throw Error(`Invalid OAuth discovery response`);let n=t.token_endpoint;return p=n,n}async function h(e){let t=await m();return await fetch(t,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,"user-agent":f},body:new URLSearchParams({client_id:`cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`,grant_type:`refresh_token`,...e})})}async function g(e){let t=await e.json();if(!e.ok){let e=typeof t==`object`&&t&&`error`in t?String(t.error):`Token refresh failed`;return[Error(e)]}return typeof t!=`object`||!t?[Error(`Invalid token response`)]:typeof t.access_token==`string`?t.token_type===`Bearer`?typeof t.expires_in==`number`?[null,t]:[Error(`Missing expires_in in response`)]:[Error(`Invalid token_type in response`)]:[Error(`Missing access_token in response`)]}0&&(n.exports={processTokenResponse:g,refreshTokenRequest:h})})),s=t(((t,s)=>{var c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,m=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of d(t))!p.call(e,i)&&i!==n&&l(e,i,{get:()=>t[i],enumerable:!(r=u(t,i))||r.enumerable});return e},g=(e,t,n)=>(n=e==null?{}:c(f(e)),h(t||!e||!e.__esModule?l(n,`default`,{value:e,enumerable:!0}):n,e)),_=e=>h(l({},`__esModule`,{value:!0}),e),v={};m(v,{assertVercelOidcTokenResponse:()=>k,findProjectInfo:()=>A,getTokenPayload:()=>N,getVercelDataDir:()=>E,getVercelOidcToken:()=>O,getVercelToken:()=>D,isExpired:()=>P,loadToken:()=>M,saveToken:()=>j}),s.exports=_(v);var y=g(e(`path`)),b=g(e(`fs`)),x=n(),S=i(),C=a(),w=o(),T=r();function E(){let e=(0,S.getUserDataDir)();return e?y.join(e,`com.vercel.cli`):null}async function D(e){let t=(0,C.readAuthConfig)();if(!t?.token)throw new T.AccessTokenMissingError;if((0,C.isValidAccessToken)(t,e?.expirationBufferMs))return t.token;if(!t.refreshToken)throw(0,C.writeAuthConfig)({}),new T.RefreshAccessTokenFailedError(`No refresh token available`);try{let e=await(0,w.refreshTokenRequest)({refresh_token:t.refreshToken}),[n,r]=await(0,w.processTokenResponse)(e);if(n||!r)throw(0,C.writeAuthConfig)({}),new T.RefreshAccessTokenFailedError(n);let i={token:r.access_token,expiresAt:Math.floor(Date.now()/1e3)+r.expires_in};return r.refresh_token&&(i.refreshToken=r.refresh_token),(0,C.writeAuthConfig)(i),i.token}catch(e){throw(0,C.writeAuthConfig)({}),e instanceof T.AccessTokenMissingError||e instanceof T.RefreshAccessTokenFailedError?e:new T.RefreshAccessTokenFailedError(e)}}async function O(e,t,n){let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new x.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return k(a),a}function k(e){if(!e||typeof e!=`object`)throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!(`token`in e)||typeof e.token!=`string`)throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function A(){let e=(0,S.findRootDir)();if(!e)throw new x.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let t=y.join(e,`.vercel`,`project.json`);if(!b.existsSync(t))throw new x.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let n=JSON.parse(b.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:n.projectId,teamId:n.orgId}}function j(e,t){let n=(0,S.getUserDataDir)();if(!n)throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`);let r=y.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);b.mkdirSync(y.dirname(r),{mode:504,recursive:!0}),b.writeFileSync(r,i),b.chmodSync(r,432)}function M(e){let t=(0,S.getUserDataDir)();if(!t)throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`);let n=y.join(t,`com.vercel.token`,`${e}.json`);if(!b.existsSync(n))return null;let r=JSON.parse(b.readFileSync(n,`utf8`));return k(r),r}function N(e){let t=e.split(`.`);if(t.length!==3)throw new x.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function P(e,t=0){return e.exp*1e3<Date.now()+t}0&&(s.exports={assertVercelOidcTokenResponse:k,findProjectInfo:A,getTokenPayload:N,getVercelDataDir:E,getVercelOidcToken:O,getVercelToken:D,isExpired:P,loadToken:M,saveToken:j})}));export{r as n,n as r,s as t};
1
+ import{i as e,t}from"./rolldown-runtime-8V8biNmG.js";var n=t(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{VercelOidcTokenError:()=>u}),t.exports=c(l);var u=class extends Error{constructor(e,t){super(e),this.name=`VercelOidcTokenError`,this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}};0&&(t.exports={VercelOidcTokenError:u})})),r=t(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>u,RefreshAccessTokenFailedError:()=>d}),t.exports=c(l);var u=class extends Error{constructor(){super(`No authentication found. Please log in with the Vercel CLI (vercel login).`),this.name=`AccessTokenMissingError`}},d=class extends Error{constructor(e){super(`Failed to refresh authentication token.`,{cause:e}),this.name=`RefreshAccessTokenFailedError`}};0&&(t.exports={AccessTokenMissingError:u,RefreshAccessTokenFailedError:d})})),i=t(((t,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{findRootDir:()=>y,getUserDataDir:()=>b}),r.exports=p(m);var h=f(e(`path`)),g=f(e(`fs`)),_=f(e(`os`)),v=n();function y(){try{let e=process.cwd();for(;e!==h.default.dirname(e);){let t=h.default.join(e,`.vercel`);if(g.default.existsSync(t))return e;e=h.default.dirname(e)}}catch{throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`)}return null}function b(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(_.default.platform()){case`darwin`:return h.default.join(_.default.homedir(),`Library/Application Support`);case`linux`:return h.default.join(_.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}0&&(r.exports={findRootDir:y,getUserDataDir:b})})),a=t(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!l.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:r(c(e)),d(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(i({},`__esModule`,{value:!0}),e),m={};u(m,{isValidAccessToken:()=>x,readAuthConfig:()=>y,writeAuthConfig:()=>b}),n.exports=p(m);var h=f(e(`fs`)),g=f(e(`path`)),_=s();function v(){let e=(0,_.getVercelDataDir)();if(!e)throw Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);return g.join(e,`auth.json`)}function y(){try{let e=v();if(!h.existsSync(e))return null;let t=h.readFileSync(e,`utf8`);return t?JSON.parse(t):null}catch{return null}}function b(e){let t=v(),n=g.dirname(t);h.existsSync(n)||h.mkdirSync(n,{mode:504,recursive:!0}),h.writeFileSync(t,JSON.stringify(e,null,2),{mode:384})}function x(e,t=0){if(!e.token)return!1;if(typeof e.expiresAt!=`number`)return!0;let n=Math.floor(Date.now()/1e3),r=t/1e3;return e.expiresAt>=n+r}0&&(n.exports={isValidAccessToken:x,readAuthConfig:y,writeAuthConfig:b})})),o=t(((t,n)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{processTokenResponse:()=>g,refreshTokenRequest:()=>h}),n.exports=l(u);var d=e(`os`);let f=`@vercel/oidc node-${process.version} ${(0,d.platform)()} (${(0,d.arch)()}) ${(0,d.hostname)()}`,p=null;async function m(){if(p)return p;let e=await fetch(`https://vercel.com/.well-known/openid-configuration`,{headers:{"user-agent":f}});if(!e.ok)throw Error(`Failed to discover OAuth endpoints`);let t=await e.json();if(!t||typeof t.token_endpoint!=`string`)throw Error(`Invalid OAuth discovery response`);let n=t.token_endpoint;return p=n,n}async function h(e){let t=await m();return await fetch(t,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,"user-agent":f},body:new URLSearchParams({client_id:`cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp`,grant_type:`refresh_token`,...e})})}async function g(e){let t=await e.json();if(!e.ok){let e=typeof t==`object`&&t&&`error`in t?String(t.error):`Token refresh failed`;return[Error(e)]}return typeof t!=`object`||!t?[Error(`Invalid token response`)]:typeof t.access_token==`string`?t.token_type===`Bearer`?typeof t.expires_in==`number`?[null,t]:[Error(`Missing expires_in in response`)]:[Error(`Invalid token_type in response`)]:[Error(`Missing access_token in response`)]}0&&(n.exports={processTokenResponse:g,refreshTokenRequest:h})})),s=t(((t,s)=>{var c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,m=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of d(t))!p.call(e,i)&&i!==n&&l(e,i,{get:()=>t[i],enumerable:!(r=u(t,i))||r.enumerable});return e},g=(e,t,n)=>(n=e==null?{}:c(f(e)),h(t||!e||!e.__esModule?l(n,`default`,{value:e,enumerable:!0}):n,e)),_=e=>h(l({},`__esModule`,{value:!0}),e),v={};m(v,{assertVercelOidcTokenResponse:()=>k,findProjectInfo:()=>A,getTokenPayload:()=>N,getVercelDataDir:()=>E,getVercelOidcToken:()=>O,getVercelToken:()=>D,isExpired:()=>P,loadToken:()=>M,saveToken:()=>j}),s.exports=_(v);var y=g(e(`path`)),b=g(e(`fs`)),x=n(),S=i(),C=a(),w=o(),T=r();function E(){let e=(0,S.getUserDataDir)();return e?y.join(e,`com.vercel.cli`):null}async function D(e){let t=(0,C.readAuthConfig)();if(!t?.token)throw new T.AccessTokenMissingError;if((0,C.isValidAccessToken)(t,e?.expirationBufferMs))return t.token;if(!t.refreshToken)throw(0,C.writeAuthConfig)({}),new T.RefreshAccessTokenFailedError(`No refresh token available`);try{let e=await(0,w.refreshTokenRequest)({refresh_token:t.refreshToken}),[n,r]=await(0,w.processTokenResponse)(e);if(n||!r)throw(0,C.writeAuthConfig)({}),new T.RefreshAccessTokenFailedError(n);let i={token:r.access_token,expiresAt:Math.floor(Date.now()/1e3)+r.expires_in};return r.refresh_token&&(i.refreshToken=r.refresh_token),(0,C.writeAuthConfig)(i),i.token}catch(e){throw(0,C.writeAuthConfig)({}),e instanceof T.AccessTokenMissingError||e instanceof T.RefreshAccessTokenFailedError?e:new T.RefreshAccessTokenFailedError(e)}}async function O(e,t,n){let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new x.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return k(a),a}function k(e){if(!e||typeof e!=`object`)throw TypeError("Vercel OIDC token is malformed. Expected an object. Please run `vc env pull` and try again");if(!(`token`in e)||typeof e.token!=`string`)throw TypeError("Vercel OIDC token is malformed. Expected a string-valued token property. Please run `vc env pull` and try again")}function A(){let e=(0,S.findRootDir)();if(!e)throw new x.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");let t=y.join(e,`.vercel`,`project.json`);if(!b.existsSync(t))throw new x.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");let n=JSON.parse(b.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");return{projectId:n.projectId,teamId:n.orgId}}function j(e,t){let n=(0,S.getUserDataDir)();if(!n)throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`);let r=y.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);b.mkdirSync(y.dirname(r),{mode:504,recursive:!0}),b.writeFileSync(r,i),b.chmodSync(r,432)}function M(e){let t=(0,S.getUserDataDir)();if(!t)throw new x.VercelOidcTokenError(`Unable to find user data directory. Please reach out to Vercel support.`);let n=y.join(t,`com.vercel.token`,`${e}.json`);if(!b.existsSync(n))return null;let r=JSON.parse(b.readFileSync(n,`utf8`));return k(r),r}function N(e){let t=e.split(`.`);if(t.length!==3)throw new x.VercelOidcTokenError("Invalid token. Please run `vc env pull` and try again");let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function P(e,t=0){return e.exp*1e3<Date.now()+t}0&&(s.exports={assertVercelOidcTokenResponse:k,findProjectInfo:A,getTokenPayload:N,getVercelDataDir:E,getVercelOidcToken:O,getVercelToken:D,isExpired:P,loadToken:M,saveToken:j})}));export{r as n,n as r,s as t};