eve 0.75.1 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/src/acp/adapter.js +1 -1
  4. package/dist/src/channel/task-card.js +1 -1
  5. package/dist/src/channel/tool-eligibility.d.ts +1 -2
  6. package/dist/src/chunks/{use-eve-agent-B2Kne9z6.js → use-eve-agent-D2V9UhLt.js} +68 -10
  7. package/dist/src/chunks/{use-eve-agent-DK_T88EP.js → use-eve-agent-QmriPA-w.js} +68 -10
  8. package/dist/src/cli/dev/environment.d.ts +0 -6
  9. package/dist/src/cli/dev/environment.js +1 -1
  10. package/dist/src/cli/dev/tui/conversation-view.js +1 -1
  11. package/dist/src/cli/dev/tui/runner.js +1 -1
  12. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  13. package/dist/src/cli/dev/tui/transcript.js +1 -1
  14. package/dist/src/client/message-action-parts.d.ts +3 -0
  15. package/dist/src/client/message-action-parts.js +1 -1
  16. package/dist/src/client/message-reducer-types.d.ts +6 -1
  17. package/dist/src/client/message-reducer.js +1 -1
  18. package/dist/src/compiled/.vendor-stamp.json +3 -2
  19. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  20. package/dist/src/compiled/@vercel/queue/index.d.ts +1066 -0
  21. package/dist/src/compiled/@vercel/queue/index.js +47 -0
  22. package/dist/src/compiler/connection-ownership.d.ts +6 -0
  23. package/dist/src/compiler/connection-ownership.js +1 -0
  24. package/dist/src/compiler/default-tool-policy.d.ts +0 -3
  25. package/dist/src/compiler/default-tool-policy.js +1 -1
  26. package/dist/src/compiler/extension-compatibility.d.ts +21 -20
  27. package/dist/src/compiler/extension-compatibility.js +1 -1
  28. package/dist/src/compiler/manifest.d.ts +9 -6
  29. package/dist/src/compiler/manifest.js +1 -1
  30. package/dist/src/compiler/normalize-connection.js +1 -1
  31. package/dist/src/compiler/normalize-manifest.js +1 -1
  32. package/dist/src/compiler/normalize-skill.d.ts +5 -0
  33. package/dist/src/compiler/normalize-skill.js +1 -1
  34. package/dist/src/compiler/normalize-subagent.d.ts +2 -1
  35. package/dist/src/compiler/normalize-subagent.js +1 -1
  36. package/dist/src/compiler/normalize-tool.js +1 -1
  37. package/dist/src/compiler/remote-agent-node.d.ts +2 -1
  38. package/dist/src/compiler/remote-agent-node.js +1 -1
  39. package/dist/src/connections/ownership.d.ts +18 -0
  40. package/dist/src/connections/ownership.js +1 -0
  41. package/dist/src/context/build-dynamic-tools.d.ts +3 -9
  42. package/dist/src/context/build-dynamic-tools.js +1 -1
  43. package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
  44. package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -11
  45. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  46. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  47. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  48. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  49. package/dist/src/context/keys.d.ts +5 -4
  50. package/dist/src/context/memory-tools.js +1 -1
  51. package/dist/src/context/schedule-collection-tools.js +1 -1
  52. package/dist/src/discover/grammar.d.ts +11 -0
  53. package/dist/src/discover/grammar.js +1 -1
  54. package/dist/src/discover/manifest.d.ts +1 -0
  55. package/dist/src/discover/manifest.js +1 -1
  56. package/dist/src/discover/skills.d.ts +1 -0
  57. package/dist/src/discover/skills.js +1 -1
  58. package/dist/src/dynamic/definition.d.ts +7 -5
  59. package/dist/src/evals/assertions/collector.d.ts +4 -0
  60. package/dist/src/evals/assertions/collector.js +1 -1
  61. package/dist/src/evals/assertions/run.d.ts +2 -3
  62. package/dist/src/evals/assertions/run.js +2 -2
  63. package/dist/src/evals/assertions/scoped.js +1 -1
  64. package/dist/src/evals/index.d.ts +1 -1
  65. package/dist/src/evals/match.d.ts +9 -6
  66. package/dist/src/evals/reported-tool-name.d.ts +9 -0
  67. package/dist/src/evals/reported-tool-name.js +1 -0
  68. package/dist/src/evals/runner/derive-run-facts.d.ts +3 -3
  69. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  70. package/dist/src/evals/runner/execute-task.js +1 -1
  71. package/dist/src/evals/runner/reporters/braintrust.js +1 -1
  72. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.d.ts +11 -0
  73. package/dist/src/evals/runner/reporters/datadog-runtime-trace-links.js +1 -0
  74. package/dist/src/evals/runner/reporters/datadog.js +2 -2
  75. package/dist/src/evals/session.js +2 -2
  76. package/dist/src/evals/target.d.ts +7 -0
  77. package/dist/src/evals/target.js +1 -1
  78. package/dist/src/evals/types.d.ts +17 -1
  79. package/dist/src/execution/agent-sessions/remote.js +1 -1
  80. package/dist/src/execution/catalog/connection-auth.d.ts +41 -0
  81. package/dist/src/execution/catalog/connection-auth.js +1 -0
  82. package/dist/src/execution/catalog/connection-entry.d.ts +16 -0
  83. package/dist/src/execution/catalog/connection-entry.js +1 -0
  84. package/dist/src/execution/catalog/listing.d.ts +9 -0
  85. package/dist/src/execution/catalog/listing.js +3 -0
  86. package/dist/src/execution/catalog/rank.d.ts +44 -0
  87. package/dist/src/execution/catalog/rank.js +1 -0
  88. package/dist/src/execution/catalog/search.d.ts +28 -0
  89. package/dist/src/execution/catalog/search.js +1 -0
  90. package/dist/src/execution/catalog/signatures.d.ts +11 -0
  91. package/dist/src/execution/catalog/signatures.js +1 -0
  92. package/dist/src/execution/catalog/skills.d.ts +24 -0
  93. package/dist/src/execution/catalog/skills.js +1 -0
  94. package/dist/src/execution/catalog/step-catalog.d.ts +51 -0
  95. package/dist/src/execution/catalog/step-catalog.js +1 -0
  96. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  97. package/dist/src/execution/dynamic-connections.js +1 -1
  98. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  99. package/dist/src/execution/invoke-tool.js +1 -1
  100. package/dist/src/execution/node-step.js +1 -1
  101. package/dist/src/execution/session/active-turn.d.ts +1 -1
  102. package/dist/src/execution/session/pending-turn-state.js +1 -1
  103. package/dist/src/execution/session/turn-step.js +1 -1
  104. package/dist/src/execution/session/turn.d.ts +5 -5
  105. package/dist/src/execution/session/turn.js +1 -1
  106. package/dist/src/execution/session.js +1 -1
  107. package/dist/src/execution/skills/instructions.d.ts +20 -10
  108. package/dist/src/execution/skills/instructions.js +2 -2
  109. package/dist/src/execution/tasks/calls.d.ts +6 -5
  110. package/dist/src/execution/tasks/calls.js +1 -1
  111. package/dist/src/execution/tasks/model-step.d.ts +10 -10
  112. package/dist/src/execution/tasks/model-step.js +1 -1
  113. package/dist/src/execution/tasks/render.d.ts +3 -3
  114. package/dist/src/execution/tasks/render.js +3 -3
  115. package/dist/src/execution/tasks/session.d.ts +2 -1
  116. package/dist/src/execution/tasks/table.d.ts +1 -1
  117. package/dist/src/execution/tasks/tool-entry-point.d.ts +1 -1
  118. package/dist/src/execution/tool-auth.js +1 -1
  119. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  120. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  121. package/dist/src/extensions/code/extension/extension.d.ts +4 -18
  122. package/dist/src/extensions/code/extension/instructions/github.d.ts +3 -0
  123. package/dist/src/extensions/code/extension/instructions/github.js +1 -0
  124. package/dist/src/extensions/code/extension/instructions.md +1 -13
  125. package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +4 -2
  126. package/dist/src/extensions/code/extension/lib/diagnostics.js +3 -3
  127. package/dist/src/extensions/code/extension/lib/github-compat.d.ts +28 -0
  128. package/dist/src/extensions/code/extension/lib/github-compat.js +1 -0
  129. package/dist/src/extensions/code/extension/lib/grep-search.d.ts +3 -13
  130. package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
  131. package/dist/src/extensions/code/extension/lib/patch.d.ts +8 -2
  132. package/dist/src/extensions/code/extension/lib/patch.js +4 -4
  133. package/dist/src/extensions/code/extension/lib/repository-root.d.ts +3 -4
  134. package/dist/src/extensions/code/extension/lib/repository-root.js +1 -1
  135. package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -1
  136. package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
  137. package/dist/src/extensions/code/extension/lib/tooling.d.ts +4 -4
  138. package/dist/src/extensions/code/extension/lib/tooling.js +7 -7
  139. package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +31 -0
  140. package/dist/src/extensions/code/extension/lib/workspace-root.js +1 -0
  141. package/dist/src/extensions/code/extension/skills/pr.d.ts +6 -0
  142. package/dist/src/extensions/code/extension/skills/pr.js +1 -0
  143. package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +2 -2
  144. package/dist/src/extensions/code/extension/tools/apply_patch.js +2 -2
  145. package/dist/src/extensions/code/extension/tools/gh.d.ts +4 -3
  146. package/dist/src/extensions/code/extension/tools/gh.js +1 -1
  147. package/dist/src/extensions/code/extension/tools/grep.js +1 -1
  148. package/dist/src/extensions/code/tools.d.ts +2 -1
  149. package/dist/src/extensions/code/tools.js +1 -1
  150. package/dist/src/extensions/git/extension/extension.d.ts +12 -0
  151. package/dist/src/extensions/git/extension/extension.js +1 -0
  152. package/dist/src/extensions/git/extension/instructions/github.d.ts +2 -0
  153. package/dist/src/extensions/git/extension/instructions/github.js +1 -0
  154. package/dist/src/extensions/git/extension/lib/gh-tool.d.ts +29 -0
  155. package/dist/src/extensions/git/extension/lib/gh-tool.js +1 -0
  156. package/dist/src/extensions/git/extension/lib/github-guidance.d.ts +3 -0
  157. package/dist/src/extensions/git/extension/lib/github-guidance.js +49 -0
  158. package/dist/src/extensions/{code → git}/extension/lib/github-shell.d.ts +1 -1
  159. package/dist/src/extensions/git/extension/lib/github-shell.js +1 -0
  160. package/dist/src/extensions/git/extension/lib/repository-root.d.ts +5 -0
  161. package/dist/src/extensions/git/extension/lib/repository-root.js +1 -0
  162. package/dist/src/extensions/git/extension/lib/sandbox.d.ts +6 -0
  163. package/dist/src/extensions/git/extension/lib/sandbox.js +1 -0
  164. package/dist/src/extensions/git/extension/lib/shell.d.ts +1 -0
  165. package/dist/src/extensions/git/extension/lib/shell.js +1 -0
  166. package/dist/src/extensions/git/extension/lib/tooling.d.ts +4 -0
  167. package/dist/src/extensions/git/extension/lib/tooling.js +1 -0
  168. package/dist/src/extensions/git/extension/skills/pr.d.ts +5 -0
  169. package/dist/src/extensions/git/extension/skills/pr.js +1 -0
  170. package/dist/src/extensions/git/extension/tools/gh.d.ts +28 -0
  171. package/dist/src/extensions/git/extension/tools/gh.js +1 -0
  172. package/dist/src/extensions/git/tools.d.ts +27 -0
  173. package/dist/src/extensions/git/tools.js +1 -0
  174. package/dist/src/framework/sources/registry.js +1 -1
  175. package/dist/src/harness/action-presentation.d.ts +2 -2
  176. package/dist/src/harness/action-result-helpers.d.ts +10 -2
  177. package/dist/src/harness/action-result-helpers.js +1 -1
  178. package/dist/src/harness/announcements.d.ts +2 -8
  179. package/dist/src/harness/announcements.js +1 -1
  180. package/dist/src/harness/coordination.d.ts +11 -11
  181. package/dist/src/harness/coordination.js +1 -1
  182. package/dist/src/harness/current-messages.d.ts +1 -5
  183. package/dist/src/harness/current-messages.js +1 -1
  184. package/dist/src/harness/emission.d.ts +2 -2
  185. package/dist/src/harness/emission.js +1 -1
  186. package/dist/src/harness/execute-call.d.ts +48 -0
  187. package/dist/src/harness/execute-call.js +1 -0
  188. package/dist/src/harness/execute-tool.d.ts +3 -1
  189. package/dist/src/harness/final-output.d.ts +2 -6
  190. package/dist/src/harness/final-output.js +1 -1
  191. package/dist/src/harness/hitl/approvals.d.ts +5 -0
  192. package/dist/src/harness/hitl/approvals.js +1 -1
  193. package/dist/src/harness/hitl/approved-calls.d.ts +3 -2
  194. package/dist/src/harness/hitl/approved-calls.js +1 -1
  195. package/dist/src/harness/hitl/candidates.d.ts +13 -2
  196. package/dist/src/harness/hitl/candidates.js +1 -1
  197. package/dist/src/harness/hitl/coordinator.d.ts +3 -3
  198. package/dist/src/harness/hitl/coordinator.js +1 -1
  199. package/dist/src/harness/hitl/index.d.ts +6 -4
  200. package/dist/src/harness/hitl/index.js +1 -1
  201. package/dist/src/harness/hitl/intake.d.ts +3 -3
  202. package/dist/src/harness/hitl/intake.js +1 -1
  203. package/dist/src/harness/input-extraction.d.ts +4 -1
  204. package/dist/src/harness/input-extraction.js +1 -1
  205. package/dist/src/harness/input-request-resolution.d.ts +15 -0
  206. package/dist/src/harness/input-request-resolution.js +1 -1
  207. package/dist/src/harness/model-call/call.d.ts +3 -5
  208. package/dist/src/harness/model-call/call.js +1 -1
  209. package/dist/src/harness/model-call/errors.js +1 -1
  210. package/dist/src/harness/model-call/request.d.ts +3 -2
  211. package/dist/src/harness/model-call/request.js +1 -1
  212. package/dist/src/harness/model-call/response.d.ts +2 -1
  213. package/dist/src/harness/model-call/response.js +1 -1
  214. package/dist/src/harness/model-call/run.d.ts +5 -3
  215. package/dist/src/harness/model-call/run.js +1 -1
  216. package/dist/src/harness/model-call/tools.d.ts +12 -21
  217. package/dist/src/harness/model-call/tools.js +1 -1
  218. package/dist/src/harness/model-profile.d.ts +5 -0
  219. package/dist/src/harness/model-profile.js +1 -1
  220. package/dist/src/harness/provider-tools.d.ts +6 -5
  221. package/dist/src/harness/provider-tools.js +1 -1
  222. package/dist/src/harness/session-machine/commit.js +1 -1
  223. package/dist/src/harness/session-machine/transitions.d.ts +5 -2
  224. package/dist/src/harness/session-machine/transitions.js +1 -1
  225. package/dist/src/harness/step/after-model.js +1 -1
  226. package/dist/src/harness/step-hooks.d.ts +4 -6
  227. package/dist/src/harness/step-hooks.js +1 -1
  228. package/dist/src/harness/tool-call-input-errors.d.ts +2 -2
  229. package/dist/src/harness/tool-call-io.d.ts +3 -0
  230. package/dist/src/harness/tool-call-io.js +1 -1
  231. package/dist/src/harness/tools.d.ts +22 -19
  232. package/dist/src/harness/tools.js +1 -1
  233. package/dist/src/harness/types.d.ts +14 -0
  234. package/dist/src/instrumentation/lifecycle.d.ts +0 -1
  235. package/dist/src/instrumentation/native-events.js +1 -1
  236. package/dist/src/instrumentation/runtime.d.ts +2 -1
  237. package/dist/src/internal/application/package.js +1 -1
  238. package/dist/src/internal/authored-definition/core.js +1 -1
  239. package/dist/src/internal/authored-definition/schedule-collection.js +1 -1
  240. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -2
  241. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  242. package/dist/src/internal/authored-module.d.ts +2 -1
  243. package/dist/src/internal/authored-module.js +1 -1
  244. package/dist/src/internal/helpers/markdown.js +1 -1
  245. package/dist/src/internal/mcp/skills.js +1 -1
  246. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  247. package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
  248. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.d.ts +5 -0
  249. package/dist/src/internal/nitro/host/local-schedules-runtime-plugin.js +1 -0
  250. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +6 -0
  251. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -1
  252. package/dist/src/internal/schedules/consumer-route.d.ts +2 -0
  253. package/dist/src/internal/schedules/consumer-route.js +1 -1
  254. package/dist/src/internal/schedules/dev-environment.d.ts +2 -0
  255. package/dist/src/internal/schedules/dev-environment.js +1 -0
  256. package/dist/src/internal/vercel-agent-summary.d.ts +2 -2
  257. package/dist/src/internal/workflow/vercel-world-defaults.d.ts +1 -1
  258. package/dist/src/internal/workflow/vercel-world-defaults.js +1 -1
  259. package/dist/src/protocol/catalog-tools.d.ts +12 -0
  260. package/dist/src/protocol/catalog-tools.js +1 -0
  261. package/dist/src/protocol/message-version.js +1 -1
  262. package/dist/src/protocol/message.d.ts +1 -1
  263. package/dist/src/protocol/remote-agent-protocol.d.ts +2 -0
  264. package/dist/src/protocol/remote-agent-protocol.js +1 -1
  265. package/dist/src/protocol/reply-tool.d.ts +2 -0
  266. package/dist/src/protocol/reply-tool.js +1 -0
  267. package/dist/src/protocol/runtime-tools.d.ts +6 -0
  268. package/dist/src/protocol/runtime-tools.js +1 -0
  269. package/dist/src/protocol/session-projection.js +1 -1
  270. package/dist/src/protocol/task-tools.d.ts +4 -4
  271. package/dist/src/protocol/task-tools.js +1 -1
  272. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
  273. package/dist/src/public/channels/linear/defaults.js +2 -2
  274. package/dist/src/public/channels/slack/action-status.d.ts +0 -9
  275. package/dist/src/public/channels/slack/action-status.js +1 -1
  276. package/dist/src/public/channels/slack/defaults.js +2 -2
  277. package/dist/src/public/channels/slack/task-card.d.ts +1 -1
  278. package/dist/src/public/definitions/connections/mcp.d.ts +4 -4
  279. package/dist/src/public/definitions/connections/openapi.d.ts +6 -7
  280. package/dist/src/public/definitions/remote-agent.d.ts +6 -3
  281. package/dist/src/public/definitions/workspace-agent.d.ts +6 -3
  282. package/dist/src/public/experimental/schedules/index.d.ts +1 -1
  283. package/dist/src/public/schedules/providers/in-memory.js +1 -1
  284. package/dist/src/public/schedules/providers/vercel.js +1 -1
  285. package/dist/src/public/schedules/subscription.d.ts +36 -16
  286. package/dist/src/public/tools/web-search.d.ts +1 -1
  287. package/dist/src/runtime/agent/bootstrap.d.ts +2 -1
  288. package/dist/src/runtime/agent/bootstrap.js +1 -1
  289. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  290. package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
  291. package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +2 -0
  292. package/dist/src/runtime/agent/mock-model-skill-selection.js +2 -2
  293. package/dist/src/runtime/agent/mock-structured-output.d.ts +1 -1
  294. package/dist/src/runtime/connections/mcp-client.js +1 -1
  295. package/dist/src/runtime/connections/registry.js +1 -1
  296. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  297. package/dist/src/runtime/connections/tool-result.d.ts +2 -2
  298. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  299. package/dist/src/runtime/resolve-tool.js +1 -1
  300. package/dist/src/runtime/schedules/collection-client.d.ts +12 -3
  301. package/dist/src/runtime/schedules/collection-client.js +1 -1
  302. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
  303. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +2 -1
  304. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  305. package/dist/src/runtime/subagents/registry.d.ts +2 -1
  306. package/dist/src/runtime/subagents/registry.js +1 -1
  307. package/dist/src/runtime/tools/registry.d.ts +2 -0
  308. package/dist/src/runtime/tools/registry.js +1 -1
  309. package/dist/src/runtime/types.d.ts +3 -3
  310. package/dist/src/setup/connection-connector.js +1 -2
  311. package/dist/src/setup/index.d.ts +1 -1
  312. package/dist/src/setup/index.js +1 -1
  313. package/dist/src/setup/integrations/slack/setup.d.ts +23 -3
  314. package/dist/src/setup/integrations/slack/setup.js +1 -1
  315. package/dist/src/setup/primitives/process-output.d.ts +5 -0
  316. package/dist/src/setup/primitives/process-output.js +2 -1
  317. package/dist/src/setup/scaffold/create/project.js +1 -1
  318. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  319. package/dist/src/setup/scaffold/create/web-template.js +1 -1
  320. package/dist/src/setup/scaffold/update/update-slack-channel.d.ts +17 -0
  321. package/dist/src/setup/scaffold/update/update-slack-channel.js +1 -1
  322. package/dist/src/setup/slack-connect-create.d.ts +10 -2
  323. package/dist/src/setup/slack-connect-create.js +1 -1
  324. package/dist/src/setup/slack-connect-lifecycle.d.ts +92 -44
  325. package/dist/src/setup/slack-connect-lifecycle.js +1 -1
  326. package/dist/src/setup/slack-connect.d.ts +30 -11
  327. package/dist/src/setup/slack-connect.js +1 -1
  328. package/dist/src/setup/slack-setup-plan.d.ts +72 -0
  329. package/dist/src/setup/slack-setup-plan.js +1 -0
  330. package/dist/src/setup/slackbot.d.ts +75 -35
  331. package/dist/src/setup/slackbot.js +2 -1
  332. package/dist/src/shared/action-label.d.ts +10 -0
  333. package/dist/src/shared/action-label.js +1 -0
  334. package/dist/src/shared/action-request-name.d.ts +3 -1
  335. package/dist/src/shared/action-request-name.js +1 -1
  336. package/dist/src/shared/action-types.d.ts +7 -8
  337. package/dist/src/shared/action-types.js +1 -1
  338. package/dist/src/shared/agent-definition.d.ts +11 -3
  339. package/dist/src/shared/development-env-files.d.ts +4 -0
  340. package/dist/src/shared/development-env-files.js +1 -0
  341. package/dist/src/shared/input.d.ts +0 -1
  342. package/dist/src/shared/map-with-concurrency.d.ts +2 -0
  343. package/dist/src/shared/map-with-concurrency.js +1 -0
  344. package/dist/src/shared/skill-definition.d.ts +6 -0
  345. package/dist/src/shared/skill-package.d.ts +1 -0
  346. package/dist/src/shared/skill-package.js +1 -1
  347. package/dist/src/shared/web-search.d.ts +15 -2
  348. package/dist/src/shared/web-search.js +1 -1
  349. package/dist/src/svelte/index.js +1 -1
  350. package/dist/src/svelte/use-eve-agent.js +1 -1
  351. package/dist/src/tool-stubs/execute.d.ts +0 -3
  352. package/dist/src/tool-stubs/execute.js +1 -1
  353. package/dist/src/tool-stubs/rules.js +1 -1
  354. package/dist/src/tool-stubs/validate-targets.js +1 -1
  355. package/dist/src/tools/behavior.d.ts +3 -6
  356. package/dist/src/tools/definition.d.ts +5 -0
  357. package/dist/src/tools/dynamic.d.ts +5 -2
  358. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  359. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  360. package/dist/src/tools/provided/task-cancel.d.ts +1 -1
  361. package/dist/src/tools/provided/task-wait.d.ts +1 -1
  362. package/dist/src/tools/provided/web-search.d.ts +20 -7
  363. package/dist/src/tools/provided/web-search.js +1 -1
  364. package/dist/src/tools/schema.d.ts +5 -0
  365. package/dist/src/tools/schema.js +1 -1
  366. package/dist/src/{runtime/connections/tool-signature.d.ts → tools/signature.d.ts} +2 -2
  367. package/dist/src/tools/workflow-definition.d.ts +1 -1
  368. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  369. package/dist/src/tracing/agent-otel-provider.js +2 -2
  370. package/dist/src/tracing/agent-otel-runtime-context.d.ts +1 -0
  371. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  372. package/dist/src/tracing/agent-otel-turn-state.d.ts +6 -0
  373. package/dist/src/tracing/agent-otel-turn-state.js +1 -0
  374. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  375. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  376. package/dist/src/tracing/agent-trace-state.d.ts +4 -1
  377. package/dist/src/vue/index.js +1 -1
  378. package/dist/src/vue/use-eve-agent.js +1 -1
  379. package/docs/agent-config.md +8 -8
  380. package/docs/channels/chat-sdk.mdx +1 -1
  381. package/docs/channels/slack.mdx +32 -82
  382. package/docs/code-extension.mdx +28 -7
  383. package/docs/concepts/built-in-tools.md +43 -43
  384. package/docs/concepts/context-control.md +1 -1
  385. package/docs/concepts/execution-model-and-durability.mdx +1 -1
  386. package/docs/concepts/sessions-runs-and-streaming.md +4 -4
  387. package/docs/connections/mcp.mdx +5 -5
  388. package/docs/connections/openapi.mdx +1 -1
  389. package/docs/connections/overview.mdx +4 -2
  390. package/docs/evals/assertions.mdx +5 -3
  391. package/docs/evals/reporters.mdx +3 -1
  392. package/docs/evals/tool-stubs.mdx +3 -1
  393. package/docs/extensions.md +2 -0
  394. package/docs/guides/dev-tui.md +2 -2
  395. package/docs/guides/dynamic-capabilities.md +14 -4
  396. package/docs/guides/frontend/overview.mdx +1 -1
  397. package/docs/guides/remote-agents.md +10 -3
  398. package/docs/instructions.mdx +5 -5
  399. package/docs/reference/cli.md +2 -2
  400. package/docs/reference/typescript-api.md +3 -3
  401. package/docs/skills.mdx +19 -4
  402. package/docs/subagents/index.mdx +5 -3
  403. package/docs/tools/overview.mdx +22 -1
  404. package/docs/tools/tasks-upgrade.md +1 -1
  405. package/docs/tools/tasks.md +32 -32
  406. package/docs/tools/workflows.mdx +6 -6
  407. package/docs/tutorial/team-playbooks.mdx +2 -2
  408. package/package.json +22 -6
  409. package/dist/src/execution/connection-announcement.d.ts +0 -7
  410. package/dist/src/execution/connection-announcement.js +0 -4
  411. package/dist/src/execution/tools/connection-approval.d.ts +0 -25
  412. package/dist/src/execution/tools/connection-approval.js +0 -1
  413. package/dist/src/execution/tools/connection-search-rank.d.ts +0 -21
  414. package/dist/src/execution/tools/connection-search-rank.js +0 -1
  415. package/dist/src/execution/tools/connection-target.d.ts +0 -18
  416. package/dist/src/execution/tools/connection-target.js +0 -1
  417. package/dist/src/execution/tools/connection-tools.d.ts +0 -4
  418. package/dist/src/execution/tools/connection-tools.js +0 -2
  419. package/dist/src/execution/tools/load-skill.d.ts +0 -10
  420. package/dist/src/execution/tools/load-skill.js +0 -1
  421. package/dist/src/extensions/code/extension/lib/github-shell.js +0 -1
  422. package/dist/src/extensions/code/extension/skills/pr/SKILL.md +0 -53
  423. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.d.ts +0 -2
  424. package/dist/src/extensions/code/extension/subagents/worker/tools/load_skill.js +0 -1
  425. package/dist/src/harness/advertised-tools.d.ts +0 -26
  426. package/dist/src/harness/advertised-tools.js +0 -1
  427. package/dist/src/harness/nested-actions.d.ts +0 -23
  428. package/dist/src/harness/nested-actions.js +0 -1
  429. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +0 -1
  430. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +0 -1
  431. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +0 -1
  432. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +0 -1
  433. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +0 -1
  434. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +0 -1
  435. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +0 -1
  436. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +0 -2
  437. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +0 -1
  438. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +0 -1
  439. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +0 -1
  440. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +0 -1
  441. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +0 -1
  442. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +0 -1
  443. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +0 -1
  444. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -1
  445. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +0 -1
  446. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -1
  447. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -2
  448. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +0 -1
  449. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +0 -1
  450. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +0 -1
  451. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +0 -1
  452. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +0 -2
  453. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +0 -1
  454. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -1
  455. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +0 -1
  456. package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +0 -36
  457. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -1
  458. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +0 -1
  459. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +0 -1
  460. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +0 -1
  461. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +0 -1
  462. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +0 -1
  463. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +0 -1
  464. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -1
  465. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +0 -1
  466. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +0 -1
  467. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +0 -2
  468. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +0 -1
  469. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +0 -1
  470. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +0 -1
  471. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +0 -1
  472. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +0 -1
  473. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +0 -1
  474. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +0 -1
  475. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +0 -1
  476. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +0 -1
  477. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +0 -1
  478. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +0 -1
  479. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +0 -1
  480. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +0 -1
  481. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +0 -1
  482. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +0 -1
  483. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +0 -1
  484. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +0 -1
  485. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +0 -1
  486. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +0 -1
  487. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +0 -1
  488. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +0 -1
  489. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +0 -1
  490. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +0 -1
  491. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +0 -1
  492. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +0 -1
  493. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +0 -1
  494. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +0 -1
  495. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +0 -1
  496. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +0 -1
  497. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +0 -1
  498. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +0 -1
  499. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +0 -1
  500. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +0 -1
  501. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +0 -1
  502. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +0 -1
  503. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +0 -1
  504. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +0 -1
  505. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +0 -1
  506. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +0 -1
  507. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +0 -1
  508. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +0 -1
  509. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +0 -1
  510. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +0 -1
  511. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +0 -1
  512. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +0 -1
  513. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +0 -1
  514. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +0 -1
  515. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +0 -1
  516. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +0 -1
  517. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +0 -1
  518. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +0 -1
  519. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +0 -1
  520. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +0 -1
  521. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +0 -1
  522. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +0 -1
  523. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +0 -1
  524. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +0 -1
  525. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +0 -1
  526. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +0 -1
  527. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +0 -1
  528. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +0 -1
  529. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +0 -1
  530. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +0 -1
  531. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +0 -1
  532. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +0 -1
  533. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +0 -1
  534. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +0 -1
  535. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +0 -1
  536. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +0 -1
  537. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +0 -1
  538. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +0 -1
  539. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +0 -1
  540. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +0 -1
  541. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +0 -1
  542. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +0 -1
  543. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +0 -1
  544. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +0 -1
  545. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +0 -1
  546. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +0 -1
  547. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +0 -1
  548. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +0 -1
  549. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +0 -1
  550. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +0 -1
  551. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +0 -1
  552. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +0 -1
  553. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +0 -1
  554. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +0 -1
  555. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +0 -1
  556. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +0 -1
  557. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +0 -1
  558. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +0 -1
  559. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +0 -1
  560. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +0 -1
  561. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +0 -1
  562. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +0 -1
  563. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +0 -1
  564. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +0 -1
  565. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +0 -1
  566. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +0 -1
  567. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -1
  568. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -1
  569. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -1
  570. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -1
  571. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -1
  572. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -1
  573. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +0 -7
  574. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +0 -1
  575. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +0 -1
  576. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +0 -1
  577. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +0 -1
  578. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
  579. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +0 -1
  580. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +0 -1
  581. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +0 -1
  582. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +0 -1
  583. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +0 -2
  584. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +0 -1
  585. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +0 -1
  586. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +0 -1
  587. package/dist/src/public/tools/load-skill.d.ts +0 -3
  588. package/dist/src/public/tools/load-skill.js +0 -1
  589. package/dist/src/runtime/skills/fragment-context.d.ts +0 -4
  590. package/dist/src/runtime/skills/fragment-context.js +0 -1
  591. package/dist/src/tools/framework/connection-tools.d.ts +0 -3
  592. package/dist/src/tools/framework/connection-tools.js +0 -1
  593. package/dist/src/tools/provided/load-skill.d.ts +0 -2
  594. package/dist/src/tools/provided/load-skill.js +0 -1
  595. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.d.ts +0 -0
  596. /package/dist/src/extensions/{code → git}/extension/lib/github-shell-schema.js +0 -0
  597. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.d.ts +0 -0
  598. /package/dist/src/extensions/{code → git}/extension/lib/signed-commit.js +0 -0
  599. /package/dist/src/{runtime/connections/tool-signature.js → tools/signature.js} +0 -0
