eve 0.27.4 → 0.27.6

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 (266) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/src/channel/forwarded-principal.d.ts +74 -0
  3. package/dist/src/channel/forwarded-principal.js +1 -0
  4. package/dist/src/channel/routes.d.ts +7 -0
  5. package/dist/src/channel/send.js +1 -1
  6. package/dist/src/chunks/{use-eve-agent-BtkhbY2I.js → use-eve-agent-COlXhAaF.js} +1 -1
  7. package/dist/src/chunks/{use-eve-agent-NUjD28Iu.js → use-eve-agent-DzVlKcUV.js} +1 -1
  8. package/dist/src/cli/commands/channels.d.ts +5 -2
  9. package/dist/src/cli/commands/channels.js +1 -1
  10. package/dist/src/cli/dev/local-server-child.d.ts +1 -0
  11. package/dist/src/cli/dev/local-server-child.js +1 -0
  12. package/dist/src/cli/dev/local-server-cleanup.d.ts +5 -0
  13. package/dist/src/cli/dev/local-server-cleanup.js +1 -0
  14. package/dist/src/cli/dev/local-server-process.d.ts +35 -0
  15. package/dist/src/cli/dev/local-server-process.js +1 -0
  16. package/dist/src/cli/dev/tui/remote-auth.js +1 -1
  17. package/dist/src/cli/dev/tui/runner.d.ts +4 -0
  18. package/dist/src/cli/dev/tui/runner.js +1 -1
  19. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -0
  20. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
  21. package/dist/src/cli/dev/tui/tui.d.ts +2 -0
  22. package/dist/src/cli/dev/tui/tui.js +1 -1
  23. package/dist/src/cli/dev/wait-for-ui.d.ts +13 -0
  24. package/dist/src/cli/dev/wait-for-ui.js +1 -0
  25. package/dist/src/cli/run.js +2 -2
  26. package/dist/src/cli/shutdown.d.ts +23 -0
  27. package/dist/src/cli/shutdown.js +1 -0
  28. package/dist/src/client/client.js +1 -1
  29. package/dist/src/client/types.d.ts +2 -1
  30. package/dist/src/compiled/@workflow/core/index.js +1 -1
  31. package/dist/src/compiled/@workflow/core/runtime.js +1 -1
  32. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  33. package/dist/src/compiled/_chunks/workflow/{attribute-changes-Dk1fP6vt.js → attribute-changes-CB7nRYoY.js} +1 -1
  34. package/dist/src/compiled/_chunks/workflow/{functions-Dv8dc_-I.js → functions-DareOZz_.js} +1 -1
  35. package/dist/src/compiled/_chunks/workflow/{resume-hook-czpG5xnP.js → resume-hook-g1vh0WRC.js} +1 -1
  36. package/dist/src/compiled/_chunks/workflow/{run-6zaMjFY6.js → run-lsS-QDok.js} +1 -1
  37. package/dist/src/compiled/_chunks/workflow/{sleep-B2u06FWc.js → sleep-BXg5I9l2.js} +1 -1
  38. package/dist/src/compiled/_chunks/workflow/wrapper-DnoQohyD.js +8 -0
  39. package/dist/src/compiler/normalize-subagent.js +1 -1
  40. package/dist/src/evals/autoevals-client.js +1 -1
  41. package/dist/src/evals/cli/eval.js +2 -2
  42. package/dist/src/evals/expect/index.js +1 -1
  43. package/dist/src/evals/judge.js +1 -1
  44. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
  45. package/dist/src/execution/remote-agent-dispatch.d.ts +5 -1
  46. package/dist/src/execution/remote-agent-dispatch.js +1 -1
  47. package/dist/src/execution/sandbox/bash-tool.js +1 -1
  48. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  49. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
  50. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
  51. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  52. package/dist/src/execution/sandbox/ensure.js +1 -1
  53. package/dist/src/execution/subagent-invocation.d.ts +10 -0
  54. package/dist/src/execution/subagent-invocation.js +2 -2
  55. package/dist/src/execution/subagent-tool.js +1 -1
  56. package/dist/src/internal/application/optional-package-install.js +1 -1
  57. package/dist/src/internal/application/package.js +1 -1
  58. package/dist/src/internal/authored-module-map-loader.js +1 -1
  59. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  60. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  61. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  62. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  63. package/dist/src/node_modules/.pnpm/{autoevals@0.0.132_ws@8.21.1 → autoevals@0.0.132_ws@8.21.1_bufferutil@4.1.0_}/node_modules/autoevals/jsdist/index.js +1 -1
  64. package/dist/src/public/channels/eve.d.ts +20 -0
  65. package/dist/src/public/channels/eve.js +1 -1
  66. package/dist/src/public/channels/slack/index.d.ts +1 -1
  67. package/dist/src/public/channels/slack/interactions.d.ts +2 -1
  68. package/dist/src/public/channels/slack/interactions.js +1 -1
  69. package/dist/src/public/channels/slack/slackChannel.d.ts +24 -1
  70. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  71. package/dist/src/public/definitions/remote-agent.d.ts +15 -0
  72. package/dist/src/public/sandbox/backends/default.js +1 -1
  73. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  74. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  75. package/dist/src/runtime/types.d.ts +1 -0
  76. package/dist/src/setup/boxes/add-channels.d.ts +9 -7
  77. package/dist/src/setup/boxes/add-channels.js +2 -2
  78. package/dist/src/setup/boxes/select-channels.d.ts +4 -5
  79. package/dist/src/setup/channel-setup-deployment.d.ts +11 -0
  80. package/dist/src/setup/channel-setup-deployment.js +1 -0
  81. package/dist/src/setup/channel-setup-environment.d.ts +16 -0
  82. package/dist/src/setup/channel-setup-environment.js +1 -0
  83. package/dist/src/setup/channel-setup-integration.d.ts +31 -0
  84. package/dist/src/setup/channel-setup-integration.js +1 -0
  85. package/dist/src/setup/channel-setup-integrations.d.ts +7 -0
  86. package/dist/src/setup/channel-setup-integrations.js +1 -0
  87. package/dist/src/setup/channel-setup-runner.d.ts +7 -0
  88. package/dist/src/setup/channel-setup-runner.js +1 -0
  89. package/dist/src/setup/channel-setup-slack.d.ts +3 -0
  90. package/dist/src/setup/channel-setup-slack.js +1 -0
  91. package/dist/src/setup/channel-setup-ui.d.ts +18 -0
  92. package/dist/src/setup/channel-setup-ui.js +2 -0
  93. package/dist/src/setup/channel-setup-web.d.ts +3 -0
  94. package/dist/src/setup/channel-setup-web.js +1 -0
  95. package/dist/src/setup/flows/channels.d.ts +5 -10
  96. package/dist/src/setup/flows/channels.js +1 -1
  97. package/dist/src/setup/flows/install-vercel-cli.js +1 -1
  98. package/dist/src/setup/flows/login.js +1 -1
  99. package/dist/src/setup/index.js +1 -1
  100. package/dist/src/setup/scaffold/channels-catalog.d.ts +0 -2
  101. package/dist/src/setup/scaffold/channels-catalog.js +1 -1
  102. package/dist/src/setup/scaffold/create/project.js +1 -1
  103. package/dist/src/setup/scaffold/update/channels.d.ts +5 -3
  104. package/dist/src/setup/scaffold/update/channels.js +5 -2
  105. package/dist/src/setup/slack-connect-lifecycle.d.ts +3 -2
  106. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  107. package/dist/src/setup/slack-connect.d.ts +2 -0
  108. package/dist/src/setup/slack-connect.js +1 -1
  109. package/dist/src/setup/slackbot.d.ts +4 -0
  110. package/dist/src/setup/slackbot.js +1 -1
  111. package/dist/src/svelte/index.js +1 -1
  112. package/dist/src/svelte/use-eve-agent.js +1 -1
  113. package/dist/src/vue/index.js +1 -1
  114. package/dist/src/vue/use-eve-agent.js +1 -1
  115. package/docs/channels/slack.mdx +24 -2
  116. package/docs/guides/auth-and-route-protection.md +20 -0
  117. package/docs/guides/client/overview.mdx +2 -0
  118. package/docs/guides/remote-agents.md +31 -8
  119. package/docs/reference/cli.md +1 -1
  120. package/package.json +1 -1
  121. package/dist/src/compiled/_chunks/workflow/wrapper-Cc2otuUR.js +0 -6
  122. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -0
  123. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/auth/workload-identity-auth.js +0 -0
  124. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/azure.js +0 -0
  125. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/client.js +0 -0
  126. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/api-promise.js +0 -0
  127. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/error.js +0 -0
  128. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/pagination.js +0 -0
  129. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/resource.js +0 -0
  130. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/streaming.js +0 -0
  131. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/uploads.js +0 -0
  132. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/error.js +0 -0
  133. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/index.js +0 -0
  134. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/decoders/line.js +0 -0
  135. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/detect-platform.js +0 -0
  136. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/errors.js +0 -0
  137. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/headers.js +0 -0
  138. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/parse.js +0 -0
  139. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/formats.js +0 -0
  140. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/stringify.js +0 -0
  141. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/utils.js +0 -0
  142. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/request-options.js +0 -0
  143. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/shims.js +0 -0
  144. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/to-file.js +0 -0
  145. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/tslib.js +0 -0
  146. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/uploads.js +0 -0
  147. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/base64.js +0 -0
  148. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/bytes.js +0 -0
  149. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/env.js +0 -0
  150. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/log.js +0 -0
  151. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/path.js +0 -0
  152. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/query.js +0 -0
  153. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/sleep.js +0 -0
  154. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/uuid.js +0 -0
  155. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/values.js +0 -0
  156. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils.js +0 -0
  157. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -0
  158. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/AssistantStream.js +0 -0
  159. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionRunner.js +0 -0
  160. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStream.js +0 -0
  161. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -0
  162. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/EventStream.js +0 -0
  163. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ResponsesParser.js +0 -0
  164. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/RunnableFunction.js +0 -0
  165. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/Util.js +0 -0
  166. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/chatCompletionUtils.js +0 -0
  167. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/parser.js +0 -0
  168. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/responses/ResponseStream.js +0 -0
  169. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/admin.js +0 -0
  170. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -0
  171. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/audit-logs.js +0 -0
  172. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/certificates.js +0 -0
  173. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/data-retention.js +0 -0
  174. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/groups.js +0 -0
  175. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/roles.js +0 -0
  176. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/users.js +0 -0
  177. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/invites.js +0 -0
  178. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/organization.js +0 -0
  179. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -0
  180. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -0
  181. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -0
  182. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -0
  183. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -0
  184. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -0
  185. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -0
  186. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/projects.js +0 -0
  187. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -0
  188. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/roles.js +0 -0
  189. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/service-accounts.js +0 -0
  190. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -0
  191. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -0
  192. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -0
  193. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/roles.js +0 -0
  194. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -0
  195. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/usage.js +0 -0
  196. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/roles.js +0 -0
  197. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/users.js +0 -0
  198. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/audio.js +0 -0
  199. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/speech.js +0 -0
  200. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/transcriptions.js +0 -0
  201. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/translations.js +0 -0
  202. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/batches.js +0 -0
  203. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/assistants.js +0 -0
  204. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/beta.js +0 -0
  205. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -0
  206. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/sessions.js +0 -0
  207. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/threads.js +0 -0
  208. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/realtime.js +0 -0
  209. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/sessions.js +0 -0
  210. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/transcription-sessions.js +0 -0
  211. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/messages.js +0 -0
  212. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/runs.js +0 -0
  213. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/steps.js +0 -0
  214. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/threads.js +0 -0
  215. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/chat.js +0 -0
  216. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/completions.js +0 -0
  217. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/index.js +0 -0
  218. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/messages.js +0 -0
  219. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/index.js +0 -0
  220. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/completions.js +0 -0
  221. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/containers.js +0 -0
  222. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/content.js +0 -0
  223. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/files.js +0 -0
  224. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/conversations.js +0 -0
  225. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/items.js +0 -0
  226. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/embeddings.js +0 -0
  227. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/evals.js +0 -0
  228. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/output-items.js +0 -0
  229. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/runs.js +0 -0
  230. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/files.js +0 -0
  231. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -0
  232. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -0
  233. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -0
  234. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -0
  235. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -0
  236. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -0
  237. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -0
  238. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/methods.js +0 -0
  239. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/grader-models.js +0 -0
  240. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/graders.js +0 -0
  241. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/images.js +0 -0
  242. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/index.js +0 -0
  243. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/models.js +0 -0
  244. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/moderations.js +0 -0
  245. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/calls.js +0 -0
  246. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/client-secrets.js +0 -0
  247. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/realtime.js +0 -0
  248. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-items.js +0 -0
  249. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-tokens.js +0 -0
  250. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/responses.js +0 -0
  251. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/shared.js +0 -0
  252. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/content.js +0 -0
  253. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/skills.js +0 -0
  254. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/content.js +0 -0
  255. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/versions.js +0 -0
  256. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/parts.js +0 -0
  257. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/uploads.js +0 -0
  258. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/file-batches.js +0 -0
  259. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/files.js +0 -0
  260. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/vector-stores.js +0 -0
  261. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/videos.js +0 -0
  262. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/index.js +0 -0
  263. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/webhooks.js +0 -0
  264. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks.js +0 -0
  265. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/streaming.js +0 -0
  266. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.1_zod@3.25.76 → openai@6.39.1_ws@8.21.1_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/version.js +0 -0
@@ -10,7 +10,7 @@ import { type SlackEvent, type SlackEventEnvelope, type SlackMessage } from "#pu
10
10
  import { type LoadThreadContextMessagesOptions } from "#public/channels/slack/thread.js";
11
11
  import { type UploadPolicyInput } from "#public/channels/upload-policy.js";
12
12
  import { type SlackWebhookVerifier } from "#public/channels/slack/verify.js";
