@cursor/july 0.1.94 → 0.1.96

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 (332) hide show
  1. package/AGENTS.md +3 -4
  2. package/dist/channels/deployments/types.d.ts +1 -1
  3. package/dist/channels/deployments/types.d.ts.map +1 -1
  4. package/dist/channels/deployments/types.js +1 -0
  5. package/dist/channels/github/github-channel.d.ts.map +1 -1
  6. package/dist/channels/github/github-channel.js +14 -2
  7. package/dist/channels/github/types.d.ts +18 -3
  8. package/dist/channels/github/types.d.ts.map +1 -1
  9. package/dist/channels/origin/api.d.ts +59 -13
  10. package/dist/channels/origin/api.d.ts.map +1 -1
  11. package/dist/channels/origin/api.js +168 -27
  12. package/dist/channels/origin/binding.d.ts +2 -2
  13. package/dist/channels/origin/checks.d.ts +6 -6
  14. package/dist/channels/origin/checks.js +6 -6
  15. package/dist/channels/origin/cursor-account.d.ts +5 -3
  16. package/dist/channels/origin/cursor-account.d.ts.map +1 -1
  17. package/dist/channels/origin/cursor-account.js +5 -3
  18. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  19. package/dist/channels/origin/origin-channel.js +11 -3
  20. package/dist/channels/origin/origin-webhook.d.ts +11 -1
  21. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  22. package/dist/channels/origin/origin-webhook.js +23 -3
  23. package/dist/channels/origin/types.d.ts +8 -0
  24. package/dist/channels/origin/types.d.ts.map +1 -1
  25. package/dist/channels/slack/api.d.ts +9 -0
  26. package/dist/channels/slack/api.d.ts.map +1 -1
  27. package/dist/channels/slack/api.js +36 -5
  28. package/dist/channels/slack/defaults.d.ts.map +1 -1
  29. package/dist/channels/slack/defaults.js +17 -46
  30. package/dist/channels/slack/dispatch.d.ts +7 -1
  31. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  32. package/dist/channels/slack/dispatch.js +47 -23
  33. package/dist/channels/slack/inbound.d.ts +8 -0
  34. package/dist/channels/slack/inbound.d.ts.map +1 -1
  35. package/dist/channels/slack/inbound.js +32 -0
  36. package/dist/channels/slack/live-delivery.d.ts +26 -29
  37. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  38. package/dist/channels/slack/live-delivery.js +172 -73
  39. package/dist/channels/slack/manifest.d.ts.map +1 -1
  40. package/dist/channels/slack/manifest.js +5 -1
  41. package/dist/channels/slack/nudge-carrier.d.ts +2 -0
  42. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  43. package/dist/channels/slack/nudge-carrier.js +48 -1
  44. package/dist/channels/slack/pr-ref.d.ts +7 -1
  45. package/dist/channels/slack/pr-ref.d.ts.map +1 -1
  46. package/dist/channels/slack/pr-ref.js +42 -23
  47. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  48. package/dist/channels/slack/slack-channel.js +2 -2
  49. package/dist/docs/404.html +2 -2
  50. package/dist/docs/ab.html +4 -4
  51. package/dist/docs/assets/{app.CFDEas4I.js → app.jXleCmOc.js} +1 -1
  52. package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
  53. package/dist/docs/assets/chunks/{VPLocalSearchBox.B1IIYpYS.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
  54. package/dist/docs/assets/chunks/{theme.Ct4NSiLm.js → theme.9ged-pr2.js} +2 -2
  55. package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
  56. package/dist/docs/assets/{index.md.DRakGHFe.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
  57. package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.js → reference_cli.md.CCnG-nJx.js} +4 -2
  58. package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.lean.js → reference_cli.md.CCnG-nJx.lean.js} +1 -1
  59. package/dist/docs/assets/{reference_skills.md.8son6Hjm.js → reference_skills.md.BFW9retM.js} +3 -3
  60. package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
  61. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
  62. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
  63. package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
  64. package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
  65. package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
  66. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
  67. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
  68. package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
  69. package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
  70. package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
  71. package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
  72. package/dist/docs/building-with-agents.html +4 -4
  73. package/dist/docs/concepts.html +4 -4
  74. package/dist/docs/deployment.html +4 -4
  75. package/dist/docs/evals.html +4 -4
  76. package/dist/docs/guides/agent-to-agent.html +4 -4
  77. package/dist/docs/guides/cloud-runtime.html +4 -4
  78. package/dist/docs/guides/convert-automation.html +4 -4
  79. package/dist/docs/guides/github.html +4 -4
  80. package/dist/docs/guides/human-in-the-loop.html +4 -4
  81. package/dist/docs/guides/mcp-oauth.html +4 -4
  82. package/dist/docs/guides/opentelemetry.html +4 -4
  83. package/dist/docs/guides/slack.html +4 -4
  84. package/dist/docs/guides/webhooks.html +4 -4
  85. package/dist/docs/hashmap.json +1 -1
  86. package/dist/docs/hillclimbing.html +4 -4
  87. package/dist/docs/index.html +6 -6
  88. package/dist/docs/index.md +5 -1
  89. package/dist/docs/llms-full.txt +189 -26
  90. package/dist/docs/llms.txt +2 -0
  91. package/dist/docs/quickstart.html +4 -4
  92. package/dist/docs/reference/agent-config.html +4 -4
  93. package/dist/docs/reference/artifacts.html +4 -4
  94. package/dist/docs/reference/channels.html +4 -4
  95. package/dist/docs/reference/cli.html +8 -6
  96. package/dist/docs/reference/cli.md +4 -1
  97. package/dist/docs/reference/connections.html +4 -4
  98. package/dist/docs/reference/hooks.html +4 -4
  99. package/dist/docs/reference/http-api.html +4 -4
  100. package/dist/docs/reference/instructions.html +4 -4
  101. package/dist/docs/reference/playground.html +4 -4
  102. package/dist/docs/reference/project-layout.html +4 -4
  103. package/dist/docs/reference/prompt.html +4 -4
  104. package/dist/docs/reference/schedules.html +4 -4
  105. package/dist/docs/reference/sessions.html +4 -4
  106. package/dist/docs/reference/skills.html +7 -7
  107. package/dist/docs/reference/subagents.html +4 -4
  108. package/dist/docs/reference/tools.html +4 -4
  109. package/dist/docs/scaffolding-agents.html +4 -4
  110. package/dist/docs/storage.html +4 -4
  111. package/dist/docs/templates/agentic-owners.html +7 -7
  112. package/dist/docs/templates/agentic-owners.md +1 -1
  113. package/dist/docs/templates/code-wiki.html +28 -0
  114. package/dist/docs/templates/code-wiki.md +91 -0
  115. package/dist/docs/templates/demo.html +6 -6
  116. package/dist/docs/templates/demo.md +3 -2
  117. package/dist/docs/templates/pr-autofixer.html +6 -6
  118. package/dist/docs/templates/pr-autofixer.md +7 -13
  119. package/dist/docs/templates/security-help.html +30 -0
  120. package/dist/docs/templates/security-help.md +65 -0
  121. package/dist/docs/templates/security-reviewer.html +6 -6
  122. package/dist/docs/templates/security-reviewer.md +1 -2
  123. package/dist/docs/templates/triage.html +7 -7
  124. package/dist/docs/templates/triage.md +2 -6
  125. package/dist/docs/troubleshooting.html +4 -4
  126. package/dist/files-backends/cursor-hosted.d.ts +26 -0
  127. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  128. package/dist/files-backends/cursor-hosted.js +32 -4
  129. package/dist/files.d.ts +2 -0
  130. package/dist/files.d.ts.map +1 -1
  131. package/dist/files.js +5 -0
  132. package/dist/internal/advertise-tools.d.ts +2 -0
  133. package/dist/internal/advertise-tools.d.ts.map +1 -1
  134. package/dist/internal/advertise-tools.js +15 -1
  135. package/dist/internal/bounded.d.ts +7 -0
  136. package/dist/internal/bounded.d.ts.map +1 -0
  137. package/dist/internal/bounded.js +32 -0
  138. package/dist/internal/cli-deploy.d.ts.map +1 -1
  139. package/dist/internal/cli-deploy.js +142 -7
  140. package/dist/internal/conversation-mirror.d.ts +85 -0
  141. package/dist/internal/conversation-mirror.d.ts.map +1 -0
  142. package/dist/internal/conversation-mirror.js +312 -0
  143. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  144. package/dist/internal/cursor/backend-client.js +22 -48
  145. package/dist/internal/cursor/session-token.d.ts +45 -0
  146. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  147. package/dist/internal/cursor/session-token.js +99 -0
  148. package/dist/internal/cursor-agent-template.d.ts +1 -1
  149. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  150. package/dist/internal/cursor-agent-template.js +1 -0
  151. package/dist/internal/deferred-channel-session.d.ts +20 -0
  152. package/dist/internal/deferred-channel-session.d.ts.map +1 -0
  153. package/dist/internal/deferred-channel-session.js +62 -0
  154. package/dist/internal/deploy-client.d.ts +13 -1
  155. package/dist/internal/deploy-client.d.ts.map +1 -1
  156. package/dist/internal/deploy-client.js +11 -1
  157. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  158. package/dist/internal/deploy-manifest.js +11 -5
  159. package/dist/internal/discovery.d.ts.map +1 -1
  160. package/dist/internal/discovery.js +22 -2
  161. package/dist/internal/framework-file-storage.d.ts +61 -0
  162. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  163. package/dist/internal/framework-file-storage.js +204 -0
  164. package/dist/internal/framework-storage-selection.d.ts +38 -16
  165. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  166. package/dist/internal/framework-storage-selection.js +78 -17
  167. package/dist/internal/hosted-admission-context.d.ts +20 -0
  168. package/dist/internal/hosted-admission-context.d.ts.map +1 -0
  169. package/dist/internal/hosted-admission-context.js +31 -0
  170. package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
  171. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  172. package/dist/internal/hosted-delivery-protocol.js +33 -1
  173. package/dist/internal/hosted-delivery.d.ts +11 -2
  174. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  175. package/dist/internal/hosted-delivery.js +79 -35
  176. package/dist/internal/hosted-managed-automation.d.ts +30 -0
  177. package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
  178. package/dist/internal/hosted-managed-automation.js +58 -0
  179. package/dist/internal/init-project.d.ts.map +1 -1
  180. package/dist/internal/init-project.js +2 -0
  181. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  182. package/dist/internal/install-cursor-skills.js +1 -3
  183. package/dist/internal/managed-delivery.d.ts +80 -0
  184. package/dist/internal/managed-delivery.d.ts.map +1 -0
  185. package/dist/internal/managed-delivery.js +86 -0
  186. package/dist/internal/review-comments.d.ts.map +1 -1
  187. package/dist/internal/review-comments.js +10 -98
  188. package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
  189. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  190. package/dist/internal/runtime-dispatch-runner.js +7 -0
  191. package/dist/internal/scm/pr-url.d.ts +14 -0
  192. package/dist/internal/scm/pr-url.d.ts.map +1 -0
  193. package/dist/internal/scm/pr-url.js +65 -0
  194. package/dist/internal/sdk-runner.d.ts +25 -0
  195. package/dist/internal/sdk-runner.d.ts.map +1 -1
  196. package/dist/internal/sdk-runner.js +70 -0
  197. package/dist/internal/server.d.ts.map +1 -1
  198. package/dist/internal/server.js +11 -2
  199. package/dist/internal/session-engine.d.ts +13 -0
  200. package/dist/internal/session-engine.d.ts.map +1 -1
  201. package/dist/internal/session-engine.js +71 -3
  202. package/dist/internal/steering.d.ts +15 -0
  203. package/dist/internal/steering.d.ts.map +1 -0
  204. package/dist/internal/steering.js +18 -0
  205. package/dist/playground/assets/index-B1DDvBeC.css +1 -0
  206. package/dist/playground/assets/{index-B3JCyigB.js → index-Cx9CclK_.js} +47 -47
  207. package/dist/playground/index.html +2 -2
  208. package/dist/storage-backends/cursor-hosted.d.ts +8 -0
  209. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  210. package/dist/storage-backends/cursor-hosted.js +4 -3
  211. package/dist/types.d.ts +2 -1
  212. package/dist/types.d.ts.map +1 -1
  213. package/docs/README.md +5 -1
  214. package/docs/reference/cli.md +4 -1
  215. package/docs/templates/agentic-owners.md +1 -1
  216. package/docs/templates/code-wiki.md +96 -0
  217. package/docs/templates/demo.md +3 -2
  218. package/docs/templates/pr-autofixer.md +7 -13
  219. package/docs/templates/security-help.md +70 -0
  220. package/docs/templates/security-reviewer.md +1 -2
  221. package/docs/templates/triage.md +2 -6
  222. package/package.json +2 -2
  223. package/skills/ab/SKILL.md +13 -97
  224. package/skills/create-agent/SKILL.md +123 -223
  225. package/skills/debug/SKILL.md +34 -68
  226. package/skills/evals/SKILL.md +55 -180
  227. package/skills/framework-map/SKILL.md +83 -145
  228. package/skills/github/SKILL.md +53 -111
  229. package/skills/hillclimb/SKILL.md +40 -163
  230. package/skills/mcp-auth/SKILL.md +48 -107
  231. package/skills/otel/SKILL.md +22 -68
  232. package/skills/setup-slack/SKILL.md +77 -208
  233. package/src/channels/deployments/types.ts +1 -0
  234. package/src/channels/github/github-channel.ts +23 -8
  235. package/src/channels/github/types.ts +19 -2
  236. package/src/channels/origin/api.ts +242 -30
  237. package/src/channels/origin/binding.ts +2 -2
  238. package/src/channels/origin/checks.ts +6 -6
  239. package/src/channels/origin/cursor-account.ts +5 -3
  240. package/src/channels/origin/origin-channel.ts +13 -1
  241. package/src/channels/origin/origin-webhook.ts +27 -3
  242. package/src/channels/origin/types.ts +8 -0
  243. package/src/channels/slack/api.ts +41 -5
  244. package/src/channels/slack/defaults.ts +15 -49
  245. package/src/channels/slack/dispatch.ts +56 -22
  246. package/src/channels/slack/inbound.ts +43 -0
  247. package/src/channels/slack/live-delivery.ts +235 -114
  248. package/src/channels/slack/manifest.ts +5 -1
  249. package/src/channels/slack/nudge-carrier.ts +48 -1
  250. package/src/channels/slack/pr-ref.ts +56 -25
  251. package/src/channels/slack/slack-channel.ts +2 -0
  252. package/src/files-backends/cursor-hosted.ts +41 -2
  253. package/src/files.ts +11 -0
  254. package/src/internal/advertise-tools.ts +18 -2
  255. package/src/internal/bounded.ts +28 -0
  256. package/src/internal/cli-deploy.ts +183 -7
  257. package/src/internal/conversation-mirror.ts +406 -0
  258. package/src/internal/cursor/backend-client.ts +34 -58
  259. package/src/internal/cursor/session-token.ts +115 -0
  260. package/src/internal/cursor-agent-template.ts +1 -0
  261. package/src/internal/deferred-channel-session.ts +61 -0
  262. package/src/internal/deploy-client.ts +24 -1
  263. package/src/internal/deploy-manifest.ts +10 -5
  264. package/src/internal/discovery.ts +25 -2
  265. package/src/internal/framework-file-storage.ts +222 -0
  266. package/src/internal/framework-storage-selection.ts +101 -19
  267. package/src/internal/hosted-admission-context.ts +37 -0
  268. package/src/internal/hosted-delivery-protocol.ts +44 -1
  269. package/src/internal/hosted-delivery.ts +105 -40
  270. package/src/internal/hosted-managed-automation.ts +72 -0
  271. package/src/internal/init-project.ts +2 -0
  272. package/src/internal/install-cursor-skills.ts +1 -4
  273. package/src/internal/managed-delivery.ts +125 -0
  274. package/src/internal/review-comments.ts +10 -113
  275. package/src/internal/runtime-dispatch-runner.ts +10 -0
  276. package/src/internal/scm/pr-url.ts +95 -0
  277. package/src/internal/sdk-runner.ts +103 -0
  278. package/src/internal/server.ts +12 -0
  279. package/src/internal/session-engine.ts +76 -4
  280. package/src/internal/steering.ts +17 -0
  281. package/src/storage-backends/cursor-hosted.ts +10 -1
  282. package/src/types.ts +2 -1
  283. package/templates/agentic-owners/README.md +1 -1
  284. package/templates/agentic-owners/agent/agent.ts +0 -10
  285. package/templates/agentic-owners/agent/channels/github.ts +5 -14
  286. package/templates/agentic-owners/agent/lib/config.ts +0 -8
  287. package/templates/agentic-owners/agent/lib/review.ts +2 -15
  288. package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
  289. package/templates/code-wiki/README.md +34 -0
  290. package/templates/code-wiki/agent/agent.ts +8 -0
  291. package/templates/code-wiki/agent/channels/github.ts +144 -0
  292. package/templates/code-wiki/agent/instructions.md +39 -0
  293. package/templates/code-wiki/agent/lib/repos.ts +5 -0
  294. package/templates/code-wiki/agent/lib/wiki.ts +22 -0
  295. package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
  296. package/templates/code-wiki/evals/evals.config.ts +5 -0
  297. package/templates/code-wiki/evals/wiki.eval.ts +132 -0
  298. package/templates/code-wiki/init.json +25 -0
  299. package/templates/code-wiki/package.json +18 -0
  300. package/templates/code-wiki/tsconfig.json +12 -0
  301. package/templates/demo/agent/agent.ts +0 -10
  302. package/templates/pr-autofixer/README.md +0 -2
  303. package/templates/pr-autofixer/agent/agent.ts +0 -11
  304. package/templates/pr-autofixer/agent/channels/slack.ts +0 -7
  305. package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
  306. package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
  307. package/templates/security-help/README.md +2 -2
  308. package/templates/security-help/agent/agent.ts +1 -2
  309. package/templates/security-help/agent/channels/slack.ts +0 -3
  310. package/templates/security-help/agent/instructions.md +9 -10
  311. package/templates/security-help/agent/skills/access-request.md +1 -1
  312. package/templates/security-help/agent/skills/faq.md +31 -0
  313. package/templates/security-help/agent/skills/security-playbooks.md +1 -1
  314. package/templates/security-help/package.json +1 -2
  315. package/templates/security-reviewer/agent/agent.ts +0 -10
  316. package/templates/triage/agent/agent.ts +0 -10
  317. package/templates/triage/agent/channels/queue.ts +1 -1
  318. package/templates/triage/agent/channels/webhook.ts +1 -3
  319. package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +0 -1
  320. package/dist/docs/assets/index.md.DRakGHFe.js +0 -5
  321. package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
  322. package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
  323. package/dist/internal/deployment-scm-event-stream.js +0 -474
  324. package/dist/playground/assets/index-D9N7-q97.css +0 -1
  325. package/src/internal/deployment-scm-event-stream.ts +0 -593
  326. package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
  327. package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
  328. package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
  329. package/templates/security-help/agent/skills/security-first-pass.md +0 -15
  330. /package/dist/docs/assets/{reference_skills.md.8son6Hjm.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
  331. /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
  332. /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
@@ -1,270 +1,139 @@
1
1
  ---
2
2
  name: agentsdk-setup-slack
3
3
  description: >-
4
- Wire Slack to an Agent SDK agent. Mint a dedicated Socket Mode app with
5
- slack create (dashboard wizard), then doctor and smoke. Use the manual
6
- manifest path only when the user owns the Slack app. Use when adding
7
- Slack to an agent.
4
+ Wire Slack to an Agent SDK agent. Mint a dedicated Socket Mode app
5
+ with slack create, then doctor and smoke. Use slack init --manual
6
+ only when the user owns the Slack app. Use when adding Slack.
8
7
  ---
9
8
 
10
9
  # Setup Slack for the Agent SDK
11
10
 
12
- Public docs index: `node_modules/@cursor/july/dist/docs/llms.txt`. A running
13
- host serves the same index at `/docs/llms.txt`.
11
+ Dedicated Socket Mode bot. `agent-sdk slack create` opens the
12
+ signed-in dashboard wizard. Tokens land in `.env.local` and as
13
+ deployment secrets. Never print token values.
14
14
 
15
- Use this skill when a human asks to wire Slack to an Agent SDK agent.
15
+ Do not generate manifests or ask anyone to paste tokens unless
16
+ they asked for `slack init --manual`.
16
17
 
17
- `slackChannel()` is a dedicated Socket Mode Slack app: the agent's own
18
- bot user. `agent-sdk slack create` opens a signed-in Cursor dashboard
19
- wizard; Slack consent and the bot name happen there. Tokens land in
20
- `.env.local` and as deployment secrets.
18
+ Existing `<PREFIX>_SLACK_BOT_TOKEN` + `_SLACK_APP_TOKEN` in
19
+ `.env.local` keep working. Do not force those onto the wizard.
21
20
 
22
- Do not generate manifests or ask anyone to paste tokens unless they
23
- asked for a custom Slack app (`slack init --manual`).
21
+ Guide: `docs/guides/slack.md`.
24
22
 
25
- Existing bots that already have `<PREFIX>_SLACK_BOT_TOKEN` and
26
- `_SLACK_APP_TOKEN` in `.env.local` keep working. Do not force them onto
27
- the wizard.
28
-
29
- ## Dedicated Slack app (Socket Mode)
30
-
31
- Goal: one dedicated bot per agent, tokens in `.env.local`, local serve
32
- without a cloud deploy. The dashboard wizard is the only first-run.
23
+ ## 1. Wizard (default)
33
24
 
34
25
  ```bash
35
26
  agent-sdk login
36
27
  agent-sdk slack create --dir .
37
28
  ```
38
29
 
39
- That opens the signed-in Cursor dashboard. Sign in as the same Cursor
40
- account that ran the command. Click **Add Slack to this agent**, approve
41
- Slack's consent screen, pick the bot name, and continue. The CLI waits
42
- and writes `<PREFIX>_SLACK_BOT_TOKEN` / `<PREFIX>_SLACK_APP_TOKEN` into
43
- `<dir>/.env.local`, then runs `doctor`. Token values never print.
44
-
45
- `--prod` provisions the prod app (default is dev). `--name` / `--icon` /
46
- `--channel-posts` prefill the wizard. `--prefix` / `--no-prefix` set the
47
- env-var names.
30
+ Same Cursor account in the browser. **Add Slack to this agent**,
31
+ approve Slack, pick the bot name. CLI writes
32
+ `<PREFIX>_SLACK_BOT_TOKEN` / `<PREFIX>_SLACK_APP_TOKEN` and runs
33
+ `doctor`.
48
34
 
49
- If Slack asks a workspace admin to approve the app, keep the CLI
50
- running. Open Slack's **Request approval** page (the CLI prints the
51
- link; the same URL is **Send a reminder** after you submit). Managed
52
- install does not file the request. After an admin approves, click
53
- **Retry** in the wizard.
35
+ Prefix is the directory basename in upper snake (`jenny`
36
+ `JENNY`, `pr-approver` `PR_APPROVER` `PR_APPROVER_SLACK_*`).
37
+ `--prefix` / `--no-prefix` override. Dev and prod are separate
38
+ apps; `--prod` is the prod app. `--name` / `--icon` /
39
+ `--channel-posts` / `--slack-team` prefill the wizard.
54
40
 