@@ -1,21 +1,13 @@
1
- import { type ConnectTriggerAttachmentResult } from "#setup/connect-provisioning.js";
2
1
  import { createPromptCommandOutput, type ChannelSetupLog } from "#setup/cli/index.js";
3
2
  import { captureVercel, runVercel } from "#setup/primitives/run-vercel.js";
4
- import { type RawSlackConnector, type SlackConnectorDetails, type SlackConnectorRef, type SlackWorkspaceConnection } from "./slack-connect.js";
3
+ import { type SlackConnectorDetails, type SlackConnectorRef, type SlackWorkspaceConnection } from "./slack-connect.js";
4
+ import type { SlackConnectorCandidate, SlackRoutingPlan } from "./slack-setup-plan.js";
5
5
  export declare const CONNECT_LOOKUP_TIMEOUT_MS = 60000;
6
- /** Connect subprocess operations needed to inventory and remove Slack connectors. */
6
+ /** Connect subprocess operations needed to inspect and remove Slack connectors. */
7
7
  export interface SlackConnectLifecycleDeps {
8
8
  captureVercel: typeof captureVercel;
9
9
  runVercel: typeof runVercel;
10
10
  }
11
- type SlackConnectorInventory = {
12
- state: "ok";
13
- body: unknown;
14
- connectors: readonly RawSlackConnector[];
15
- } | {
16
- state: "failed";
17
- message: string;
18
- };
19
11
  export type SlackConnectorCleanupResult = {
20
12
  state: "clean";
21
13
  } | {
@@ -23,43 +15,96 @@ export type SlackConnectorCleanupResult = {
23
15
  connectorUids: readonly string[];
24
16
  };
25
17
  type CommandOutput = ReturnType<typeof createPromptCommandOutput>;
18
+ type LookupFailure = {
19
+ state: "failed";
20
+ message: string;
21
+ };
26
22
  /** Shared dependencies and output routing for one connector cleanup operation. */
27
23
  interface SlackConnectorCleanupContext {
28
24
  log: ChannelSetupLog;
29
25
  deps: SlackConnectLifecycleDeps;
30
26
  projectRoot: string;
27
+ orgId: string | undefined;
31
28
  onOutput: CommandOutput;
32
29
  }
33
- /** Reads and validates the account-level Slack connector inventory. */
34
- export declare function listSlackConnectors(deps: SlackConnectLifecycleDeps, projectRoot: string, onOutput: CommandOutput, signal?: AbortSignal): Promise<SlackConnectorInventory>;
35
- export type SlackConnectorLookup = {
36
- state: "found";
37
- connectors: readonly SlackConnectorRef[];
38
- preferred?: SlackConnectorRef;
39
- connectorUids: ReadonlySet<string>;
40
- } | {
41
- state: "not-found";
42
- connectorUids: ReadonlySet<string>;
43
- } | {
44
- state: "failed";
45
- message: string;
46
- };
47
- /** Lists Slack connectors attached to the linked project and identifies the expected UID. */
48
- export declare function findSlackConnector(deps: SlackConnectLifecycleDeps, projectRoot: string, projectId: string | undefined, expectedUid: string | undefined, onOutput: CommandOutput, signal?: AbortSignal): Promise<SlackConnectorLookup>;
30
+ export type SlackConnectorInspection = {
31
+ state: "ok";
32
+ /** Connectors attached to this project or found by UID, with details. */
33
+ candidates: readonly SlackConnectorCandidate[];
34
+ } | LookupFailure;
35
+ /**
36
+ * Read-only snapshot of the Slack connectors that matter to the linked
37
+ * project: those attached to it, plus `namedUids` looked up directly. Each
38
+ * carries its attachment, workspace installation, and trigger destination.
39
+ * Any unreadable connector fails the whole snapshot so setup never guesses.
40
+ */
41
+ export declare function inspectSlackConnectors(input: {
42
+ deps: SlackConnectLifecycleDeps;
43
+ projectRoot: string;
44
+ projectId: string;
45
+ orgId: string | undefined;
46
+ /**
47
+ * UIDs to look up even when this project isn't attached: the channel
48
+ * file's connector and `slack/<slug>`, the names a connector made for this
49
+ * agent would carry. No other unattached connector is ever reused.
50
+ */
51
+ namedUids: ReadonlySet<string>;
52
+ onOutput: CommandOutput;
53
+ signal?: AbortSignal;
54
+ }): Promise<SlackConnectorInspection>;
55
+ /** Rechecks the chosen connector before changing its project access or destinations. */
56
+ export declare function refreshSlackCandidate(input: {
57
+ deps: SlackConnectLifecycleDeps;
58
+ projectRoot: string;
59
+ candidate: SlackConnectorCandidate;
60
+ projectId: string;
61
+ orgId: string | undefined;
62
+ onOutput: CommandOutput;
63
+ signal?: AbortSignal;
64
+ }): Promise<{
65
+ state: "ok";
66
+ candidate: SlackConnectorCandidate;
67
+ } | LookupFailure>;
49
68
  /**
50
- * Outcome of pointing a connector's trigger destination at this project's eve
51
- * route. Detach and attach are reported separately because attach must not run
52
- * while an old trigger destination may still exist. A `detach-failed` connector
53
- * is left in a known-stale state the caller surfaces with manual recovery steps.
69
+ * Picks the `--name` for a new connector: `slug`, then `slug-2`, `slug-3`,
70
+ * and so on. Connect derives the UID `slack/<name>` from it, and a UID a
71
+ * team connector already uses fails the create, so each name is checked by
72
+ * looking its UID up directly.
54
73
  */
55
- type SlackConnectorAttachmentResult = ConnectTriggerAttachmentResult;
74
+ export declare function findFreeSlackConnectorName(input: {
75
+ deps: Pick<SlackConnectLifecycleDeps, "captureVercel">;
76
+ projectRoot: string;
77
+ orgId: string | undefined;
78
+ slug: string;
79
+ onOutput: CommandOutput;
80
+ signal?: AbortSignal;
81
+ }): Promise<{
82
+ state: "ok";
83
+ name: string;
84
+ } | LookupFailure>;
85
+ /** Result of making a connector deliver this project's events to eve's Slack route. */
86
+ export type SlackRoutingResult = {
87
+ state: "configured";
88
+ } | {
89
+ state: "attach-failed";
90
+ message?: string;
91
+ };
56
92
  /**
57
- * Replaces the connector's default trigger destination with the eve route:
58
- * detach the existing destination first, then attach this project. Either
59
- * subprocess failing short-circuits so a half-configured connector is reported
60
- * rather than silently left pointing at the wrong place.
93
+ * Applies the planned routing mutation. Never detaches: attach only adds
94
+ * token access, and the trigger-destinations replacement keeps the project's
95
+ * token access and every other project's entries intact.
61
96
  */
62
- export declare function attachSlackConnector(deps: SlackConnectLifecycleDeps, projectRoot: string, ref: SlackConnectorRef, onOutput: CommandOutput, signal?: AbortSignal): Promise<SlackConnectorAttachmentResult>;
97
+ export declare function applySlackRouting(input: {
98
+ deps: SlackConnectLifecycleDeps;
99
+ projectRoot: string;
100
+ ref: SlackConnectorRef;
101
+ plan: Extract<SlackRoutingPlan, {
102
+ kind: "apply";
103
+ }>;
104
+ orgId: string | undefined;
105
+ onOutput: CommandOutput;
106
+ signal?: AbortSignal;
107
+ }): Promise<SlackRoutingResult>;
63
108
  type SlackWorkspaceLookup = {
64
109
  state: "connected";
65
110
  workspace: SlackWorkspaceConnection;
@@ -97,16 +142,19 @@ export declare function fetchSlackWorkspace(input: {
97
142
  signal?: AbortSignal;
98
143
  }): Promise<SlackWorkspaceLookup>;
99
144
  /**
100
- * Removes the exact connector returned by `connect create`. When no UID was
101
- * returned, ownership cannot be proven: a concurrent or eventually-consistent
102
- * connector looks the same as this attempt's. So cleanup fails closed. It
103
- * removes nothing and instead surfaces the connectors that look like this
104
- * attempt's, matching `expectedUid` and absent from the pre-create snapshot, so
105
- * the caller can stop rather than risk removing a bystander's connector.
145
+ * Removes the exact connector returned by `connect create`. A run the CLI
146
+ * rejected before its browser flow cannot have created a connector, so there
147
+ * is nothing to remove. Otherwise, when no UID was returned, ownership cannot be
148
+ * proven: the browser page may still create one, and a concurrent or
149
+ * eventually-consistent connector looks the same as this attempt's. So
150
+ * cleanup fails closed. It removes nothing and instead surfaces
151
+ * `expectedUid`, which was free before this attempt, if it now exists, so the
152
+ * caller can stop rather than risk removing a bystander's connector.
106
153
  */
107
154
  export declare function cleanupCreatedAttempt(context: SlackConnectorCleanupContext, input: {
108
155
  expectedUid: string;
109
- baselineConnectorUids: ReadonlySet<string>;
110
156
  createdRef: SlackConnectorRef | undefined;
157
+ /** The CLI reported its own error before printing the browser URL. */
158
+ rejected: boolean;
111
159
  }): Promise<SlackConnectorCleanupResult>;
112
160
  export {};
@@ -1 +1 @@
1
- import{parseSlackConnectorDetails,parseSlackConnectors}from"./slack-connect.js";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import"#setup/primitives/run-vercel.js";import"#setup/cli/index.js";import{CONNECT_MUTATION_TIMEOUT_MS,replaceConnectTrigger}from"#setup/connect-provisioning.js";const CONNECT_LOOKUP_TIMEOUT_MS=6e4;async function listSlackConnectors(e,t,n,r){let i=await e.captureVercel([`connect`,`list`,`-F`,`json`,`--all-projects`],{cwd:t,onOutput:n,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS,signal:r});if(!i.ok)return{state:`failed`,message:i.failure.message};try{let e=JSON.parse(i.stdout);if(typeof e!=`object`||!e)return{state:`failed`,message:`Vercel returned a malformed connector list.`};let t=e;return Array.isArray(t.connectors??t.clients)?{state:`ok`,body:e,connectors:parseSlackConnectors(e)}:{state:`failed`,message:`Vercel returned a malformed connector list.`}}catch{return{state:`failed`,message:`Vercel returned invalid JSON for the connector list.`}}}async function findSlackConnector(e,t,n,r,i,a){let o=await listSlackConnectors(e,t,i,a);if(o.state===`failed`)return o;let s=new Set(o.connectors.map(e=>e.uid));if(n===void 0)return{state:`not-found`,connectorUids:s};let c=o.connectors.filter(e=>e.id!==void 0&&e.projectIds.includes(n)).sort((e,t)=>t.createdAt-e.createdAt).map(({uid:e,id:t})=>({uid:e,id:t}));if(c.length===0)return{state:`not-found`,connectorUids:s};let l=c.find(e=>e.uid===r);return l===void 0?{state:`found`,connectors:c,connectorUids:s}:{state:`found`,connectors:c,preferred:l,connectorUids:s}}async function attachSlackConnector(e,t,n,r,i){return replaceConnectTrigger({connectorUid:n.uid,projectRoot:t,triggerPath:SLACK_CHANNEL_DEFAULT_ROUTE,onOutput:r,signal:i,deps:e})}async function fetchSlackConnectorDetails(e){let t=e.orgId===void 0?``:`?teamId=${encodeURIComponent(e.orgId)}`,n=[`api`,`/v1/connect/connectors/${encodeURIComponent(e.connectorId)}${t}`];e.orgId!==void 0&&n.push(`--scope`,e.orgId);let r=await e.deps.captureVercel(n,{cwd:e.projectRoot,onOutput:e.onOutput,timeoutMs:e.timeoutMs,signal:e.signal});if(!r.ok)return{state:`failed`,message:r.failure.message};try{let t=JSON.parse(r.stdout),n=parseSlackConnectorDetails(t);return n?.ref.id===e.connectorId?{state:`found`,details:n}:{state:`failed`,message:`Vercel returned an invalid Slack connector.`}}catch{return{state:`failed`,message:`Vercel returned invalid JSON for the Slack connector.`}}}async function fetchSlackWorkspace(e){let t=await fetchSlackConnectorDetails(e);return t.state===`failed`?t:t.details.workspace===void 0?{state:`pending`}:{state:`connected`,workspace:t.details.workspace}}async function cleanupConnectorUid(e,t){let{log:n,deps:r,projectRoot:i,onOutput:a}=e;return await r.runVercel([`connect`,`remove`,t,`--disconnect-all`,`--yes`],{cwd:i,onOutput:a,timeoutMs:CONNECT_MUTATION_TIMEOUT_MS})?!0:(n.warning(`Could not remove the abandoned Slack connector. Run \`vercel connect remove ${t} --disconnect-all --yes\` to clean it up.`),!1)}async function cleanupConnectorUids(e,t){let n=[];for(let r of new Set(t))await cleanupConnectorUid(e,r)||n.push(r);return n.length===0?{state:`clean`}:{state:`failed`,connectorUids:n}}async function cleanupCreatedAttempt(e,t){if(t.createdRef)return cleanupConnectorUids(e,[t.createdRef.uid]);e.log.warning(`eve couldn't confirm the Slack request in your browser was cancelled. Wait for it to expire before retrying.`);let n=await listSlackConnectors(e.deps,e.projectRoot,e.onOutput);return n.state===`failed`?{state:`failed`,connectorUids:[]}:{state:`failed`,connectorUids:n.connectors.map(e=>e.uid).filter(e=>(e===t.expectedUid||e.startsWith(`${t.expectedUid}-`))&&!t.baselineConnectorUids.has(e))}}export{CONNECT_LOOKUP_TIMEOUT_MS,attachSlackConnector,cleanupCreatedAttempt,fetchSlackConnectorDetails,fetchSlackWorkspace,findSlackConnector,listSlackConnectors};
1
+ import{parseConnectorProjects,parseSlackConnectorDetails,parseSlackConnectorPage}from"./slack-connect.js";import"#setup/primitives/run-vercel.js";import{isNotFoundApiFailure,normalizeVercelApiResult}from"#setup/vercel-api-failure.js";import{mapWithConcurrency}from"#shared/map-with-concurrency.js";import"#setup/cli/index.js";import{CONNECT_MUTATION_TIMEOUT_MS}from"#setup/connect-provisioning.js";const CONNECT_LOOKUP_TIMEOUT_MS=6e4;function connectApiArgs(e,t,n={},r=[]){let i=new URLSearchParams(n);t!==void 0&&i.set(`teamId`,t);let a=i.toString(),o=[`api`,a===``?e:`${e}?${a}`,...r];return t!==void 0&&o.push(`--scope`,t),o}function connectorPath(e){return`/v1/connect/connectors/${encodeURIComponent(e)}`}async function listProjectSlackConnectors(e){let t=[],n=new Set,r;for(let i=0;i<50;i+=1){let i={projectId:e.projectId,type:`slack`,include:`projects`,limit:`100`};r!==void 0&&(i.cursor=r);let a=await e.deps.captureVercel(connectApiArgs(`/v1/connect/connectors`,e.orgId,i),{cwd:e.projectRoot,onOutput:e.onOutput,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS,signal:e.signal});if(!a.ok)return{state:`failed`,message:a.failure.message};let o;try{o=parseSlackConnectorPage(JSON.parse(a.stdout))}catch{return{state:`failed`,message:`Vercel returned invalid JSON for the connector list.`}}if(o===void 0)return{state:`failed`,message:`Vercel returned a malformed connector list.`};if(t.push(...o.connectors),o.next===void 0)return{state:`ok`,connectors:t};if(n.has(o.next))return{state:`failed`,message:`The connector list repeated cursor ${o.next}.`};n.add(o.next),r=o.next}return{state:`failed`,message:`The connector list has more than 50 pages.`}}async function fetchConnectorProjects(e){let t=await e.deps.captureVercel(connectApiArgs(`${connectorPath(e.connectorId)}/projects`,e.orgId),{cwd:e.projectRoot,onOutput:e.onOutput,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS,signal:e.signal});if(!t.ok)return{state:`failed`,message:t.failure.message};try{let e=parseConnectorProjects(JSON.parse(t.stdout));return e===void 0?{state:`failed`,message:`Vercel returned a malformed connector project list.`}:{state:`ok`,projects:e}}catch{return{state:`failed`,message:`Vercel returned invalid JSON for the connector project list.`}}}function otherProjectsOf(e,t,n){let r=e.filter(e=>e.id!==n);for(let e of t)e.projectId!==n&&(r.some(t=>t.id===e.projectId)||r.push({id:e.projectId}));return r}function toCandidate(e){let{details:t,projectId:n}=e,r=t.triggerDestinations,i={...t.ref,attached:e.attached,triggerDestinations:r,otherProjects:otherProjectsOf(e.projects,r,n),createdAt:e.createdAt};return t.workspace!==void 0&&(i.workspace=t.workspace),i}async function inspectSlackConnectors(e){let{deps:t,projectRoot:n,projectId:r,orgId:i,onOutput:a,signal:o}=e,s=await listProjectSlackConnectors(e);if(s.state===`failed`)return s;let c=new Set(s.connectors.map(e=>e.uid)),l=[...e.namedUids].filter(e=>!c.has(e)),u={deps:t,projectRoot:n,orgId:i,onOutput:a,signal:o},inspectListed=async e=>{let t=await fetchSlackConnectorDetails({...u,connectorId:e.id,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS});return t.state===`failed`?`${e.uid}: ${t.message}`:toCandidate({details:t.details,attached:!0,projects:e.projects,projectId:r,createdAt:e.createdAt})},inspectNamed=async e=>{let t=await lookupSlackConnector({...u,key:e,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS});if(t.state===`absent`)return;if(t.state===`failed`)return`${e}: ${t.message}`;let n=await fetchConnectorProjects({...u,connectorId:t.details.ref.id});return n.state===`failed`?`${e}: ${n.message}`:toCandidate({details:t.details,attached:n.projects.some(e=>e.id===r),projects:n.projects,projectId:r,createdAt:0})},d=await mapWithConcurrency([...s.connectors.map(e=>()=>inspectListed(e)),...l.map(e=>()=>inspectNamed(e))],4,e=>e()),f=d.find(e=>typeof e==`string`);return f===void 0?{state:`ok`,candidates:d.filter(e=>typeof e==`object`)}:{state:`failed`,message:f}}async function refreshSlackCandidate(e){let{deps:t,projectRoot:n,candidate:r,projectId:i,orgId:a,onOutput:o,signal:s}=e,c=await fetchSlackConnectorDetails({deps:t,projectRoot:n,connectorId:r.id,orgId:a,onOutput:o,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS,signal:s});if(c.state===`failed`)return c;if(c.details.ref.uid!==r.uid)return{state:`failed`,message:`The connector ${r.uid} changed since inspection.`};let l=await fetchConnectorProjects({deps:t,projectRoot:n,connectorId:r.id,orgId:a,onOutput:o,signal:s});return l.state===`failed`?l:{state:`ok`,candidate:toCandidate({details:c.details,attached:l.projects.some(e=>e.id===i),projects:l.projects,projectId:i,createdAt:r.createdAt})}}async function findFreeSlackConnectorName(e){for(let t=1;t<=20;t+=1){let n=t===1?e.slug:`${e.slug}-${t}`,r=`slack/${n}`,i=await lookupSlackConnector({...e,key:r,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS});if(i.state===`failed`)return i;if(i.state===`absent`)return{state:`ok`,name:n}}return{state:`failed`,message:`Slack connectors \`slack/${e.slug}\` through \`slack/${e.slug}-20\` already exist. Remove unused ones with \`vercel connect remove <uid> --disconnect-all --yes\`, then try again.`}}async function applySlackRouting(e){let{deps:t,projectRoot:n,ref:r,plan:i,orgId:a,onOutput:o,signal:s}=e;if(i.attach){let e=[`connect`,`attach`,r.uid,`--yes`];if(a!==void 0&&e.push(`--scope`,a),!await t.runVercel(e,{cwd:n,onOutput:o,nonInteractive:!0,timeoutMs:CONNECT_MUTATION_TIMEOUT_MS,signal:s}))return{state:`attach-failed`}}if(i.destinations===void 0)return{state:`configured`};let c=connectApiArgs(`${connectorPath(r.id)}/trigger-destinations`,a,{},[`--method`,`PATCH`,`--input`,`-`]),l=normalizeVercelApiResult(await t.captureVercel(c,{cwd:n,onOutput:o,stdin:JSON.stringify({destinations:i.destinations}),timeoutMs:CONNECT_MUTATION_TIMEOUT_MS,signal:s}));return l.ok?{state:`configured`}:{state:`attach-failed`,message:l.failure.message}}async function lookupSlackConnector(e){let t=await e.deps.captureVercel(connectApiArgs(connectorPath(e.key),e.orgId),{cwd:e.projectRoot,onOutput:e.onOutput,timeoutMs:e.timeoutMs,signal:e.signal});if(!t.ok)return{state:isNotFoundApiFailure(t.failure)?`absent`:`failed`,message:t.failure.message};try{let n=JSON.parse(t.stdout),r=parseSlackConnectorDetails(n);return r?.ref.id===e.key||r?.ref.uid===e.key?{state:`found`,details:r}:{state:`failed`,message:`Vercel returned an invalid Slack connector.`}}catch{return{state:`failed`,message:`Vercel returned invalid JSON for the Slack connector.`}}}async function fetchSlackConnectorDetails(e){let t=await lookupSlackConnector({...e,key:e.connectorId});return t.state===`absent`?{state:`failed`,message:t.message}:t}async function fetchSlackWorkspace(e){let t=await fetchSlackConnectorDetails(e);return t.state===`failed`?t:t.details.workspace===void 0?{state:`pending`}:{state:`connected`,workspace:t.details.workspace}}async function cleanupConnectorUid(e,t){let{log:n,deps:r,projectRoot:i,onOutput:a}=e;return await r.runVercel([`connect`,`remove`,t,`--disconnect-all`,`--yes`],{cwd:i,onOutput:a,timeoutMs:CONNECT_MUTATION_TIMEOUT_MS})?!0:(n.warning(`Could not remove the abandoned Slack connector. Run \`vercel connect remove ${t} --disconnect-all --yes\` to clean it up.`),!1)}async function cleanupConnectorUids(e,t){let n=[];for(let r of new Set(t))await cleanupConnectorUid(e,r)||n.push(r);return n.length===0?{state:`clean`}:{state:`failed`,connectorUids:n}}async function cleanupCreatedAttempt(e,t){return t.createdRef?cleanupConnectorUids(e,[t.createdRef.uid]):t.rejected?{state:`clean`}:(e.log.warning(`eve couldn't confirm the Slack request in your browser was cancelled. Wait for it to expire before retrying.`),{state:`failed`,connectorUids:(await lookupSlackConnector({...e,key:t.expectedUid,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS})).state===`found`?[t.expectedUid]:[]})}export{CONNECT_LOOKUP_TIMEOUT_MS,applySlackRouting,cleanupCreatedAttempt,fetchSlackConnectorDetails,fetchSlackWorkspace,findFreeSlackConnectorName,inspectSlackConnectors,refreshSlackCandidate};
@@ -6,12 +6,6 @@
6
6
  * focused on flow and these stay trivially testable.
7
7
  */
8
8
  import { z } from "#compiled/zod/index.js";
9
- export interface VercelConnectListResponse {
10
- /** `vercel connect list -F json` (current CLI). */
11
- connectors?: unknown;
12
- /** Older CLI builds emitted the same array under `clients`. */
13
- clients?: unknown;
14
- }
15
9
  declare const SlackConnectorRefSchema: z.ZodObject<{
16
10
  uid: z.ZodString;
17
11
  id: z.ZodString;
@@ -23,10 +17,21 @@ export interface SlackWorkspaceConnection {
23
17
  workspaceUrl: string;
24
18
  workspaceName?: string;
25
19
  }
20
+ /**
21
+ * One place Vercel Connect forwards Slack events. A destination without
22
+ * `branch` or `customEnvironmentId` targets the project's default deployment.
23
+ */
24
+ export interface SlackTriggerDestination {
25
+ projectId: string;
26
+ path?: string;
27
+ branch?: string;
28
+ customEnvironmentId?: string;
29
+ }
26
30
  /** Parsed Slack connector state returned by Vercel's connector detail API. */
27
31
  export interface SlackConnectorDetails {
28
32
  ref: SlackConnectorRef;
29
33
  workspace?: SlackWorkspaceConnection;
34
+ triggerDestinations: readonly SlackTriggerDestination[];
30
35
  }
31
36
  /**
32
37
  * Parses the exact connector response. Vercel reports a completed Slack
@@ -48,13 +53,27 @@ export declare function parseCreatedSlackConnector(stdout: string): SlackConnect
48
53
  * See https://docs.slack.dev/interactivity/deep-linking/.
49
54
  */
50
55
  export declare function slackMessageDeepLink(url: string): string;
51
- /** A Slack connector plus the project ids it is attached to. */
56
+ /** A project attached to a connector. */
57
+ export interface SlackConnectorProject {
58
+ id: string;
59
+ name?: string;
60
+ }
61
+ /** A Slack connector plus the projects it is attached to. */
52
62
  export interface RawSlackConnector {
53
63
  uid: string;
54
- id?: string;
55
- projectIds: readonly string[];
64
+ id: string;
65
+ /** Attached projects, possibly truncated to the first few. */
66
+ projects: readonly SlackConnectorProject[];
56
67
  createdAt: number;
57
68
  }
58
- /** Parses Slack connectors (uid + attached project ids) from a connect-list response. */
59
- export declare function parseSlackConnectors(listJson: unknown): RawSlackConnector[];
69
+ /** One page of `GET /v1/connect/connectors?include=projects`. */
70
+ export interface SlackConnectorPage {
71
+ connectors: RawSlackConnector[];
72
+ /** Cursor for the next page, absent on the last one. */
73
+ next?: string;
74
+ }
75
+ /** Parses one connector list page, keeping only Slack connectors. */
76
+ export declare function parseSlackConnectorPage(body: unknown): SlackConnectorPage | undefined;
77
+ /** Parses one page of `GET /v1/connect/connectors/<id>/projects`. */
78
+ export declare function parseConnectorProjects(body: unknown): SlackConnectorProject[] | undefined;
60
79
  export {};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";const NonEmptyStringSchema=z.string().min(1),SlackConnectorDetailsSchema=z.object({uid:NonEmptyStringSchema,id:NonEmptyStringSchema}).extend({data:z.object({appId:NonEmptyStringSchema.nullish(),slackTeam:z.object({id:NonEmptyStringSchema,name:NonEmptyStringSchema.nullish()}).nullish()}).nullish()});function parseSlackConnectorDetails(e){let t=SlackConnectorDetailsSchema.safeParse(e);if(!t.success)return;let{id:n,uid:r,data:i}=t.data,a={id:n,uid:r};if(i?.appId==null||i.slackTeam==null)return{ref:a};let o=new URL(`https://slack.com/app_redirect`);return o.searchParams.set(`app`,i.appId),o.searchParams.set(`team`,i.slackTeam.id),{ref:a,workspace:i.slackTeam.name==null?{workspaceUrl:o.href}:{workspaceUrl:o.href,workspaceName:i.slackTeam.name}}}function parseCreatedSlackConnector(e){let t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return}return parseSlackConnectorDetails(n)?.ref}function slackMessageDeepLink(e){let t=URL.parse(e);return t===null||!t.pathname.endsWith(`/app_redirect`)||!t.searchParams.has(`app`)||!t.searchParams.has(`team`)?e:(t.searchParams.set(`tab`,`messages`),t.href)}function parseSlackConnectors(e){if(typeof e!=`object`||!e)return[];let t=e,n=t.connectors??t.clients;if(!Array.isArray(n))return[];let r=[];for(let e of n){if(e.type!==`slack`||typeof e.uid!=`string`)continue;let t=Array.isArray(e.projects)?e.projects.map(e=>typeof e==`object`&&e?e.id:void 0).filter(e=>typeof e==`string`):[],n={uid:e.uid,projectIds:t,createdAt:typeof e.createdAt==`number`?e.createdAt:0};typeof e.id==`string`&&(n.id=e.id),r.push(n)}return r}export{parseCreatedSlackConnector,parseSlackConnectorDetails,parseSlackConnectors,slackMessageDeepLink};
1
+ import{z}from"#compiled/zod/index.js";const NonEmptyStringSchema=z.string().min(1),SlackConnectorRefSchema=z.object({uid:NonEmptyStringSchema,id:NonEmptyStringSchema}),SlackTriggerDestinationSchema=z.object({projectId:NonEmptyStringSchema,path:NonEmptyStringSchema.nullish(),branch:NonEmptyStringSchema.nullish(),customEnvironmentId:NonEmptyStringSchema.nullish()}),SlackConnectorDetailsSchema=SlackConnectorRefSchema.extend({triggerDestinations:z.array(SlackTriggerDestinationSchema).nullish(),data:z.object({appId:NonEmptyStringSchema.nullish(),slackTeam:z.object({id:NonEmptyStringSchema,name:NonEmptyStringSchema.nullish()}).nullish()}).nullish()});function toTriggerDestination(e){let t={projectId:e.projectId};return e.path!=null&&(t.path=e.path),e.branch!=null&&(t.branch=e.branch),e.customEnvironmentId!=null&&(t.customEnvironmentId=e.customEnvironmentId),t}function parseSlackConnectorDetails(e){let t=SlackConnectorDetailsSchema.safeParse(e);if(!t.success)return;let{id:n,uid:r,data:i}=t.data,a={id:n,uid:r},o=(t.data.triggerDestinations??[]).map(toTriggerDestination);if(i?.appId==null||i.slackTeam==null)return{ref:a,triggerDestinations:o};let s=new URL(`https://slack.com/app_redirect`);return s.searchParams.set(`app`,i.appId),s.searchParams.set(`team`,i.slackTeam.id),{ref:a,workspace:i.slackTeam.name==null?{workspaceUrl:s.href}:{workspaceUrl:s.href,workspaceName:i.slackTeam.name},triggerDestinations:o}}function parseCreatedSlackConnector(e){let t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return}return parseSlackConnectorDetails(n)?.ref}function slackMessageDeepLink(e){let t=URL.parse(e);return t===null||!t.pathname.endsWith(`/app_redirect`)||!t.searchParams.has(`app`)||!t.searchParams.has(`team`)?e:(t.searchParams.set(`tab`,`messages`),t.href)}const ProjectLinkSchema=z.object({projectId:NonEmptyStringSchema,project:z.object({id:NonEmptyStringSchema,name:z.string().nullish()}).nullish()}),PaginationSchema=z.object({next:z.string().nullish()}).nullish(),ConnectorPageSchema=z.object({clients:z.array(z.object({id:NonEmptyStringSchema,uid:NonEmptyStringSchema,type:z.string(),createdAt:z.number().nullish(),includes:z.object({projects:z.object({items:z.array(ProjectLinkSchema)}).nullish()}).nullish()})),pagination:PaginationSchema}),ConnectorProjectsSchema=z.object({projects:z.array(ProjectLinkSchema)});function toProject(e){let t=e.project?.id??e.projectId,n=e.project?.name;return n==null?{id:t}:{id:t,name:n}}function parseSlackConnectorPage(e){let t=ConnectorPageSchema.safeParse(e);if(!t.success)return;let n=t.data.clients.filter(e=>e.type===`slack`).map(e=>({uid:e.uid,id:e.id,projects:(e.includes?.projects?.items??[]).map(toProject),createdAt:e.createdAt??0})),r=t.data.pagination?.next;return r==null?{connectors:n}:{connectors:n,next:r}}function parseConnectorProjects(e){let t=ConnectorProjectsSchema.safeParse(e);return t.success?t.data.projects.map(toProject):void 0}export{parseConnectorProjects,parseCreatedSlackConnector,parseSlackConnectorDetails,parseSlackConnectorPage,slackMessageDeepLink};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Pure decisions for resumable Slack setup: which mutation (if any) finishes
3
+ * event delivery and which connector setup suggests.
4
+ */
5
+ import type { SlackConnectorProject, SlackConnectorRef, SlackTriggerDestination, SlackWorkspaceConnection } from "./slack-connect.js";
6
+ /** Connect rejects a fourth trigger destination on one connector. */
7
+ export declare const MAX_SLACK_TRIGGER_DESTINATIONS = 3;
8
+ /** A connector other projects use, which setup never attaches to this one. */
9
+ export interface SlackConnectorInUse {
10
+ uid: string;
11
+ otherProjects: readonly SlackConnectorProject[];
12
+ }
13
+ /** One team Slack connector as setup sees it before changing anything. */
14
+ export interface SlackConnectorCandidate extends SlackConnectorRef {
15
+ /** Whether the linked project has token access to this connector. */
16
+ attached: boolean;
17
+ /** Present once the Slack app is installed into a workspace. */
18
+ workspace?: SlackWorkspaceConnection;
19
+ triggerDestinations: readonly SlackTriggerDestination[];
20
+ /**
21
+ * Other projects that use this connector, by attachment or by trigger
22
+ * destination. Setup never changes their attachments or destinations.
23
+ */
24
+ otherProjects: readonly SlackConnectorProject[];
25
+ createdAt: number;
26
+ }
27
+ /**
28
+ * Whether setup may reuse a connector: it already belongs to this project, or
29
+ * no other project uses it (for example, one created by hand for this agent).
30
+ * One Slack app forwards every event to every destination, so attaching a
31
+ * second agent would make both respond.
32
+ */
33
+ export declare function isReusableSlackConnector(candidate: SlackConnectorCandidate): boolean;
34
+ /**
35
+ * What finishes event delivery for one connector. `attach` gives the project
36
+ * token access; `destinations`, when present, is the full destination set to
37
+ * write, changing only this project's default-deployment entry. Each half is
38
+ * idempotent, so a run that stops between them resumes on the next one.
39
+ */
40
+ export type SlackRoutingPlan = {
41
+ kind: "apply";
42
+ attach: boolean;
43
+ destinations?: readonly SlackTriggerDestination[];
44
+ } | {
45
+ kind: "limit-reached";
46
+ destinations: readonly SlackTriggerDestination[];
47
+ };
48
+ /**
49
+ * Plans the routing mutation. An attached project is never re-attached,
50
+ * because `connect attach` without `--environment` resets its environment
51
+ * scoping.
52
+ */
53
+ export declare function planSlackRouting(input: {
54
+ attached: boolean;
55
+ destinations: readonly SlackTriggerDestination[];
56
+ projectId: string;
57
+ route: string;
58
+ }): SlackRoutingPlan;
59
+ /**
60
+ * Orders candidates for the connector question and picks the suggestion:
61
+ * the channel file's UID, then `slack/<slug>`, then the newest connector
62
+ * already attached to this project. `undefined` suggests a new connector.
63
+ */
64
+ export declare function orderSlackConnectorCandidates(candidates: readonly SlackConnectorCandidate[], input: {
65
+ channelConnectorUid?: string | undefined;
66
+ expectedUid: string;
67
+ }): {
68
+ candidates: SlackConnectorCandidate[];
69
+ preferred?: SlackConnectorCandidate;
70
+ };
71
+ /** Human-readable destination list for the trigger-limit report. */
72
+ export declare function describeSlackDestinations(destinations: readonly SlackTriggerDestination[], projectNames: ReadonlyMap<string, string>): string[];
@@ -0,0 +1 @@
1
+ const MAX_SLACK_TRIGGER_DESTINATIONS=3;function isReusableSlackConnector(e){return e.attached||e.otherProjects.length===0}function isDefaultDeployment(e){return e.branch===void 0&&e.customEnvironmentId===void 0}function isProjectDefault(e,t){return e.projectId===t&&isDefaultDeployment(e)}function planSlackRouting(e){let{attached:t,destinations:n,projectId:r,route:i}=e,a=!t,o=n.filter(e=>isProjectDefault(e,r));if(o.length===1&&o[0]?.path===i)return{kind:`apply`,attach:a};let s=[...n.filter(e=>!isProjectDefault(e,r)),{projectId:r,path:i}];return s.length>3?{kind:`limit-reached`,destinations:n}:{kind:`apply`,attach:a,destinations:s}}function orderSlackConnectorCandidates(e,t){let n=[...e].sort((e,t)=>t.createdAt-e.createdAt),r=n.find(e=>e.uid===t.channelConnectorUid)??n.find(e=>e.uid===t.expectedUid)??n.find(e=>e.attached),i=n.filter(e=>e!==r).sort((e,t)=>Number(t.attached)-Number(e.attached)),a=r===void 0?i:[r,...i];return r===void 0?{candidates:a}:{candidates:a,preferred:r}}function describeSlackDestinations(e,t){return e.map(e=>`${t.get(e.projectId)??e.projectId} (${e.customEnvironmentId===void 0?e.branch===void 0?`production`:`branch ${e.branch}`:`custom environment ${e.customEnvironmentId}`}) ${e.path??`<default path>`}`)}export{MAX_SLACK_TRIGGER_DESTINATIONS,describeSlackDestinations,isReusableSlackConnector,orderSlackConnectorCandidates,planSlackRouting};
@@ -1,8 +1,10 @@
1
1
  import { readProjectLink } from "#setup/project-resolution.js";
2
2
  import { type ChannelSetupAwaitChoice, type ChannelSetupLog } from "#setup/cli/index.js";
3
- import type { SlackConnectorRef } from "./slack-connect.js";
3
+ import type { SlackConnectorProject, SlackTriggerDestination } from "./slack-connect.js";
4
4
  import { type SlackConnectorCreateDeps } from "./slack-connect-create.js";
5
- import { type SlackConnectLifecycleDeps, type SlackConnectorLookup } from "./slack-connect-lifecycle.js";
5
+ import { type SlackConnectLifecycleDeps } from "./slack-connect-lifecycle.js";
6
+ import { type SlackConnectorInUse, type SlackConnectorCandidate } from "./slack-setup-plan.js";
7
+ export type { SlackConnectorCandidate } from "./slack-setup-plan.js";
6
8
  /** Injected for tests; defaults to the real Vercel CLI subprocess primitives. */
7
9
  interface SlackbotProvisionDeps extends SlackConnectLifecycleDeps, SlackConnectorCreateDeps {
8
10
  /** Test seam for the linked Vercel project and team lookup. */
@@ -12,21 +14,32 @@ interface SlackbotProvisionDeps extends SlackConnectLifecycleDeps, SlackConnecto
12
14
  /** Monotonic-enough clock for enforcing the workspace lookup deadline. */
13
15
  now?: () => number;
14
16
  }
17
+ /** A Slack connector that delivers this project's events to eve's Slack route. */
18
+ interface SlackbotConnection {
19
+ connectorUid: string;
20
+ /** Deep link that opens a DM compose with the bot ("chat with your agent"). */
21
+ chatUrl?: string;
22
+ workspaceName?: string;
23
+ }
15
24
  /**
16
- * Outcome of the Connect create-and-attach sequence for a Slackbot. The
17
- * discriminant is the complete lifecycle state: `attached` means a connector
18
- * exists, this project is registered as the trigger destination, and the app
19
- * is installed into a Slack workspace.
20
- * `not-installed` means the workspace-install deadline elapsed and any connector
21
- * created by this attempt was removed. `cleanup-failed` means it may remain and
22
- * callers must stop rather than create another connector. Attachment setup
23
- * reports detach and attach failures separately because attach must not run
24
- * while an old trigger destination may still exist.
25
+ * Outcome of Slackbot provisioning. `attached` means a connector exists, this
26
+ * project receives its events at eve's Slack route, and the app is installed
27
+ * into a Slack workspace. `already-configured` is the same state reached
28
+ * without changing anything. `not-installed` means the workspace-install
29
+ * deadline elapsed and any connector created by this attempt was removed.
30
+ * `cleanup-failed` means it may remain and callers must stop rather than
31
+ * create another connector. `trigger-limit-reached` changed nothing because
32
+ * the connector already has the maximum number of trigger destinations.
33
+ * `connector-in-use` changed nothing because another project now uses the
34
+ * chosen connector.
25
35
  */
26
36
  export type ProvisionSlackbotResult = {
27
37
  state: "connector-lookup-failed";
28
- } | {
38
+ }
39
+ /** `detail` is the Vercel CLI's own error line, when it printed one. */
40
+ | {
29
41
  state: "create-failed";
42
+ detail?: string;
30
43
  } | {
31
44
  state: "cancelled";
32
45
  } | {
@@ -36,50 +49,77 @@ export type ProvisionSlackbotResult = {
36
49
  state: "cleanup-failed";
37
50
  connectorUids: readonly string[];
38
51
  } | {
39
- state: "detach-failed";
52
+ state: "attach-failed";
40
53
  connectorUid: string;
41
54
  } | {
42
- state: "attach-failed";
55
+ state: "connector-in-use";
43
56
  connectorUid: string;
57
+ projects: readonly SlackConnectorProject[];
58
+ } | {
59
+ state: "trigger-limit-reached";
60
+ connectorUid: string;
61
+ destinations: readonly SlackTriggerDestination[];
44
62
  } | {
45
63
  state: "not-installed";
46
64
  } | {
47
65
  state: "installation-check-failed";
48
66
  connectorUid: string;
49
- } | {
67
+ } | ({
50
68
  state: "attached";
51
- connectorUid: string;
52
- /** Deep link that opens a DM compose with the bot ("chat with your agent"). */
53
- chatUrl?: string;
54
- workspaceName?: string;
55
- };
69
+ } & SlackbotConnection) | ({
70
+ state: "already-configured";
71
+ } & SlackbotConnection);
72
+ /** Explains why setup won't attach a connector another project uses. */
73
+ export declare function connectorInUseMessage(candidate: SlackConnectorInUse): string;
74
+ /** A reusable connector from {@link inspectSlackbotConnectors}, or a request to create one. */
75
+ export type SlackConnectorSelection = SlackConnectorCandidate | "create";
76
+ /**
77
+ * Read-only snapshot of the Slack connectors setup may reuse for the linked
78
+ * project. Setup takes it once, asks its questions from it, and hands it to
79
+ * {@link provisionSlackbot}.
80
+ */
81
+ export interface SlackbotConnectorInspection {
82
+ projectId: string;
83
+ orgId: string | undefined;
84
+ /** Preferred short-name for `connect create slack --name`; suffixed when taken. */
85
+ slug: string;
86
+ /**
87
+ * Reusable connectors in question order: the suggestion first, then
88
+ * attached, then the rest. Connectors other projects use are excluded.
89
+ */
90
+ candidates: readonly SlackConnectorCandidate[];
91
+ preferred?: SlackConnectorCandidate;
92
+ /** Connectors other projects use, which setup never attaches to this one. */
93
+ inUse: readonly SlackConnectorInUse[];
94
+ }
56
95
  /**
57
- * Creates or reuses a Slack connector and points its event destination at eve.
58
- * A successful `connect create` is the completion boundary for a new browser
59
- * flow. Existing connectors are verified through their team-scoped detail
60
- * payload before attachment.
96
+ * Inspects the connectors attached to the linked project, plus
97
+ * `slack/<slug>` and the channel file's UID looked up by name. Throws when
98
+ * the project isn't linked or any connector can't be read, so setup never
99
+ * creates a connector on a guess.
61
100
  */
62
- export type SlackConnectorSelection = SlackConnectorRef | "create";
63
- /** Read-only connector inventory used to resolve the create/reuse decision before provisioning. */
64
- export declare function inspectSlackbotConnectors(log: ChannelSetupLog, projectRoot: string, slug: string, signal?: AbortSignal, deps?: SlackbotProvisionDeps): Promise<Extract<SlackConnectorLookup, {
65
- state: "found" | "not-found";
66
- }>>;
101
+ export declare function inspectSlackbotConnectors(log: ChannelSetupLog, projectRoot: string, slug: string, options?: {
102
+ signal?: AbortSignal;
103
+ channelConnectorUid?: string | undefined;
104
+ }, deps?: SlackbotProvisionDeps): Promise<SlackbotConnectorInspection>;
67
105
  interface ProvisionSlackbotOptions {
68
106
  /**
69
107
  * Cancels the caller's whole operation. The promise rejects after attempting
70
108
  * cleanup; only the explicit interactive Cancel action returns `cancelled`.
71
109
  */
72
110
  signal?: AbortSignal;
73
- /** Chooses a project-attached connector or requests a new one. */
74
- selectConnector?: (connectors: readonly SlackConnectorRef[], preferred: SlackConnectorRef | undefined) => Promise<SlackConnectorSelection>;
75
111
  /** Concurrent retry/cancel controls supplied by an interactive prompter. */
76
112
  awaitChoice?: ChannelSetupAwaitChoice;
77
113
  }
78
- export declare function provisionSlackbot(log: ChannelSetupLog, projectRoot: string,
79
- /** Connector short-name passed to `vercel connect create slack --name`. */
80
- slug: string, deps?: SlackbotProvisionDeps, options?: ProvisionSlackbotOptions): Promise<ProvisionSlackbotResult>;
114
+ /**
115
+ * Reuses the selected connector or creates a new one, then points its event
116
+ * destination at eve, running only the steps the connector still needs.
117
+ * Re-running it after a partial failure resumes where the previous run
118
+ * stopped; it never detaches a project. A successful `connect create` is the
119
+ * completion boundary for a new browser flow.
120
+ */
121
+ export declare function provisionSlackbot(log: ChannelSetupLog, projectRoot: string, inspection: SlackbotConnectorInspection, selection: SlackConnectorSelection, deps?: SlackbotProvisionDeps, options?: ProvisionSlackbotOptions): Promise<ProvisionSlackbotResult>;
81
122
  /**
82
123
  * Patches a connector UID chosen by Connect before the caller deploys the channel definition.
83
124
  */
84
125
  export declare function reconcileSlackUid(log: ChannelSetupLog, projectRoot: string, slackbot: ProvisionSlackbotResult, expectedUid: string): Promise<boolean>;
85
- export {};
@@ -1 +1,2 @@
1
- import{CONNECT_LOOKUP_TIMEOUT_MS,attachSlackConnector,cleanupCreatedAttempt,fetchSlackWorkspace,findSlackConnector,listSlackConnectors}from"./slack-connect-lifecycle.js";import{createSlackConnector}from"./slack-connect-create.js";import{join}from"node:path";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import{readProjectLink}from"#setup/project-resolution.js";import{performance}from"node:perf_hooks";import{captureVercel,runVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{setTimeout}from"node:timers/promises";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{updateSlackChannelConnectorUid}from"#setup/scaffold/update/update-slack-channel.js";const defaultDeps={captureVercel,runVercel,runVercelCaptureStdout},realDelay=(e,t)=>setTimeout(e,void 0,{signal:t}),monotonicNow=()=>performance.now();async function pollSlackWorkspace(e,t,n,r,i,a){let o=e.delay??realDelay,s=e.now??monotonicNow,c=s()+3e5;for(;;){a?.throwIfAborted();let l=c-s();if(l<=0)return{state:`timed-out`};let u=await fetchSlackWorkspace({deps:e,projectRoot:t,connectorId:n,orgId:r,onOutput:i,timeoutMs:Math.min(CONNECT_LOOKUP_TIMEOUT_MS,l),signal:a});if(a?.throwIfAborted(),u.state!==`pending`)return u;let d=c-s();if(d<=0)return{state:`timed-out`};await o(Math.min(3e3,d),a)}}function isAbortFromSignal(e,t){return t?.aborted===!0&&(e===t.reason||e instanceof Error&&e.name===`AbortError`)}function cleanupFailureResult(e){return{state:`cleanup-failed`,connectorUids:e.connectorUids}}async function runAttempt(e){let{log:t,deps:n,projectRoot:r,orgId:i,onOutput:a,signal:o,phase:s}=e,c,l;if(e.source.state===`existing`)c=e.source.ref;else{let u=await createSlackConnector({deps:n,projectRoot:r,orgId:i,slug:e.slug,onOutput:a,signal:o,phase:s,onCreated:e.onCreated,waitForWorkspace:async(e,t)=>{let o=await pollSlackWorkspace(n,r,e.id,i,a,t);return o.state===`connected`?o.workspace:void 0}});if(u.state===`failed`)return{state:`create-failed`};if(u.state===`unresolved`)return t.warning(`Vercel did not return an exact Slack connector UID for this request, so eve cannot attach or remove it safely.`),{state:`unresolved`};c=u.ref,u.via===`workspace`&&(l=u.workspace)}if(e.source.state===`existing`&&l===void 0){let e=await s(`Waiting for the Slack workspace connection...`,()=>pollSlackWorkspace(n,r,c.id,i,a,o));if(e.state===`timed-out`)return{state:`timed-out`,ref:c};if(e.state===`failed`)return{state:`failed`,ref:c,message:e.message};l=e.workspace}let u=await s(`Configuring Slack event delivery for this agent...`,()=>attachSlackConnector(n,r,c,a,o));return o?.throwIfAborted(),u.state===`attached`?l===void 0?{state:`attached`,ref:c}:{state:`attached`,ref:c,workspace:l}:{state:u.state,ref:c}}async function raceAttemptAgainstChoice(e){let t=new AbortController,n=e.outerSignal?AbortSignal.any([e.outerSignal,t.signal]):t.signal,r=e.run(n);try{let i=await Promise.race([r.then(e=>({via:`work`,outcome:e})),e.prompt.choice.then(e=>({via:`choice`,choice:e}))]);if(i.via===`work`)return i;t.abort();let a;try{a=await r}catch(e){if(!isAbortFromSignal(e,n))throw e}return{via:`choice`,choice:i.choice,settled:a}}catch(e){t.abort();try{await r}catch{}throw e}finally{e.prompt.close()}}async function inspectSlackbotConnectors(e,t,n,r,i=defaultDeps){let a=await(i.readProjectLink??readProjectLink)(t),o=await findSlackConnector(i,t,a?.projectId,`slack/${n}`,createPromptCommandOutput(e),r);if(o.state===`failed`)throw Error(o.message);return o}async function provisionSlackbot(e,t,n,r=defaultDeps,i={}){i.signal?.throwIfAborted();let a=createPromptCommandOutput(e),o={log:e,deps:r,projectRoot:t,onOutput:a},s=await(r.readProjectLink??readProjectLink)(t),c=s?.projectId,l=s?.orgId,u=`slack/${n}`,d=await withPhase(e,`Checking for an existing Slackbot...`,()=>findSlackConnector(r,t,c,u,a,i.signal));if(i.signal?.throwIfAborted(),d.state===`failed`)return e.warning(`Could not inspect existing Slack connectors, so eve did not create another one. ${d.message}`),{state:`connector-lookup-failed`};if(c===void 0&&d.connectorUids.size>0)return e.warning("Could not verify which Slack connectors belong to this Vercel project, so eve did not create another one. Restore `.vercel/project.json`, then try again."),{state:`connector-lookup-failed`};let finishOutcome=async(t,n,r)=>{let i=n.state===`new`;switch(t.state){case`create-failed`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`create-failed`};case`unresolved`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`create-failed`};case`detach-failed`:return e.warning(`Could not remove the connector's existing trigger destination. Run \`vercel connect detach ${t.ref.uid} --yes\`, then \`vercel connect attach ${t.ref.uid} --triggers --trigger-path ${SLACK_CHANNEL_DEFAULT_ROUTE} --yes\`.`),{state:`detach-failed`,connectorUid:t.ref.uid};case`attach-failed`:return e.warning(`Could not register this project as a trigger destination. Run \`vercel connect attach ${t.ref.uid} --triggers --trigger-path ${SLACK_CHANNEL_DEFAULT_ROUTE} --yes\` to enable event delivery.`),{state:`attach-failed`,connectorUid:t.ref.uid};case`attached`:return t.workspace===void 0?{state:`attached`,connectorUid:t.ref.uid}:{state:`attached`,connectorUid:t.ref.uid,chatUrl:t.workspace.workspaceUrl,workspaceName:t.workspace.workspaceName};case`failed`:return e.warning(`Could not verify the Slack workspace connection. ${t.message}`),{state:`installation-check-failed`,connectorUid:t.ref.uid};case`timed-out`:if(e.warning(`The Slackbot did not connect to a Slack workspace in time.`),i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`not-installed`}}},cleanupNewAttempt=async(e,t)=>cleanupCreatedAttempt(o,{expectedUid:u,baselineConnectorUids:e.baselineConnectorUids,createdRef:t});function attemptInput(i,o){return{log:e,deps:r,projectRoot:t,orgId:l,slug:n,source:i,onOutput:a,onCreated:o}}async function runExistingConnector(t){let cleanupCurrentAttempt=async()=>({state:`clean`}),notInstalled=()=>(e.warning(`The existing Slack connector \`${t.ref.uid}\` is not connected to a Slack workspace. eve did not remove it because this run did not create it. If its original browser request is still open, complete it; otherwise run \`vercel connect remove ${t.ref.uid} --disconnect-all --yes\` before trying again.`),{state:`existing-not-installed`,connectorUid:t.ref.uid}),finishExistingOutcome=async e=>e.state===`timed-out`?notInstalled():finishOutcome(e,t,cleanupCurrentAttempt);if(i.awaitChoice!==void 0){let e=await raceAttemptAgainstChoice({prompt:i.awaitChoice({status:`Waiting for the existing Slack workspace connection...`,context:`Complete the original setup in the browser`,actions:[{value:`cancel`,label:`Stop waiting`}]}),outerSignal:i.signal,run:e=>runAttempt({...attemptInput(t,()=>{}),signal:e,phase:(e,t)=>t()})});return e.via===`work`?finishExistingOutcome(e.outcome):e.settled?.state===`attached`?finishExistingOutcome(e.settled):notInstalled()}return finishExistingOutcome(await runAttempt({...attemptInput(t,()=>{}),signal:i.signal,phase:(t,n)=>withPhase(e,t,n)}))}async function runUncontrolledAttempt(t){let n,cleanupCurrentAttempt=()=>cleanupNewAttempt(t,n),r=runAttempt({...attemptInput(t,e=>{n=e}),signal:i.signal,phase:(t,n)=>withPhase(e,t,n)});try{return await finishOutcome(await r,t,cleanupCurrentAttempt)}catch(e){throw i.signal?.aborted===!0&&await cleanupCurrentAttempt(),e}}async function runInteractiveAttempt(n,o){let s,cleanupCurrentAttempt=()=>cleanupNewAttempt(n,s),c=o({status:`Waiting for Slack setup to finish...`,context:`Complete setup in the browser, then wait while eve verifies the connection`,actions:[{value:`retry`,label:`Did your browser not open? Try again`},{value:`cancel`,label:`Cancel`}]}),l;try{l=await raceAttemptAgainstChoice({prompt:c,outerSignal:i.signal,run:t=>runAttempt({...attemptInput(n,e=>{s=e}),signal:t,phase:e.spinner===void 0?(e,t)=>t():(t,n)=>withPhase(e,t,n)})})}catch(e){throw await cleanupCurrentAttempt(),e}if(l.via===`work`)return{state:`finished`,result:await finishOutcome(l.outcome,n,cleanupCurrentAttempt)};if(l.settled?.state===`attached`)return{state:`finished`,result:await finishOutcome(l.settled,n,cleanupCurrentAttempt)};let u=await cleanupCurrentAttempt();if(u.state===`failed`)return{state:`finished`,result:cleanupFailureResult(u)};if(l.choice===`retry`){let n=await withPhase(e,`Checking existing Slack connectors...`,()=>listSlackConnectors(r,t,a,i.signal));return i.signal?.throwIfAborted(),n.state===`failed`?(e.warning(`Could not inspect existing Slack connectors, so eve did not create another one. ${n.message}`),{state:`finished`,result:{state:`connector-lookup-failed`}}):{state:`retry`,source:{state:`new`,baselineConnectorUids:new Set(n.connectors.map(e=>e.uid))}}}return{state:`finished`,result:{state:`cancelled`}}}if(d.state===`found`){let e=i.selectConnector===void 0?d.preferred??d.connectors[0]:await i.selectConnector(d.connectors,d.preferred);if(i.signal?.throwIfAborted(),e!==`create`)return runExistingConnector({state:`existing`,ref:e})}let f={state:`new`,baselineConnectorUids:d.connectorUids};if(i.awaitChoice===void 0)return runUncontrolledAttempt(f);for(;;){let e=await runInteractiveAttempt(f,i.awaitChoice);if(e.state===`finished`)return e.result;f=e.source}}async function reconcileSlackUid(e,t,n,r){if(n.state!==`attached`||n.connectorUid===r)return!0;let i=join(t,`agent/channels/slack.ts`),{patched:a}=await updateSlackChannelConnectorUid(i,n.connectorUid);return a?!0:(e.warning(`Could not patch agent/channels/slack.ts automatically. Update \`connectSlackCredentials("...")\` to \`"${n.connectorUid}"\` and run \`vercel deploy --prod\`.`),!1)}export{inspectSlackbotConnectors,provisionSlackbot,reconcileSlackUid};
1
+ import{CONNECT_LOOKUP_TIMEOUT_MS,applySlackRouting,cleanupCreatedAttempt,fetchSlackConnectorDetails,fetchSlackWorkspace,findFreeSlackConnectorName,inspectSlackConnectors,refreshSlackCandidate}from"./slack-connect-lifecycle.js";import{createSlackConnector}from"./slack-connect-create.js";import{describeSlackDestinations,isReusableSlackConnector,orderSlackConnectorCandidates,planSlackRouting}from"./slack-setup-plan.js";import{createHash,randomBytes}from"node:crypto";import{join}from"node:path";import{SLACK_CHANNEL_DEFAULT_ROUTE}from"#setup/scaffold/index.js";import{readProjectLink}from"#setup/project-resolution.js";import{performance}from"node:perf_hooks";import{captureVercel,runVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{setTimeout}from"node:timers/promises";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";import{openUrl}from"#setup/primitives/open-url.js";import{updateSlackChannelConnectorUid}from"#setup/scaffold/update/update-slack-channel.js";const defaultDeps={captureVercel,runVercel,runVercelCaptureStdout},realDelay=(e,t)=>setTimeout(e,void 0,{signal:t}),monotonicNow=()=>performance.now();async function pollSlackWorkspace(e,t,n,r,i,a){let o=e.delay??realDelay,s=e.now??monotonicNow,c=s()+3e5;for(;;){a?.throwIfAborted();let l=c-s();if(l<=0)return{state:`timed-out`};let u=await fetchSlackWorkspace({deps:e,projectRoot:t,connectorId:n,orgId:r,onOutput:i,timeoutMs:Math.min(CONNECT_LOOKUP_TIMEOUT_MS,l),signal:a});if(a?.throwIfAborted(),u.state!==`pending`)return u;let d=c-s();if(d<=0)return{state:`timed-out`};await o(Math.min(3e3,d),a)}}function isAbortFromSignal(e,t){return t?.aborted===!0&&(e===t.reason||e instanceof Error&&e.name===`AbortError`)}function cleanupFailureResult(e){return{state:`cleanup-failed`,connectorUids:e.connectorUids}}function openSlackInstall(e,t,n){if(n===void 0){e.info(`Run \`vercel connect open ${t.uid}\` to install it in a Slack workspace.`);return}let r=randomBytes(37).toString(`base64url`),i=new URL(`https://vercel.com/api/v1/connect/install/${encodeURIComponent(t.id)}`);i.searchParams.set(`teamId`,n),i.searchParams.set(`request_code`,createHash(`sha256`).update(r).digest(`base64url`)),e.info(`Install \`${t.uid}\` in a Slack workspace: ${i.href}`),openUrl(i.href)}function renamedConnectorMessage(e,t,n){let r=n.find(t=>t.uid===`slack/${e}`);if(r===void 0)return`A Slack connector named \`slack/${e}\` already exists, so eve will name the new one \`slack/${t}\`.`;let i=r.otherProjects.map(e=>e.name??e.id);return`\`slack/${e}\` is already used by ${i.length===1?`another project`:`other projects`} (${i.join(`, `)}), so eve will create \`slack/${t}\` for this project.`}function connectorInUseMessage(e){let t=e.otherProjects.map(e=>e.name??e.id).join(`, `);return`\`${e.uid}\` is used by ${t}. eve does not add a second agent to one Slack app because both would respond to the same events. Create a new Slack app for this agent instead.`}async function runAttempt(e){let{log:t,deps:n,projectRoot:r,projectId:i,orgId:a,onOutput:o,signal:s,phase:c}=e,l,u,d,f,p=[],m=e.source.state===`new`;if(e.source.state===`existing`){let{candidate:h}=e.source;if(l={uid:h.uid,id:h.id},u=h.workspace,u===void 0){openSlackInstall(t,l,a);let e=await c(`Waiting for the Slack workspace install...`,()=>pollSlackWorkspace(n,r,l.id,a,o,s));if(e.state===`timed-out`)return{state:`timed-out`,ref:l};if(e.state===`failed`)return{state:`failed`,ref:l,message:e.message};u=e.workspace,m=!0}let g=await refreshSlackCandidate({deps:n,projectRoot:r,candidate:h,projectId:i,orgId:a,onOutput:o,signal:s});if(s?.throwIfAborted(),g.state===`failed`)return{state:`attach-failed`,ref:l,message:g.message};if(!isReusableSlackConnector(g.candidate))return{state:`in-use`,ref:l,projects:g.candidate.otherProjects};d=g.candidate.attached,f=g.candidate.triggerDestinations,p=g.candidate.otherProjects,u??=g.candidate.workspace}else{let i=await createSlackConnector({deps:n,projectRoot:r,orgId:a,slug:e.source.name,onOutput:o,signal:s,phase:c,onCreated:t=>{e.trace.createdRef=t},waitForWorkspace:async(e,t)=>{let i=await pollSlackWorkspace(n,r,e.id,a,o,t);return i.state===`connected`?i.workspace:void 0}});if(i.state===`failed`)return e.trace.rejected=i.rejected,i.detail===void 0?{state:`create-failed`}:{state:`create-failed`,detail:i.detail};if(i.state===`unresolved`)return t.warning(`Vercel did not return an exact Slack connector UID for this request, so eve cannot attach or remove it safely.`),{state:`unresolved`};l=i.ref,i.via===`workspace`&&(u=i.workspace),d=!0;let p=await fetchSlackConnectorDetails({deps:n,projectRoot:r,connectorId:l.id,orgId:a,onOutput:o,timeoutMs:CONNECT_LOOKUP_TIMEOUT_MS,signal:s});if(s?.throwIfAborted(),p.state===`failed`)return{state:`attach-failed`,ref:l,message:p.message};f=p.details.triggerDestinations,u??=p.details.workspace}let h=planSlackRouting({attached:d,destinations:f,projectId:i,route:SLACK_CHANNEL_DEFAULT_ROUTE});if(h.kind===`limit-reached`){let e=new Map(p.map(e=>[e.id,e.name??e.id]));return e.set(i,`this project`),{state:`limit-reached`,ref:l,destinations:h.destinations,description:describeSlackDestinations(h.destinations,e)}}if(h.attach||h.destinations!==void 0){let e=await c(`Configuring Slack event delivery for this agent...`,()=>applySlackRouting({deps:n,projectRoot:r,ref:l,plan:h,orgId:a,onOutput:o,signal:s}));if(s?.throwIfAborted(),e.state===`attach-failed`)return{state:`attach-failed`,ref:l,message:e.message};m=!0}return u===void 0?{state:`attached`,ref:l,changed:m}:{state:`attached`,ref:l,workspace:u,changed:m}}async function raceAttemptAgainstChoice(e){let t=new AbortController,n=e.outerSignal?AbortSignal.any([e.outerSignal,t.signal]):t.signal,r=e.run(n);try{let i=await Promise.race([r.then(e=>({via:`work`,outcome:e})),e.prompt.choice.then(e=>({via:`choice`,choice:e}))]);if(i.via===`work`)return i;t.abort();let a;try{a=await r}catch(e){if(!isAbortFromSignal(e,n))throw e}return{via:`choice`,choice:i.choice,settled:a}}catch(e){t.abort();try{await r}catch{}throw e}finally{e.prompt.close()}}async function inspectSlackbotConnectors(e,t,n,r={},i=defaultDeps){let a=await(i.readProjectLink??readProjectLink)(t);if(a?.projectId===void 0)throw Error("Slack setup with Vercel Connect needs a linked Vercel project to tell which Slack connectors belong to it, so eve did not create one. Run `vercel link`, then try again.");let{projectId:o,orgId:s}=a,{channelConnectorUid:c}=r,l=`slack/${n}`,u=new Set([l]);c!==void 0&&u.add(c);let d=await withPhase(e,`Checking existing Slack connectors...`,()=>inspectSlackConnectors({deps:i,projectRoot:t,projectId:o,orgId:s,namedUids:u,onOutput:createPromptCommandOutput(e),signal:r.signal}));if(d.state===`failed`)throw Error(`Could not inspect existing Slack connectors, so eve did not create another one. ${d.message}`);return{projectId:o,orgId:s,slug:n,...orderSlackConnectorCandidates(d.candidates.filter(isReusableSlackConnector),{expectedUid:l,channelConnectorUid:c}),inUse:d.candidates.filter(e=>!isReusableSlackConnector(e))}}async function provisionSlackbot(e,t,n,r,i=defaultDeps,a={}){a.signal?.throwIfAborted();let o=createPromptCommandOutput(e),{projectId:s,orgId:c,slug:l}=n,u={log:e,deps:i,projectRoot:t,orgId:c,onOutput:o},findFreeName=async()=>{let n=await findFreeSlackConnectorName({deps:i,projectRoot:t,orgId:c,slug:l,onOutput:o,signal:a.signal});return n.state===`failed`&&e.warning(`Could not pick a name for the new Slack connector. ${n.message}`),n},finishOutcome=async(t,n,r)=>{let i=n.state===`new`;switch(t.state){case`create-failed`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return t.detail===void 0?{state:`create-failed`}:{state:`create-failed`,detail:t.detail};case`unresolved`:if(i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`create-failed`};case`in-use`:return e.warning(connectorInUseMessage({uid:t.ref.uid,otherProjects:t.projects})),{state:`connector-in-use`,connectorUid:t.ref.uid,projects:t.projects};case`attach-failed`:return e.warning(`Could not register ${SLACK_CHANNEL_DEFAULT_ROUTE} on this project as a trigger destination for \`${t.ref.uid}\`.${t.message===void 0?``:` ${t.message}`} eve kept the connector; re-run \`eve add channel/slack\` to finish event delivery.`),{state:`attach-failed`,connectorUid:t.ref.uid};case`limit-reached`:return e.warning([`\`${t.ref.uid}\` already has ${t.destinations.length} trigger destinations, the most Vercel Connect allows, so eve changed nothing:`,...t.description.map(e=>` - ${e}`),"Remove one in the Connect dashboard, then re-run `eve add channel/slack`."].join(`
2
+ `)),{state:`trigger-limit-reached`,connectorUid:t.ref.uid,destinations:t.destinations};case`attached`:{let e=t.changed?`attached`:`already-configured`;return t.workspace===void 0?{state:e,connectorUid:t.ref.uid}:{state:e,connectorUid:t.ref.uid,chatUrl:t.workspace.workspaceUrl,workspaceName:t.workspace.workspaceName}}case`failed`:return e.warning(`Could not verify the Slack workspace connection. ${t.message}`),{state:`installation-check-failed`,connectorUid:t.ref.uid};case`timed-out`:if(e.warning(`The Slackbot did not connect to a Slack workspace in time.`),i){let e=await r();if(e.state===`failed`)return cleanupFailureResult(e)}return{state:`not-installed`}}},cleanupNewAttempt=async(e,t)=>cleanupCreatedAttempt(u,{expectedUid:`slack/${e.name}`,createdRef:t.createdRef,rejected:t.rejected});function attemptInput(n,r){return{log:e,deps:i,projectRoot:t,projectId:s,orgId:c,source:n,onOutput:o,trace:r}}async function runExistingConnector(t){let cleanupCurrentAttempt=async()=>({state:`clean`}),n=t.candidate.uid,notInstalled=()=>(e.warning(`The Slack connector \`${n}\` is not installed in a Slack workspace yet. Re-run \`eve add channel/slack\` to open its install page again, or choose "Create a new Slack app" instead.`),{state:`existing-not-installed`,connectorUid:n}),finishExistingOutcome=async e=>e.state===`timed-out`?notInstalled():finishOutcome(e,t,cleanupCurrentAttempt);if(a.awaitChoice!==void 0&&t.candidate.workspace===void 0)for(;;){let e=await raceAttemptAgainstChoice({prompt:a.awaitChoice({status:`Waiting for the Slack workspace install...`,context:`Install the Slack app in your browser, then wait while eve verifies it`,actions:[{value:`retry`,label:`Did your browser not open? Try again`},{value:`cancel`,label:`Stop waiting`}]}),outerSignal:a.signal,run:e=>runAttempt({...attemptInput(t,{rejected:!1}),signal:e,phase:(e,t)=>t()})});if(e.via===`work`)return finishExistingOutcome(e.outcome);if(e.settled?.state===`attached`)return finishExistingOutcome(e.settled);if(e.choice!==`retry`)return notInstalled()}return finishExistingOutcome(await runAttempt({...attemptInput(t,{rejected:!1}),signal:a.signal,phase:(t,n)=>withPhase(e,t,n)}))}async function runUncontrolledAttempt(t){let n={rejected:!1},cleanupCurrentAttempt=()=>cleanupNewAttempt(t,n),r=runAttempt({...attemptInput(t,n),signal:a.signal,phase:(t,n)=>withPhase(e,t,n)});try{return await finishOutcome(await r,t,cleanupCurrentAttempt)}catch(e){throw a.signal?.aborted===!0&&await cleanupCurrentAttempt(),e}}async function runInteractiveAttempt(t,n){let r={rejected:!1},cleanupCurrentAttempt=()=>cleanupNewAttempt(t,r),i=n({status:`Waiting for Slack setup to finish...`,context:`Complete setup in the browser, then wait while eve verifies the connection`,actions:[{value:`retry`,label:`Did your browser not open? Try again`},{value:`cancel`,label:`Cancel`}]}),o;try{o=await raceAttemptAgainstChoice({prompt:i,outerSignal:a.signal,run:n=>runAttempt({...attemptInput(t,r),signal:n,phase:e.spinner===void 0?(e,t)=>t():(t,n)=>withPhase(e,t,n)})})}catch(e){throw await cleanupCurrentAttempt(),e}if(o.via===`work`)return{state:`finished`,result:await finishOutcome(o.outcome,t,cleanupCurrentAttempt)};if(o.settled?.state===`attached`)return{state:`finished`,result:await finishOutcome(o.settled,t,cleanupCurrentAttempt)};let s=await cleanupCurrentAttempt();if(s.state===`failed`)return{state:`finished`,result:cleanupFailureResult(s)};if(o.choice===`retry`){let t=await withPhase(e,`Checking existing Slack connectors...`,()=>findFreeName());return a.signal?.throwIfAborted(),t.state===`failed`?{state:`finished`,result:{state:`connector-lookup-failed`}}:{state:`retry`,source:{state:`new`,name:t.name}}}return{state:`finished`,result:{state:`cancelled`}}}if(r!==`create`)return runExistingConnector({state:`existing`,candidate:r});let d=await findFreeName();if(a.signal?.throwIfAborted(),d.state===`failed`)return{state:`connector-lookup-failed`};d.name!==l&&e.info(renamedConnectorMessage(l,d.name,n.inUse));let f={state:`new`,name:d.name};if(a.awaitChoice===void 0)return runUncontrolledAttempt(f);for(;;){let e=await runInteractiveAttempt(f,a.awaitChoice);if(e.state===`finished`)return e.result;f=e.source}}async function reconcileSlackUid(e,t,n,r){if(n.state!==`attached`&&n.state!==`already-configured`||n.connectorUid===r)return!0;let i=join(t,`agent/channels/slack.ts`),{patched:a}=await updateSlackChannelConnectorUid(i,n.connectorUid);return a?!0:(e.warning(`Could not patch agent/channels/slack.ts automatically. Update \`connectSlackCredentials("...")\` to \`"${n.connectorUid}"\` and run \`vercel deploy --prod\`.`),!1)}export{connectorInUseMessage,inspectSlackbotConnectors,provisionSlackbot,reconcileSlackUid};
@@ -0,0 +1,10 @@
1
+ import type { ActionPresentationByCallId } from "#protocol/message.js";
2
+ import type { RuntimeActionRequest } from "#shared/action-types.js";
3
+ /**
4
+ * How a call reads to people on every surface: the label its entry's definition
5
+ * gives it, or the entry's display title. A call made through `eve__tool` or
6
+ * `eve__skill` arrives as the call to its entry, so it reads like a direct call.
7
+ */
8
+ export declare function actionLabel(action: RuntimeActionRequest, presentation: ActionPresentationByCallId | undefined): string;
9
+ /** The calls people see: the model waiting on or stopping its own tasks stays out of view. */
10
+ export declare function visibleActions<T extends RuntimeActionRequest>(actions: readonly T[]): T[];
@@ -0,0 +1 @@
1
+ import{actionRequestName}from"#shared/action-request-name.js";import{displayTitle}from"#shared/display-name.js";import{isTaskControlTool}from"#protocol/task-tools.js";function actionLabel(e,t){return t?.[e.callId]?.label??displayTitle(actionRequestName(e))}function visibleActions(e){return e.filter(e=>!(e.kind===`tool-call`&&isTaskControlTool(e.toolName)))}export{actionLabel,visibleActions};
@@ -1,3 +1,5 @@
1
1
  import type { RuntimeActionRequest } from "#shared/action-types.js";
2
- /** The tool, agent, or `load_skill` a request targets. */
2
+ /** The tool, agent, or skill a request targets. */
3
3
  export declare function actionRequestName(action: RuntimeActionRequest): string;
4
+ /** The skill an `eve__skill` input names, if it names one. */
5
+ export declare function skillTarget(input: unknown): string | undefined;