@cursor/july 0.1.92 → 0.1.94

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 (448) hide show
  1. package/AGENTS.md +8 -20
  2. package/README.md +115 -182
  3. package/dist/channels/deployments/deployments-channel.d.ts +7 -0
  4. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  5. package/dist/channels/deployments/deployments-channel.js +26 -2
  6. package/dist/channels/deployments/types.d.ts +8 -0
  7. package/dist/channels/deployments/types.d.ts.map +1 -1
  8. package/dist/channels/github/github-channel.d.ts +3 -0
  9. package/dist/channels/github/github-channel.d.ts.map +1 -1
  10. package/dist/channels/github/github-channel.js +28 -56
  11. package/dist/channels/slack/attachments.js +2 -2
  12. package/dist/channels/slack/dispatch.d.ts +0 -7
  13. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  14. package/dist/channels/slack/dispatch.js +4 -7
  15. package/dist/channels/slack/eval-directive.d.ts +5 -12
  16. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  17. package/dist/channels/slack/eval-directive.js +8 -19
  18. package/dist/channels/slack/index.d.ts +0 -6
  19. package/dist/channels/slack/index.d.ts.map +1 -1
  20. package/dist/channels/slack/index.js +0 -6
  21. package/dist/channels/slack/setup.d.ts +4 -4
  22. package/dist/channels/slack/setup.d.ts.map +1 -1
  23. package/dist/channels/slack/setup.js +8 -15
  24. package/dist/channels/slack/slack-channel.d.ts +6 -13
  25. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  26. package/dist/channels/slack/slack-channel.js +15 -101
  27. package/dist/channels/slack/types.d.ts +12 -79
  28. package/dist/channels/slack/types.d.ts.map +1 -1
  29. package/dist/channels/slack/types.js +1 -15
  30. package/dist/client.d.ts +14 -0
  31. package/dist/client.d.ts.map +1 -0
  32. package/dist/client.js +12 -0
  33. package/dist/connections.d.ts +18 -9
  34. package/dist/connections.d.ts.map +1 -1
  35. package/dist/connections.js +17 -8
  36. package/dist/continuation.d.ts +1 -1
  37. package/dist/continuation.js +1 -1
  38. package/dist/docs/404.html +2 -2
  39. package/dist/docs/ab.html +8 -8
  40. package/dist/docs/ab.md +7 -13
  41. package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
  42. package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
  43. package/dist/docs/assets/{app.Bci6CM9E.js → app.CFDEas4I.js} +1 -1
  44. package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
  45. package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
  46. package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
  47. package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
  48. package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Ct4NSiLm.js} +2 -2
  49. package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
  50. package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.lwAgBIMI.lean.js} +1 -1
  51. package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.D9msOFOW.js} +9 -14
  52. package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
  53. package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
  54. package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
  55. package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.BDb0t1QV.js} +2 -2
  56. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
  57. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
  58. package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.B4sjlodG.js} +2 -2
  59. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.Cnh2mL4a.js} +5 -5
  60. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.Cnh2mL4a.lean.js} +1 -1
  61. package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
  62. package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
  63. package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.C32HsdKk.js} +7 -13
  64. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
  65. package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
  66. package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
  67. package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
  68. package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.DRakGHFe.lean.js} +1 -1
  69. package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.Nj_LjW_a.js} +2 -2
  70. package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
  71. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
  72. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
  73. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.Cw6_ICYG.js} +10 -11
  74. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +1 -1
  75. package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.BH8Oc0D0.js} +7 -7
  76. package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
  77. package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +14 -0
  78. package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +1 -1
  79. package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
  80. package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
  81. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
  82. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
  83. package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
  84. package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
  85. package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
  86. package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
  87. package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
  88. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
  89. package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
  90. package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.8son6Hjm.js} +4 -4
  91. package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
  92. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.BHeXn2id.js} +3 -3
  93. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
  94. package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
  95. package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
  96. package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
  97. package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
  98. package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
  99. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
  100. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
  101. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
  102. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
  103. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
  104. package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +1 -1
  105. package/dist/docs/building-with-agents.html +7 -7
  106. package/dist/docs/building-with-agents.md +5 -11
  107. package/dist/docs/concepts.html +5 -8
  108. package/dist/docs/concepts.md +13 -17
  109. package/dist/docs/deployment.html +13 -18
  110. package/dist/docs/deployment.md +9 -30
  111. package/dist/docs/design/agsh.md +406 -0
  112. package/dist/docs/evals.html +10 -10
  113. package/dist/docs/evals.md +16 -37
  114. package/dist/docs/guides/agent-to-agent.html +6 -6
  115. package/dist/docs/guides/agent-to-agent.md +3 -3
  116. package/dist/docs/guides/cloud-runtime.html +6 -6
  117. package/dist/docs/guides/cloud-runtime.md +9 -25
  118. package/dist/docs/guides/convert-automation.html +7 -7
  119. package/dist/docs/guides/convert-automation.md +4 -4
  120. package/dist/docs/guides/github.html +9 -9
  121. package/dist/docs/guides/github.md +16 -28
  122. package/dist/docs/guides/human-in-the-loop.html +4 -4
  123. package/dist/docs/guides/mcp-oauth.html +11 -13
  124. package/dist/docs/guides/mcp-oauth.md +14 -22
  125. package/dist/docs/guides/opentelemetry.html +5 -5
  126. package/dist/docs/guides/slack.html +11 -17
  127. package/dist/docs/guides/slack.md +13 -50
  128. package/dist/docs/guides/webhooks.html +6 -6
  129. package/dist/docs/guides/webhooks.md +3 -3
  130. package/dist/docs/hashmap.json +1 -1
  131. package/dist/docs/hillclimbing.html +6 -6
  132. package/dist/docs/hillclimbing.md +1 -1
  133. package/dist/docs/index.html +6 -6
  134. package/dist/docs/index.md +0 -36
  135. package/dist/docs/llms-full.txt +965 -3633
  136. package/dist/docs/llms.txt +3 -18
  137. package/dist/docs/quickstart.html +6 -6
  138. package/dist/docs/quickstart.md +3 -4
  139. package/dist/docs/reference/agent-config.html +8 -8
  140. package/dist/docs/reference/agent-config.md +10 -15
  141. package/dist/docs/reference/artifacts.html +4 -4
  142. package/dist/docs/reference/channels.html +6 -6
  143. package/dist/docs/reference/channels.md +20 -31
  144. package/dist/docs/reference/cli.html +14 -15
  145. package/dist/docs/reference/cli.md +29 -38
  146. package/dist/docs/reference/connections.html +11 -11
  147. package/dist/docs/reference/connections.md +24 -25
  148. package/dist/docs/reference/hooks.html +6 -6
  149. package/dist/docs/reference/hooks.md +12 -17
  150. package/dist/docs/reference/http-api.html +7 -7
  151. package/dist/docs/reference/http-api.md +25 -37
  152. package/dist/docs/reference/instructions.html +6 -6
  153. package/dist/docs/reference/instructions.md +1 -1
  154. package/dist/docs/reference/playground.html +5 -5
  155. package/dist/docs/reference/playground.md +14 -19
  156. package/dist/docs/reference/project-layout.html +9 -7
  157. package/dist/docs/reference/project-layout.md +7 -3
  158. package/dist/docs/reference/prompt.html +6 -6
  159. package/dist/docs/reference/prompt.md +1 -1
  160. package/dist/docs/reference/schedules.html +6 -6
  161. package/dist/docs/reference/schedules.md +1 -2
  162. package/dist/docs/reference/sessions.html +5 -12
  163. package/dist/docs/reference/sessions.md +8 -19
  164. package/dist/docs/reference/skills.html +8 -8
  165. package/dist/docs/reference/skills.md +3 -3
  166. package/dist/docs/reference/subagents.html +6 -6
  167. package/dist/docs/reference/subagents.md +2 -2
  168. package/dist/docs/reference/tools.html +8 -8
  169. package/dist/docs/reference/tools.md +30 -19
  170. package/dist/docs/scaffolding-agents.html +5 -5
  171. package/dist/docs/scaffolding-agents.md +4 -5
  172. package/dist/docs/storage.html +9 -9
  173. package/dist/docs/storage.md +37 -80
  174. package/dist/docs/templates/agentic-owners.html +7 -7
  175. package/dist/docs/templates/agentic-owners.md +2 -2
  176. package/dist/docs/templates/demo.html +4 -4
  177. package/dist/docs/templates/pr-autofixer.html +6 -6
  178. package/dist/docs/templates/pr-autofixer.md +7 -9
  179. package/dist/docs/templates/security-reviewer.html +5 -5
  180. package/dist/docs/templates/security-reviewer.md +2 -3
  181. package/dist/docs/templates/triage.html +4 -4
  182. package/dist/docs/troubleshooting.html +5 -5
  183. package/dist/docs/troubleshooting.md +8 -8
  184. package/dist/index.d.ts +1 -1
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +1 -1
  187. package/dist/internal/advertise-tools.d.ts +11 -0
  188. package/dist/internal/advertise-tools.d.ts.map +1 -1
  189. package/dist/internal/advertise-tools.js +47 -9
  190. package/dist/internal/authored-alias-hooks.d.ts +14 -11
  191. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  192. package/dist/internal/authored-alias-hooks.js +14 -11
  193. package/dist/internal/authored-loaders.d.ts +7 -6
  194. package/dist/internal/authored-loaders.d.ts.map +1 -1
  195. package/dist/internal/authored-loaders.js +14 -10
  196. package/dist/internal/cli-deploy.d.ts +1 -1
  197. package/dist/internal/cli-deploy.js +5 -5
  198. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  199. package/dist/internal/cli-mcp-oauth.js +7 -4
  200. package/dist/internal/continuation-channel.d.ts +6 -3
  201. package/dist/internal/continuation-channel.d.ts.map +1 -1
  202. package/dist/internal/continuation-channel.js +44 -40
  203. package/dist/internal/continuation-identity.d.ts +17 -16
  204. package/dist/internal/continuation-identity.d.ts.map +1 -1
  205. package/dist/internal/continuation-identity.js +109 -36
  206. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  207. package/dist/internal/convert-automation/convert-workflow.js +26 -15
  208. package/dist/internal/convert-automation/slug.d.ts +0 -2
  209. package/dist/internal/convert-automation/slug.d.ts.map +1 -1
  210. package/dist/internal/convert-automation/slug.js +0 -8
  211. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  212. package/dist/internal/cursor/account-mcp.js +5 -1
  213. package/dist/internal/deploy-manifest.d.ts +2 -2
  214. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  215. package/dist/internal/deploy-manifest.js +4 -9
  216. package/dist/internal/discovery.d.ts.map +1 -1
  217. package/dist/internal/discovery.js +91 -13
  218. package/dist/internal/distribution.d.ts +4 -3
  219. package/dist/internal/distribution.d.ts.map +1 -1
  220. package/dist/internal/distribution.js +4 -3
  221. package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
  222. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
  223. package/dist/internal/hosted-delivery-protocol.js +70 -0
  224. package/dist/internal/hosted-delivery.d.ts +35 -0
  225. package/dist/internal/hosted-delivery.d.ts.map +1 -0
  226. package/dist/internal/hosted-delivery.js +239 -0
  227. package/dist/internal/http-channel.d.ts.map +1 -1
  228. package/dist/internal/http-channel.js +1 -1
  229. package/dist/internal/mcp-endpoint.js +3 -3
  230. package/dist/internal/mcp-host.d.ts +8 -7
  231. package/dist/internal/mcp-host.d.ts.map +1 -1
  232. package/dist/internal/mcp-host.js +8 -7
  233. package/dist/internal/peer-connections.d.ts.map +1 -1
  234. package/dist/internal/peer-connections.js +5 -1
  235. package/dist/internal/playground/static.d.ts +0 -3
  236. package/dist/internal/playground/static.d.ts.map +1 -1
  237. package/dist/internal/resolved-connections.d.ts.map +1 -1
  238. package/dist/internal/resolved-connections.js +5 -7
  239. package/dist/internal/review-comments.d.ts +186 -63
  240. package/dist/internal/review-comments.d.ts.map +1 -1
  241. package/dist/internal/review-comments.js +350 -168
  242. package/dist/internal/server.d.ts.map +1 -1
  243. package/dist/internal/server.js +134 -175
  244. package/dist/internal/session-engine.d.ts +50 -10
  245. package/dist/internal/session-engine.d.ts.map +1 -1
  246. package/dist/internal/session-engine.js +221 -68
  247. package/dist/internal/shallow-clone.d.ts +8 -2
  248. package/dist/internal/shallow-clone.d.ts.map +1 -1
  249. package/dist/internal/shallow-clone.js +17 -10
  250. package/dist/internal/tool-catalog.d.ts +31 -0
  251. package/dist/internal/tool-catalog.d.ts.map +1 -0
  252. package/dist/internal/tool-catalog.js +67 -0
  253. package/dist/playground/assets/{index-DDvyC2z6.js → index-B3JCyigB.js} +2 -2
  254. package/dist/playground/index.html +1 -1
  255. package/dist/types.d.ts +81 -40
  256. package/dist/types.d.ts.map +1 -1
  257. package/dist/types.js +19 -0
  258. package/docs/README.md +0 -36
  259. package/docs/ab.md +7 -13
  260. package/docs/building-with-agents.md +5 -11
  261. package/docs/concepts.md +13 -17
  262. package/docs/deployment.md +9 -30
  263. package/docs/design/agsh.md +406 -0
  264. package/docs/evals.md +16 -37
  265. package/docs/guides/agent-to-agent.md +3 -3
  266. package/docs/guides/cloud-runtime.md +9 -25
  267. package/docs/guides/convert-automation.md +4 -4
  268. package/docs/guides/github.md +16 -28
  269. package/docs/guides/mcp-oauth.md +14 -22
  270. package/docs/guides/slack.md +14 -51
  271. package/docs/guides/webhooks.md +3 -3
  272. package/docs/hillclimbing.md +1 -1
  273. package/docs/quickstart.md +3 -4
  274. package/docs/reference/agent-config.md +10 -15
  275. package/docs/reference/channels.md +20 -31
  276. package/docs/reference/cli.md +29 -38
  277. package/docs/reference/connections.md +24 -25
  278. package/docs/reference/hooks.md +12 -17
  279. package/docs/reference/http-api.md +26 -38
  280. package/docs/reference/instructions.md +1 -1
  281. package/docs/reference/playground.md +14 -19
  282. package/docs/reference/project-layout.md +7 -3
  283. package/docs/reference/prompt.md +1 -1
  284. package/docs/reference/schedules.md +1 -2
  285. package/docs/reference/sessions.md +8 -19
  286. package/docs/reference/skills.md +3 -3
  287. package/docs/reference/subagents.md +2 -2
  288. package/docs/reference/tools.md +30 -19
  289. package/docs/scaffolding-agents.md +4 -5
  290. package/docs/storage.md +37 -80
  291. package/docs/templates/agentic-owners.md +2 -2
  292. package/docs/templates/pr-autofixer.md +7 -9
  293. package/docs/templates/security-reviewer.md +2 -3
  294. package/docs/troubleshooting.md +8 -8
  295. package/package.json +16 -2
  296. package/skills/create-agent/SKILL.md +6 -13
  297. package/skills/debug/SKILL.md +2 -4
  298. package/skills/evals/SKILL.md +1 -1
  299. package/skills/framework-map/SKILL.md +3 -2
  300. package/skills/mcp-auth/SKILL.md +10 -13
  301. package/skills/setup-slack/SKILL.md +21 -137
  302. package/src/channels/deployments/deployments-channel.ts +32 -2
  303. package/src/channels/deployments/types.ts +8 -0
  304. package/src/channels/github/github-channel.ts +71 -21
  305. package/src/channels/slack/attachments.ts +2 -2
  306. package/src/channels/slack/dispatch.ts +2 -16
  307. package/src/channels/slack/eval-directive.ts +8 -27
  308. package/src/channels/slack/index.ts +0 -6
  309. package/src/channels/slack/setup.ts +8 -15
  310. package/src/channels/slack/slack-channel.ts +14 -125
  311. package/src/channels/slack/types.ts +12 -96
  312. package/src/client.ts +23 -0
  313. package/src/connections.ts +20 -7
  314. package/src/continuation.ts +1 -1
  315. package/src/index.ts +2 -0
  316. package/src/internal/advertise-tools.ts +45 -7
  317. package/src/internal/authored-alias-hooks.ts +14 -11
  318. package/src/internal/authored-loaders.ts +14 -10
  319. package/src/internal/cli-deploy.ts +5 -5
  320. package/src/internal/cli-mcp-oauth.ts +6 -4
  321. package/src/internal/continuation-channel.ts +62 -45
  322. package/src/internal/continuation-identity.ts +123 -38
  323. package/src/internal/convert-automation/convert-workflow.ts +29 -17
  324. package/src/internal/convert-automation/slug.ts +0 -9
  325. package/src/internal/cursor/account-mcp.ts +4 -1
  326. package/src/internal/deploy-manifest.ts +5 -9
  327. package/src/internal/discovery.ts +107 -13
  328. package/src/internal/distribution.ts +4 -3
  329. package/src/internal/fixtures/units-server.ts +52 -0
  330. package/src/internal/hosted-delivery-protocol.ts +114 -0
  331. package/src/internal/hosted-delivery.ts +359 -0
  332. package/src/internal/http-channel.ts +0 -2
  333. package/src/internal/mcp-endpoint.ts +3 -3
  334. package/src/internal/mcp-host.ts +8 -7
  335. package/src/internal/peer-connections.ts +4 -1
  336. package/src/internal/playground/static.ts +1 -3
  337. package/src/internal/resolved-connections.ts +8 -10
  338. package/src/internal/review-comments.ts +542 -229
  339. package/src/internal/server.ts +180 -253
  340. package/src/internal/session-engine.ts +279 -70
  341. package/src/internal/shallow-clone.ts +30 -16
  342. package/src/internal/tool-catalog.ts +106 -0
  343. package/src/types.ts +99 -40
  344. package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
  345. package/templates/triage/README.md +2 -1
  346. package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
  347. package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
  348. package/dist/channels/slack/cursor-account.d.ts +0 -87
  349. package/dist/channels/slack/cursor-account.d.ts.map +0 -1
  350. package/dist/channels/slack/cursor-account.js +0 -100
  351. package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
  352. package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
  353. package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
  354. package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.js +0 -10
  355. package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.lean.js +0 -1
  356. package/dist/docs/assets/example-agents_benny.md.C40vHRLc.js +0 -7
  357. package/dist/docs/assets/example-agents_benny.md.C40vHRLc.lean.js +0 -1
  358. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
  359. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
  360. package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.js +0 -8
  361. package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.lean.js +0 -1
  362. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
  363. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
  364. package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.js +0 -23
  365. package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.lean.js +0 -1
  366. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
  367. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
  368. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
  369. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
  370. package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.js +0 -11
  371. package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.lean.js +0 -1
  372. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
  373. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
  374. package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.js +0 -19
  375. package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.lean.js +0 -1
  376. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
  377. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
  378. package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.js +0 -25
  379. package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +0 -1
  380. package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.js +0 -9
  381. package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.lean.js +0 -1
  382. package/dist/docs/assets/guides_slack.md.DiUmk_Oi.lean.js +0 -1
  383. package/dist/docs/assets/index.md.BAaMXLFd.js +0 -5
  384. package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
  385. package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
  386. package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
  387. package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
  388. package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
  389. package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.js +0 -17
  390. package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
  391. package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
  392. package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
  393. package/dist/docs/example-agents/approval-buddy.html +0 -36
  394. package/dist/docs/example-agents/approval-buddy.md +0 -266
  395. package/dist/docs/example-agents/benny.html +0 -33
  396. package/dist/docs/example-agents/benny.md +0 -182
  397. package/dist/docs/example-agents/bugbot.html +0 -37
  398. package/dist/docs/example-agents/bugbot.md +0 -229
  399. package/dist/docs/example-agents/codebase-wiki.html +0 -34
  400. package/dist/docs/example-agents/codebase-wiki.md +0 -170
  401. package/dist/docs/example-agents/codeowners-review.html +0 -34
  402. package/dist/docs/example-agents/codeowners-review.md +0 -192
  403. package/dist/docs/example-agents/concierge.html +0 -49
  404. package/dist/docs/example-agents/concierge.md +0 -201
  405. package/dist/docs/example-agents/fsd.html +0 -41
  406. package/dist/docs/example-agents/fsd.md +0 -329
  407. package/dist/docs/example-agents/index.html +0 -28
  408. package/dist/docs/example-agents/index.md +0 -102
  409. package/dist/docs/example-agents/knowledge-base.html +0 -37
  410. package/dist/docs/example-agents/knowledge-base.md +0 -168
  411. package/dist/docs/example-agents/oncall.html +0 -36
  412. package/dist/docs/example-agents/oncall.md +0 -212
  413. package/dist/docs/example-agents/security-reviewer.html +0 -45
  414. package/dist/docs/example-agents/security-reviewer.md +0 -265
  415. package/dist/docs/example-agents/slack-agent.html +0 -31
  416. package/dist/docs/example-agents/slack-agent.md +0 -142
  417. package/dist/docs/example-agents/weather-agent.html +0 -51
  418. package/dist/docs/example-agents/weather-agent.md +0 -296
  419. package/dist/internal/cursor-slack-relay.d.ts +0 -96
  420. package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
  421. package/dist/internal/cursor-slack-relay.js +0 -176
  422. package/docs/example-agents/approval-buddy.md +0 -271
  423. package/docs/example-agents/benny.md +0 -187
  424. package/docs/example-agents/bugbot.md +0 -234
  425. package/docs/example-agents/codebase-wiki.md +0 -175
  426. package/docs/example-agents/codeowners-review.md +0 -197
  427. package/docs/example-agents/concierge.md +0 -206
  428. package/docs/example-agents/fsd.md +0 -334
  429. package/docs/example-agents/index.md +0 -107
  430. package/docs/example-agents/knowledge-base.md +0 -173
  431. package/docs/example-agents/oncall.md +0 -217
  432. package/docs/example-agents/security-reviewer.md +0 -270
  433. package/docs/example-agents/slack-agent.md +0 -147
  434. package/docs/example-agents/weather-agent.md +0 -301
  435. package/src/channels/slack/cursor-account.ts +0 -202
  436. package/src/internal/cursor-slack-relay.ts +0 -249
  437. /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
  438. /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
  439. /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
  440. /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
  441. /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
  442. /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
  443. /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
  444. /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
  445. /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
  446. /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
  447. /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
  448. /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