55
- `create` scaffolds `agent/channels/slack.ts` when missing. Do not paste
56
- a manifest at api.slack.com for this path. `slack init` without
57
- `--manual` hard-errors; see the manual path below for a hand-imported
58
- app.
41
+ If Slack needs workspace-admin approval, keep the CLI running.
42
+ Open the **Request approval** link it prints. Managed install
43
+ does not file the request. After approval, **Retry** in the
44
+ wizard.
59
45
 
60
- Existing tokens in `.env.local` keep working. Skip the wizard for those
61
- agents unless you want a Cursor-managed app.
46
+ `create` scaffolds `agent/channels/slack.ts` when missing:
62
47
 
63
- Then:
64
-
65
- ```bash
66
- agent-sdk slack doctor --prefix MY_AGENT
67
- agent-sdk dev .
48
+ ```ts
49
+ export default slackChannel({
50
+ envPrefix: "JENNY",
51
+ suggestedPrompts: [{ title: "Help", message: "How can you help me?" }],
52
+ });
68
53
  ```
69
54
 
70
- Confirm log: `[agent-sdk/slack] Socket Mode connected`.
71
-
72
- When tokens are missing the channel logs
73
- `channel idle reason=missing credentials need=…` and `serve` continues.
74
-
75
- Human:
55
+ Return from dispatch handlers. Do not await long work in the
56
+ handler.
76
57
 
77
- 1. Invite the bot to a channel
78
- 2. `@mention` it (or DM)
79
- 3. Confirm Thinking… / Working… typing and a threaded reply
80
- 4. Server logs should show correlated lines (`event_id`, `session`, `channel`, `thread_ts`):
81
- - `inbound kind=app_mention …`
82
- - `session start …`
83
- - `reply delivered via postMessage|stream …`
58
+ A second `slack create` for the same agent and env overwrites the
59
+ app (same Slack app id, new manifest and tokens).
60
+ `agent-sdk slack destroy` deletes it.
84
61
 
85
- The dashboard lists a first-run agent as **Not deployed yet**. Local
86
- serve does not need a hosted engine. The next `agent-sdk deploy` (or
87
- dashboard **Deploy**) injects the stored secrets.
62
+ Local serve does not need a hosted engine. Next
63
+ `agent-sdk deploy` injects the stored secrets.
88
64
 
89
- A second `slack create` for the same agent and env overwrites that Slack
90
- app. It keeps the Slack app id and replaces the manifest and tokens.
91
- `agent-sdk slack destroy` deletes the provisioned app. Tokens left in
92
- `.env.local` simply stop working.
65
+ ## 2. Manual (`slack init --manual`)
93
66
 
94
- ## Manual Slack app (`slack init --manual`)
95
-
96
- Use this when the user wants a Slack app they own at api.slack.com, not
97
- a Cursor-managed app. Not the default. Do not offer it unless they
98
- asked for a custom/unmanaged app or already have one. Update
99
- `.agent-serve/slack/setup-status.json` as you complete phases.
100
-
101
- ### Phase 0 — Generate (agent)
67
+ Only when they own the app at api.slack.com.
102
68
 
103
69
  ```bash