13
- import { type Channel } from "#public/definitions/channel.js";
13
+ import { type Channel, type ResetResult } from "#public/definitions/channel.js";
14
14
  type EventData<T extends HandleMessageStreamEvent["type"]> = Extract<HandleMessageStreamEvent, {
15
15
  type: T;
16
16
  }> extends {
@@ -208,12 +208,20 @@ export interface SlackSessionTarget {
208
208
  export interface SlackCancelOptions {
209
209
  readonly turnId?: string;
210
210
  }
211
+ /** Options for resetting the session bound to a message or interaction context. */
212
+ export interface SlackResetOptions {
213
+ /** Human-readable terminal reason. Do not include credentials or message contents. */
214
+ readonly reason?: string;
215
+ }
211
216
  /**
212
217
  * Target and optional stale-turn guard accepted by `onEvent`'s cancellation
213
218
  * helper.
214
219
  */
215
220
  export interface SlackEventCancelOptions extends SlackSessionTarget, SlackCancelOptions {
216
221
  }
222
+ /** Target and optional terminal reason accepted by `onEvent`'s reset helper. */
223
+ export interface SlackEventResetOptions extends SlackSessionTarget, SlackResetOptions {
224
+ }
217
225
  /**
218
226
  * Imperative surface handed to `slackChannel({ onEvent })`. Generic Events API
219
227
  * payloads are not necessarily tied to one thread, so the context exposes a
@@ -234,6 +242,11 @@ export interface SlackInboundEventContext {
234
242
  readonly resolveActiveSession: (target: SlackSessionTarget) => Promise<{
235
243
  readonly sessionId: string;
236
244
  } | undefined>;
245
+ /**
246
+ * Terminally retires the session for a Slack thread so its next message starts
247
+ * a fresh session.
248
+ */
249
+ readonly reset: (options: SlackEventResetOptions) => Promise<ResetResult>;
237
250
  /** Workspace-scoped Slack identity and raw Web API escape hatch. */
238
251
  readonly slack: SlackWorkspaceHandle;
239
252
  /** Keeps detached handler work alive after the Slack webhook is acknowledged. */
@@ -253,6 +266,11 @@ export interface SlackInboundMessageContext extends SlackContext {
253
266
  isSubscribed(): Promise<boolean>;
254
267
  /** Returns whether the inbound event explicitly mentions this bot. */
255
268
  isBotMentioned(): boolean;
269
+ /**
270
+ * Terminally retires this thread's session so its next delivered message
271
+ * starts with fresh history and state.
272
+ */
273
+ reset(options?: SlackResetOptions): Promise<ResetResult>;
256
274
  }
257
275
  /** Interaction-scoped context handed to `slackChannel({ onInteraction })`. */
258
276
  export interface SlackInteractionContext extends SlackContext {
@@ -261,6 +279,11 @@ export interface SlackInteractionContext extends SlackContext {
261
279
  * `"no_active_turn"` are successful outcomes.
262
280
  */
263
281
  cancel(options?: SlackCancelOptions): Promise<CancelTurnResult>;
282
+ /**
283
+ * Terminally retires this thread's session so the continuation token can
284
+ * start a fresh session.
285
+ */
286
+ reset(options?: SlackResetOptions): Promise<ResetResult>;
264
287
  }
265
288
  export interface SlackInteractionAction {
266
289
  readonly actionId: string;
@@ -1 +1 @@
1
- import{markEventHandled}from"./utils.js";import{createLogger,logError}from"#internal/logging.js";import{POST,defineChannel}from"#public/definitions/channel.js";import{mergeUploadPolicy}from"#public/channels/upload-policy.js";import{buildSlackBinding,buildSlackWorkspaceHandle,slackContinuationToken}from"#public/channels/slack/api.js";import{slackUserIdFromAuthContext}from"#public/channels/slack/auth.js";import{defaultEvents,defaultInputRequestedHandler,defaultOnAppMention,defaultOnDirectMessage}from"#public/channels/slack/defaults.js";import{loadThreadContextMessages}from"#public/channels/slack/thread.js";import{parseSlackWebhookBody}from"#compiled/@chat-adapter/slack/webhook.js";import{buildSlackTurnMessage,collectInboundFileParts,createSlackFetchFile}from"#public/channels/slack/attachments.js";import{parseMessageEvent,parseSlackEventEnvelope,slackEventBotUserId,slackMessageFromWebhookPayload}from"#public/channels/slack/inbound.js";import{formatSlackInboundMessage,formatSlackThreadContext}from"#public/channels/slack/model-context.js";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#public/channels/slack/constants.js";import{handleInteractionPost}from"#public/channels/slack/interactions.js";import{verifySlackRequest as verifySlackRequest$1}from"#public/channels/slack/verify.js";const log=createLogger(`slack.channel`);function rebuildSlackContext(e,t,n){let{thread:r,slack:i}=buildSlackBinding({botToken:n?.botToken,channelId:e.channelId??``,threadTs:e.threadTs??``,teamId:e.teamId??void 0,onThreadTsChanged(n){e.threadTs=n,e.channelId&&t.setContinuationToken(slackContinuationToken(e.channelId,n))}});return{thread:r,slack:i,state:e}}function slackChannel(e={}){let t=mergeUploadPolicy(e.uploadPolicy),n=createSlackFetchFile({botToken:e.credentials?.botToken}),o=e.events?.[`authorization.required`],s=e.events?.[`turn.started`]??defaultEvents[`turn.started`],c={...defaultEvents,...e.events,async"turn.started"(e,t,n){let r=slackUserIdFromAuthContext(n.session.auth.current);r!==void 0&&(t.state.triggeringUserId=r),await s(e,t,n)},"input.requested":e.events?.[`input.requested`]??defaultInputRequestedHandler(),"authorization.required":o===void 0?defaultEvents[`authorization.required`]:constrainAuthorizationRequired(o)},u=new Set;return defineChannel({kindHint:`slack`,state:{channelId:null,threadTs:null,teamId:null,triggeringUserId:null,pendingToolCallMessage:null,lastReasoningTypingAtMs:null,lastReasoningTypingStatus:null,pendingAuthMessageTs:{}},fetchFile:n,metadata(e){return{channelId:e.channelId,teamId:e.teamId,threadTs:e.threadTs,triggeringUserId:e.triggeringUserId??null}},context(t,n){return rebuildSlackContext(t,n,e.credentials)},routes:[POST(e.route??SLACK_CHANNEL_DEFAULT_ROUTE,async(n,{cancel:r,resolveActiveSession:i,send:a,waitUntil:o})=>{let s=await verifyInbound(n,e.credentials);return s===null?new Response(`unauthorized`,{status:401}):shouldDropSlackHttpTimeoutRetry(n.headers)?new Response(`ok`):(n.headers.get(`content-type`)??``).includes(`application/x-www-form-urlencoded`)?handleInteractionPost(s,{cancel:r,send:a,waitUntil:o},{config:e}):handleEventPost({body:s,cancel:r,send:a,resolveActiveSession:i,waitUntil:o,config:e,uploadPolicy:t,handledEvents:u,headers:n.headers})})],receive(t,{send:n}){return receiveOnSlack(t,{credentials:e.credentials,send:n})},events:c})}async function receiveOnSlack(e,t){let n=e.target,r=n.channelId;if(!r||typeof r!=`string`)throw Error(`slackChannel().receive requires target.channelId.`);let i=typeof n.threadTs==`string`?n.threadTs:``,a=n.initialMessage;if(a&&i.length>0)throw Error("slackChannel().receive: `threadTs` and `initialMessage` are mutually exclusive.");let s=i;if(a){let{thread:e}=buildSlackBinding({botToken:t.credentials?.botToken,channelId:r,threadTs:``,teamId:t.teamId}),n={card:a.card};a.fallbackText!==void 0&&(n.fallbackText=a.fallbackText),s=(await e.post(n)).id}let l=s||crypto.randomUUID();return t.send(e.message,{auth:e.auth,continuationToken:slackContinuationToken(r,l),state:{channelId:r,threadTs:s||null,teamId:t.teamId??null,triggeringUserId:null}})}function constrainAuthorizationRequired(e){return(t,n,r)=>e(t,{postEphemeral:(e,t)=>n.thread.postEphemeral(e,t),postDirectMessage:(e,t)=>n.thread.postDirectMessage(e,t),state:n.state},r)}function shouldDropSlackHttpTimeoutRetry(e){return Number(e.get(`x-slack-retry-num`)??`0`)>=1&&e.get(`x-slack-retry-reason`)===`http_timeout`}async function handleEventPost(t){let{config:n}=t,r,i;try{r=parseSlackWebhookBody(t.body,{headers:t.headers}),i=parseSlackEventEnvelope(t.body)}catch(e){return log.warn(`inbound webhook body is not valid JSON`,{error:e}),new Response(`ok`)}if(r.kind===`url_verification`)return new Response(r.challenge,{status:200,headers:{"content-type":`text/plain`}});if(i===null)return new Response(`ok`);let a=typeof i.api_app_id==`string`?i.api_app_id:void 0,o=slackEventBotUserId(i),dispatch=null,s=null;if(r.kind===`app_mention`||r.kind===`direct_message`){let e=r.kind,i=slackMessageFromWebhookPayload(r);if(i!==null&&!isSelfAuthoredSlackMessage({appId:a,botUserId:o},i)){let dispatchMessageWith=r=>()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:r,kind:e,message:i,resolveActiveSession:t.resolveActiveSession,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy}),r=(e===`app_mention`?n.onAppMention:n.onDirectMessage)??n.onMessage;r===void 0?s=dispatchMessageWith(e===`app_mention`?defaultOnAppMention:defaultOnDirectMessage):dispatch=()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:r,kind:e,message:i,resolveActiveSession:t.resolveActiveSession,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy})}}if(dispatch===null&&n.onMessage!==void 0){let e=parseMessageEvent(i);e!==null&&!isSelfAuthoredSlackMessage({appId:a,botUserId:o},e)&&(o===void 0||!e.text.includes(`<@${o}`))&&(dispatch=()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:n.onMessage,kind:`channel_message`,message:e,resolveActiveSession:t.resolveActiveSession,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy}))}let c=n.onEvent;if(dispatch===null&&c!==void 0&&(dispatch=()=>dispatchSlackEvent({cancel:t.cancel,credentials:n.credentials,envelope:i,handler:c,resolveActiveSession:t.resolveActiveSession,send:t.send})),dispatch??=s,dispatch===null)return new Response(`ok`);let l=i.event_id;if(l){if(t.handledEvents.has(l))return log.warn(`received a duplicate event`,{event_id:l,event_time:i.event_time,retry_num:r.retry?.num??`(null)`,retry_reason:r.retry?.reason??`(null)`}),new Response(`ok`);markEventHandled(l,t.handledEvents)}return t.waitUntil(dispatch()),new Response(`ok`)}function isSelfAuthoredSlackMessage(e,t){return e.botUserId!==void 0&&t.author?.userId===e.botUserId?!0:e.appId!==void 0&&t.raw.app_id===e.appId}async function dispatchSlackMessage(e){let t=slackContinuationToken(e.message.channelId,e.message.threadTs),{thread:r,slack:i}=buildSlackBinding({appId:e.appId,botToken:e.credentials?.botToken,botUserId:e.botUserId,channelId:e.message.channelId,threadTs:e.message.threadTs,teamId:e.message.teamId}),a={cancel:(n={})=>e.cancel({continuationToken:t,turnId:n.turnId}),isBotMentioned:()=>e.kind===`app_mention`||e.botUserId!==void 0&&e.message.text.includes(`<@${e.botUserId}`),isSubscribed:async()=>await e.resolveActiveSession({continuationToken:t})!==void 0,slack:i,thread:r},s;try{s=await e.handler(a,e.message)}catch(t){logError(log,`${e.kind} handler failed`,t,{channelId:e.message.channelId});return}s!=null&&await deliverSlackMessage({credentials:e.credentials,kind:e.kind,message:e.message,result:s,send:e.send,thread:r,threadContext:e.threadContext,uploadPolicy:e.uploadPolicy})}async function dispatchSlackEvent(e){let t=e.envelope.event.team_id,r=typeof t==`string`?t:typeof e.envelope.team_id==`string`?e.envelope.team_id:void 0,i=[],a={cancel:({channelId:t,threadTs:n,turnId:r})=>e.cancel({continuationToken:slackContinuationToken(t,n),turnId:r}),envelope:e.envelope,receive:t=>receiveOnSlack(t,{credentials:e.credentials,send:e.send,teamId:r}),resolveActiveSession:({channelId:t,threadTs:n})=>e.resolveActiveSession({continuationToken:slackContinuationToken(t,n)}),slack:buildSlackWorkspaceHandle({botToken:e.credentials?.botToken,teamId:r}),waitUntil(e){i.push(e)}};try{await e.handler(a,e.envelope.event)}catch(t){logError(log,`event handler failed`,t,{eventId:e.envelope.event_id,eventType:e.envelope.event.type})}await Promise.allSettled(i)}async function verifyInbound(e,t){try{return await verifySlackRequest$1(e,{signingSecret:t?.signingSecret??(t?.webhookVerifier?void 0:process.env.SLACK_SIGNING_SECRET),webhookVerifier:t?.webhookVerifier})}catch(e){return log.warn(`slack inbound verification failed`,{error:e}),null}}async function deliverSlackMessage(e){let{message:t,thread:r}=e;try{let n=formatSlackThreadContext(e.threadContext===void 0?[]:await loadThreadContextMessages(r,t,e.threadContext)),i=await collectInboundFileParts({mention:t,thread:r,policy:e.uploadPolicy}),a={channelId:t.channelId,fullName:t.author?.fullName,teamId:t.teamId,threadTs:t.threadTs,userId:t.author?.userId??``,userName:t.author?.userName},o=formatSlackInboundMessage(a,t),s=buildSlackTurnMessage(n===void 0?o:`${n}\n\n${o}`,i),l=e.result.context??[];await e.send(l.length===0?{message:s}:{message:s,context:l},{auth:e.result.auth,continuationToken:slackContinuationToken(t.channelId,t.threadTs),state:{channelId:t.channelId,threadTs:t.threadTs,teamId:t.teamId??null,triggeringUserId:a.userId||null},title:t.markdown})}catch(r){logError(log,`${e.kind} delivery failed`,r,{channelId:t.channelId})}}export{constrainAuthorizationRequired,slackChannel};
1
+ import{markEventHandled}from"./utils.js";import{createLogger,logError}from"#internal/logging.js";import{POST,defineChannel}from"#public/definitions/channel.js";import{mergeUploadPolicy}from"#public/channels/upload-policy.js";import{buildSlackBinding,buildSlackWorkspaceHandle,slackContinuationToken}from"#public/channels/slack/api.js";import{slackUserIdFromAuthContext}from"#public/channels/slack/auth.js";import{defaultEvents,defaultInputRequestedHandler,defaultOnAppMention,defaultOnDirectMessage}from"#public/channels/slack/defaults.js";import{loadThreadContextMessages}from"#public/channels/slack/thread.js";import{parseSlackWebhookBody}from"#compiled/@chat-adapter/slack/webhook.js";import{buildSlackTurnMessage,collectInboundFileParts,createSlackFetchFile}from"#public/channels/slack/attachments.js";import{parseMessageEvent,parseSlackEventEnvelope,slackEventBotUserId,slackMessageFromWebhookPayload}from"#public/channels/slack/inbound.js";import{formatSlackInboundMessage,formatSlackThreadContext}from"#public/channels/slack/model-context.js";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#public/channels/slack/constants.js";import{handleInteractionPost}from"#public/channels/slack/interactions.js";import{verifySlackRequest as verifySlackRequest$1}from"#public/channels/slack/verify.js";const log=createLogger(`slack.channel`);function rebuildSlackContext(e,t,n){let{thread:r,slack:i}=buildSlackBinding({botToken:n?.botToken,channelId:e.channelId??``,threadTs:e.threadTs??``,teamId:e.teamId??void 0,onThreadTsChanged(n){e.threadTs=n,e.channelId&&t.setContinuationToken(slackContinuationToken(e.channelId,n))}});return{thread:r,slack:i,state:e}}function slackChannel(e={}){let t=mergeUploadPolicy(e.uploadPolicy),n=createSlackFetchFile({botToken:e.credentials?.botToken}),o=e.events?.[`authorization.required`],s=e.events?.[`turn.started`]??defaultEvents[`turn.started`],c={...defaultEvents,...e.events,async"turn.started"(e,t,n){let r=slackUserIdFromAuthContext(n.session.auth.current);r!==void 0&&(t.state.triggeringUserId=r),await s(e,t,n)},"input.requested":e.events?.[`input.requested`]??defaultInputRequestedHandler(),"authorization.required":o===void 0?defaultEvents[`authorization.required`]:constrainAuthorizationRequired(o)},u=new Set;return defineChannel({kindHint:`slack`,state:{channelId:null,threadTs:null,teamId:null,triggeringUserId:null,pendingToolCallMessage:null,lastReasoningTypingAtMs:null,lastReasoningTypingStatus:null,pendingAuthMessageTs:{}},fetchFile:n,metadata(e){return{channelId:e.channelId,teamId:e.teamId,threadTs:e.threadTs,triggeringUserId:e.triggeringUserId??null}},context(t,n){return rebuildSlackContext(t,n,e.credentials)},routes:[POST(e.route??SLACK_CHANNEL_DEFAULT_ROUTE,async(n,{cancel:r,reset:i,resolveActiveSession:a,send:o,waitUntil:s})=>{let c=await verifyInbound(n,e.credentials);return c===null?new Response(`unauthorized`,{status:401}):shouldDropSlackHttpTimeoutRetry(n.headers)?new Response(`ok`):(n.headers.get(`content-type`)??``).includes(`application/x-www-form-urlencoded`)?handleInteractionPost(c,{cancel:r,reset:i,send:o,waitUntil:s},{config:e}):handleEventPost({body:c,cancel:r,reset:i,send:o,resolveActiveSession:a,waitUntil:s,config:e,uploadPolicy:t,handledEvents:u,headers:n.headers})})],receive(t,{send:n}){return receiveOnSlack(t,{credentials:e.credentials,send:n})},events:c})}async function receiveOnSlack(e,t){let n=e.target,r=n.channelId;if(!r||typeof r!=`string`)throw Error(`slackChannel().receive requires target.channelId.`);let i=typeof n.threadTs==`string`?n.threadTs:``,a=n.initialMessage;if(a&&i.length>0)throw Error("slackChannel().receive: `threadTs` and `initialMessage` are mutually exclusive.");let s=i;if(a){let{thread:e}=buildSlackBinding({botToken:t.credentials?.botToken,channelId:r,threadTs:``,teamId:t.teamId}),n={card:a.card};a.fallbackText!==void 0&&(n.fallbackText=a.fallbackText),s=(await e.post(n)).id}let l=s||crypto.randomUUID();return t.send(e.message,{auth:e.auth,continuationToken:slackContinuationToken(r,l),state:{channelId:r,threadTs:s||null,teamId:t.teamId??null,triggeringUserId:null}})}function constrainAuthorizationRequired(e){return(t,n,r)=>e(t,{postEphemeral:(e,t)=>n.thread.postEphemeral(e,t),postDirectMessage:(e,t)=>n.thread.postDirectMessage(e,t),state:n.state},r)}function shouldDropSlackHttpTimeoutRetry(e){return Number(e.get(`x-slack-retry-num`)??`0`)>=1&&e.get(`x-slack-retry-reason`)===`http_timeout`}async function handleEventPost(t){let{config:n}=t,r,i;try{r=parseSlackWebhookBody(t.body,{headers:t.headers}),i=parseSlackEventEnvelope(t.body)}catch(e){return log.warn(`inbound webhook body is not valid JSON`,{error:e}),new Response(`ok`)}if(r.kind===`url_verification`)return new Response(r.challenge,{status:200,headers:{"content-type":`text/plain`}});if(i===null)return new Response(`ok`);let a=typeof i.api_app_id==`string`?i.api_app_id:void 0,o=slackEventBotUserId(i),dispatch=null,s=null;if(r.kind===`app_mention`||r.kind===`direct_message`){let e=r.kind,i=slackMessageFromWebhookPayload(r);if(i!==null&&!isSelfAuthoredSlackMessage({appId:a,botUserId:o},i)){let dispatchMessageWith=r=>()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:r,kind:e,message:i,resolveActiveSession:t.resolveActiveSession,reset:t.reset,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy}),r=(e===`app_mention`?n.onAppMention:n.onDirectMessage)??n.onMessage;r===void 0?s=dispatchMessageWith(e===`app_mention`?defaultOnAppMention:defaultOnDirectMessage):dispatch=()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:r,kind:e,message:i,resolveActiveSession:t.resolveActiveSession,reset:t.reset,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy})}}if(dispatch===null&&n.onMessage!==void 0){let e=parseMessageEvent(i);e!==null&&!isSelfAuthoredSlackMessage({appId:a,botUserId:o},e)&&(o===void 0||!e.text.includes(`<@${o}`))&&(dispatch=()=>dispatchSlackMessage({appId:a,botUserId:o,cancel:t.cancel,credentials:n.credentials,handler:n.onMessage,kind:`channel_message`,message:e,resolveActiveSession:t.resolveActiveSession,reset:t.reset,send:t.send,threadContext:n.threadContext,uploadPolicy:t.uploadPolicy}))}let c=n.onEvent;if(dispatch===null&&c!==void 0&&(dispatch=()=>dispatchSlackEvent({cancel:t.cancel,credentials:n.credentials,envelope:i,handler:c,resolveActiveSession:t.resolveActiveSession,reset:t.reset,send:t.send})),dispatch??=s,dispatch===null)return new Response(`ok`);let l=i.event_id;if(l){if(t.handledEvents.has(l))return log.warn(`received a duplicate event`,{event_id:l,event_time:i.event_time,retry_num:r.retry?.num??`(null)`,retry_reason:r.retry?.reason??`(null)`}),new Response(`ok`);markEventHandled(l,t.handledEvents)}return t.waitUntil(dispatch()),new Response(`ok`)}function isSelfAuthoredSlackMessage(e,t){return e.botUserId!==void 0&&t.author?.userId===e.botUserId?!0:e.appId!==void 0&&t.raw.app_id===e.appId}async function dispatchSlackMessage(e){let t=slackContinuationToken(e.message.channelId,e.message.threadTs),{thread:r,slack:i}=buildSlackBinding({appId:e.appId,botToken:e.credentials?.botToken,botUserId:e.botUserId,channelId:e.message.channelId,threadTs:e.message.threadTs,teamId:e.message.teamId}),a={cancel:(n={})=>e.cancel({continuationToken:t,turnId:n.turnId}),isBotMentioned:()=>e.kind===`app_mention`||e.botUserId!==void 0&&e.message.text.includes(`<@${e.botUserId}`),isSubscribed:async()=>await e.resolveActiveSession({continuationToken:t})!==void 0,reset:(n={})=>e.reset({continuationToken:t,reason:n.reason}),slack:i,thread:r},s;try{s=await e.handler(a,e.message)}catch(t){logError(log,`${e.kind} handler failed`,t,{channelId:e.message.channelId});return}s!=null&&await deliverSlackMessage({credentials:e.credentials,kind:e.kind,message:e.message,result:s,send:e.send,thread:r,threadContext:e.threadContext,uploadPolicy:e.uploadPolicy})}async function dispatchSlackEvent(e){let t=e.envelope.event.team_id,r=typeof t==`string`?t:typeof e.envelope.team_id==`string`?e.envelope.team_id:void 0,i=[],a={cancel:({channelId:t,threadTs:n,turnId:r})=>e.cancel({continuationToken:slackContinuationToken(t,n),turnId:r}),envelope:e.envelope,receive:t=>receiveOnSlack(t,{credentials:e.credentials,send:e.send,teamId:r}),resolveActiveSession:({channelId:t,threadTs:n})=>e.resolveActiveSession({continuationToken:slackContinuationToken(t,n)}),reset:({channelId:t,threadTs:n,reason:r})=>e.reset({continuationToken:slackContinuationToken(t,n),reason:r}),slack:buildSlackWorkspaceHandle({botToken:e.credentials?.botToken,teamId:r}),waitUntil(e){i.push(e)}};try{await e.handler(a,e.envelope.event)}catch(t){logError(log,`event handler failed`,t,{eventId:e.envelope.event_id,eventType:e.envelope.event.type})}await Promise.allSettled(i)}async function verifyInbound(e,t){try{return await verifySlackRequest$1(e,{signingSecret:t?.signingSecret??(t?.webhookVerifier?void 0:process.env.SLACK_SIGNING_SECRET),webhookVerifier:t?.webhookVerifier})}catch(e){return log.warn(`slack inbound verification failed`,{error:e}),null}}async function deliverSlackMessage(e){let{message:t,thread:r}=e;try{let n=formatSlackThreadContext(e.threadContext===void 0?[]:await loadThreadContextMessages(r,t,e.threadContext)),i=await collectInboundFileParts({mention:t,thread:r,policy:e.uploadPolicy}),a={channelId:t.channelId,fullName:t.author?.fullName,teamId:t.teamId,threadTs:t.threadTs,userId:t.author?.userId??``,userName:t.author?.userName},o=formatSlackInboundMessage(a,t),s=buildSlackTurnMessage(n===void 0?o:`${n}\n\n${o}`,i),l=e.result.context??[];await e.send(l.length===0?{message:s}:{message:s,context:l},{auth:e.result.auth,continuationToken:slackContinuationToken(t.channelId,t.threadTs),state:{channelId:t.channelId,threadTs:t.threadTs,teamId:t.teamId??null,triggeringUserId:a.userId||null},title:t.markdown})}catch(r){logError(log,`${e.kind} delivery failed`,r,{channelId:t.channelId})}}export{constrainAuthorizationRequired,slackChannel};
@@ -19,6 +19,21 @@ export interface RemoteAgentDefinition {
19
19
  * The parent agent reads this as the lowered subagent tool's description.
20
20
  */
21
21
  readonly description: string;
22
+ /**
23
+ * Forwards the dispatching turn's session principal to the remote
24
+ * deployment as the `forwardedPrincipal` create-session body field, so the
25
+ * remote session runs as the same end user as the parent (per-user
26
+ * Connect, local subagents, and further remote hops all see that
27
+ * principal). Defaults to `false` — forwarding identity to another
28
+ * deployment is an explicit decision, never ambient.
29
+ *
30
+ * Only principal metadata crosses the wire, never tokens or credentials —
31
+ * {@link auth} keeps authenticating *this* deployment to the remote. The
32
+ * receiver must opt in with `eveChannel({ trustedForwarders })`;
33
+ * a receiver that refuses the forwarder (or accepts no forwarded principal
34
+ * at all) rejects with 403 and the dispatch fails.
35
+ */
36
+ readonly forwardPrincipal?: boolean;
22
37
  readonly headers?: HeadersValue;
23
38
  readonly kind: "remote";
24
39
  /**
@@ -1 +1 @@
1
- import{lazyBackend}from"#execution/sandbox/lazy-backend.js";import{isDockerDaemonAvailableSync,isMicrosandboxPlatformSupported}from"#execution/sandbox/bindings/local.js";import{docker}from"#public/sandbox/backends/docker.js";import{justbash}from"#public/sandbox/backends/just-bash.js";import{microsandbox}from"#public/sandbox/backends/microsandbox.js";import{vercel}from"#public/sandbox/backends/vercel.js";const PRODUCTION_PROBES={isDeployedOnVercel:()=>!!process.env.VERCEL,isDockerAvailable:()=>isDockerDaemonAvailableSync(),isMicrosandboxSupported:()=>isMicrosandboxPlatformSupported()};function defaultSandbox(t){return lazyBackend(()=>selectDefaultSandbox(t,PRODUCTION_PROBES))}function selectDefaultSandbox(e,t){return t.isDeployedOnVercel()?vercel(e?.vercel):t.isDockerAvailable()?docker(e?.docker):t.isMicrosandboxSupported()?microsandbox(e?.microsandbox):justbash(e?.justBash)}export{defaultSandbox,selectDefaultSandbox};
1
+ import{isDockerDaemonAvailableSync,isMicrosandboxPlatformSupported}from"#execution/sandbox/bindings/local.js";import{lazyBackend}from"#execution/sandbox/lazy-backend.js";import{docker}from"#public/sandbox/backends/docker.js";import{justbash}from"#public/sandbox/backends/just-bash.js";import{microsandbox}from"#public/sandbox/backends/microsandbox.js";import{vercel}from"#public/sandbox/backends/vercel.js";const PRODUCTION_PROBES={isDeployedOnVercel:()=>!!process.env.VERCEL,isDockerAvailable:()=>isDockerDaemonAvailableSync(),isMicrosandboxSupported:()=>isMicrosandboxPlatformSupported()};function defaultSandbox(e){return lazyBackend(()=>selectDefaultSandbox(e,PRODUCTION_PROBES))}function selectDefaultSandbox(e,t){return t.isDeployedOnVercel()?vercel(e?.vercel):t.isDockerAvailable()?docker(e?.docker):t.isMicrosandboxSupported()?microsandbox(e?.microsandbox):justbash(e?.justBash)}export{defaultSandbox,selectDefaultSandbox};
@@ -1 +1 @@
1
- import{expectObjectRecord}from"#internal/authored-module.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{WORKFLOW_TOOL_NAME}from"#shared/workflow-sandbox.js";import{getAllFrameworkChannelNames,getFrameworkChannelDefinitions}from"#runtime/framework-channels/index.js";import{getAllFrameworkToolNames,getFrameworkToolDefinitions}from"#runtime/framework-tools/index.js";import{createConnectionSearchResolver}from"#runtime/framework-tools/connection-search-dynamic.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){let n=new Map,r=createChildNodeIdsByParentNodeId(e.manifest),i=new Map(e.manifest.subagents.map(e=>[e.nodeId,e]));return{nodesByNodeId:n,root:await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:r,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:n,subagentNodesById:i})}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let r=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),a=r.connections.length>0,o=getFrameworkToolDefinitions({authoredSkills:r.skills,hasConnections:a}),s=new Set(o.map(e=>e.name)),c=getAllFrameworkToolNames(),l=new Set(r.tools.map(e=>e.name));for(let n of r.disabledFrameworkTools)if(!c.has(n))throw new ResolveRuntimeAgentGraphError(`agent/tools/${n}.ts exports disableTool() but "${n}" is not a framework tool. Rename the file to one of: ${[...c].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let u=new Set(r.disabledFrameworkTools),d=await createRuntimeToolRegistry({tools:[...o.filter(e=>!l.has(e.name)&&!u.has(e.name)),...r.tools]},{reservedToolNames:[WORKFLOW_TOOL_NAME,...s.has(LOAD_SKILL_TOOL_NAME)||l.has(LOAD_SKILL_TOOL_NAME)?[]:[LOAD_SKILL_TOOL_NAME]]}),f=new Set(r.channels.map(e=>e.name)),p=getAllFrameworkChannelNames();for(let n of r.disabledFrameworkChannels)if(!p.has(n))throw new ResolveRuntimeAgentGraphError(`agent/channels/${n}.ts exports disableRoute() but "${n}" is not a framework channel. Rename the file to one of: ${[...p].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let m=new Set(r.disabledFrameworkChannels),h=[...getFrameworkChannelDefinitions().filter(e=>!f.has(e.name)&&!m.has(e.name)),...r.channels],g=createRuntimeSandboxRegistry({authoredSandbox:r.sandbox,workspaceResourceRoot:r.workspaceResourceRoot}),_=createRuntimeSubagentRegistry({reservedToolNames:[LOAD_SKILL_TOOL_NAME,...d.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),v=a?{...r,dynamicToolResolvers:[...r.dynamicToolResolvers,createConnectionSearchResolver()]}:r,y={agent:v,channels:h,hookRegistry:createRuntimeHookRegistry(v.hooks),nodeId:t,sandboxRegistry:g,sourceId:e.sourceId,subagentRegistry:_,toolRegistry:d,turnAgent:createResolvedRuntimeTurnAgent({agent:v,nodeId:t,tools:[...d.preparedTools,..._.preparedTools]})};return e.nodesByNodeId.set(t,y),y}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={description:e.sourceRef.description,kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(t){let n=expectObjectRecord(await loadResolvedModuleExport({definition:t.sourceRef,kindLabel:`remote agent`,moduleMap:t.moduleMap,nodeId:t.nodeScopeId}),`Expected remote agent source "${t.sourceRef.logicalPath}" to export an object.`),r={description:t.sourceRef.description,kind:`remote`,logicalPath:t.sourceRef.logicalPath,name:t.sourceRef.name,nodeId:toRuntimeNodeId(t.sourceRef.nodeId),outputSchema:t.sourceRef.outputSchema,path:t.sourceRef.path,sourceId:t.sourceRef.sourceId,sourceKind:`module`,url:await resolveRemoteAgentUrl({bakedUrl:t.sourceRef.url,logicalPath:t.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function createChildNodeIdsByParentNodeId(e){let t=new Map;for(let n of e.subagentEdges){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.childNodeId]);continue}e.push(n.childNodeId)}return t}function toRuntimeNodeId(e){return e===ROOT_COMPILED_AGENT_NODE_ID?ROOT_RUNTIME_AGENT_NODE_ID:e}export{resolveRuntimeAgentGraph};
1
+ import{expectObjectRecord}from"#internal/authored-module.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{WORKFLOW_TOOL_NAME}from"#shared/workflow-sandbox.js";import{getAllFrameworkChannelNames,getFrameworkChannelDefinitions}from"#runtime/framework-channels/index.js";import{getAllFrameworkToolNames,getFrameworkToolDefinitions}from"#runtime/framework-tools/index.js";import{createConnectionSearchResolver}from"#runtime/framework-tools/connection-search-dynamic.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){let n=new Map,r=createChildNodeIdsByParentNodeId(e.manifest),i=new Map(e.manifest.subagents.map(e=>[e.nodeId,e]));return{nodesByNodeId:n,root:await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:r,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:n,subagentNodesById:i})}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let r=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),a=r.connections.length>0,o=getFrameworkToolDefinitions({authoredSkills:r.skills,hasConnections:a}),s=new Set(o.map(e=>e.name)),c=getAllFrameworkToolNames(),l=new Set(r.tools.map(e=>e.name));for(let n of r.disabledFrameworkTools)if(!c.has(n))throw new ResolveRuntimeAgentGraphError(`agent/tools/${n}.ts exports disableTool() but "${n}" is not a framework tool. Rename the file to one of: ${[...c].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let u=new Set(r.disabledFrameworkTools),d=await createRuntimeToolRegistry({tools:[...o.filter(e=>!l.has(e.name)&&!u.has(e.name)),...r.tools]},{reservedToolNames:[WORKFLOW_TOOL_NAME,...s.has(LOAD_SKILL_TOOL_NAME)||l.has(LOAD_SKILL_TOOL_NAME)?[]:[LOAD_SKILL_TOOL_NAME]]}),f=new Set(r.channels.map(e=>e.name)),p=getAllFrameworkChannelNames();for(let n of r.disabledFrameworkChannels)if(!p.has(n))throw new ResolveRuntimeAgentGraphError(`agent/channels/${n}.ts exports disableRoute() but "${n}" is not a framework channel. Rename the file to one of: ${[...p].sort().join(`, `)}.`,{nodeId:t,sourceId:e.sourceId});let m=new Set(r.disabledFrameworkChannels),h=[...getFrameworkChannelDefinitions().filter(e=>!f.has(e.name)&&!m.has(e.name)),...r.channels],g=createRuntimeSandboxRegistry({authoredSandbox:r.sandbox,workspaceResourceRoot:r.workspaceResourceRoot}),_=createRuntimeSubagentRegistry({reservedToolNames:[LOAD_SKILL_TOOL_NAME,...d.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),v=a?{...r,dynamicToolResolvers:[...r.dynamicToolResolvers,createConnectionSearchResolver()]}:r,y={agent:v,channels:h,hookRegistry:createRuntimeHookRegistry(v.hooks),nodeId:t,sandboxRegistry:g,sourceId:e.sourceId,subagentRegistry:_,toolRegistry:d,turnAgent:createResolvedRuntimeTurnAgent({agent:v,nodeId:t,tools:[...d.preparedTools,..._.preparedTools]})};return e.nodesByNodeId.set(t,y),y}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={description:e.sourceRef.description,kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(t){let n=expectObjectRecord(await loadResolvedModuleExport({definition:t.sourceRef,kindLabel:`remote agent`,moduleMap:t.moduleMap,nodeId:t.nodeScopeId}),`Expected remote agent source "${t.sourceRef.logicalPath}" to export an object.`),r={description:t.sourceRef.description,kind:`remote`,logicalPath:t.sourceRef.logicalPath,name:t.sourceRef.name,nodeId:toRuntimeNodeId(t.sourceRef.nodeId),outputSchema:t.sourceRef.outputSchema,path:t.sourceRef.path,sourceId:t.sourceRef.sourceId,sourceKind:`module`,url:await resolveRemoteAgentUrl({bakedUrl:t.sourceRef.url,logicalPath:t.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth),n.forwardPrincipal===!0&&(r.forwardPrincipal=!0);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function createChildNodeIdsByParentNodeId(e){let t=new Map;for(let n of e.subagentEdges){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.childNodeId]);continue}e.push(n.childNodeId)}return t}function toRuntimeNodeId(e){return e===ROOT_COMPILED_AGENT_NODE_ID?ROOT_RUNTIME_AGENT_NODE_ID:e}export{resolveRuntimeAgentGraph};
@@ -1 +1 @@
1
- import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{getResolvedRuntimeAgentNode}from"#runtime/graph.js";import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{resolveRuntimeAgentGraph}from"#runtime/resolve-agent-graph.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{pathToFileURL}from"node:url";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";import{getActiveRuntimeSession}from"#runtime/sessions/runtime-session.js";import{createRuntimeAdapterRegistry}from"#runtime/channels/registry.js";const isCacheDisabled=process.env.EVE_DISABLE_AGENT_CACHE===`1`;function isDevelopmentRuntimeSnapshotRoot(e){return e.replaceAll(`\\`,`/`).includes(`/.eve/dev-runtime/snapshots/`)}function normalizeCompiledArtifactsSource(t){return t.kind!==`disk`||t.moduleMapLoaderPath!==void 0||!isDevelopmentRuntimeSnapshotRoot(t.appRoot)?t:{...t,moduleMapLoaderPath:resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`)}}async function loadFullBundle(e){let t=normalizeCompiledArtifactsSource(e),[n,a]=await Promise.all([loadCompiledManifest({compiledArtifactsSource:t}),loadRuntimeCompiledModuleMap(t)]),o=await resolveRuntimeAgentGraph({manifest:n,moduleMap:a}),s=o.root;return{adapterRegistry:createRuntimeAdapterRegistry({channels:collectResolvedChannels(o)}),compiledArtifactsSource:t,graph:o,hookRegistry:s.hookRegistry,moduleMap:a,resolvedAgent:s.agent,subagentRegistry:s.subagentRegistry,toolRegistry:s.toolRegistry,turnAgent:s.turnAgent}}async function loadRuntimeCompiledModuleMap(e){return e.kind===`disk`&&e.moduleMapLoaderPath!==void 0?await loadAuthoredSourceCompiledModuleMap(e):await loadCompiledModuleMap({compiledArtifactsSource:e})}async function loadAuthoredSourceCompiledModuleMap(e){if(e.moduleMapLoaderPath===void 0)throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`);return await(await import(pathToFileURL(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({compiledArtifactsSource:e})}async function getOrLoadFullBundle(e){let t=normalizeCompiledArtifactsSource(e);if(isCacheDisabled)return loadFullBundle(t);let r=getActiveRuntimeSession(),i=getRuntimeCompiledArtifactsCacheKey(t),o=await resolveRuntimeCompiledArtifactsVersionedCacheKey(t),s=r.bundleCacheKeyBySourceKey.get(i);s!==void 0&&s!==o&&r.bundleCache.delete(s),r.bundleCacheKeyBySourceKey.set(i,o);let c=r.bundleCache.get(o);if(c!==void 0)return c;let l=loadFullBundle(t).catch(e=>{throw r.bundleCache.delete(o),r.bundleCacheKeyBySourceKey.get(i)===o&&r.bundleCacheKeyBySourceKey.delete(i),e});return r.bundleCache.set(o,l),l}async function getCompiledRuntimeAgentBundle(e){let n=await getOrLoadFullBundle(e.compiledArtifactsSource);if(e.nodeId===void 0)return n;let r=getResolvedRuntimeAgentNode(n.graph,e.nodeId);return{adapterRegistry:n.adapterRegistry,compiledArtifactsSource:n.compiledArtifactsSource,graph:{nodesByNodeId:n.graph.nodesByNodeId,root:r},hookRegistry:r.hookRegistry,moduleMap:n.moduleMap,nodeId:e.nodeId,resolvedAgent:r.agent,subagentRegistry:r.subagentRegistry,toolRegistry:r.toolRegistry,turnAgent:r.turnAgent}}function clearCompiledRuntimeAgentBundleCache(){let e=getActiveRuntimeSession();e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()}function collectResolvedChannels(e){let t=new Map;for(let n of e.nodesByNodeId.values())for(let e of n.channels)t.set(`${e.sourceId}:${e.name}`,e);return[...t.values()]}export{clearCompiledRuntimeAgentBundleCache,getCompiledRuntimeAgentBundle};
1
+ import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{pathToFileURL}from"node:url";import{getResolvedRuntimeAgentNode}from"#runtime/graph.js";import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{resolveRuntimeAgentGraph}from"#runtime/resolve-agent-graph.js";import{resolveRuntimeCompiledArtifactsVersionedCacheKey}from"#runtime/cache-key.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";import{getActiveRuntimeSession}from"#runtime/sessions/runtime-session.js";import{createRuntimeAdapterRegistry}from"#runtime/channels/registry.js";const isCacheDisabled=process.env.EVE_DISABLE_AGENT_CACHE===`1`;function isDevelopmentRuntimeSnapshotRoot(e){return e.replaceAll(`\\`,`/`).includes(`/.eve/dev-runtime/snapshots/`)}function normalizeCompiledArtifactsSource(t){return t.kind!==`disk`||t.moduleMapLoaderPath!==void 0||!isDevelopmentRuntimeSnapshotRoot(t.appRoot)?t:{...t,moduleMapLoaderPath:resolvePackageSourceFilePath(`src/internal/authored-module-map-loader.ts`)}}async function loadFullBundle(e){let t=normalizeCompiledArtifactsSource(e),[n,r]=await Promise.all([loadCompiledManifest({compiledArtifactsSource:t}),loadRuntimeCompiledModuleMap(t)]),o=await resolveRuntimeAgentGraph({manifest:n,moduleMap:r}),s=o.root;return{adapterRegistry:createRuntimeAdapterRegistry({channels:collectResolvedChannels(o)}),compiledArtifactsSource:t,graph:o,hookRegistry:s.hookRegistry,moduleMap:r,resolvedAgent:s.agent,subagentRegistry:s.subagentRegistry,toolRegistry:s.toolRegistry,turnAgent:s.turnAgent}}async function loadRuntimeCompiledModuleMap(e){return e.kind===`disk`&&e.moduleMapLoaderPath!==void 0?await loadAuthoredSourceCompiledModuleMap(e):await loadCompiledModuleMap({compiledArtifactsSource:e})}async function loadAuthoredSourceCompiledModuleMap(e){if(e.moduleMapLoaderPath===void 0)throw Error(`Authored-source module map loading requires "moduleMapLoaderPath" in the compiled artifacts source.`);return await(await import(pathToFileURL(e.moduleMapLoaderPath).href)).loadCompiledModuleMapFromAuthoredSource({compiledArtifactsSource:e})}async function getOrLoadFullBundle(e){let t=normalizeCompiledArtifactsSource(e);if(isCacheDisabled)return loadFullBundle(t);let n=getActiveRuntimeSession(),i=getRuntimeCompiledArtifactsCacheKey(t),a=await resolveRuntimeCompiledArtifactsVersionedCacheKey(t),s=n.bundleCacheKeyBySourceKey.get(i);s!==void 0&&s!==a&&n.bundleCache.delete(s),n.bundleCacheKeyBySourceKey.set(i,a);let c=n.bundleCache.get(a);if(c!==void 0)return c;let l=loadFullBundle(t).catch(e=>{throw n.bundleCache.delete(a),n.bundleCacheKeyBySourceKey.get(i)===a&&n.bundleCacheKeyBySourceKey.delete(i),e});return n.bundleCache.set(a,l),l}async function getCompiledRuntimeAgentBundle(e){let t=await getOrLoadFullBundle(e.compiledArtifactsSource);if(e.nodeId===void 0)return t;let r=getResolvedRuntimeAgentNode(t.graph,e.nodeId);return{adapterRegistry:t.adapterRegistry,compiledArtifactsSource:t.compiledArtifactsSource,graph:{nodesByNodeId:t.graph.nodesByNodeId,root:r},hookRegistry:r.hookRegistry,moduleMap:t.moduleMap,nodeId:e.nodeId,resolvedAgent:r.agent,subagentRegistry:r.subagentRegistry,toolRegistry:r.toolRegistry,turnAgent:r.turnAgent}}function clearCompiledRuntimeAgentBundleCache(){let e=getActiveRuntimeSession();e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()}function collectResolvedChannels(e){let t=new Map;for(let n of e.nodesByNodeId.values())for(let e of n.channels)t.set(`${e.sourceId}:${e.name}`,e);return[...t.values()]}export{clearCompiledRuntimeAgentBundleCache,getCompiledRuntimeAgentBundle};
@@ -243,6 +243,7 @@ export type ResolvedRuntimeSubagentNode = Readonly<ModuleSourceRef & Node & {
243
243
  export type ResolvedRuntimeRemoteAgentNode = Readonly<ModuleSourceRef & Node & {
244
244
  auth?: OutboundAuthFn;
245
245
  description: string;
246
+ forwardPrincipal?: boolean;
246
247
  headers?: HeadersValue;
247
248
  kind: "remote";
248
249
  name: string;
@@ -3,7 +3,7 @@ import { detectPackageManager } from "#setup/package-manager.js";
3
3
  import { runPackageManagerInstall } from "#setup/primitives/pm/run.js";
4
4
  import { runVercel } from "#setup/primitives/run-vercel.js";
5
5
  import { detectDeployment, type ProjectResolution } from "../project-resolution.js";
6
- import { type Asker } from "../ask.js";
6
+ import type { Asker } from "../ask.js";
7
7
  import type { Prompter } from "../prompter.js";
8
8
  import { provisionSlackbot, reconcileSlackUid } from "../slackbot.js";
9
9
  import { type SetupState } from "../state.js";
@@ -39,14 +39,16 @@ export interface AddChannelsOptions {
39
39
  * every package value comes from the build-stamped defaults.
40
40
  */
41
41
  evePackage?: EvePackageContract;
42
- /** Skip the "Create slackbot?" prompt and use this answer. */
42
+ /** Reuse the preferred existing Slack connector without prompting. */
43
43
  presetCreateSlackbot?: boolean;
44
44
  /** Overwrite existing channel files (`eve channels add --force`). */
45
45
  force?: boolean;
46
+ /** Credential source for Slack. Defaults to Vercel Connect. */
47
+ slackCredentials?: "vercel-connect" | "environment";
46
48
  /**
47
- * Override for the web scaffold's Vercel services config. Defaults to
48
- * `hasVercelProject(state)`; `eve channels add` pins it to true so an
49
- * unlinked directory still gets the config, matching the dissolved engine.
49
+ * Override for the web scaffold's Vercel services config. The explicit
50
+ * environment plan takes precedence; otherwise this defaults to
51
+ * `hasVercelProject(state)`.
50
52
  */
51
53
  configureVercelServices?: boolean;
52
54
  /**
@@ -67,8 +69,7 @@ export interface AddChannelsOptions {
67
69
  deps?: AddChannelsDeps;
68
70
  }
69
71
  /**
70
- * What the user (or the preset) decided before `perform` runs effects.
71
- * `createSlackbot` is only consulted when Slack is in the channel selection.
72
+ * Inputs resolved before `perform` runs channel effects.
72
73
  */
73
74
  export interface AddChannelsInput {
74
75
  headless: boolean;
@@ -98,6 +99,7 @@ export interface AddChannelsPayload {
98
99
  * channels were recorded (nothing ran) and when the install failed; only a
99
100
  * success lets `apply` mark the deploy-time install as already done.
100
101
  */
102
+ dependenciesChanged: boolean;
101
103
  dependenciesInstalled: boolean;
102
104
  project: ProjectResolution;
103
105
  slackbot?: AddChannelsSlackbotFacts;
@@ -1,2 +1,2 @@
1
- import{SkippedSignal,confirm}from"../ask.js";import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployment}from"../project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"../slackbot.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{WizardCancelledError}from"../step.js";import{deriveSlackConnectorSlug,ensureChannel}from"#setup/scaffold/index.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectPackageManager}from"#setup/package-manager.js";import{runVercel}from"#setup/primitives/run-vercel.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";const SLACKBOT_NOT_ATTACHED_ERROR=`Slackbot provisioning did not attach this project. Slack channel was not added.`;function slackbotFailureCopy(e){switch(e.state){case`not-installed`:return{reason:`Slackbot is not connected to a Slack workspace. Slack channel was not added.`,followUp:"Continuing without Slack — the install timed out and was cleaned up; re-run `eve channels add slack` to try again."};case`cleanup-failed`:return{reason:`The abandoned Slack connector could not be removed. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the cleanup warning above before trying again.`};case`connector-lookup-failed`:return{reason:`Existing Slack connectors could not be inspected. Slack channel was not added.`,followUp:"Continuing without Slack — restore Vercel CLI access, then re-run `eve channels add slack`."};case`installation-check-failed`:return{reason:`Slack workspace installation could not be verified. Slack channel was not added.`,followUp:"Continuing without Slack — verify Vercel Connect is reachable, then re-run `eve channels add slack`."};case`existing-not-installed`:return{reason:`The existing Slack connector is not connected to a Slack workspace. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the existing connector warning above before trying again.`};case`detach-failed`:return{reason:`Slackbot provisioning could not replace the existing trigger destination. Slack channel was not added.`,followUp:"Continuing without Slack — run the `vercel connect detach` and `vercel connect attach` commands above."};case`attach-failed`:return{reason:SLACKBOT_NOT_ATTACHED_ERROR,followUp:"Continuing without Slack — finish event delivery with the `vercel connect attach` command above."};case`create-failed`:return{reason:`Slackbot creation failed.`,followUp:"Continuing without Slack — add it later with `eve channels add slack`."}}}function warnOverwrittenFiles(e,t){for(let n of t??[])e.warning(`Overwrote ${n}`)}function warnCompetingNextConfigFiles(e,t){for(let n of t??[])e.warning(`Found competing Next.js config at ${n}; merge any needed settings into next.config.ts and remove it before starting the preview, or Next.js may ignore the generated eve rewrite.`)}function addChannels(l){let u=l.deps??{ensureChannel,deriveSlackConnectorSlug,provisionSlackbot,reconcileSlackUid,detectPackageManager,runPackageManagerInstall,runVercel,detectDeployment};async function scaffoldSlackChannel(e,t,n,r,i,a){let o=!1;if(!t.slackScaffolded){let t=await u.ensureChannel({projectRoot:n,kind:`slack`,slackConnectorUid:a,slackConnectorSlug:r,force:l.force});warnOverwrittenFiles(e,t.filesOverwritten),t.action===`created`||t.action===`overwritten`?e.success(`Scaffolded channel: slack`):e.info(`Channel "slack" already exists. Skipping file creation.`),o=t.action!==`skipped`,i.slackScaffolded=!0}return i.channelsAdded.push(`slack`),o}async function linkProjectForSlackbot(e,t,n,o,s){if(o)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Slackbot creation needs this directory linked to a Vercel project.`});if(e.message(`Linking this directory to a Vercel project...`),!await u.runVercel([`link`],{cwd:t,signal:s}))throw s?.throwIfAborted(),Error(`Vercel project linking failed. Slackbot creation did not start.`);let c=mergeProjectResolution(n,projectResolutionFromDeployment(await u.detectDeployment(t,{signal:s})));if(!isProjectResolved(c))throw Error(`Vercel project linking failed. Slackbot creation did not start.`);return c}async function addWebChannelToPayload(e,t,n,r,i,a){if(!t.channelSelection.includes(`web`))return;if(t.webScaffolded){i.channelsAdded.push(`web`);return}e.message(`Scaffolding Web Chat channel files...`);let o={projectRoot:n,kind:`web`,packageManager:r,force:l.force,configureVercelServices:l.configureVercelServices??hasVercelProject(t)};l.evePackage!==void 0&&(o.webPackageVersions={evePackage:l.evePackage});let s=await u.ensureChannel(o);if(a?.throwIfAborted(),warnOverwrittenFiles(e,s.filesOverwritten),s.kind===`web`&&s.action!==`skipped`&&s.nodeEngineOverride!==void 0&&e.warning(formatNodeEngineOverrideWarning(s.nodeEngineOverride)),warnCompetingNextConfigFiles(e,`competingNextConfigFiles`in s?s.competingNextConfigFiles:void 0),s.action===`created`||s.action===`overwritten`){e.success(`Scaffolded channel: web`),i.webScaffolded=!0,i.channelsAdded.push(`web`);return}e.info(`Next.js project detected. Skipping Web Chat scaffolding.`)}function assertSlackProjectReady(e){if(l.ensureLinkedProject===void 0){if(!hasVercelProject(e))throw Error(`Slack requires a Vercel project. Re-run and choose to deploy to Vercel to add Slack.`);if(!isProjectResolved(e.project))throw Error(`Expected a linked Vercel project for Slack, but none was resolved.`)}}async function provisionSlackbotWithControls(e,t,n,r){if(r===void 0&&l.prompter.awaitChoice===void 0)return u.provisionSlackbot(e,t,n);let i={};return r!==void 0&&(i.signal=r),l.prompter.awaitChoice!==void 0&&(i.awaitChoice=l.prompter.awaitChoice),u.provisionSlackbot(e,t,n,void 0,i)}async function scaffoldAttachedSlackChannel(e,t,n,r,i,a){if(!await scaffoldSlackChannel(e,t,n,r,i,a.connectorUid)&&!await u.reconcileSlackUid(e,n,a,`slack/${r}`))throw Error(`Slack connector UID update is required before deployment.`)}async function addSlackChannelToPayload(e,t,n,i,a,o){if(!t.channelSelection.includes(`slack`))return;assertSlackProjectReady(t);let s=await u.deriveSlackConnectorSlug(i,t.agentName);if(t.slackbotCreated){if(!t.slackbotAttached)throw Error(SLACKBOT_NOT_ATTACHED_ERROR);if(!t.deploymentPending)return;let n=t.slackConnectorUid;if(n===void 0)throw Error(`Slack connector UID was not resolved. Slack deployment did not start.`);await scaffoldAttachedSlackChannel(e,t,i,s,a,{state:`attached`,connectorUid:n});return}if(n.createSlackbot!==!0){e.info(`Slack channel was not added because Slackbot setup was skipped.`);return}isProjectResolved(a.project)||(a.project=await linkProjectForSlackbot(e,i,a.project,n.headless,o));let c=await provisionSlackbotWithControls(e,i,s,o);if(o?.throwIfAborted(),c.state===`cancelled`)throw new WizardCancelledError;if(c.state!==`attached`){let t=slackbotFailureCopy(c);if(l.slackbotFailure!==`warn-and-continue`)throw Error(t.reason);e.warning(`${t.reason} ${t.followUp}`);return}a.slackbot={connectorUid:c.connectorUid,chatUrl:c.chatUrl,workspaceName:c.workspaceName},await scaffoldAttachedSlackChannel(e,t,i,s,a,c)}async function installChannelDependencies(e,t,n,r,i){if(r.channelsAdded.length!==0){if(await withPhase(e,`Installing channel dependencies (${n} install)...`,()=>u.runPackageManagerInstall(n,t,{onOutput:createPromptCommandOutput(e),signal:i}))){r.dependenciesInstalled=!0;return}e.warning(`Dependency installation failed. The new channels stay unloadable until \`${n} install\` or a deploy succeeds.`)}}async function performAddChannels(e,t,n){n?.throwIfAborted();let r=l.prompter.log,i=requireProjectPath(e),a={channelsAdded:[],webScaffolded:e.webScaffolded,slackScaffolded:e.slackScaffolded,dependenciesInstalled:!1,project:e.project},o=await u.detectPackageManager(i);return await addWebChannelToPayload(r,e,i,o.kind,a,n),await addSlackChannelToPayload(r,e,t,i,a,n),await installChannelDependencies(r,i,o.kind,a,n),a}return{id:`add-channels`,async gather({state:n}){let r=l.headless??!1;if(r&&n.channelSelection.includes(`slack`))throw Error("Slack setup is interactive. Run `eve channels add slack` from an interactive terminal.");if(!n.channelSelection.includes(`slack`)||l.presetCreateSlackbot!==void 0||n.slackbotCreated)return{headless:r,createSlackbot:l.presetCreateSlackbot};try{return{headless:r,createSlackbot:await l.asker.ask(confirm({key:`create-slackbot`,message:`Do you want to create your slackbot?`}))}}catch(t){if(t instanceof SkippedSignal)return{headless:r,createSlackbot:!1};throw t}},async perform({state:e,input:t,signal:n}){try{return await performAddChannels(e,t,n)}catch(e){if(!(e instanceof WizardCancelledError)){let t=e instanceof Error?e.message:String(e),n=t.split(`
2
- `)[0]?.trim()??t;l.prompter.log.error(n)}throw e}},apply(e,t){let n=[...e.channels];for(let e of t.channelsAdded)n.includes(e)||n.push(e);let r={...e,channels:n,webScaffolded:t.webScaffolded,slackScaffolded:t.slackScaffolded,deploymentPending:e.deploymentPending||t.channelsAdded.length>0,deploymentDependenciesInstalled:t.channelsAdded.length>0?t.dependenciesInstalled:e.deploymentDependenciesInstalled,project:mergeProjectResolution(e.project,t.project)};return t.slackbot===void 0?r:{...r,slackbotCreated:!0,slackbotAttached:!0,slackConnectorUid:t.slackbot.connectorUid,slackChatUrl:t.slackbot.chatUrl,slackWorkspaceName:t.slackbot.workspaceName}}}}export{addChannels};
1
+ import{detectDeployment,isProjectResolved,mergeProjectResolution,projectResolutionFromDeployment}from"../project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"../slackbot.js";import{hasVercelProject,requireProjectPath}from"../state.js";import{WizardCancelledError}from"../step.js";import{deriveSlackConnectorSlug,ensureChannel}from"#setup/scaffold/index.js";import{formatNodeEngineOverrideWarning}from"#setup/node-engine.js";import{detectPackageManager}from"#setup/package-manager.js";import{runVercel}from"#setup/primitives/run-vercel.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{runPackageManagerInstall}from"#setup/primitives/pm/run.js";const SLACKBOT_NOT_ATTACHED_ERROR=`Slackbot provisioning did not attach this project. Slack channel was not added.`;function slackbotFailureCopy(e){switch(e.state){case`not-installed`:return{reason:`Slackbot is not connected to a Slack workspace. Slack channel was not added.`,followUp:"Continuing without Slack — the install timed out and was cleaned up; re-run `eve channels add slack` to try again."};case`cleanup-failed`:return{reason:`The abandoned Slack connector could not be removed. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the cleanup warning above before trying again.`};case`connector-lookup-failed`:return{reason:`Existing Slack connectors could not be inspected. Slack channel was not added.`,followUp:"Continuing without Slack — restore Vercel CLI access, then re-run `eve channels add slack`."};case`installation-check-failed`:return{reason:`Slack workspace installation could not be verified. Slack channel was not added.`,followUp:"Continuing without Slack — verify Vercel Connect is reachable, then re-run `eve channels add slack`."};case`existing-not-installed`:return{reason:`The existing Slack connector is not connected to a Slack workspace. Slack channel was not added.`,followUp:`Continuing without Slack — resolve the existing connector warning above before trying again.`};case`detach-failed`:return{reason:`Slackbot provisioning could not replace the existing trigger destination. Slack channel was not added.`,followUp:"Continuing without Slack — run the `vercel connect detach` and `vercel connect attach` commands above."};case`attach-failed`:return{reason:SLACKBOT_NOT_ATTACHED_ERROR,followUp:"Continuing without Slack — finish event delivery with the `vercel connect attach` command above."};case`create-failed`:return{reason:`Slackbot creation failed.`,followUp:"Continuing without Slack — add it later with `eve channels add slack`."}}}function warnOverwrittenFiles(e,t){for(let n of t??[])e.warning(`Overwrote ${n}`)}function warnCompetingNextConfigFiles(e,t){for(let n of t??[])e.warning(`Found competing Next.js config at ${n}; merge any needed settings into next.config.ts and remove it before starting the preview, or Next.js may ignore the generated eve rewrite.`)}function addChannels(u){let d=u.deps??{ensureChannel,deriveSlackConnectorSlug,provisionSlackbot,reconcileSlackUid,detectPackageManager,runPackageManagerInstall,runVercel,detectDeployment};async function scaffoldSlackChannel(e,t,n,r,i,a){let o=!1;if(!t.slackScaffolded){let t=await d.ensureChannel({projectRoot:n,kind:`slack`,slackConnectorUid:a,slackConnectorSlug:r,force:u.force});i.dependenciesChanged||=t.packageJsonUpdated.length>0,warnOverwrittenFiles(e,t.filesOverwritten),t.action===`created`||t.action===`overwritten`?e.success(`Scaffolded channel: slack`):e.info(`Channel "slack" already exists. Skipping file creation.`),o=t.action!==`skipped`,i.slackScaffolded=!0}return i.channelsAdded.push(`slack`),o}async function linkProjectForSlackbot(e,i,a,o,s){if(o)throw new HumanActionRequiredError({kind:`vercel-link`,command:`vercel link`,reason:`Slackbot creation needs this directory linked to a Vercel project.`});if(e.message(`Linking this directory to a Vercel project...`),!await d.runVercel([`link`],{cwd:i,signal:s}))throw s?.throwIfAborted(),Error(`Vercel project linking failed. Slackbot creation did not start.`);let c=mergeProjectResolution(a,projectResolutionFromDeployment(await d.detectDeployment(i,{signal:s})));if(!isProjectResolved(c))throw Error(`Vercel project linking failed. Slackbot creation did not start.`);return c}async function addWebChannelToPayload(e,t,n,r,i,a){if(!t.channelSelection.includes(`web`))return;if(t.webScaffolded){i.channelsAdded.push(`web`);return}e.message(`Scaffolding Web Chat channel files...`);let s={projectRoot:n,kind:`web`,packageManager:r,force:u.force,configureVercelServices:u.configureVercelServices??hasVercelProject(t)};u.evePackage!==void 0&&(s.webPackageVersions={evePackage:u.evePackage});let c=await d.ensureChannel(s);if(i.dependenciesChanged||=c.packageJsonUpdated.length>0,a?.throwIfAborted(),warnOverwrittenFiles(e,c.filesOverwritten),c.kind===`web`&&c.action!==`skipped`&&c.nodeEngineOverride!==void 0&&e.warning(formatNodeEngineOverrideWarning(c.nodeEngineOverride)),warnCompetingNextConfigFiles(e,`competingNextConfigFiles`in c?c.competingNextConfigFiles:void 0),c.action===`created`||c.action===`overwritten`){e.success(`Scaffolded channel: web`),i.webScaffolded=!0,i.channelsAdded.push(`web`);return}e.info(`Next.js project detected. Skipping Web Chat scaffolding.`)}function assertSlackProjectReady(e){if(u.ensureLinkedProject===void 0){if(!hasVercelProject(e))throw Error(`Slack requires a Vercel project. Re-run and choose to deploy to Vercel to add Slack.`);if(!isProjectResolved(e.project))throw Error(`Expected a linked Vercel project for Slack, but none was resolved.`)}}async function provisionSlackbotWithControls(e,t,n,r){let i={selectConnector:async(e,t)=>{if(u.presetCreateSlackbot===!0)return t??e[0];let n={message:`Which Slack app would you like to use?`,options:[...e.map(e=>{let n={value:e.uid,label:`Use ${e.uid}`};return e.uid===t?.uid&&(n.hint=`Matches this agent`),n}),{value:`create`,label:`Create a new Slack app`}],initialValue:t?.uid},r=await u.prompter.select(n);return r===`create`?`create`:e.find(e=>e.uid===r)}};return r!==void 0&&(i.signal=r),u.prompter.awaitChoice!==void 0&&(i.awaitChoice=u.prompter.awaitChoice),d.provisionSlackbot(e,t,n,void 0,i)}async function scaffoldAttachedSlackChannel(e,t,n,r,i,a){if(!await scaffoldSlackChannel(e,t,n,r,i,a.connectorUid)&&!await d.reconcileSlackUid(e,n,a,`slack/${r}`))throw Error(`Slack connector UID update is required before deployment.`)}async function addSlackChannelToPayload(e,n,r,i,a,o){if(!n.channelSelection.includes(`slack`))return;let s=await d.deriveSlackConnectorSlug(i,n.agentName);if(u.slackCredentials===`environment`){if(!n.slackScaffolded){let t=await d.ensureChannel({projectRoot:i,kind:`slack`,slackConnectorSlug:s,slackCredentials:`environment`,force:u.force});a.dependenciesChanged||=t.packageJsonUpdated.length>0,warnOverwrittenFiles(e,t.filesOverwritten),t.action===`created`||t.action===`overwritten`?e.success(`Scaffolded channel: slack`):e.info(`Channel "slack" already exists. Skipping file creation.`),a.slackScaffolded=!0}a.channelsAdded.push(`slack`);return}if(assertSlackProjectReady(n),n.slackbotCreated){if(!n.slackbotAttached)throw Error(SLACKBOT_NOT_ATTACHED_ERROR);if(!n.deploymentPending)return;let t=n.slackConnectorUid;if(t===void 0)throw Error(`Slack connector UID was not resolved. Slack deployment did not start.`);await scaffoldAttachedSlackChannel(e,n,i,s,a,{state:`attached`,connectorUid:t});return}isProjectResolved(a.project)||(a.project=await linkProjectForSlackbot(e,i,a.project,r.headless,o));let l=await provisionSlackbotWithControls(e,i,s,o);if(o?.throwIfAborted(),l.state===`cancelled`)throw new WizardCancelledError;if(l.state!==`attached`){let t=slackbotFailureCopy(l);if(u.slackbotFailure!==`warn-and-continue`)throw Error(t.reason);e.warning(`${t.reason} ${t.followUp}`);return}a.slackbot={connectorUid:l.connectorUid,chatUrl:l.chatUrl,workspaceName:l.workspaceName},await scaffoldAttachedSlackChannel(e,n,i,s,a,l)}async function installChannelDependencies(e,t,n,r,i){if(r.dependenciesChanged){if(await withPhase(e,`Installing channel dependencies (${n} install)...`,()=>d.runPackageManagerInstall(n,t,{onOutput:createPromptCommandOutput(e),signal:i}))){r.dependenciesInstalled=!0;return}e.warning(`Dependency installation failed. The new channels stay unloadable until \`${n} install\` or a deploy succeeds.`)}}async function performAddChannels(e,t,n){n?.throwIfAborted();let r=u.prompter.log,i=requireProjectPath(e),a={channelsAdded:[],webScaffolded:e.webScaffolded,slackScaffolded:e.slackScaffolded,dependenciesChanged:!1,dependenciesInstalled:!1,project:e.project},o=await d.detectPackageManager(i);return await addWebChannelToPayload(r,e,i,o.kind,a,n),await addSlackChannelToPayload(r,e,t,i,a,n),await installChannelDependencies(r,i,o.kind,a,n),a}return{id:`add-channels`,async gather({state:e}){let t=u.headless??!1;if(t&&e.channelSelection.includes(`slack`)&&u.slackCredentials!==`environment`)throw Error("Slack setup is interactive. Run `eve channels add slack` from an interactive terminal.");return{headless:t,createSlackbot:u.presetCreateSlackbot}},async perform({state:e,input:t,signal:n}){try{return await performAddChannels(e,t,n)}catch(e){if(!(e instanceof WizardCancelledError)){let t=e instanceof Error?e.message:String(e),n=t.split(`
2
+ `)[0]?.trim()??t;u.prompter.log.error(n)}throw e}},apply(e,t){let r=[...e.channels];for(let e of t.channelsAdded)r.includes(e)||r.push(e);let i={...e,channels:r,webScaffolded:t.webScaffolded,slackScaffolded:t.slackScaffolded,deploymentPending:e.deploymentPending||t.channelsAdded.length>0,deploymentDependenciesInstalled:t.dependenciesChanged?t.dependenciesInstalled:e.deploymentDependenciesInstalled,project:mergeProjectResolution(e.project,t.project)};return t.slackbot===void 0?i:{...i,slackbotCreated:!0,slackbotAttached:!0,slackConnectorUid:t.slackbot.connectorUid,slackChatUrl:t.slackbot.chatUrl,slackWorkspaceName:t.slackbot.workspaceName}}}}export{addChannels};
@@ -17,10 +17,9 @@ export interface SelectChannelsOptions {
17
17
  presetChannels?: ChannelKind[];
18
18
  /**
19
19
  * Picker shape, chosen explicitly because the variants differ in whether a
20
- * selection is required, whether the REPL row is shown, and how Slack is
21
- * gated. The "channels-add" picker allows an empty submission and keeps Slack
22
- * selectable from an unlinked directory because its add-channels box can run
23
- * an interactive `vercel link` on demand.
20
+ * selection is required and whether the REPL row is shown. The
21
+ * "channels-add" picker allows an empty submission and keeps Slack selectable
22
+ * because capability planning later chooses Connect or environment credentials.
24
23
  */
25
24
  variant: "onboarding" | "in-project" | "channels-add";
26
25
  /**
@@ -41,7 +40,7 @@ export interface SelectChannelsOptions {
41
40
  * chosen channels afterward from `state.channelSelection`. During onboarding
42
41
  * the deployment decision has not been made yet, so Slack is never gated here:
43
42
  * picking it is what makes the later provisioning box resolve to Vercel. Only
44
- * the in-project variant gates Slack, on the detected on-disk link.
43
+ * the legacy in-project variant gates Slack on the detected on-disk link.
45
44
  *
46
45
  * The onboarding picker is required and always carries a locked, pre-selected
47
46
  * Terminal UI row, so an empty selection is impossible: every agent can at least be
@@ -0,0 +1,11 @@
1
+ import type { DeployProjectDeps } from "./boxes/deploy-project.js";
2
+ import type { ChannelSetupUi } from "./channel-setup-ui.js";
3
+ import { type SetupState } from "./state.js";
4
+ /** Offers and, when accepted, performs deployment after channel setup completes. */
5
+ export declare function deployChannelSetup(input: {
6
+ state: SetupState;
7
+ ui: ChannelSetupUi;
8
+ signal?: AbortSignal;
9
+ presetDeploy?: boolean;
10
+ deps?: DeployProjectDeps;
11
+ }): Promise<SetupState>;
@@ -0,0 +1 @@
1
+ import{snapshotSetupState}from"./state.js";import{deployProject}from"./boxes/deploy-project.js";import{runInteractive}from"./runner.js";async function deployChannelSetup(t){if(!(t.presetDeploy??await t.ui.confirm({key:`deploy-channels`,message:`Deploy this project to Vercel now?`,recommended:!0})))return t.ui.nextSteps(["Run `eve deploy` to deploy when ready."]),t.state;let n=await runInteractive([deployProject({prompter:t.ui.prompter,ensureLinkedProject:`interactive-vercel-link`,deps:t.deps})],t.state,{write:e=>t.ui.prompter.log.message(e)},{snapshot:snapshotSetupState,signal:t.signal});return n.kind===`done`?n.state:t.state}export{deployChannelSetup};
@@ -0,0 +1,16 @@
1
+ import type { ProjectResolution } from "./project-resolution.js";
2
+ import type { VercelAuthStatus } from "./vercel-project.js";
3
+ /** Read-only hosting facts available to channel-owned setup hooks. */
4
+ export interface ChannelSetupEnvironment {
5
+ vercel: {
6
+ kind: "available";
7
+ project: ProjectResolution;
8
+ } | {
9
+ kind: "unavailable";
10
+ reason: Exclude<VercelAuthStatus, "authenticated">;
11
+ };
12
+ }
13
+ /** Describes the result of the read-only Vercel capability probe. */
14
+ export declare function describeChannelSetupEnvironment(environment: ChannelSetupEnvironment): string;
15
+ /** Builds channel setup facts from the independent Vercel probes. */
16
+ export declare function channelSetupEnvironment(authStatus: VercelAuthStatus, project: ProjectResolution): ChannelSetupEnvironment;
@@ -0,0 +1 @@
1
+ function describeChannelSetupEnvironment(e){if(e.vercel.kind===`available`)switch(e.vercel.project.kind){case`deployed`:return`Found an authenticated Vercel account and deployed project (${e.vercel.project.productionUrl}).`;case`linked`:return`Found an authenticated Vercel account and linked project.`;case`unresolved`:return`Found an authenticated Vercel account; this directory is not linked to a project.`}switch(e.vercel.reason){case`logged-out`:return`No authenticated Vercel account found; using portable channel setup.`;case`cli-missing`:return`Vercel CLI not found; using portable channel setup.`;case`unavailable`:return`Could not verify the Vercel account; using portable channel setup.`}}function channelSetupEnvironment(e,t){return e===`authenticated`?{vercel:{kind:`available`,project:t}}:{vercel:{kind:`unavailable`,reason:e}}}export{channelSetupEnvironment,describeChannelSetupEnvironment};
@@ -0,0 +1,31 @@
1
+ import type { AddChannelsDeps } from "./boxes/add-channels.js";
2
+ import type { ChannelSetupEnvironment } from "./channel-setup-environment.js";
3
+ import type { ChannelSetupUi } from "./channel-setup-ui.js";
4
+ import type { ChannelKind } from "./scaffold/index.js";
5
+ import type { SetupState } from "./state.js";
6
+ /** Shared inputs available to a channel-owned setup implementation. */
7
+ export interface ChannelSetupContext {
8
+ readonly environment: ChannelSetupEnvironment;
9
+ readonly state: Readonly<SetupState>;
10
+ readonly ui: ChannelSetupUi;
11
+ readonly signal?: AbortSignal;
12
+ readonly force?: boolean;
13
+ readonly headless?: boolean;
14
+ readonly presetCreateSlackbot?: boolean;
15
+ readonly presetPortableCredentials?: boolean;
16
+ readonly deps?: AddChannelsDeps;
17
+ }
18
+ /** Structured outcome from a channel-owned setup implementation. */
19
+ export type ChannelSetupResult = {
20
+ readonly kind: "done";
21
+ readonly state: SetupState;
22
+ } | {
23
+ readonly kind: "cancelled";
24
+ };
25
+ /** Setup behavior paired with canonical channel catalog metadata. */
26
+ export interface ChannelSetupIntegration {
27
+ readonly kind: ChannelKind;
28
+ readonly label: string;
29
+ readonly hint?: string;
30
+ setup(context: ChannelSetupContext): Promise<ChannelSetupResult>;
31
+ }
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,7 @@
1
+ import type { ChannelSetupIntegration } from "./channel-setup-integration.js";
2
+ import type { ChannelKind } from "./scaffold/index.js";
3
+ /** Built-in channel integrations in canonical picker order. */
4
+ export declare const CHANNEL_SETUP_INTEGRATIONS: readonly ChannelSetupIntegration[];
5
+ /** Resolves a channel setup integration by its filesystem-facing kind. */
6
+ export declare function channelSetupIntegration(kind: ChannelKind): ChannelSetupIntegration;
7
+ export { createChannelSetupUi } from "./channel-setup-ui.js";
@@ -0,0 +1 @@
1
+ import{SLACK_CHANNEL_SETUP}from"./channel-setup-slack.js";import{WEB_CHANNEL_SETUP}from"./channel-setup-web.js";import{createChannelSetupUi}from"./channel-setup-ui.js";const CHANNEL_SETUP_INTEGRATIONS=[WEB_CHANNEL_SETUP,SLACK_CHANNEL_SETUP];function channelSetupIntegration(e){let t=CHANNEL_SETUP_INTEGRATIONS.find(t=>t.kind===e);if(t===void 0)throw Error(`No channel setup integration for "${e}".`);return t}export{CHANNEL_SETUP_INTEGRATIONS,channelSetupIntegration,createChannelSetupUi};
@@ -0,0 +1,7 @@
1
+ import type { ChannelSetupContext, ChannelSetupResult } from "./channel-setup-integration.js";
2
+ /** Runs the shared scaffold box with decisions supplied by a channel integration. */
3
+ export declare function runChannelSetup(context: ChannelSetupContext, options: {
4
+ configureVercelServices?: boolean;
5
+ slackCredentials?: "vercel-connect" | "environment";
6
+ ensureLinkedProject?: "interactive-vercel-link";
7
+ }): Promise<ChannelSetupResult>;
@@ -0,0 +1 @@
1
+ import{snapshotSetupState}from"./state.js";import{addChannels}from"./boxes/add-channels.js";import{runInteractive}from"./runner.js";async function runChannelSetup(t,n){let r=await runInteractive([addChannels({asker:t.ui.asker,prompter:t.ui.prompter,headless:t.headless,presetCreateSlackbot:t.presetCreateSlackbot,force:t.force,configureVercelServices:n.configureVercelServices,slackCredentials:n.slackCredentials,ensureLinkedProject:n.ensureLinkedProject,deps:t.deps})],t.state,{write:e=>t.ui.prompter.log.message(e)},{snapshot:snapshotSetupState,signal:t.signal});return r.kind===`done`?{kind:`done`,state:r.state}:{kind:`cancelled`}}export{runChannelSetup};
@@ -0,0 +1,3 @@
1
+ import type { ChannelSetupIntegration } from "./channel-setup-integration.js";
2
+ /** Slack's channel-owned credential choice, provisioning, and scaffold behavior. */
3
+ export declare const SLACK_CHANNEL_SETUP: ChannelSetupIntegration;
@@ -0,0 +1 @@
1
+ import{WizardCancelledError}from"./step.js";import{runChannelSetup}from"./channel-setup-runner.js";async function choosePortableCredentials(t){if(t.environment.vercel.kind===`available`)return`vercel-connect`;if(t.presetPortableCredentials!==void 0)return t.presetPortableCredentials?`environment`:`vercel-connect`;try{return await t.ui.prompter.select({message:`How would you like to configure Slack?`,options:[{value:`vercel`,label:`Set up Vercel Connect`,hint:`Sign in and link this project`},{value:`portable`,label:`Use portable credentials`,hint:`Read Slack tokens from environment variables`}]})===`portable`?`environment`:`vercel-connect`}catch(t){if(t instanceof WizardCancelledError)return`cancelled`;throw t}}const SLACK_CHANNEL_SETUP={kind:`slack`,label:`Slack`,hint:`Slack app mentions and DMs`,async setup(e){let n=await choosePortableCredentials(e);if(n===`cancelled`)return{kind:`cancelled`};let r=await runChannelSetup(e,n===`environment`?{slackCredentials:`environment`}:{slackCredentials:`vercel-connect`,ensureLinkedProject:`interactive-vercel-link`});return r.kind===`done`&&n===`environment`&&r.state.channels.includes(`slack`)&&e.ui.nextSteps([`Set SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET in .env.local (listed in .env.example).`,`Configure your Slack app to send events to /eve/v1/slack on your public agent URL.`]),r}};export{SLACK_CHANNEL_SETUP};
@@ -0,0 +1,18 @@
1
+ import { type Asker } from "./ask.js";
2
+ import type { Prompter } from "./prompter.js";
3
+ /** UI capabilities available to a channel-owned setup hook. */
4
+ export interface ChannelSetupUi {
5
+ readonly asker: Asker;
6
+ readonly prompter: Prompter;
7
+ confirm(input: {
8
+ key: string;
9
+ message: string;
10
+ recommended?: boolean;
11
+ }): Promise<boolean>;
12
+ nextSteps(lines: readonly string[]): void;
13
+ }
14
+ /** Adapts the shared setup asker and prompter to the channel hook UI. */
15
+ export declare function createChannelSetupUi(input: {
16
+ asker: Asker;
17
+ prompter: Prompter;
18
+ }): ChannelSetupUi;
@@ -0,0 +1,2 @@
1
+ import{SkippedSignal,confirm}from"./ask.js";function createChannelSetupUi(n){return{...n,async confirm(r){try{return await n.asker.ask(confirm(r))}catch(t){if(t instanceof SkippedSignal)return!1;throw t}},nextSteps(e){e.length!==0&&n.prompter.note(e.join(`
2
+ `),`Next steps`,{tone:`success`})}}}export{createChannelSetupUi};
@@ -0,0 +1,3 @@
1
+ import type { ChannelSetupIntegration } from "./channel-setup-integration.js";
2
+ /** Web Chat's channel-owned setup behavior. */
3
+ export declare const WEB_CHANNEL_SETUP: ChannelSetupIntegration;
@@ -0,0 +1 @@
1
+ import{runChannelSetup}from"./channel-setup-runner.js";const WEB_CHANNEL_SETUP={kind:`web`,label:`Web Chat`,hint:`Browser-based chat interface`,setup(e){return runChannelSetup(e,{configureVercelServices:e.environment.vercel.kind===`available`})}};export{WEB_CHANNEL_SETUP};
@@ -1,4 +1,4 @@
1
- import { type AddChannelsDeps } from "../boxes/add-channels.js";
1
+ import type { AddChannelsDeps } from "../boxes/add-channels.js";
2
2
  import { inspectExistingChannelRegistrations } from "../channel-add-conflicts.js";
3
3
  import { detectDeployment } from "../project-resolution.js";
4
4
  import type { Prompter } from "../prompter.js";
@@ -31,7 +31,7 @@ export type ChannelsFlowResult = {
31
31
  addedChannels: readonly string[];
32
32
  message: string;
33
33
  };
34
- /** The post-Slack "see it live" chooser's title. */
34
+ /** Title for Slack's optional deploy-and-chat continuation. */
35
35
  export declare const SEE_IT_LIVE_MESSAGE = "See it live";
36
36
  /**
37
37
  * THE CHANNELS FLOW for the dev TUI's `/channels`: a task list that loops.
@@ -43,14 +43,9 @@ export declare const SEE_IT_LIVE_MESSAGE = "See it live";
43
43
  * the list after something was added reports the additions exactly like Done;
44
44
  * only an empty exit folds to cancelled.
45
45
  *
46
- * Each pick reuses the `eve channels add` composition the same conflict
47
- * validation, Vercel services config pinned on, and the default empty agent
48
- * name (the Slack connector slug falls back to the package.json name) — with
49
- * two TUI-specific differences: no trailing deploy box (the TUI exposes
50
- * `/deploy` as its own command), and no inline link pickers — channels that
51
- * provision against the Vercel project render disabled with a warning
52
- * pointing at /model while the directory is unlinked, so a pick can never
53
- * reach provisioning without a link.
46
+ * The outer loop owns only picker lifecycle, conflict validation, and durable
47
+ * re-inspection. Each selected integration owns its prompts, provisioning,
48
+ * scaffold choices, deployment continuation, and next-step guidance.
54
49
  */
55
50
  export declare function runChannelsFlow(input: {
56
51
  appRoot: string;
@@ -1 +1 @@
1
- import{interactiveAsker}from"../ask.js";import{detectDeployment,isProjectResolved,projectResolutionFromDeployment}from"../project-resolution.js";import{createDefaultSetupState,snapshotSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{addChannels}from"../boxes/add-channels.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus,vercelAuthBlockerReason}from"../vercel-project.js";import{CHANNELS_PROMPT_MESSAGE,selectChannels}from"../boxes/select-channels.js";import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"../channel-add-conflicts.js";import{runInteractive}from"../runner.js";import{prompterSink}from"./in-project.js";import{SCAFFOLDABLE_CHANNELS}from"#setup/scaffold/index.js";import{toErrorMessage}from"#shared/errors.js";const SEE_IT_LIVE_MESSAGE=`See it live`;async function promptSeeItLive(e){try{return await e.select({message:SEE_IT_LIVE_MESSAGE,options:[{value:`deploy`,label:`Deploy and chat`},{value:`later`,label:`Later`}]})}catch(e){if(e instanceof WizardCancelledError)return`later`;throw e}}function channelAlreadyAdded(e,t){return t===`web`?e.webAppPresent:e.slackOwners.length>0}function appendChannel(e,t){return e.includes(t)?[...e]:[...e,t]}async function pickChannel(e,t,n,r){let i=channelListRows(t,n,r),a=!i.some(e=>e.value!==`done`&&e.completed!==!0&&e.disabled!==!0),s={message:CHANNELS_PROMPT_MESSAGE,options:i,hintLayout:`inline`};a&&(s.initialValue=`done`);try{return{kind:`picked`,value:await e.select(s)}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}function channelLandedDuringSubflow(e,t,n){return!channelAlreadyAdded(e,n)&&channelAlreadyAdded(t,n)}function deployAndChatDetails(e){let t={};return e.slackChatUrl!==void 0&&(t.chatUrl=e.slackChatUrl),e.slackWorkspaceName!==void 0&&(t.workspaceName=e.slackWorkspaceName),t}function vercelChannelBlocker(e,t){let n=vercelAuthBlockerReason(e);if(n!==void 0)return n;if(!t)return`Requires Vercel account, see /model`}function channelListRows(e,t,n){let r=[{value:`repl`,label:`Terminal UI`,completed:!0,focusHint:`Already installed`}];for(let i of SCAFFOLDABLE_CHANNELS){if(channelAlreadyAdded(e,i.kind)){r.push({value:i.kind,label:i.label,completed:!0,focusHint:`Already installed`});continue}let a=e.disabledChannelReasons[i.kind];if(a!==void 0){r.push({value:i.kind,label:i.label,disabled:!0,disabledReason:a});continue}if(i.requiresVercelProject===!0){let e=vercelChannelBlocker(n,t);if(e!==void 0){r.push({value:i.kind,label:i.label,disabled:!0,disabledReason:e,disabledReasonTone:`warning`});continue}}let o={value:i.kind,label:i.label};i.hint!==void 0&&(o.hint=i.hint),r.push(o)}return r.push({value:`done`,label:`Done`,trailingAction:!0}),r}async function runChannelsFlow(o){let{appRoot:c,prompter:l,signal:u}=o,d={detectDeployment,inspectExistingChannelRegistrations,getVercelAuthStatus,...o.deps},[f,p,m]=await withSpinner(l,`Checking the project…`,()=>Promise.all([d.detectDeployment(c,{signal:u}),d.inspectExistingChannelRegistrations(c),d.getVercelAuthStatus(c,{signal:u})]));u?.throwIfAborted();let h=p,g={...createDefaultSetupState(),project:projectResolutionFromDeployment(f),projectPath:{kind:`resolved`,inPlace:!0,path:c}},_;for(;;){let t=await pickChannel(l,h,isProjectResolved(g.project),m);if(t.kind===`cancelled`){if(g.channels.length===0)return{kind:`cancelled`};break}let r=t.value;if(r===`done`)break;if(r===`repl`||channelAlreadyAdded(h,r))continue;let i=[selectChannels({asker:interactiveAsker(l),variant:`channels-add`,presetChannels:[r],validateSelection:e=>assertCanAddSelectedChannels(e,h)}),addChannels({asker:interactiveAsker(l),prompter:l,configureVercelServices:!0,deps:d.addChannels})],o;try{o=await runInteractive(i,g,prompterSink(l),{snapshot:snapshotSetupState,signal:u})}catch(e){let t=await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,t,r)){if(g={...g,channels:appendChannel(g.channels,r)},h=t,_=toErrorMessage(e),u?.aborted===!0)break;continue}throw e}if(o.kind===`done`){if(g=o.state,h=await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c)),u?.throwIfAborted(),r===`slack`&&g.slackbotAttached&&await promptSeeItLive(l)===`deploy`)return{kind:`deploy-and-chat`,addedChannels:g.channels,chat:deployAndChatDetails(g)}}else{let e=await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,e,r))return{kind:`done`,addedChannels:appendChannel(g.channels,r)};h=e}}return _===void 0?{kind:`done`,addedChannels:g.channels}:{kind:`failed`,addedChannels:g.channels,message:_}}export{SEE_IT_LIVE_MESSAGE,runChannelsFlow};
1
+ import{interactiveAsker}from"../ask.js";import{detectDeployment,projectResolutionFromDeployment}from"../project-resolution.js";import{createDefaultSetupState}from"../state.js";import{WizardCancelledError}from"../step.js";import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus}from"../vercel-project.js";import{CHANNELS_PROMPT_MESSAGE}from"../boxes/select-channels.js";import{assertCanAddSelectedChannels,inspectExistingChannelRegistrations}from"../channel-add-conflicts.js";import{channelSetupEnvironment}from"../channel-setup-environment.js";import{createChannelSetupUi}from"../channel-setup-ui.js";import{CHANNEL_SETUP_INTEGRATIONS,channelSetupIntegration}from"../channel-setup-integrations.js";import{toErrorMessage}from"#shared/errors.js";const SEE_IT_LIVE_MESSAGE=`See it live`;async function offerDeployAndChat(e){try{return await e.select({message:SEE_IT_LIVE_MESSAGE,options:[{value:`deploy`,label:`Deploy and chat`},{value:`later`,label:`Later`}]})===`deploy`}catch(e){if(e instanceof WizardCancelledError)return!1;throw e}}function channelAlreadyAdded(e,t){return t===`web`?e.webAppPresent:e.slackOwners.length>0}function appendChannel(e,t){return e.includes(t)?[...e]:[...e,t]}async function pickChannel(e,t){let n=channelListRows(t),r=!n.some(e=>e.value!==`done`&&e.completed!==!0&&e.disabled!==!0),a={message:CHANNELS_PROMPT_MESSAGE,options:n,hintLayout:`inline`};r&&(a.initialValue=`done`);try{return{kind:`picked`,value:await e.select(a)}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}function channelLandedDuringSubflow(e,t,n){return!channelAlreadyAdded(e,n)&&channelAlreadyAdded(t,n)}function deployAndChatDetails(e){let t={};return e.slackChatUrl!==void 0&&(t.chatUrl=e.slackChatUrl),e.slackWorkspaceName!==void 0&&(t.workspaceName=e.slackWorkspaceName),t}function channelListRows(e){let t=[{value:`repl`,label:`Terminal UI`,completed:!0,focusHint:`Already installed`}];for(let n of CHANNEL_SETUP_INTEGRATIONS){if(channelAlreadyAdded(e,n.kind)){t.push({value:n.kind,label:n.label,completed:!0,focusHint:`Already installed`});continue}let r=e.disabledChannelReasons[n.kind];if(r!==void 0){t.push({value:n.kind,label:n.label,disabled:!0,disabledReason:r});continue}let i={value:n.kind,label:n.label};n.hint!==void 0&&(i.hint=n.hint),t.push(i)}return t.push({value:`done`,label:`Done`,trailingAction:!0}),t}async function runChannelsFlow(s){let{appRoot:c,prompter:l,signal:u}=s,d={detectDeployment,inspectExistingChannelRegistrations,getVercelAuthStatus,...s.deps},[f,p,m]=await withSpinner(l,`Checking the project…`,()=>Promise.all([d.detectDeployment(c,{signal:u}),d.inspectExistingChannelRegistrations(c),d.getVercelAuthStatus(c,{signal:u})]));u?.throwIfAborted();let h=p,g=channelSetupEnvironment(m,projectResolutionFromDeployment(f)),_={...createDefaultSetupState(),project:projectResolutionFromDeployment(f),projectPath:{kind:`resolved`,inPlace:!0,path:c}},v;for(;;){let t=await pickChannel(l,h);if(t.kind===`cancelled`){if(_.channels.length===0)return{kind:`cancelled`};break}let n=t.value;if(n===`done`)break;if(n===`repl`||channelAlreadyAdded(h,n))continue;assertCanAddSelectedChannels([n],h);let r;try{r=await channelSetupIntegration(n).setup({environment:g,state:{..._,channelSelection:[n]},ui:createChannelSetupUi({asker:interactiveAsker(l),prompter:l}),signal:u,deps:d.addChannels})}catch(e){let t=u?.aborted===!0?await d.inspectExistingChannelRegistrations(c):await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,t,n)){if(_={..._,channels:appendChannel(_.channels,n)},h=t,e instanceof WizardCancelledError||(v=toErrorMessage(e)),u?.aborted===!0)break;continue}if(e instanceof WizardCancelledError){h=t;continue}throw e}r.kind===`done`&&(_=r.state);let o=u?.aborted===!0?await d.inspectExistingChannelRegistrations(c):await withSpinner(l,`Checking the project…`,()=>d.inspectExistingChannelRegistrations(c));if(channelLandedDuringSubflow(h,o,n)&&(_={..._,channels:appendChannel(_.channels,n)}),h=o,u?.aborted===!0)break;if(r.kind!==`cancelled`&&n===`slack`&&_.slackbotAttached&&await offerDeployAndChat(l))return{kind:`deploy-and-chat`,addedChannels:_.channels,chat:deployAndChatDetails(_)}}return v===void 0?{kind:`done`,addedChannels:_.channels}:{kind:`failed`,addedChannels:_.channels,message:v}}export{SEE_IT_LIVE_MESSAGE,runChannelsFlow};
@@ -1 +1 @@
1
- import{withSpinner}from"../with-spinner.js";import{detectPackageManager}from"#setup/package-manager.js";import{runVercel,spawnPackageManager}from"#setup/primitives/index.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{createPromptCommandOutput}from"#setup/cli/index.js";const defaultDeps={getVercelAuthStatus,detectPackageManager,runVercel,spawnPackageManager};function globalInstallArguments(e){switch(e){case`npm`:return[`install`,`-g`,`vercel@latest`];case`yarn`:return[`global`,`add`,`vercel@latest`];case`pnpm`:case`bun`:return[`add`,`-g`,`vercel@latest`]}}function summarizeUpgradeFailure(e){let t=e.map(e=>e.trim().replace(/\s+/gu,` `)).filter(e=>e!==``&&e!==`}`&&!e.startsWith(`at `)&&!/^vercel upgrade exited with code \d+\.$/u.test(e)),n=t.find(e=>/^(?:error\b|err_|.*\b(?:cannot|failed|could not)\b)/iu.test(e))??t.at(-1);if(n!==void 0)return n.length<=240?n:`${n.slice(0,239)}…`}async function runInstallVercelCliFlow(t){let{appRoot:n,prompter:r,signal:i}=t,a={...defaultDeps,...t.deps},o=createPromptCommandOutput(r.log),probe=async()=>await a.getVercelAuthStatus(n,{signal:i})!==`cli-missing`;if(!t.upgrade&&await withSpinner(r,`Checking for the Vercel CLI…`,probe))return i?.throwIfAborted(),{kind:`already`};i?.throwIfAborted();let s,c;if(t.upgrade){let t=[];s=await withSpinner(r,`Upgrading the Vercel CLI…`,async()=>{let e=await a.runVercel([`upgrade`],{cwd:n,onOutput:e=>{o(e),e.stream===`stderr`&&t.push(e.text)},signal:i,nonInteractive:!0});return e||(c=summarizeUpgradeFailure(t)),e})}else{let t=await a.detectPackageManager(n);s=await withSpinner(r,`Installing the Vercel CLI with ${t.kind}…`,()=>a.spawnPackageManager(t.kind,n,globalInstallArguments(t.kind),{onOutput:o,signal:i,nonInteractive:!0}))}if(i?.aborted===!0)return{kind:`cancelled`};if(!s)return c===void 0?{kind:`failed`}:{kind:`failed`,reason:c};let l=await withSpinner(r,`Verifying the Vercel CLI…`,probe);return i?.throwIfAborted(),l?{kind:`installed`}:t.upgrade?{kind:`failed`,reason:`The Vercel CLI could not be found after the upgrade completed.`}:{kind:`failed`}}export{runInstallVercelCliFlow};
1
+ import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{detectPackageManager}from"#setup/package-manager.js";import{runVercel,spawnPackageManager}from"#setup/primitives/index.js";import{createPromptCommandOutput}from"#setup/cli/index.js";const defaultDeps={getVercelAuthStatus,detectPackageManager,runVercel,spawnPackageManager};function globalInstallArguments(e){switch(e){case`npm`:return[`install`,`-g`,`vercel@latest`];case`yarn`:return[`global`,`add`,`vercel@latest`];case`pnpm`:case`bun`:return[`add`,`-g`,`vercel@latest`]}}function summarizeUpgradeFailure(e){let t=e.map(e=>e.trim().replace(/\s+/gu,` `)).filter(e=>e!==``&&e!==`}`&&!e.startsWith(`at `)&&!/^vercel upgrade exited with code \d+\.$/u.test(e)),n=t.find(e=>/^(?:error\b|err_|.*\b(?:cannot|failed|could not)\b)/iu.test(e))??t.at(-1);if(n!==void 0)return n.length<=240?n:`${n.slice(0,239)}…`}async function runInstallVercelCliFlow(t){let{appRoot:n,prompter:r,signal:i}=t,a={...defaultDeps,...t.deps},o=createPromptCommandOutput(r.log),probe=async()=>await a.getVercelAuthStatus(n,{signal:i})!==`cli-missing`;if(!t.upgrade&&await withSpinner(r,`Checking for the Vercel CLI…`,probe))return i?.throwIfAborted(),{kind:`already`};i?.throwIfAborted();let s,c;if(t.upgrade){let t=[];s=await withSpinner(r,`Upgrading the Vercel CLI…`,async()=>{let e=await a.runVercel([`upgrade`],{cwd:n,onOutput:e=>{o(e),e.stream===`stderr`&&t.push(e.text)},signal:i,nonInteractive:!0});return e||(c=summarizeUpgradeFailure(t)),e})}else{let t=await a.detectPackageManager(n);s=await withSpinner(r,`Installing the Vercel CLI with ${t.kind}…`,()=>a.spawnPackageManager(t.kind,n,globalInstallArguments(t.kind),{onOutput:o,signal:i,nonInteractive:!0}))}if(i?.aborted===!0)return{kind:`cancelled`};if(!s)return c===void 0?{kind:`failed`}:{kind:`failed`,reason:c};let l=await withSpinner(r,`Verifying the Vercel CLI…`,probe);return i?.throwIfAborted(),l?{kind:`installed`}:t.upgrade?{kind:`failed`,reason:`The Vercel CLI could not be found after the upgrade completed.`}:{kind:`failed`}}export{runInstallVercelCliFlow};
@@ -1 +1 @@
1
- import{withSpinner}from"../with-spinner.js";import{runVercel}from"#setup/primitives/run-vercel.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{createPromptCommandOutput}from"#setup/cli/index.js";const defaultDeps={getVercelAuthStatus,runVercelLogin:({cwd:e,onOutput:n,signal:r})=>runVercel([`login`],{cwd:e,nonInteractive:!0,onOutput:n,timeoutMs:3e5,signal:r})};async function runVercelLoginWithControls(t,n,r,i,a){if(i.awaitChoice===void 0)return withSpinner(i,`Opening Vercel login in your browser…`,()=>t.runVercelLogin({cwd:n,onOutput:r,signal:a}));let o=new AbortController,s=a?AbortSignal.any([a,o.signal]):o.signal,c=i.awaitChoice({status:`Logging in to Vercel…`,context:`Complete the login in your browser`,actions:[{value:`cancel`,label:`Cancel`}]}),l=t.runVercelLogin({cwd:n,onOutput:r,signal:s});try{let e=await Promise.race([l.then(e=>({via:`work`,ok:e})),c.choice.then(()=>({via:`choice`}))]);return e.via===`work`?e.ok:(o.abort(),await l.catch(()=>{}),`cancelled`)}finally{c.close()}}async function runLoginFlow(t){let{appRoot:n,prompter:a,signal:o}=t,s={...defaultDeps,...t.deps},c=createPromptCommandOutput(a.log),probeAuth=()=>s.getVercelAuthStatus(n,{signal:o}),l=await withSpinner(a,`Checking your Vercel login…`,probeAuth);switch(o?.throwIfAborted(),l){case`authenticated`:if(t.force!==!0)return{kind:`already`};break;case`cli-missing`:return{kind:`cli-missing`};case`unavailable`:return{kind:`unavailable`};case`logged-out`:break;default:return l}let u=await runVercelLoginWithControls(s,n,c,a,o);if(u===`cancelled`)return{kind:`cancelled`};if(!u)return{kind:`failed`};let d=await withSpinner(a,`Confirming your Vercel login…`,probeAuth);switch(o?.throwIfAborted(),d){case`authenticated`:return{kind:`logged-in`};case`logged-out`:return{kind:`failed`};case`cli-missing`:return{kind:`cli-missing`};case`unavailable`:return{kind:`unavailable`};default:return d}}export{runLoginFlow};
1
+ import{withSpinner}from"../with-spinner.js";import{getVercelAuthStatus}from"#setup/vercel-project.js";import{runVercel}from"#setup/primitives/run-vercel.js";import{createPromptCommandOutput}from"#setup/cli/index.js";const defaultDeps={getVercelAuthStatus,runVercelLogin:({cwd:e,onOutput:t,signal:r})=>runVercel([`login`],{cwd:e,nonInteractive:!0,onOutput:t,timeoutMs:3e5,signal:r})};async function runVercelLoginWithControls(t,n,r,i,a){if(i.awaitChoice===void 0)return withSpinner(i,`Opening Vercel login in your browser…`,()=>t.runVercelLogin({cwd:n,onOutput:r,signal:a}));let o=new AbortController,s=a?AbortSignal.any([a,o.signal]):o.signal,c=i.awaitChoice({status:`Logging in to Vercel…`,context:`Complete the login in your browser`,actions:[{value:`cancel`,label:`Cancel`}]}),l=t.runVercelLogin({cwd:n,onOutput:r,signal:s});try{let e=await Promise.race([l.then(e=>({via:`work`,ok:e})),c.choice.then(()=>({via:`choice`}))]);return e.via===`work`?e.ok:(o.abort(),await l.catch(()=>{}),`cancelled`)}finally{c.close()}}async function runLoginFlow(t){let{appRoot:n,prompter:a,signal:o}=t,s={...defaultDeps,...t.deps},c=createPromptCommandOutput(a.log),probeAuth=()=>s.getVercelAuthStatus(n,{signal:o}),l=await withSpinner(a,`Checking your Vercel login…`,probeAuth);switch(o?.throwIfAborted(),l){case`authenticated`:if(t.force!==!0)return{kind:`already`};break;case`cli-missing`:return{kind:`cli-missing`};case`unavailable`:return{kind:`unavailable`};case`logged-out`:break;default:return l}let u=await runVercelLoginWithControls(s,n,c,a,o);if(u===`cancelled`)return{kind:`cancelled`};if(!u)return{kind:`failed`};let d=await withSpinner(a,`Confirming your Vercel login…`,probeAuth);switch(o?.throwIfAborted(),d){case`authenticated`:return{kind:`logged-in`};case`logged-out`:return{kind:`failed`};case`cli-missing`:return{kind:`cli-missing`};case`unavailable`:return{kind:`unavailable`};default:return d}}export{runLoginFlow};
@@ -1 +1 @@
1
- import{InteractionRequired}from"./ask.js";import{runVercel}from"./primitives/run-vercel.js";import{detectDeployment,detectProjectResolution,projectProductionUrlFromResolution}from"./project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"./slackbot.js";import{createDefaultSetupState,requireProjectPath,snapshotSetupState}from"./state.js";import{WizardCancelledError}from"./step.js";import{setupConnectionConnector}from"./connection-connector.js";import{getPackageManagerStrategy}from"./primitives/pm/index.js";import{linkProject,requireAuth,resolveProjectByNameOrId,resolveTeam}from"./vercel-project.js";import{runVercelEnvPull}from"./run-vercel-link.js";import{createPromptCommandOutput}from"./cli/command-output.js";import"./cli/index.js";import{runHeadless,runInteractive}from"./runner.js";import{HeadlessPromptError,createHeadlessPrompter,formatHeadlessEvent}from"./headless.js";import{createPrompter}from"./prompter.js";import{composeOnboardingBoxes}from"./onboarding.js";import{runPackageManagerInstall,runPnpmInstall,spawnPackageManager,spawnPnpm}from"./primitives/pm/run.js";import"./primitives/index.js";export{HeadlessPromptError,InteractionRequired,WizardCancelledError,composeOnboardingBoxes,createDefaultSetupState,createHeadlessPrompter,createPromptCommandOutput,createPrompter,detectDeployment,detectProjectResolution,formatHeadlessEvent,getPackageManagerStrategy,linkProject,projectProductionUrlFromResolution,provisionSlackbot,reconcileSlackUid,requireAuth,requireProjectPath,resolveProjectByNameOrId,resolveTeam,runHeadless,runInteractive,runPackageManagerInstall,runPnpmInstall,runVercel,runVercelEnvPull,setupConnectionConnector,snapshotSetupState,spawnPackageManager,spawnPnpm};
1
+ import{InteractionRequired}from"./ask.js";import{runVercel}from"./primitives/run-vercel.js";import{detectDeployment,detectProjectResolution,projectProductionUrlFromResolution}from"./project-resolution.js";import{provisionSlackbot,reconcileSlackUid}from"./slackbot.js";import{createDefaultSetupState,requireProjectPath,snapshotSetupState}from"./state.js";import{WizardCancelledError}from"./step.js";import{setupConnectionConnector}from"./connection-connector.js";import{getPackageManagerStrategy}from"./primitives/pm/index.js";import{linkProject,requireAuth,resolveProjectByNameOrId,resolveTeam}from"./vercel-project.js";import{runVercelEnvPull}from"./run-vercel-link.js";import{runHeadless,runInteractive}from"./runner.js";import{createPromptCommandOutput}from"./cli/command-output.js";import"./cli/index.js";import{HeadlessPromptError,createHeadlessPrompter,formatHeadlessEvent}from"./headless.js";import{createPrompter}from"./prompter.js";import{composeOnboardingBoxes}from"./onboarding.js";import{runPackageManagerInstall,runPnpmInstall,spawnPackageManager,spawnPnpm}from"./primitives/pm/run.js";import"./primitives/index.js";export{HeadlessPromptError,InteractionRequired,WizardCancelledError,composeOnboardingBoxes,createDefaultSetupState,createHeadlessPrompter,createPromptCommandOutput,createPrompter,detectDeployment,detectProjectResolution,formatHeadlessEvent,getPackageManagerStrategy,linkProject,projectProductionUrlFromResolution,provisionSlackbot,reconcileSlackUid,requireAuth,requireProjectPath,resolveProjectByNameOrId,resolveTeam,runHeadless,runInteractive,runPackageManagerInstall,runPnpmInstall,runVercel,runVercelEnvPull,setupConnectionConnector,snapshotSetupState,spawnPackageManager,spawnPnpm};
@@ -20,8 +20,6 @@ export interface ScaffoldableChannel {
20
20
  label: string;
21
21
  /** Optional picker hint. */
22
22
  hint?: string;
23
- /** The add sub-flow provisions against the linked Vercel project. */
24
- requiresVercelProject?: true;
25
23
  }
26
24
  /**
27
25
  * Channels the CLI can scaffold, in picker order. Derived from