@@ -39,10 +39,6 @@ import {
39
39
  tryResolveAppToken,
40
40
  tryResolveBotToken,
41
41
  } from "./credentials.js";
42
- import {
43
- createPendingSlackApiTransport,
44
- registerSlackCursorAccountRuntime,
45
- } from "./cursor-account.js";
46
42
  import {
47
43
  buildDefaultEvents,
48
44
  createDefaultOnChannelPost,
@@ -67,12 +63,10 @@ import {
67
63
  startSlackSocketMode,
68
64
  } from "./socket-mode.js";
69
65
  import { buildToolApprovalEvents } from "./tool-approval-events.js";
70
- import {
71
- assertSlackCursorAgentName,
72
- type SlackChannelOptions,
73
- type SlackChannelState,
74
- type SlackCredentials,
75
- type SlackCursorAgentName,
66
+ import type {
67
+ SlackChannelOptions,
68
+ SlackChannelState,
69
+ SlackCredentials,
76
70
  } from "./types.js";
77
71
 
78
72
  /** Options used to construct a slack channel — for host-level credential binding. */
@@ -98,8 +92,7 @@ export interface SlackChannelHostBinding {
98
92
  }
99
93
 
100
94
  /**
101
- * First dedicated (Socket Mode) Slack channel on a project. Skips
102
- * `cursorAccount` channels — those have no local bot token for
95
+ * First Slack channel on a project. Used for
103
96
  * {@link HostContext.slack.getClient}.
104
97
  */
105
98
  export function resolveDedicatedSlackHostBinding(
@@ -107,7 +100,7 @@ export function resolveDedicatedSlackHostBinding(
107
100
  ): SlackChannelHostBinding | undefined {
108
101
  for (const channel of channels) {
109
102
  const options = slackChannelOptionsByDefinition.get(channel.definition);
110
- if (options === undefined || options.cursorAccount === true) {
103
+ if (options === undefined) {
111
104
  continue;
112
105
  }
113
106
  return {
@@ -121,97 +114,19 @@ export function resolveDedicatedSlackHostBinding(
121
114
  /**
122
115
  * Create a Slack channel. Author as `agent/channels/slack.ts` default export.
123
116
  *
124
- * Missing credentials are not an error: without a token pair (or a
125
- * signed-in host for `cursorAccount`) the channel mounts idle and logs
126
- * `channel idle`, so serving an agent never blocks on Slack setup.
127
- *
128
- * When `cursorAccount` is on, `agentName` must be a single token (no
129
- * whitespace) — string literals with spaces fail at the type level;
130
- * runtime values are still checked by {@link assertSlackCursorAgentName}.
117
+ * Missing credentials are not an error: without a token pair the channel
118
+ * mounts idle and logs `channel idle`, so serving an agent never blocks
119
+ * on Slack setup.
131
120
  */
132
- export function slackChannel<const Name extends string = string>(
133
- authored: Omit<SlackChannelOptions, "agentName"> & {
134
- agentName?: SlackCursorAgentName<Name>;
135
- } = {}
121
+ export function slackChannel(
122
+ authored: SlackChannelOptions = {}
136
123
  ): ChannelDefinition<SlackChannelState> {
137
124
  const options = { ...authored };
138
125
  if (options.continuation !== undefined) {
139
126
  options.continuation = normalizeIdentity(options.continuation, "slack");
140
127
  }
141
- const cursorAccount = options.cursorAccount === true;
142
- if (cursorAccount) {
143
- // Token pair and the Cursor connection are different Slack apps —
144
- // they can't be mixed on one channel definition.
145
- if (options.credentials !== undefined || options.envPrefix !== undefined) {
146
- throw new Error(
147
- "slackChannel({ cursorAccount: true }) uses the Cursor account's Slack connection — do not also set credentials/envPrefix. Author a second slack channel file for a dedicated Slack app."
148
- );
149
- }
150
- if (options.agentName !== undefined) {
151
- assertSlackCursorAgentName(options.agentName);
152
- }
153
- // Channel watching is Socket Mode only — cursorAccount agents must be
154
- // explicitly addressed (@mention, DM, or claimed-thread reply).
155
- if (options.engagement?.channelPosts !== undefined) {
156
- throw new Error(
157
- "slackChannel({ cursorAccount: true }) does not support engagement.channelPosts — agents must be explicitly addressed (@mention, DM, or claimed-thread reply). Channel watching is Socket Mode only."
158
- );
159
- }
160
- // Bot-mention wake needs the app's own bot identity (auth.test) and
161
- // Socket Mode event delivery; the Cursor relay drops bot-authored
162
- // mentions before they reach the agent.
163
- if (options.engagement?.botMentions !== undefined) {
164
- throw new Error(
165
- "slackChannel({ cursorAccount: true }) does not support engagement.botMentions — bot-to-bot mention wake is Socket Mode only (author a dedicated Slack app channel)."
166
- );
167
- }
168
- // Mentions/DMs are always routed by the backend. Disabling them
169
- // client-side would black-hole events the webhook already stole from
170
- // native Cursor handling — reject at construction instead.
171
- if (options.engagement?.mentions === false) {
172
- throw new Error(
173
- "slackChannel({ cursorAccount: true }) cannot set engagement.mentions to false — the Cursor Slack relay always delivers mention and claimed-thread traffic."
174
- );
175
- }
176
- if (options.engagement?.directMessages === false) {
177
- throw new Error(
178
- "slackChannel({ cursorAccount: true }) cannot set engagement.directMessages to false — DM continuity is part of the Cursor Slack connection."
179
- );
180
- }
181
- // Tool approvals / interactivity ride Slack Socket Mode `interactive`
182
- // envelopes; the Cursor connection does not relay Block Kit clicks, so
183
- // there is no backend tap to route Approve/Deny over cursorAccount.
184
- // Reject at construction (same posture as channelPosts) instead of
185
- // silently dropping clicks. Approvals stay available on a dedicated
186
- // Socket Mode Slack app channel.
187
- if (options.toolApprovals === true) {
188
- throw new Error(
189
- "slackChannel({ cursorAccount: true }) does not support toolApprovals — Approve/Deny clicks are not relayed over the Cursor Slack connection. Tool approvals are Socket Mode only (author a dedicated Slack app channel for them)."
190
- );
191
- }
192
- if (options.interactivity === true) {
193
- throw new Error(
194
- "slackChannel({ cursorAccount: true }) does not support interactivity — interactive Block Kit clicks are not relayed over the Cursor Slack connection. Interactivity is Socket Mode only."
195
- );
196
- }
197
- if (options.onBlockAction !== undefined) {
198
- throw new Error(
199
- "slackChannel({ cursorAccount: true }) does not support onBlockAction — interactive Block Kit clicks are not relayed over the Cursor Slack connection. Block actions are Socket Mode only."
200
- );
201
- }
202
- if (options.onReactionAdded !== undefined) {
203
- throw new Error(
204
- "slackChannel({ cursorAccount: true }) does not support onReactionAdded because the Cursor Slack relay does not forward reaction events. Reaction handling is Socket Mode only."
205
- );
206
- }
207
- }
208
- const accountTransport = cursorAccount
209
- ? createPendingSlackApiTransport()
210
- : undefined;
211
128
  const credentials =
212
- accountTransport !== undefined
213
- ? { botToken: accountTransport }
214
- : (options.credentials ?? credentialsFromEnv(options.envPrefix));
129
+ options.credentials ?? credentialsFromEnv(options.envPrefix);
215
130
  const envKeys = slackEnvKeys(options.envPrefix);
216
131
  const loadingMessages = options.loadingMessages;
217
132
  const policy = options.policy;
@@ -259,9 +174,7 @@ export function slackChannel<const Name extends string = string>(
259
174
  events,
260
175
  buildDefaultEvents({
261
176
  credentials,
262
- // cursorAccount: never edit posts — setStatus for thinking, one
263
- // final postMessage for the reply (proxy pins agent username/icon).
264
- streaming: cursorAccount ? false : options.streaming,
177
+ streaming: options.streaming,
265
178
  thinkingSteps: options.thinkingSteps,
266
179
  suggestedPrompts: options.suggestedPrompts,
267
180
  suggestedPromptsTitle: options.suggestedPromptsTitle,
@@ -307,8 +220,7 @@ export function slackChannel<const Name extends string = string>(
307
220
  directMessagesEnabled,
308
221
  evalCommandsEnabled,
309
222
  followUpStatus,
310
- // cursorAccount: backend router already refuses externals.
311
- blockExternals: cursorAccount ? false : blockExternals,
223
+ blockExternals,
312
224
  ...(args.hasContinuationSession === undefined
313
225
  ? {}
314
226
  : { hasContinuationSession: args.hasContinuationSession }),
@@ -335,7 +247,6 @@ export function slackChannel<const Name extends string = string>(
335
247
  routes: [],
336
248
  meta: {
337
249
  kind: "slack",
338
- ...(cursorAccount ? { slackCursorAccount: true } : {}),
339
250
  ...(channelPosts === undefined
340
251
  ? {}
341
252
  : { slackChannelPosts: [...channelPosts.allow] }),
@@ -390,13 +301,6 @@ export function slackChannel<const Name extends string = string>(
390
301
  async onStart(args) {
391
302
  runtime.log = createSlackLogger(args.logger ?? options.logger);
392
303
 
393
- if (cursorAccount) {
394
- // Inbound arrives through the serve host's Cursor Slack relay
395
- // (`/v0/slack-events`), not Socket Mode; outbound goes through the
396
- // bound API transport. Nothing to start here.
397
- getLog().info("channel start", { transport: "cursor-account" });
398
- return;
399
- }
400
304
  getLog().info("channel start", { transport: "socket" });
401
305
 
402
306
  const appToken = await tryResolveAppToken(credentials);
@@ -640,20 +544,5 @@ export function slackChannel<const Name extends string = string>(
640
544
 
641
545
  slackChannelOptionsByDefinition.set(definition, options);
642
546
 
643
- if (accountTransport !== undefined) {
644
- // Serve-time seam: the host discovers cursor-account channels through
645
- // this registry, binds the outbound transport, and dispatches relayed
646
- // inbound envelopes through the pack's normal path.
647
- registerSlackCursorAccountRuntime(definition, {
648
- options,
649
- credentials,
650
- transport: accountTransport,
651
- eventIds,
652
- onAppMention,
653
- onDirectMessage,
654
- getLog,
655
- });
656
- }
657
-
658
547
  return definition;
659
548
  }
@@ -13,14 +13,13 @@ import type {
13
13
 
14
14
  /**
15
15
  * Pluggable Slack Web API caller. Instead of holding a raw `xoxb-…` token,
16
- * calls are executed by `call` e.g. proxied through the Cursor backend
17
- * with the signed-in account's Slack connection (`cursorAccount: true`).
18
- * Implementations return the Slack response body (including `ok: false`
19
- * platform errors) and only throw on programmer error.
16
+ * calls are executed by `call`. Implementations return the Slack response
17
+ * body (including `ok: false` platform errors) and only throw on
18
+ * programmer error.
20
19
  */
21
20
  export interface SlackApiTransport {
22
21
  kind: "api-transport";
23
- /** Human-readable transport label for logs (e.g. `cursor-account`). */
22
+ /** Human-readable transport label for logs. */
24
23
  label: string;
25
24
  call(
26
25
  method: string,
@@ -122,8 +121,8 @@ export interface SlackMessageFile {
122
121
  mode?: string;
123
122
  size?: number;
124
123
  /**
125
- * When set (cursorAccount relay), bytes were already downloaded by the
126
- * Cursor backend — skip a second `files.info` / private URL fetch.
124
+ * When set, bytes were already downloaded by the caller. Skip a second
125
+ * `files.info` / private URL fetch.
127
126
  */
128
127
  dataBase64?: string;
129
128
  }
@@ -333,8 +332,7 @@ export interface SlackChannelPostsOptions {
333
332
  * channel the bot is in. Must be non-empty (empty is a definition error).
334
333
  * `#names` are resolved to ids via `conversations.list` when the channel
335
334
  * starts; the bot must be a member of each watched channel to receive its
336
- * messages. Socket Mode only — `cursorAccount: true` rejects
337
- * `engagement.channelPosts`.
335
+ * messages.
338
336
  *
339
337
  * `"*"` suits agents whose handler decides per message (a thread the agent
340
338
  * is already in, say) rather than per channel. Every delivered message then
@@ -384,11 +382,8 @@ export interface SlackBotMentionsOptions {
384
382
  * - `"U…"` — a bot *user* id.
385
383
  * - `"<botId>:<username>"` — compound: the posting app's `bot_id` AND its
386
384
  * message `username` must both match (case-insensitive username). Use
387
- * this for shared multi-tenant apps like the Cursor Slack connection,
388
- * where every agent posts under one `bot_id` but the backend pins each
389
- * agent's `username` server-side — `"B0CURSOR…:Lasso"` trusts only the
390
- * Cursor app posting as Lasso, not every Cursor-connected agent.
391
- * Fails closed when the event carries no username.
385
+ * this when several agents post through one app under different
386
+ * usernames. Fails closed when the event carries no username.
392
387
  *
393
388
  * Must be non-empty (empty is a definition error).
394
389
  */
@@ -432,51 +427,10 @@ export interface SlackEngagementOptions {
432
427
  channelPosts?: SlackChannelPostsOptions;
433
428
  /**
434
429
  * Opt-in bot-to-bot mention wake (see {@link SlackBotMentionsOptions}).
435
- * Socket Mode only — rejected on `cursorAccount: true`.
436
430
  */
437
431
  botMentions?: SlackBotMentionsOptions;
438
432
  }
439
433
 
440
- /**
441
- * Whitespace forbidden in {@link SlackChannelOptions.agentName}. The Cursor
442
- * Slack router matches on leading words; multi-word names collide with Named
443
- * Agent shortened-prefix matching (`Approval …` stealing `ApprovalBuddy`).
444
- */
445
- type SlackAgentNameWhitespace = " " | "\t" | "\n" | "\r" | "\f" | "\v";
446
-
447
- /**
448
- * Single-token Cursor Slack handle for `cursorAccount` routing
449
- * (`@Cursor <name> …`). String literals that contain whitespace become
450
- * `never` (type error at the call site); plain `string` stays `string` and
451
- * is still rejected at runtime by {@link assertSlackCursorAgentName}.
452
- */
453
- export type SlackCursorAgentName<S extends string = string> = string extends S
454
- ? string
455
- : S extends `${string}${SlackAgentNameWhitespace}${string}`
456
- ? never
457
- : S;
458
-
459
- const SLACK_CURSOR_AGENT_NAME_WHITESPACE = /\s/;
460
-
461
- /**
462
- * Runtime guard for {@link SlackChannelOptions.agentName}. Call from
463
- * `slackChannel({ cursorAccount: true })` construction and serve-time
464
- * name resolution so derived defaults cannot sneak spaces in.
465
- */
466
- export function assertSlackCursorAgentName(name: string): void {
467
- const trimmed = name.trim();
468
- if (trimmed.length === 0) {
469
- throw new Error(
470
- 'slackChannel({ cursorAccount: true }) agentName must be a non-empty single token (no whitespace), e.g. "ApprovalBuddy".'
471
- );
472
- }
473
- if (SLACK_CURSOR_AGENT_NAME_WHITESPACE.test(trimmed)) {
474
- throw new Error(
475
- `slackChannel({ cursorAccount: true }) agentName must be a single token with no whitespace (got ${JSON.stringify(name)}). Use PascalCase like "ApprovalBuddy" — multi-word names break @Cursor routing.`
476
- );
477
- }
478
- }
479
-
480
434
  /** `"thread"` = anyone in the thread (default); `"author"` = session starter only. */
481
435
  export type SlackRespondTo = "thread" | "author";
482
436
 
@@ -504,38 +458,6 @@ export interface SlackChannelOptions {
504
458
  * Ignored when `credentials` is set explicitly.
505
459
  */
506
460
  envPrefix?: string;
507
- /**
508
- * Use the signed-in Cursor account's Slack connection instead of a
509
- * dedicated Slack app: no bot/app tokens, no extra install. Inbound
510
- * traffic (`@Cursor <agent name> …` mentions, replies in threads the
511
- * agent owns, and DMs) is relayed from the Cursor backend
512
- * (`/v0/slack-events`), and outbound Web API calls are proxied through it
513
- * — the agent posts as the Cursor Slack app with this agent's name and
514
- * icon.
515
- *
516
- * Both paths stay first-class: omit this (default) for the classic
517
- * Socket-Mode channel with your own Slack app and tokens. Requires a
518
- * signed-in host (`agent-serve login` / `CURSOR_API_KEY`) and a Slack
519
- * account linked to the Cursor account. Mutually exclusive with
520
- * `credentials` / `envPrefix`. `engagement.mentions: false` and
521
- * `engagement.directMessages: false` are rejected (the relay always
522
- * carries that traffic). Channel watching (`engagement.channelPosts`) and
523
- * tool approvals / interactivity (`toolApprovals` / `interactivity`) are
524
- * Socket Mode only — not supported on cursorAccount; agents must be
525
- * explicitly addressed, and Approve/Deny buttons need a dedicated Slack
526
- * app.
527
- */
528
- cursorAccount?: boolean;
529
- /**
530
- * Single-token display name registered with the Cursor backend when
531
- * {@link cursorAccount} is on: `@Cursor <agentName> …` routes here, and
532
- * replies post under this username. **No whitespace** — prefer PascalCase
533
- * (`ApprovalBuddy`). Defaults to a PascalCase name derived from the
534
- * agent's mount slug (or project name).
535
- */
536
- agentName?: SlackCursorAgentName;
537
- /** Avatar for posts when {@link cursorAccount} is on. */
538
- agentIcon?: { url?: string; emoji?: string };
539
461
  /**
540
462
  * Optional log sink. When omitted, uses `console.log` until the server
541
463
  * mounts the channel and rebinds to {@link ServeOptions.logger}.
@@ -573,9 +495,7 @@ export interface SlackChannelOptions {
573
495
  deliverDefaults?: boolean;
574
496
  /**
575
497
  * Stream assistant text while the turn runs via `chat.startStream` /
576
- * `appendStream` / `stopStream` (defaults to `true` for Socket Mode).
577
- * Ignored when {@link cursorAccount} is on — that path never edits posts
578
- * (`setStatus` + one final `chat.postMessage` only).
498
+ * `appendStream` / `stopStream` (defaults to `true`).
579
499
  */
580
500
  streaming?: boolean;
581
501
  /**
@@ -598,9 +518,7 @@ export interface SlackChannelOptions {
598
518
  *
599
519
  * Framework park/resume is enabled by `needsApproval` on server tools.
600
520
  * Set this to `true` to also post Block Kit Approve/Deny cards and route
601
- * the Socket Mode `interactive` clicks to `resolveApproval`. Socket Mode
602
- * only — rejected on `cursorAccount: true` (the Cursor Slack connection
603
- * does not relay Block Kit clicks).
521
+ * the Socket Mode `interactive` clicks to `resolveApproval`.
604
522
  *
605
523
  * Defaults to `false`. For custom composition, spread
606
524
  * `buildToolApprovalEvents({ credentials })` into `events`.
@@ -609,8 +527,7 @@ export interface SlackChannelOptions {
609
527
  /**
610
528
  * Route interactive payloads to approval resolution without opting into
611
529
  * the full {@link buildToolApprovalEvents} handler pack. Use when
612
- * composing `buildToolApprovalEvents` into `events` manually. Socket Mode
613
- * only — rejected on `cursorAccount: true`.
530
+ * composing `buildToolApprovalEvents` into `events` manually.
614
531
  */
615
532
  interactivity?: boolean;
616
533
  /**
@@ -622,7 +539,6 @@ export interface SlackChannelOptions {
622
539
  * thread, or `null` to ignore the click. Setting this implies
623
540
  * interactive routing; the Slack app manifest still needs
624
541
  * `interactivity` enabled (`buildSlackManifest({ interactivity: true })`).
625
- * Socket Mode only — rejected on `cursorAccount: true`.
626
542
  */
627
543
  onBlockAction?: SlackBlockActionHandler;
628
544
  /**
package/src/client.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Client-side plumbing for talking to a running agent-serve deployment:
3
+ * production target resolution (stored Cursor login → engineAccess URL and
4
+ * headers), request-header assembly, and the sessions listing used for
5
+ * latest-session binding.
6
+ *
7
+ * This entry point exists for first-party CLI clients (`agsh`); agent code
8
+ * should not need it.
9
+ */
10
+
11
+ export {
12
+ mergeRequestHeaders,
13
+ type RequestAuth,
14
+ } from "./internal/request-headers.js";
15
+ export {
16
+ PROD_ENGINE_WAKE_HEADERS,
17
+ ProdTargetError,
18
+ type ResolvedProdTarget,
19
+ type ResolveProdTargetOptions,
20
+ resolveProdTarget,
21
+ } from "./internal/resolve-prod-target.js";
22
+ export { listSessions } from "./internal/sessions-client.js";
23
+ export type { SessionSummary } from "./types.js";
@@ -1,11 +1,15 @@
1
1
  /**
2
- * `defineConnection` — authored at `agent/mcp-connections/<name>.ts`.
2
+ * `defineConnection` — authored at `agent/mcp-connections/<name>.ts`
3
+ * (model + host) or `agent/host-connections/<name>.ts` (host + `mcp oauth`
4
+ * only).
3
5
  *
4
6
  * A connection gives tools from an external MCP server. The filename
5
- * becomes the connection (server) name. Available to the agent (SDK
6
- * `mcpServers`), host (`ctx.host.mcp`), and channel/schedule handlers.
7
- * Pass `advertiseTools: true` for named tools on local turns. Pass
8
- * `hostOnly: true` to keep it off the model (still on `host.mcp`).
7
+ * becomes the connection (server) name. Files under `mcp-connections/`
8
+ * are available to the agent (SDK `mcpServers`), host (`ctx.host.mcp`),
9
+ * and channel/schedule handlers. Pass `advertiseTools: true` for named
10
+ * tools on local turns. Pass `effects: "read"` with `advertiseTools` to
11
+ * advertise only tools the server classifies as reads. Files under
12
+ * `host-connections/` stay off the model.
9
13
  *
10
14
  * ```ts
11
15
  * import { defineConnection } from "@cursor/july/connections";
@@ -27,11 +31,16 @@
27
31
  * },
28
32
  * });
29
33
  *
30
- * // privileged connector, model cannot call directly:
31
34
  * export default defineConnection({
32
35
  * cursorAccount: true,
33
36
  * servers: ["anytool"],
34
- * hostOnly: true,
37
+ * });
38
+ *
39
+ * // query-only: advertise only tools classified as reads
40
+ * export default defineConnection({
41
+ * url: "https://api.cursor.com/v1/agent/mcp",
42
+ * advertiseTools: true,
43
+ * effects: "read",
35
44
  * });
36
45
  * ```
37
46
  *
@@ -107,15 +116,19 @@ import type { ConnectionConfig, ConnectionDefinition } from "./types.js";
107
116
  export type {
108
117
  ConnectionConfig,
109
118
  ConnectionDefinition,
119
+ ConnectionEffects,
110
120
  ConnectionTransport,
111
121
  HostMcpCallResult,
112
122
  HostMcpRegistry,
113
123
  HostMcpToolInfo,
114
124
  InlineStdioConnectionConfig,
115
125
  InlineStdioToolConfig,
126
+ ToolEffect,
116
127
  } from "./types.js";
117
128
  export {
118
129
  isInlineStdioConnection,
130
+ isToolEffect,
131
+ normalizeConnectionEffects,
119
132
  normalizeCursorAccountServers,
120
133
  } from "./types.js";
121
134
 
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * Per-channel selectors still override type (`"github.issue/v2"`,
15
15
  * `"github.none/v2"`). Other `/v2` selectors: `"slack.thread/v2"`,
16
- * `"origin.pr/v2"`, `"none/v2"`.
16
+ * `"origin.pr/v2"`, `"deployments.deployment/v2"`, `"none/v2"`.
17
17
  */
18
18
 
19
19
  export type {
package/src/index.ts CHANGED
@@ -182,7 +182,9 @@ export {
182
182
  isCursorAccountTransport,
183
183
  isPeerConnectionTransport,
184
184
  isSymbolicConnectionTransport,
185
+ isToolEffect,
185
186
  MAX_RUNNING_TURNS_LIMIT,
187
+ normalizeConnectionEffects,
186
188
  normalizeCursorAccountServers,
187
189
  supportsKvCas,
188
190
  } from "./types.js";
@@ -23,6 +23,10 @@
23
23
  * `normalizeMcpToolName` uses for IDE/Sand MCP tools. A listing failure
24
24
  * still fails the turn rather than running it with a silently shrunken
25
25
  * toolset.
26
+ *
27
+ * `defineConnection({ effects })` filters the listing before names are
28
+ * assigned: only tools whose MCP annotations classify as an intended
29
+ * effect are advertised. Unclassified tools are omitted, not guessed.
26
30
  */
27
31
 
28
32
  import type {
@@ -31,9 +35,11 @@ import type {
31
35
  HostMcpCallResult,
32
36
  HostMcpToolInfo,
33
37
  JsonSchemaObject,
38
+ McpToolAnnotations,
34
39
  ResolvedAgent,
35
40
  SessionInfo,
36
41
  ToolDefinition,
42
+ ToolEffect,
37
43
  } from "../types.js";
38
44
  import { brandDefinition } from "./brand.js";
39
45
  import type { HostMcpOneOff } from "./mcp-host.js";
@@ -41,6 +47,7 @@ import {
41
47
  sanitizeMcpToolName,
42
48
  suffixMcpToolName,
43
49
  } from "./sanitize-mcp-tool-name.js";
50
+ import { classifyAnnotationsEffect } from "./tool-policy.js";
44
51
 
45
52
  /**
46
53
  * What the resolver needs from the host MCP registry: the shared cached
@@ -88,6 +95,13 @@ export async function resolveAdvertisedTools(args: {
88
95
  agent: ResolvedAgent;
89
96
  session: SessionInfo;
90
97
  hostMcp: AdvertiseHostMcp;
98
+ /**
99
+ * When set, a connection whose source or listing fails is reported here
100
+ * and skipped instead of throwing. Turns keep the throwing default (a
101
+ * turn must fail closed); the inspection catalog passes this so one
102
+ * broken connector does not hide every other tool.
103
+ */
104
+ onConnectionError?: (connection: string, error: unknown) => void;
91
105
  /** Test seam; defaults to {@link sourceForConnection}. */
92
106
  sourceFor?: (
93
107
  connection: DiscoveredConnection,
@@ -105,17 +119,25 @@ export async function resolveAdvertisedTools(args: {
105
119
  const claimed = new Set(args.agent.tools.map((tool) => tool.name));
106
120
  const resolved: DiscoveredTool[] = [];
107
121
  for (const connection of advertising) {
108
- const source = await sourceFor(connection, args.session, args.hostMcp);
109
122
  let listed: HostMcpToolInfo[];
123
+ let source: AdvertisedToolSource;
110
124
  try {
125
+ source = await sourceFor(connection, args.session, args.hostMcp);
111
126
  listed = await source.listTools();
112
127
  } catch (error) {
128
+ if (args.onConnectionError !== undefined) {
129
+ args.onConnectionError(connection.name, error);
130
+ continue;
131
+ }
113
132
  throw new Error(
114
133
  `Failed to list tools on advertised connection "${connection.name}": ${describeError(error)}`,
115
134
  { cause: error }
116
135
  );
117
136
  }
118
- const exposed = exposeListedTools(listed, claimed);
137
+ const intended = listed.filter((info) =>
138
+ matchesIntendedEffects(info.annotations, connection.effects)
139
+ );
140
+ const exposed = exposeListedTools(intended, claimed);
119
141
  for (const { info, exposedName } of exposed) {
120
142
  resolved.push(toDiscoveredTool(connection, info, exposedName, source));
121
143
  claimed.add(exposedName);
@@ -210,6 +232,17 @@ function exposeListedTools(
210
232
  }));
211
233
  }
212
234
 
235
+ function matchesIntendedEffects(
236
+ annotations: McpToolAnnotations | undefined,
237
+ effects: readonly ToolEffect[] | undefined
238
+ ): boolean {
239
+ if (effects === undefined) {
240
+ return true;
241
+ }
242
+ const effect = classifyAnnotationsEffect(annotations);
243
+ return effect !== undefined && effects.includes(effect);
244
+ }
245
+
213
246
  function toDiscoveredTool(
214
247
  connection: DiscoveredConnection,
215
248
  info: HostMcpToolInfo,
@@ -222,10 +255,15 @@ function toDiscoveredTool(
222
255
  : info.description;
223
256
  const inputSchema = info.inputSchema ?? ANY_OBJECT_SCHEMA;
224
257
  const outputSchema = info.outputSchema;
258
+ const effect =
259
+ connection.effects === undefined
260
+ ? undefined
261
+ : classifyAnnotationsEffect(info.annotations);
225
262
  const definition: ToolDefinition = brandDefinition("tool", {
226
263
  description,
227
264
  inputSchema,
228
- ...(outputSchema === undefined ? {} : { outputSchema }),
265
+ outputSchema,
266
+ effect,
229
267
  execute: async (input: Record<string, unknown>) =>
230
268
  formatMcpToolResult(
231
269
  connection.name,
@@ -237,16 +275,16 @@ function toDiscoveredTool(
237
275
  name: exposedName,
238
276
  description,
239
277
  inputSchema,
240
- ...(outputSchema === undefined ? {} : { outputSchema }),
278
+ outputSchema,
241
279
  execution: "server",
242
280
  needsApproval: false,
281
+ effect,
243
282
  // The server's own annotations ride along (bounded at listing time), so
244
283
  // the harness listing carries them and effect classification can read
245
284
  // them. Absent stays absent — the fail-closed state.
246
- ...(info.annotations === undefined
247
- ? {}
248
- : { annotations: info.annotations }),
285
+ annotations: info.annotations,
249
286
  advertised: true,
287
+ connection: connection.name,
250
288
  definition,
251
289
  };
252
290
  }
@@ -3,19 +3,22 @@
3
3
  * node:module `register()` from authored-loaders.ts; runs on Node's loader
4
4
  * thread — keep this module dependency-free).
5
5
  *
6
- * Authored files import the framework by bare specifier. From a published
7
- * install those need help in two cases:
6
+ * Authored files import the framework by bare specifier. On compiled runs the
7
+ * CLI pins every public package name onto the running `dist/` entries via
8
+ * `directAliases` so channel-option WeakMaps stay single-copy:
8
9
  *
9
- * - `@anysphere/agent-serve[/subpath]` (the historical monorepo name) is not
10
- * on npm, so it can never resolve from a user project. `directAliases` map
11
- * it straight onto the running package's dist entries.
12
- * - `@cursor/july[/subpath]` (the published name) and `@cursor/agentkit
13
- * [/subpath]` (the future public name) normally resolve through the
14
- * project's own node_modules; `fallbackAliases` only apply when that
15
- * fails (npx/global installs, projects without a local dependency), so a
16
- * real install in the user's project keeps precedence.
10
+ * - `@anysphere/agent-serve[/subpath]` (historical monorepo name; not on npm)
11
+ * - `@cursor/july[/subpath]` (published name)
12
+ * - `@cursor/agentkit[/subpath]` (future public name)
17
13
  *
18
- * A third case is first-party factory agents that relative-import this
14
+ * Preferring a project's own `node_modules` (or tsx tsconfig paths that map
15
+ * onto this package's `src/`) would load a second module instance and break
16
+ * `getGitHubChannelOptions` / continuation stamping / hosted-delivery.
17
+ *
18
+ * `fallbackAliases` remains for tests and any future soft remap; production
19
+ * registration leaves it empty.
20
+ *
21
+ * A separate case is first-party factory agents that relative-import this
19
22
  * package's `src/` from a monorepo checkout. Hosted engines `npm install`
20
23
  * only the agent directory, so files under `packages/agent-serve/src` have
21
24
  * no `node_modules`. Bare specifiers from that tree (`zod`, octokit, …)