104
70
  agent-sdk slack init --manual --dir . --name "My Agent"
105
71
  ```
106
72
 
107
- Creates:
108
-
109
- - `agent/channels/slack.ts` with `envPrefix` from the directory name
110
- - `.agent-serve/slack/manifest.{dev,prod}.json`
111
- - `.agent-serve/slack/env.example` (`<PREFIX>_SLACK_BOT_TOKEN` / `_APP_TOKEN`)
112
- - `.agent-serve/slack/setup-status.json`
113
-
114
- Use `--no-prefix` for the shared `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN`
115
- globals (single-agent only). Use `--prefix CUSTOM` to override the
116
- default prefix. `--channel-posts` subscribes the manifests to
117
- `message.channels` / `message.groups`.
118
-
119
- These files omit `settings.managed_app_settings`. Slack accepts that
120
- block only from a manager app's user token, so it belongs to
121
- `slack create`, not to a manifest a human pastes in.
122
-
123
- ### Phase 1 — Create apps (human)
124
-
125
- 1. Open https://api.slack.com/apps → **Create New App** → **From a manifest**
126
- 2. Paste `manifest.dev.json` → create the *dev* app
127
- 3. Repeat with `manifest.prod.json` for prod
128
-
129
- Stop and ask the human to complete this gate.
130
-
131
- ### Phase 2 — Install + tokens (human)
73
+ Writes `agent/channels/slack.ts` (`envPrefix` from the directory),
74
+ manifests under the project state directory, and `env.example`.
75
+ `--channel-posts` subscribes `message.channels` /
76
+ `message.groups`.
132
77
 
133
- For each app:
78
+ Human gates, one at a time. Stop after each.
134
79
 
135
- 1. **Install to Workspace** copy Bot User OAuth Token (`xoxb-…`)
136
- 2. **Basic Information → App-Level Tokens** — Create Token with scope
137
- `connections:write` copy (`xapp-…`)
80
+ 1. **Create the app.** Create New App From a manifest. Start
81
+ with `manifest.dev.json`.
82
+ 2. **Install.** Install to Workspace. Copy the bot token
83
+ (`xoxb-...`).
84
+ 3. **App token.** Create an app-level token with
85
+ `connections:write` (`xapp-...`).
86
+ 4. **Write env.** Put both in `.env.local`. Then doctor.
138
87
 
139
- ### Phase 3 Env (agent)
88
+ Repeat for prod with the prod manifest.
140
89
 
141
- Write into `.env.local` (dev app), using the keys from `env.example`:
90
+ ## 3. Doctor and smoke
142
91
 
143
92
  ```bash
144
- MY_AGENT_SLACK_BOT_TOKEN=xoxb-…
145
- MY_AGENT_SLACK_APP_TOKEN=xapp-…
93
+ agent-sdk slack doctor --prefix JENNY
94
+ agent-sdk serve --dir . --dev
146
95
  ```
147
96
 
148
- ```bash
149
- agent-sdk slack doctor --prefix MY_AGENT
150
- ```
151
-
152
- Stop when `app_token`, `connections_open`, `bot_token`, and `auth_test`
153
- are green.
154
-
155
- ### Phase 4 — Serve + smoke (agent + human)
156
-
157
- ```bash
158
- agent-sdk dev .
159
- ```
160
-
161
- Confirm log: `[agent-sdk/slack] Socket Mode connected`.
162
-
163
- When tokens are missing the channel logs
164
- `channel idle reason=missing credentials need=…` and `serve` continues.
97
+ Green: `app_token`, `connections_open`, `bot_token`, `auth_test`.
98
+ Log: `[agent-sdk/slack] Socket Mode connected`. Missing tokens
99
+ idle the channel; `serve` continues.
165
100
 
166
- Human:
101
+ 1. Invite the bot
102
+ 2. `@mention` or DM
103
+ 3. Thinking / Working, then a threaded reply
104
+ 4. Logs: `inbound kind=app_mention`, `session start`,
105
+ `reply delivered via postMessage|stream`
167
106
 
168
- 1. Invite the bot to a channel
169
- 2. `@mention` it (or DM)
170
- 3. Confirm Thinking… / Working… typing and a threaded reply
171
- 4. Server logs should show correlated lines (`event_id`, `session`, `channel`, `thread_ts`):
172
- - `inbound kind=app_mention …`
173
- - `session start …`
174
- - `reply delivered via postMessage|stream …`
107
+ ## Watch channels (opt-in)
175
108
 
176
- ## Features (defaults ON)
177
-
178
- - Chat streaming (`chat.startStream` / `appendStream` / `stopStream`) with postMessage fallback
179
- - Thinking / task cards for tool calls
180
- - `assistant.threads.setStatus` with rotating `loading_messages`
181
- - Thread title + suggested prompts
182
- - `markdown_text` when supported
183
- - Handler `message` / `workspaceFiles` / `cloud` passthrough for PR demos
184
-
185
- If a Slack API is unavailable (`method_not_found` / `missing_scope`), the pack falls back to postMessage + setStatus.
186
-
187
- ## Engagement: mentions by default, channel watch opt-in
188
-
189
- The pack dispatches only on `app_mention` + DMs unless told otherwise:
190
- summoned, never proactive. To watch channels (dispatch on new posts without
191
- a mention), opt in explicitly:
109
+ Default is mentions + DMs only. To wake on new posts:
192
110
 
193
111
  ```ts
194
112
  export default slackChannel({
113
+ envPrefix: "JENNY",
195
114
  engagement: {
196
115
  channelPosts: {
197
- allow: ["#issues-cursor-desktop"], // use ["*"] for every joined channel
198
- posts: "top-level", // default — thread replies never dispatch
199
- debounceMs: 15_000, // optional: edits settle, deletes cancel
116
+ allow: ["#alerts"], // ["*"] for every joined channel
117
+ posts: "top-level",
200
118
  },
201
119
  },
202
120
  onChannelPost: async (ctx, message) => ({}), // null = skip
203
121
  });
204
122
  ```
205
123
 
206
- Pass `--channel-posts` on `slack create` or `slack init --manual` so the
207
- app subscribes to `message.channels` / `message.groups`. Invite the bot to
208
- each watched channel. Posts mentioning the bot stay on the
209
- `app_mention` path; watch sessions reuse the thread-scoped principal with an
210
- `engagement: "channel_post"` attribute, so a later mention continues the
211
- thread. `engagement.mentions` / `engagement.directMessages` can be set to
212
- `false` to turn those surfaces off.
213
-
214
- ## Tool approvals over Slack (opt-in HITL)
124
+ Pass `--channel-posts` on `create` / `init --manual`. Invite the
125
+ bot to each watched channel. Mentions stay on `app_mention`; a
126
+ later mention continues the watch thread.
215
127
 
216
- Tools with `needsApproval` park until a human approves or denies. To route
217
- that through Slack, set `toolApprovals: true` on `slackChannel`. It posts
218
- Block Kit Approve/Deny cards and routes Socket Mode `interactive` clicks
219
- back to the parked call:
128
+ ## Approvals (opt-in)
220
129
 
221
130
  ```ts
222
131
  export default slackChannel({
223
- credentials: { /* … */ },
132
+ envPrefix: "JENNY",
224
133
  toolApprovals: true,
225
134
  });
226
135
  ```
227
136
 
228
- Requirements and caveats:
229
-
230
- - The Slack app needs **interactivity** enabled. The wizard turns this
231
- on when `toolApprovals` is in play; `buildSlackManifest({ interactivity: true })`
232
- is the same switch for existing apps.
233
- - Composing by hand: spread `buildToolApprovalEvents({ credentials })` into
234
- `events` **and** set `interactivity: true` on the channel.
235
- - Cards show **redacted / truncated** args (Block Kit limits); execution
236
- uses the full validated input. Review sensitive tools in the playground
237
- when args may exceed the card.
238
- - Approvals only exist for `execution: "server"` tools on the `local`
239
- runtime, and parked calls do not survive a host restart.
240
- - In `--dev` (loopback) or `--allow-anonymous` (trusted shared host), the
241
- playground can also list Slack sessions and Approve/Deny
242
- their parked tools (audit records the HTTP caller). Production and
243
- bearer-auth hosts stay strict: Slack resolve must come from Slack
244
- interactivity or a matching principal.
245
-
246
- ## Notes
247
-
248
- - Dev and prod are **separate Slack apps** (separate tokens).
249
- - Socket Mode is outbound only. No Events HTTP / Request URL path.
250
- - Do not `await waitForCompletion()` inside Slack dispatch handlers. The pack uses `waitUntil`.
251
- - Do not share one token pair across multiple agents in the same process.
252
-
253
- ## CLI reference
254
-
255
- Wizard tooling is `create` / `destroy` / `icon` / `doctor`. Manual is
256
- `init --manual` / `manifest` / `doctor`. `slack setup` prints this
257
- guide. `slack init` hard-errors unless `--manual`.
258
-
259
- ```bash
260
- agent-sdk slack setup
261
- agent-sdk slack create --dir . # dashboard wizard (dev app)
262
- agent-sdk slack create --dir . --prod # prod app
263
- agent-sdk slack create --dir . --slack-team T0123ABCD
264
- agent-sdk slack destroy --dir . [--prod] [--slack-team T0123ABCD]
265
- agent-sdk slack init --manual --dir . --name "My Agent"
266
- agent-sdk slack init --manual --dir . --no-prefix
267
- agent-sdk slack init --manual --dir . --channel-posts
268
- agent-sdk slack manifest --env both
269
- agent-sdk slack doctor --prefix MY_AGENT
270
- ```
137
+ Wizard enables interactivity when this is set. Server tools on
138
+ `local` only. Parked calls die on host restart. Cards truncate
139
+ args; execution uses the full input.
@@ -7,6 +7,7 @@ export const DEPLOYMENTS_CHANNEL_KIND = "deployments";
7
7
  export const DEPLOYMENT_EVENT_TYPES = [
8
8
  "deployment.created",
9
9
  "deployment.succeeded",
10
+ "deployment.failed",
10
11
  ] as const;
11
12
  export type DeploymentEventType = (typeof DEPLOYMENT_EVENT_TYPES)[number];
12
13
 
@@ -11,6 +11,7 @@ import {
11
11
  continuationSource,
12
12
  normalizeIdentity,
13
13
  } from "../../internal/continuation-identity.js";
14
+ import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
14
15
  import { isDevMode } from "../../internal/dev-mode.js";
15
16
  import { bindLocalIngressSend } from "../../internal/local-ingress.js";
16
17
  import type {
@@ -1622,16 +1623,15 @@ async function startTurn(input: {
1622
1623
  scheduleAfterAck(input.args, async () => {
1623
1624
  await sendTurn();
1624
1625
  });
1625
- return withDispatchOutcome(
1626
- Response.json(
1627
- { ok: true, dispatched: true, mode: "turn" },
1628
- { status: 202 }
1629
- ),
1630
- "send"
1631
- );
1626
+ return acknowledgeTurn();
1632
1627
  }
1633
1628
 
1634
1629
  const session = await sendTurn();
1630
+ if (isDeferredChannelSession(session)) {
1631
+ // Hosted admission captured the send; the control plane allocates the
1632
+ // session after acknowledgement, so there is nothing to report yet.
1633
+ return acknowledgeTurn();
1634
+ }
1635
1635
  return withDispatchOutcome(
1636
1636
  Response.json({
1637
1637
  ok: true,
@@ -1677,12 +1677,27 @@ function scheduleAfterAck(
1677
1677
  );
1678
1678
  }
1679
1679
 
1680
+ /** 202 ack for a turn whose send completes after the response flushes. */
1681
+ function acknowledgeTurn(): Response {
1682
+ return withDispatchOutcome(
1683
+ Response.json(
1684
+ { ok: true, dispatched: true, mode: "turn" },
1685
+ { status: 202 }
1686
+ ),
1687
+ "send"
1688
+ );
1689
+ }
1690
+
1680
1691
  function acknowledgeTask(
1681
1692
  args: ChannelHandlerArgs,
1682
1693
  dispatch: GitHubTaskDispatch,
1683
1694
  extra: Record<string, unknown>
1684
1695
  ): Response {
1685
- scheduleAfterAck(args, dispatch.task);
1696
+ // Hand the task the per-delivery send/waitUntil so hosted admission can
1697
+ // capture task-initiated sends; startup-captured sends bypass capture.
1698
+ scheduleAfterAck(args, () =>
1699
+ dispatch.task({ send: args.send, waitUntil: args.waitUntil })
1700
+ );
1686
1701
  return withDispatchOutcome(
1687
1702
  Response.json(
1688
1703
  { ok: true, dispatched: true, mode: "task", ...extra },
@@ -7,6 +7,7 @@ import type {
7
7
  ChannelEventHandlers,
8
8
  ChannelStartArgs,
9
9
  HostContext,
10
+ SendMessageFn,
10
11
  SendMessageOptions,
11
12
  } from "../../types.js";
12
13
  import type { GitHubApiOptions } from "./api.js";
@@ -370,13 +371,29 @@ export interface GitHubTurnDispatch {
370
371
  | Promise<GitHubWorkspaceFiles | undefined>);
371
372
  }
372
373
 
374
+ /** Bound per-delivery helpers passed to a {@link GitHubTaskDispatch.task}. */
375
+ export interface GitHubTaskArgs {
376
+ /**
377
+ * Start (or resume) a session for this delivery. Locally this runs a real
378
+ * turn and returns the live session. In hosted admission it captures the
379
+ * send for the control plane to execute after `ses_…` is allocated and
380
+ * returns an inert deferred handle, so the task body keeps running.
381
+ * Always use this over a send captured at `onStart` — a startup-captured
382
+ * send bypasses hosted capture and is rejected during hosted admission.
383
+ */
384
+ send: SendMessageFn;
385
+ /** Extend the delivery's background window past the task promise. */
386
+ waitUntil: (promise: Promise<unknown>) => void;
387
+ }
388
+
373
389
  /**
374
390
  * Run a host-side handler for the event instead of a model turn. The task
375
391
  * runs in the background (`waitUntil`) after the webhook is acknowledged
376
- * with a 202, so it can outlive GitHub's ~10s delivery timeout.
392
+ * with a 202, so it can outlive GitHub's ~10s delivery timeout. The callback
393
+ * receives {@link GitHubTaskArgs}; zero-argument tasks remain valid.
377
394
  */
378
395
  export interface GitHubTaskDispatch {
379
- task: () => void | Promise<void>;
396
+ task: (args: GitHubTaskArgs) => void | Promise<void>;
380
397
  }
381
398
 
382
399
  export type GitHubDispatchResult =