@cursor/july 0.1.95 → 0.1.97

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 (424) hide show
  1. package/AGENTS.md +3 -4
  2. package/README.md +3 -2
  3. package/dist/bin/agent-serve.js +14 -3
  4. package/dist/channels/deployments/types.d.ts +1 -1
  5. package/dist/channels/deployments/types.d.ts.map +1 -1
  6. package/dist/channels/deployments/types.js +1 -0
  7. package/dist/channels/origin/api.d.ts +72 -15
  8. package/dist/channels/origin/api.d.ts.map +1 -1
  9. package/dist/channels/origin/api.js +185 -28
  10. package/dist/channels/origin/binding.d.ts +13 -2
  11. package/dist/channels/origin/binding.d.ts.map +1 -1
  12. package/dist/channels/origin/binding.js +41 -25
  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/index.d.ts +1 -0
  19. package/dist/channels/origin/index.d.ts.map +1 -1
  20. package/dist/channels/origin/index.js +1 -0
  21. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  22. package/dist/channels/origin/origin-channel.js +3 -0
  23. package/dist/channels/origin/reactions.d.ts +56 -0
  24. package/dist/channels/origin/reactions.d.ts.map +1 -0
  25. package/dist/channels/origin/reactions.js +67 -0
  26. package/dist/channels/origin/types.d.ts +11 -0
  27. package/dist/channels/origin/types.d.ts.map +1 -1
  28. package/dist/channels/slack/api.d.ts +9 -0
  29. package/dist/channels/slack/api.d.ts.map +1 -1
  30. package/dist/channels/slack/api.js +36 -5
  31. package/dist/channels/slack/approvals.d.ts +16 -0
  32. package/dist/channels/slack/approvals.d.ts.map +1 -1
  33. package/dist/channels/slack/approvals.js +86 -0
  34. package/dist/channels/slack/cli-project.d.ts +19 -0
  35. package/dist/channels/slack/cli-project.d.ts.map +1 -0
  36. package/dist/channels/slack/cli-project.js +234 -0
  37. package/dist/channels/slack/defaults.d.ts.map +1 -1
  38. package/dist/channels/slack/defaults.js +110 -81
  39. package/dist/channels/slack/dispatch.d.ts +7 -1
  40. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  41. package/dist/channels/slack/dispatch.js +47 -23
  42. package/dist/channels/slack/inbound.d.ts +8 -0
  43. package/dist/channels/slack/inbound.d.ts.map +1 -1
  44. package/dist/channels/slack/inbound.js +32 -0
  45. package/dist/channels/slack/init.d.ts +3 -2
  46. package/dist/channels/slack/init.d.ts.map +1 -1
  47. package/dist/channels/slack/init.js +5 -5
  48. package/dist/channels/slack/interactive.d.ts +2 -1
  49. package/dist/channels/slack/interactive.d.ts.map +1 -1
  50. package/dist/channels/slack/interactive.js +15 -4
  51. package/dist/channels/slack/live-delivery.d.ts +26 -29
  52. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  53. package/dist/channels/slack/live-delivery.js +172 -73
  54. package/dist/channels/slack/manifest.d.ts +1 -1
  55. package/dist/channels/slack/manifest.d.ts.map +1 -1
  56. package/dist/channels/slack/manifest.js +6 -2
  57. package/dist/channels/slack/nudge-carrier.d.ts +2 -0
  58. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  59. package/dist/channels/slack/nudge-carrier.js +48 -1
  60. package/dist/channels/slack/setup.d.ts +1 -1
  61. package/dist/channels/slack/setup.d.ts.map +1 -1
  62. package/dist/channels/slack/setup.js +10 -6
  63. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  64. package/dist/channels/slack/slack-channel.js +3 -2
  65. package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
  66. package/dist/channels/slack/tool-approval-events.js +91 -1
  67. package/dist/docs/404.html +2 -2
  68. package/dist/docs/ab.html +4 -4
  69. package/dist/docs/assets/{app.BBj0klBO.js → app.B3rWNYE1.js} +1 -1
  70. package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +1 -0
  71. package/dist/docs/assets/chunks/{VPLocalSearchBox.CUEXpL78.js → VPLocalSearchBox.C1lhqJJR.js} +1 -1
  72. package/dist/docs/assets/chunks/{theme.DabmQnia.js → theme.B40_SXuv.js} +2 -2
  73. package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
  74. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
  75. package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
  76. package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
  77. package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
  78. package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
  79. package/dist/docs/assets/{index.md.BoHaMdeZ.lean.js → index.md.CVeRUOeZ.lean.js} +1 -1
  80. package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
  81. package/dist/docs/assets/{reference_cli.md.BsMOxDvh.js → reference_cli.md.RyZf5OTE.js} +10 -6
  82. package/dist/docs/assets/{reference_cli.md.BsMOxDvh.lean.js → reference_cli.md.RyZf5OTE.lean.js} +1 -1
  83. package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
  84. package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.5zOAbV86.js} +1 -1
  85. package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
  86. package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.B84gw9Ii.js} +1 -1
  87. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
  88. package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
  89. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
  90. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
  91. package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
  92. package/dist/docs/building-with-agents.html +4 -4
  93. package/dist/docs/concepts.html +4 -4
  94. package/dist/docs/deployment.html +7 -7
  95. package/dist/docs/deployment.md +5 -4
  96. package/dist/docs/evals.html +4 -4
  97. package/dist/docs/guides/agent-to-agent.html +4 -4
  98. package/dist/docs/guides/cloud-runtime.html +4 -4
  99. package/dist/docs/guides/convert-automation.html +4 -4
  100. package/dist/docs/guides/github.html +4 -4
  101. package/dist/docs/guides/human-in-the-loop.html +4 -4
  102. package/dist/docs/guides/mcp-oauth.html +8 -8
  103. package/dist/docs/guides/mcp-oauth.md +26 -8
  104. package/dist/docs/guides/opentelemetry.html +4 -4
  105. package/dist/docs/guides/slack.html +17 -33
  106. package/dist/docs/guides/slack.md +92 -201
  107. package/dist/docs/guides/webhooks.html +4 -4
  108. package/dist/docs/hashmap.json +1 -1
  109. package/dist/docs/hillclimbing.html +4 -4
  110. package/dist/docs/index.html +6 -6
  111. package/dist/docs/index.md +7 -3
  112. package/dist/docs/llms-full.txt +398 -653
  113. package/dist/docs/llms.txt +3 -2
  114. package/dist/docs/quickstart.html +4 -4
  115. package/dist/docs/reference/agent-config.html +6 -6
  116. package/dist/docs/reference/agent-config.md +2 -2
  117. package/dist/docs/reference/artifacts.html +4 -4
  118. package/dist/docs/reference/channels.html +4 -4
  119. package/dist/docs/reference/cli.html +14 -10
  120. package/dist/docs/reference/cli.md +39 -16
  121. package/dist/docs/reference/connections.html +9 -8
  122. package/dist/docs/reference/connections.md +6 -3
  123. package/dist/docs/reference/hooks.html +4 -4
  124. package/dist/docs/reference/http-api.html +6 -6
  125. package/dist/docs/reference/http-api.md +2 -1
  126. package/dist/docs/reference/instructions.html +4 -4
  127. package/dist/docs/reference/playground.html +4 -4
  128. package/dist/docs/reference/project-layout.html +4 -4
  129. package/dist/docs/reference/prompt.html +4 -4
  130. package/dist/docs/reference/schedules.html +4 -4
  131. package/dist/docs/reference/sessions.html +5 -5
  132. package/dist/docs/reference/sessions.md +4 -2
  133. package/dist/docs/reference/skills.html +4 -4
  134. package/dist/docs/reference/subagents.html +4 -4
  135. package/dist/docs/reference/tools.html +6 -6
  136. package/dist/docs/reference/tools.md +9 -2
  137. package/dist/docs/scaffolding-agents.html +4 -4
  138. package/dist/docs/storage.html +4 -4
  139. package/dist/docs/templates/agentic-owners.html +4 -4
  140. package/dist/docs/templates/agents-md.html +28 -0
  141. package/dist/docs/templates/agents-md.md +105 -0
  142. package/dist/docs/templates/code-wiki.html +28 -0
  143. package/dist/docs/templates/code-wiki.md +91 -0
  144. package/dist/docs/templates/demo.html +5 -5
  145. package/dist/docs/templates/pr-autofixer.html +4 -4
  146. package/dist/docs/templates/security-help.html +4 -4
  147. package/dist/docs/templates/security-reviewer.html +5 -5
  148. package/dist/docs/templates/triage.html +4 -4
  149. package/dist/docs/troubleshooting.html +5 -5
  150. package/dist/docs/troubleshooting.md +2 -2
  151. package/dist/evals/run-facts.d.ts.map +1 -1
  152. package/dist/evals/run-facts.js +27 -0
  153. package/dist/files-backends/cursor-hosted.d.ts +26 -4
  154. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  155. package/dist/files-backends/cursor-hosted.js +32 -4
  156. package/dist/internal/advertise-tools.d.ts +2 -0
  157. package/dist/internal/advertise-tools.d.ts.map +1 -1
  158. package/dist/internal/advertise-tools.js +30 -10
  159. package/dist/internal/approval-gate.d.ts +12 -13
  160. package/dist/internal/approval-gate.d.ts.map +1 -1
  161. package/dist/internal/approval-gate.js +16 -21
  162. package/dist/internal/bounded.d.ts +7 -0
  163. package/dist/internal/bounded.d.ts.map +1 -0
  164. package/dist/internal/bounded.js +32 -0
  165. package/dist/internal/chat-client.js +10 -0
  166. package/dist/internal/cli-deploy.d.ts +5 -0
  167. package/dist/internal/cli-deploy.d.ts.map +1 -1
  168. package/dist/internal/cli-deploy.js +57 -18
  169. package/dist/internal/cli-mcp-oauth.js +8 -18
  170. package/dist/internal/cli-slack-manual.d.ts +24 -2
  171. package/dist/internal/cli-slack-manual.d.ts.map +1 -1
  172. package/dist/internal/cli-slack-manual.js +251 -20
  173. package/dist/internal/cli-slack.d.ts +9 -2
  174. package/dist/internal/cli-slack.d.ts.map +1 -1
  175. package/dist/internal/cli-slack.js +29 -82
  176. package/dist/internal/conversation-mirror.d.ts +11 -8
  177. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  178. package/dist/internal/conversation-mirror.js +116 -55
  179. package/dist/internal/cursor/account-mcp.d.ts +1 -0
  180. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  181. package/dist/internal/cursor/account-mcp.js +17 -0
  182. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  183. package/dist/internal/cursor/backend-client.js +22 -48
  184. package/dist/internal/cursor/session-token.d.ts +45 -0
  185. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  186. package/dist/internal/cursor/session-token.js +99 -0
  187. package/dist/internal/cursor-agent-template.d.ts +1 -1
  188. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  189. package/dist/internal/cursor-agent-template.js +2 -0
  190. package/dist/internal/deploy-client.d.ts +17 -0
  191. package/dist/internal/deploy-client.d.ts.map +1 -1
  192. package/dist/internal/deploy-client.js +31 -10
  193. package/dist/internal/env-file.d.ts +19 -0
  194. package/dist/internal/env-file.d.ts.map +1 -0
  195. package/dist/internal/env-file.js +90 -0
  196. package/dist/internal/framework-file-storage.d.ts +61 -0
  197. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  198. package/dist/internal/framework-file-storage.js +210 -0
  199. package/dist/internal/framework-storage-selection.d.ts +11 -5
  200. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  201. package/dist/internal/framework-storage-selection.js +38 -11
  202. package/dist/internal/hosted-delivery-protocol.d.ts +7 -0
  203. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  204. package/dist/internal/hosted-delivery-protocol.js +7 -0
  205. package/dist/internal/hosted-delivery.d.ts +13 -0
  206. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  207. package/dist/internal/hosted-delivery.js +64 -19
  208. package/dist/internal/hosted-execution-diag.d.ts +48 -0
  209. package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
  210. package/dist/internal/hosted-execution-diag.js +150 -0
  211. package/dist/internal/http-channel.d.ts.map +1 -1
  212. package/dist/internal/http-channel.js +81 -1
  213. package/dist/internal/init-project.d.ts.map +1 -1
  214. package/dist/internal/init-project.js +4 -0
  215. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  216. package/dist/internal/install-cursor-skills.js +1 -3
  217. package/dist/internal/logs-client.d.ts +5 -0
  218. package/dist/internal/logs-client.d.ts.map +1 -1
  219. package/dist/internal/logs-client.js +5 -0
  220. package/dist/internal/managed-delivery.d.ts +80 -0
  221. package/dist/internal/managed-delivery.d.ts.map +1 -0
  222. package/dist/internal/managed-delivery.js +86 -0
  223. package/dist/internal/mcp-endpoint.js +2 -3
  224. package/dist/internal/mcp-host.d.ts +10 -0
  225. package/dist/internal/mcp-host.d.ts.map +1 -1
  226. package/dist/internal/mcp-host.js +57 -8
  227. package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
  228. package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
  229. package/dist/internal/mcp-oauth-on-demand.js +287 -0
  230. package/dist/internal/mcp-oauth-persist.d.ts +42 -0
  231. package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
  232. package/dist/internal/mcp-oauth-persist.js +92 -0
  233. package/dist/internal/mcp-oauth.d.ts +1 -0
  234. package/dist/internal/mcp-oauth.d.ts.map +1 -1
  235. package/dist/internal/mcp-oauth.js +10 -2
  236. package/dist/internal/otel/collector.d.ts.map +1 -1
  237. package/dist/internal/otel/collector.js +22 -9
  238. package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
  239. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  240. package/dist/internal/runtime-dispatch-runner.js +7 -0
  241. package/dist/internal/sdk-runner.d.ts +11 -0
  242. package/dist/internal/sdk-runner.d.ts.map +1 -1
  243. package/dist/internal/sdk-runner.js +39 -8
  244. package/dist/internal/server.d.ts +3 -0
  245. package/dist/internal/server.d.ts.map +1 -1
  246. package/dist/internal/server.js +49 -21
  247. package/dist/internal/session-engine.d.ts +101 -3
  248. package/dist/internal/session-engine.d.ts.map +1 -1
  249. package/dist/internal/session-engine.js +577 -46
  250. package/dist/internal/sessions-client.d.ts +9 -7
  251. package/dist/internal/sessions-client.d.ts.map +1 -1
  252. package/dist/internal/sessions-client.js +3 -1
  253. package/dist/internal/steering.d.ts +15 -0
  254. package/dist/internal/steering.d.ts.map +1 -0
  255. package/dist/internal/steering.js +18 -0
  256. package/dist/internal/storage-coordinator.d.ts +7 -0
  257. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  258. package/dist/internal/storage-coordinator.js +28 -5
  259. package/dist/internal/storage-roles.d.ts +5 -0
  260. package/dist/internal/storage-roles.d.ts.map +1 -1
  261. package/dist/internal/stream-progress.d.ts.map +1 -1
  262. package/dist/internal/stream-progress.js +10 -0
  263. package/dist/internal/tool-policy.d.ts +9 -1
  264. package/dist/internal/tool-policy.d.ts.map +1 -1
  265. package/dist/internal/tool-policy.js +13 -0
  266. package/dist/internal/trajectory.d.ts.map +1 -1
  267. package/dist/internal/trajectory.js +10 -0
  268. package/dist/internal/turn-outbox.d.ts +24 -0
  269. package/dist/internal/turn-outbox.d.ts.map +1 -0
  270. package/dist/internal/turn-outbox.js +80 -0
  271. package/dist/playground/assets/{index-CZA1uEWA.js → index-DrkI6y5O.js} +51 -51
  272. package/dist/playground/assets/index-DzNGwm7q.css +1 -0
  273. package/dist/playground/index.html +2 -2
  274. package/dist/storage-backends/cursor-hosted.d.ts +9 -6
  275. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  276. package/dist/storage-backends/cursor-hosted.js +16 -3
  277. package/dist/storage.d.ts +8 -0
  278. package/dist/storage.d.ts.map +1 -1
  279. package/dist/types.d.ts +65 -8
  280. package/dist/types.d.ts.map +1 -1
  281. package/docs/README.md +7 -3
  282. package/docs/deployment.md +5 -4
  283. package/docs/guides/mcp-oauth.md +26 -8
  284. package/docs/guides/slack.md +93 -202
  285. package/docs/reference/agent-config.md +2 -2
  286. package/docs/reference/cli.md +39 -16
  287. package/docs/reference/connections.md +6 -3
  288. package/docs/reference/http-api.md +2 -1
  289. package/docs/reference/sessions.md +4 -2
  290. package/docs/reference/tools.md +9 -2
  291. package/docs/templates/agents-md.md +110 -0
  292. package/docs/templates/code-wiki.md +96 -0
  293. package/docs/troubleshooting.md +2 -2
  294. package/package.json +2 -2
  295. package/skills/ab/SKILL.md +13 -97
  296. package/skills/create-agent/SKILL.md +124 -223
  297. package/skills/debug/SKILL.md +34 -68
  298. package/skills/evals/SKILL.md +55 -180
  299. package/skills/framework-map/SKILL.md +83 -145
  300. package/skills/github/SKILL.md +53 -111
  301. package/skills/hillclimb/SKILL.md +40 -163
  302. package/skills/mcp-auth/SKILL.md +51 -107
  303. package/skills/otel/SKILL.md +22 -68
  304. package/skills/setup-slack/SKILL.md +91 -212
  305. package/src/bin/agent-serve.ts +13 -1
  306. package/src/channels/deployments/types.ts +1 -0
  307. package/src/channels/origin/api.ts +264 -33
  308. package/src/channels/origin/binding.ts +57 -28
  309. package/src/channels/origin/checks.ts +6 -6
  310. package/src/channels/origin/cursor-account.ts +5 -3
  311. package/src/channels/origin/index.ts +1 -0
  312. package/src/channels/origin/origin-channel.ts +4 -0
  313. package/src/channels/origin/reactions.ts +82 -0
  314. package/src/channels/origin/types.ts +11 -0
  315. package/src/channels/slack/api.ts +41 -5
  316. package/src/channels/slack/approvals.ts +105 -0
  317. package/src/channels/slack/cli-project.ts +267 -0
  318. package/src/channels/slack/defaults.ts +122 -93
  319. package/src/channels/slack/dispatch.ts +56 -22
  320. package/src/channels/slack/inbound.ts +43 -0
  321. package/src/channels/slack/init.ts +10 -5
  322. package/src/channels/slack/interactive.ts +35 -9
  323. package/src/channels/slack/live-delivery.ts +235 -114
  324. package/src/channels/slack/manifest.ts +6 -2
  325. package/src/channels/slack/nudge-carrier.ts +48 -1
  326. package/src/channels/slack/setup.ts +10 -6
  327. package/src/channels/slack/slack-channel.ts +3 -0
  328. package/src/channels/slack/tool-approval-events.ts +93 -0
  329. package/src/evals/run-facts.ts +32 -0
  330. package/src/files-backends/cursor-hosted.ts +40 -7
  331. package/src/internal/advertise-tools.ts +49 -12
  332. package/src/internal/approval-gate.ts +20 -29
  333. package/src/internal/bounded.ts +28 -0
  334. package/src/internal/chat-client.ts +19 -0
  335. package/src/internal/cli-deploy.ts +91 -9
  336. package/src/internal/cli-mcp-oauth.ts +7 -21
  337. package/src/internal/cli-slack-manual.ts +350 -18
  338. package/src/internal/cli-slack.ts +40 -84
  339. package/src/internal/conversation-mirror.ts +145 -69
  340. package/src/internal/cursor/account-mcp.ts +21 -0
  341. package/src/internal/cursor/backend-client.ts +34 -58
  342. package/src/internal/cursor/session-token.ts +115 -0
  343. package/src/internal/cursor-agent-template.ts +2 -0
  344. package/src/internal/deploy-client.ts +43 -0
  345. package/src/internal/env-file.ts +84 -0
  346. package/src/internal/framework-file-storage.ts +228 -0
  347. package/src/internal/framework-storage-selection.ts +51 -11
  348. package/src/internal/hosted-delivery-protocol.ts +7 -0
  349. package/src/internal/hosted-delivery.ts +107 -24
  350. package/src/internal/hosted-execution-diag.ts +207 -0
  351. package/src/internal/http-channel.ts +99 -0
  352. package/src/internal/init-project.ts +4 -0
  353. package/src/internal/install-cursor-skills.ts +1 -4
  354. package/src/internal/logs-client.ts +5 -0
  355. package/src/internal/managed-delivery.ts +125 -0
  356. package/src/internal/mcp-endpoint.ts +13 -4
  357. package/src/internal/mcp-host.ts +77 -11
  358. package/src/internal/mcp-oauth-on-demand.ts +352 -0
  359. package/src/internal/mcp-oauth-persist.ts +127 -0
  360. package/src/internal/mcp-oauth.ts +17 -1
  361. package/src/internal/otel/collector.ts +30 -0
  362. package/src/internal/runtime-dispatch-runner.ts +10 -0
  363. package/src/internal/sdk-runner.ts +56 -8
  364. package/src/internal/server.ts +61 -9
  365. package/src/internal/session-engine.ts +723 -60
  366. package/src/internal/sessions-client.ts +17 -8
  367. package/src/internal/steering.ts +17 -0
  368. package/src/internal/storage-coordinator.ts +38 -8
  369. package/src/internal/storage-roles.ts +7 -0
  370. package/src/internal/stream-progress.ts +19 -0
  371. package/src/internal/tool-policy.ts +18 -0
  372. package/src/internal/trajectory.ts +10 -0
  373. package/src/internal/turn-outbox.ts +85 -0
  374. package/src/storage-backends/cursor-hosted.ts +22 -8
  375. package/src/storage.ts +12 -0
  376. package/src/types.ts +70 -9
  377. package/templates/agents-md/README.md +39 -0
  378. package/templates/agents-md/agent/agent.ts +8 -0
  379. package/templates/agents-md/agent/channels/github.ts +10 -0
  380. package/templates/agents-md/agent/channels/queue.ts +28 -0
  381. package/templates/agents-md/agent/channels/slack.ts +9 -0
  382. package/templates/agents-md/agent/instructions.md +39 -0
  383. package/templates/agents-md/agent/lib/collect.ts +439 -0
  384. package/templates/agents-md/agent/lib/config.ts +8 -0
  385. package/templates/agents-md/agent/lib/paths.ts +51 -0
  386. package/templates/agents-md/agent/schedules/weekly.ts +17 -0
  387. package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
  388. package/templates/agents-md/evals/agents.eval.ts +135 -0
  389. package/templates/agents-md/evals/evals.config.ts +5 -0
  390. package/templates/agents-md/init.json +38 -0
  391. package/templates/agents-md/package.json +18 -0
  392. package/templates/agents-md/tsconfig.json +12 -0
  393. package/templates/code-wiki/README.md +34 -0
  394. package/templates/code-wiki/agent/agent.ts +8 -0
  395. package/templates/code-wiki/agent/channels/github.ts +144 -0
  396. package/templates/code-wiki/agent/instructions.md +39 -0
  397. package/templates/code-wiki/agent/lib/repos.ts +5 -0
  398. package/templates/code-wiki/agent/lib/wiki.ts +22 -0
  399. package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
  400. package/templates/code-wiki/evals/evals.config.ts +5 -0
  401. package/templates/code-wiki/evals/wiki.eval.ts +132 -0
  402. package/templates/code-wiki/init.json +25 -0
  403. package/templates/code-wiki/package.json +18 -0
  404. package/templates/code-wiki/tsconfig.json +12 -0
  405. package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +0 -1
  406. package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
  407. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
  408. package/dist/docs/assets/index.md.BoHaMdeZ.js +0 -5
  409. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
  410. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
  411. package/dist/docs/design/agsh.md +0 -406
  412. package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
  413. package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
  414. package/dist/internal/deployment-scm-event-stream.js +0 -474
  415. package/dist/playground/assets/index-CF7hUDnQ.css +0 -1
  416. package/docs/design/agsh.md +0 -406
  417. package/src/internal/deployment-scm-event-stream.ts +0 -593
  418. /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
  419. /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
  420. /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
  421. /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.5zOAbV86.lean.js} +0 -0
  422. /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
  423. /package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.B84gw9Ii.lean.js} +0 -0
  424. /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
@@ -1,20 +1,18 @@
1
1
  ---
2
2
  title: "Slack"
3
- description: "Put the agent in Slack: a dedicated Socket Mode app via the dashboard wizard, or a manual manifest import."
3
+ description: "Run a Socket Mode Slack bot from the dashboard wizard, or import an app you own."
4
4
  ---
5
5
 
6
6
  # Slack agents
7
7
 
8
- The Slack channel puts your agent in Slack as its own Socket Mode bot.
9
- `agent-sdk slack create` opens the dashboard wizard and writes tokens
10
- to `.env.local`. To own the Slack app yourself, run
11
- `agent-sdk slack init --manual` and paste the manifests at
12
- [api.slack.com](https://api.slack.com/apps). Socket Mode has no
13
- public Request URL. Replies stream in threads, with tool "thinking" steps,
14
- suggested prompts, and opt-in approval buttons.
8
+ The Slack channel is a Socket Mode bot. The app connects out, so you
9
+ don't need a public Request URL. Mentions and DMs start a thread.
10
+ Replies stream there, with thinking steps and suggested prompts.
15
11
 
16
- The companion skill is
17
- [`skills/setup-slack/SKILL.md`](../../skills/setup-slack/SKILL.md).
12
+ Use `agent-sdk slack create` when Cursor should own the Slack app. Use
13
+ `agent-sdk slack init --manual` when you own it. Commands and flags live
14
+ in the [CLI reference](../reference/cli.md#slack). Coding agents should
15
+ follow [`skills/setup-slack/SKILL.md`](../../skills/setup-slack/SKILL.md).
18
16
 
19
17
  ## Define the channel
20
18
 
@@ -24,35 +22,23 @@ Author `agent/channels/slack.ts` with `slackChannel()` from
24
22
  ```ts
25
23
  import { slackChannel } from "@cursor/july/channels/slack";
26
24
 
27
- // Single agent: reads SLACK_BOT_TOKEN + SLACK_APP_TOKEN
28
25
  export default slackChannel();
29
-
30
- // Multi-agent serve: one Slack app (and token pair) per agent
31
- export default slackChannel({ envPrefix: "WEATHER_AGENT" });
32
- // → WEATHER_AGENT_SLACK_BOT_TOKEN + WEATHER_AGENT_SLACK_APP_TOKEN
33
26
  ```
34
27
 
35
- By default the channel connects over Socket Mode (the app connects
36
- outward, so it works from behind any firewall) and responds only to
37
- `app_mention` events and direct messages. It also refuses Slack Connect
38
- users, guests, and senders from other workspaces. Threads bind to
39
- sessions with `continuationToken = channelId:threadTs`, so a thread is
40
- one durable conversation. Replies stream (`chat.startStream` /
41
- `appendStream` / `stopStream`) with a plain-message fallback, a rotating
42
- status shows while the agent works, and the pack sets thread titles and
43
- suggested prompts. When a Slack API is unavailable (`method_not_found`,
44
- `missing_scope`), the pack degrades to `postMessage` instead of failing.
45
-
46
- Missing tokens leave the channel idle (`channel idle … missing
47
- credentials`) rather than failing `serve`. That's useful when you mount
48
- many agents and only some have Slack apps.
28
+ `slackChannel()` reads `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`. Pass
29
+ `envPrefix: "WEATHER_AGENT"` to read `WEATHER_AGENT_SLACK_BOT_TOKEN`
30
+ and `WEATHER_AGENT_SLACK_APP_TOKEN` instead. Use a prefix when one
31
+ host serves several Slack bots.
32
+
33
+ A thread is one conversation. The bot answers mentions and DMs. It
34
+ refuses Slack Connect users, guests, and people from other workspaces.
35
+ Missing tokens leave this channel idle. The rest of `serve` still
36
+ starts.
49
37
 
50
38
  ## Control who can message the agent
51
39
 
52
- External senders are blocked by default. Slack Connect users, guests, and
53
- people whose home workspace is not the install team never reach the
54
- handler. Set `blockExternals: false` only when the agent should serve
55
- people outside your org:
40
+ External senders are blocked. Set `blockExternals: false` only when
41
+ people outside your org should reach the agent:
56
42
 
57
43
  ```ts
58
44
  export default slackChannel({
@@ -60,9 +46,8 @@ export default slackChannel({
60
46
  });
61
47
  ```
62
48
 
63
- Sessions are thread-scoped by default, so anyone in the thread can
64
- continue. Restrict follow-ups to the person who started the session with
65
- `respondTo: "author"`:
49
+ Anyone in the thread can continue it. Restrict follow-ups to the person
50
+ who started the session with `respondTo: "author"`:
66
51
 
67
52
  ```ts
68
53
  export default slackChannel({
@@ -72,234 +57,140 @@ export default slackChannel({
72
57
 
73
58
  ## Set it up
74
59
 
75
- For a dedicated Socket Mode bot, run `agent-sdk slack create`. The CLI
76
- opens the signed-in Cursor dashboard wizard. Slack consent, bot name,
77
- and admin-approval wait happen there. Tokens are stored as deployment
78
- secrets and written to `.env.local`. They are never shown. Do not paste
79
- a manifest at [api.slack.com](https://api.slack.com/apps) unless you
80
- are on the [manual setup](#manual-setup) path.
81
-
82
- Bots that already have tokens in `.env.local` keep working. Skip the
83
- wizard unless you want a Cursor-managed app.
60
+ `slack create` opens the Cursor dashboard wizard. Finish Slack consent
61
+ and the bot name there. The CLI writes tokens to `.env.local` and never
62
+ prints them. Skip the wizard if those tokens are already set, unless
63
+ you want a Cursor-managed app.
84
64
 
85
65
  ### Provision with the CLI
86
66
 
87
67
  ```bash
88
- agent-sdk slack create --dir . # dev app (default)
89
- agent-sdk slack create --dir . --prod # prod app
68
+ agent-sdk slack create --dir .
69
+ agent-sdk slack create --dir . --prod
90
70
  ```
91
71
 
92
- `slack create` needs a signed-in host (`agent-sdk login` or
93
- `CURSOR_API_KEY`). It scaffolds `agent/channels/slack.ts` when the file
94
- is missing, opens the dashboard wizard, and waits. Finish **Add Slack
95
- to this agent** in the browser as the same Cursor account. The CLI
96
- writes `<PREFIX>_SLACK_BOT_TOKEN` and `<PREFIX>_SLACK_APP_TOKEN` into
97
- `<dir>/.env.local`, then runs `doctor`. Serve and smoke it as described
98
- [below](#wire-the-env-and-verify).
99
-
100
- If Slack needs a workspace admin to approve the app, keep the CLI
101
- running. Managed install does not file the request. Open Slack's
102
- **Request approval** page (the CLI prints the link; the same URL is
103
- **Send a reminder** after you submit). After an admin approves, click
72
+ Sign in first (`agent-sdk login` or `CURSOR_API_KEY`). Finish **Add
73
+ Slack to this agent** as the same Cursor account. Then run
74
+ `agent-sdk slack doctor --prefix MY_AGENT` and serve:
75
+
76
+ ```bash
77
+ agent-sdk serve --dir . --dev
78
+ ```
79
+
80
+ Invite the bot and mention it, or DM it. Expect a Thinking status,
81
+ then a threaded streaming reply.
82
+
83
+ If Slack needs a workspace admin, keep the CLI running. Open the
84
+ **Request approval** link it prints. After an admin approves, click
104
85
  **Retry** in the wizard.
105
86
 
106
- Useful companions: `--name` / `--icon` / `--channel-posts` prefill the
107
- wizard. `--slack-team T0123ABCD` picks a workspace when several are
108
- connected. A second `slack create` for the same agent and env overwrites
109
- that Slack app. It keeps the Slack app id and replaces the manifest and
110
- tokens. `agent-sdk slack destroy` deletes the provisioned app.
111
- `agent-sdk slack icon <source>` updates the icon later.
87
+ `slack destroy` deletes the Cursor-managed app. `slack icon` updates
88
+ its icon. A second `slack create` for the same agent and environment
89
+ replaces that app's manifest and tokens.
112
90
 
113
91
  ### Provision from the dashboard
114
92
 
115
93
  The same wizard is on [Deployed Agents](https://cursor.com/dashboard).
116
- Open **Integrations** on an agent and click **Add Slack to this agent**,
117
- or follow the URL `slack create` printed.
94
+ Open **Integrations** and click **Add Slack to this agent**.
118
95
 
119
- A first-run agent that has no hosted engine yet shows **Not deployed
120
- yet**. Local `agent-sdk serve` works from `.env.local`. The next
121
- **Deploy** injects the stored secrets; there is no Slack-only Redeploy.
96
+ Local `agent-sdk serve` reads `.env.local`. The next deploy injects the
97
+ stored secrets.
122
98
 
123
- If Slack needs admin approval, the wizard waits. Click **Request
124
- approval** to file the request in Slack (that same page later sends a
125
- reminder). After an admin approves, click **Retry**.
99
+ If Slack needs admin approval, click **Request approval**, then
100
+ **Retry** after an admin approves.
126
101
 
127
- The app row's menu covers later care: rename, set an icon, rotate
128
- tokens, remove the app, or disconnect the workspace.
102
+ The app row's menu covers rename, icon, token rotation, removal, and
103
+ workspace disconnect.
129
104
 
130
- ### Wire the env and verify
105
+ ### Create your own Slack app
131
106
 
132
- `agent-sdk slack create` already wrote the tokens to `.env.local`, so
133
- after provisioning skip straight to `doctor`. `serve` / `dev` /
134
- `slack doctor` load that file (real environment variables always win).
107
+ `slack init --manual` is for an app you own. It writes the channel file
108
+ and Slack manifests. When Slack CLI (`~/.slack/bin/slack`) is logged
109
+ in, it installs the app. When it isn't, install the app yourself.
135
110
 
136
111
  ```bash
137
- agent-sdk slack doctor --prefix MY_AGENT
138
- ```
139
-
140
- Proceed when `app_token`, `connections_open`, `bot_token`, and
141
- `auth_test` are all green. Then serve and smoke it:
142
-
143
- ```bash
144
- agent-sdk serve --dir . --dev
145
- # expect: [agent-sdk/slack] Socket Mode connected
112
+ agent-sdk slack init --manual --dir . --name "My Agent"
146
113
  ```
147
114
 
148
- Invite the bot to a channel and @mention it (or DM it). Expect the
149
- Thinking… status, then a threaded streaming reply, with correlated
150
- server logs (`inbound kind=app_mention`, `session start`,
151
- `reply delivered via stream|postMessage`).
152
-
153
- ### Manual setup
154
-
155
- `slack init --manual` is for a Slack app you own at api.slack.com. You
156
- paste the generated manifests and mint tokens yourself. Use this when
157
- you want an unmanaged app, or when the dashboard wizard is not an
158
- option.
115
+ Install Slack CLI if you need it:
159
116
 
160
117
  ```bash
161
- agent-sdk slack init --manual --dir . --name "My Agent"
118
+ curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
162
119
  ```
163
120
 
164
- That writes `agent/channels/slack.ts`, Slack manifests under the
165
- project state directory, `env.example`, and `setup-status.json`.
166
- `--no-prefix` uses shared `SLACK_*` variables on
167
- a single-agent host. `--prefix CUSTOM` overrides the directory-derived
168
- prefix. `--channel-posts` subscribes the manifests to channel-post
169
- events.
121
+ Log in with `slack login --no-prompt`. In Slack, send
122
+ `/slackauthticket <ticket>`, then
123
+ `slack login --ticket <ticket> --challenge <code>`. Install the
124
+ workspace app with `slack app install`. Create a separate production
125
+ app the same way.
170
126
 
171
- `slack manifest --env both` regenerates the JSON files without
172
- touching the channel file.
127
+ Or paste `.slack/manifest.dev.json` at
128
+ [api.slack.com/apps](https://api.slack.com/apps) (**Create New App** →
129
+ **From a manifest**). Repeat with `.slack/manifest.prod.json`. Dev and
130
+ prod are separate Slack apps.
173
131
 
174
- #### Create the apps
132
+ Then put a bot token (`xoxb-...`) and an app-level token with
133
+ `connections:write` (`xapp-...`) in `.env.local`. Use the names
134
+ `slack init --manual` printed. Run `slack doctor` and serve as above.
175
135
 
176
- This phase needs someone with permission to create Slack apps.
177
-
178
- 1. Open [api.slack.com/apps](https://api.slack.com/apps) → **Create New
179
- App** → **From a manifest**.
180
- 2. Paste `manifest.dev.json` and create the dev app.
181
- 3. Repeat with `manifest.prod.json`. Dev and prod are separate Slack
182
- apps with separate tokens.
183
-
184
- #### Install and mint tokens
185
-
186
- For each app: **Install to Workspace** and copy the Bot User OAuth Token
187
- (`xoxb-…`). Then under **Basic Information → App-Level Tokens** create a
188
- token with scope `connections:write` and copy it (`xapp-…`).
189
-
190
- Put the pair in `.env.local` using the names from `env.example`, then
191
- run `slack doctor` and serve as [above](#wire-the-env-and-verify).
136
+ Serve this app with Agent SDK. Do not run `slack deploy`.
192
137
 
193
138
  ## Choose when the agent engages
194
139
 
195
- Mentions and DMs are on by default. Watching channels means dispatching
196
- on new posts without a mention. That's an explicit opt-in:
140
+ Mentions and DMs are on. Watching channel posts without a mention is
141
+ opt-in:
197
142
 
198
143
  ```ts
199
144
  export default slackChannel({
200
145
  envPrefix: "TRIAGE",
201
146
  engagement: {
202
- // mentions / directMessages default to true
203
147
  channelPosts: {
204
- allow: ["#triage-alerts"], // use ["*"] for every joined channel
205
- posts: "top-level", // default: thread replies never dispatch
206
- debounceMs: 15_000, // optional: let rapid edits settle
207
- includeBotPosts: false, // default: bot-authored posts never dispatch
148
+ allow: ["#triage-alerts"],
149
+ posts: "top-level",
150
+ debounceMs: 15_000,
208
151
  },
209
152
  },
210
- onChannelPost: async (ctx, message) => {
211
- // same contract as onAppMention: return null to skip
153
+ onChannelPost: async (_ctx, message) => {
212
154
  return message.markdown.length > 20 ? {} : null;
213
155
  },
214
156
  });
215
157
  ```
216
158
 
217
- Channel watching needs the `message.channels` / `message.groups` events
218
- on the Slack app. Pass `--channel-posts` on `slack create` or
219
- `slack init --manual`. The bot must also be a member of each watched
220
- channel.
221
-
222
- Set `allow: ["*"]` to watch every channel the bot has joined.
159
+ Pass `--channel-posts` on `slack create` or `slack init --manual` so
160
+ the Slack app receives those events. The bot must be in each watched
161
+ channel. `allow: ["*"]` watches every joined channel.
223
162
 
224
- Set `includeBotPosts: true` when the posts worth watching come from bots:
225
- alert feeds, webhook integrations, or other agents posting notes. The
226
- watching app's own posts stay dropped either way, matched by the `bot_id`
227
- and bot user id from `auth.test`, so an agent can never dispatch on its
228
- own replies. Use this for a bot-fed alerts channel.
163
+ Set `includeBotPosts: true` for alert feeds and other bots. This app
164
+ never wakes on its own posts.
229
165
 
230
166
  ## Prepare work on the host
231
167
 
232
168
  Mention and DM handlers may return a prepared `message`,
233
- `workspaceFiles`, or `cloud` block. It's the same host-prep pattern as
169
+ `workspaceFiles`, or `cloud` block. Use the same host-prep pattern as
234
170
  [custom channels](./webhooks.md#prepare-on-the-host-then-hand-off).
235
- PR agents use it: extract a PR URL from the mention text and run the
236
- same host path as the HTTP channel.
237
171
 
238
- Slack file uploads are attached automatically. Images become vision input.
172
+ Slack file uploads attach automatically. Images become vision input.
239
173
  Supported documents become workspace files for the turn.
240
174
 
241
175
  ## Add approval buttons
242
176
 
243
- Tools with `needsApproval` park until a person decides. Route that
244
- through Slack with one flag:
177
+ Tools with `needsApproval` park until a person decides. Post those
178
+ decisions in Slack with one flag:
245
179
 
246
180
  ```ts
247
181
  export default slackChannel({
248
- toolApprovals: true, // posts Block Kit Approve/Deny cards + routes clicks
182
+ toolApprovals: true,
249
183
  });
250
184
  ```
251
185
 
252
- Approval cards need interactivity on the Slack app. Recreate with
253
- `slack create` if clicks do nothing. Composing events by hand: spread
254
- `buildToolApprovalEvents({ credentials })` into `events` and set
255
- `interactivity: true` on the channel so Socket Mode routes the clicks.
256
-
257
- Cards show redacted, truncated arguments (Block Kit size limits);
258
- execution still uses the full validated input, so review sensitive tools
259
- in the playground when the arguments may exceed the card. Approvals
260
- exist for `execution: "server"` tools on the local runtime only, and
261
- parked calls do not survive a host restart. The full lifecycle is in
186
+ The Slack app needs interactivity. Recreate it with `slack create` if
187
+ clicks do nothing. Cards show redacted, truncated arguments. Execution
188
+ still uses the full input, so review sensitive tools in the playground
189
+ when the card may hide fields. The lifecycle is in
262
190
  [Human-in-the-loop](./human-in-the-loop.md).
263
191
 
264
192
  ## Run several agents on one host
265
193
 
266
- One Slack app and token pair per agent. Never share a pair across
267
- agents in the same process. `envPrefix` keeps them apart
268
- (`WEATHER_AGENT_SLACK_*`, `TRIAGE_SLACK_*`, …), and agents without tokens mount
269
- with their Slack channel idle while everything else serves normally.
270
-
271
- ## Keep the channel healthy
272
-
273
- Two habits matter most.
274
-
275
- - Don't `await` long work inside Slack dispatch handlers. The pack
276
- dispatches through `waitUntil` and streams as the turn progresses.
277
- - In `--dev` (loopback) or `--allow-anonymous` (trusted shared host), the
278
- playground can list and stream Slack sessions and resolve their parked
279
- approvals (the audit trail records the HTTP caller). Bearer-auth hosts
280
- stay strict: Slack approvals must come from Slack interactivity or a
281
- matching principal.
282
-
283
- ## CLI reference
284
-
285
- The `slack` subcommands cover setup end to end.
286
-
287
- ```bash
288
- agent-sdk slack setup # printed setup guide
289
- agent-sdk slack create --dir . # dashboard wizard (dev app)
290
- agent-sdk slack create --dir . --prod # prod app
291
- agent-sdk slack destroy --dir . # delete the provisioned app
292
- agent-sdk slack icon ./icon.png --dir . # set the provisioned app's icon
293
- agent-sdk slack init --manual --dir . # manifests to paste at api.slack.com
294
- agent-sdk slack manifest --env both # regenerate those JSON files
295
- agent-sdk slack doctor --prefix MY_AGENT # token / connectivity checks
296
- ```
297
-
298
- ## What's next
299
-
300
- Continue with these pages:
301
-
302
- - [Human-in-the-loop](./human-in-the-loop.md): the approval lifecycle
303
- behind `toolApprovals`
304
- - [Webhooks and custom channels](./webhooks.md): the mechanism this
305
- pack is built on
194
+ Give each agent its own Slack app and token pair. Set `envPrefix` so
195
+ the names don't collide (`WEATHER_AGENT_SLACK_*`, `TRIAGE_SLACK_*`).
196
+ Agents without tokens stay idle. The others still serve.
@@ -184,8 +184,8 @@ When every slot is busy, newly admitted turns queue FIFO instead of
184
184
  failing: the stream records a durable `turn.queued` event with the
185
185
  queue position, `GET /v1/sessions` reports `queued: true`, and each
186
186
  queued turn starts as soon as a slot frees. A queued turn still counts
187
- as running for busy semantics: follow-ups preempt it, and direct tool
188
- calls get `409 session_busy`. Omit for unlimited.
187
+ as running for busy semantics: follow-ups preempt it, and direct
188
+ write-effect tool calls get `409 session_busy`. Omit for unlimited.
189
189
 
190
190
  ```ts
191
191
  export default defineAgent({
@@ -342,8 +342,9 @@ the value before execution. A local call needs no inference credential.
342
342
  A hosted call still needs Cursor credentials to reach the deployment.
343
343
 
344
344
  `--session` runs the tool inside an existing session and records it on
345
- the event stream. If a model turn is active or pending, the server
346
- returns `session_busy`; retry after the turn finishes. The command
345
+ the event stream. If a model turn is active or pending, a read-effect
346
+ tool runs alongside it and a write-effect tool gets `session_busy`;
347
+ retry after the turn finishes. The command
347
348
  prints the server's JSON response and exits non-zero unless the HTTP
348
349
  response succeeds with `ok: true`. See
349
350
  [Tools](./tools.md#call-a-tool-without-a-model-turn).
@@ -414,6 +415,8 @@ non-zero when the reconstructed trajectory failed.
414
415
  ```bash
415
416
  agent-sdk init ./my-agent # scaffold package.json, tsconfig.json, agent/ + a demo tool
416
417
  agent-sdk init ./my-demo --template demo # record a PR walkthrough
418
+ agent-sdk init ./code-wiki --template code-wiki # keep wiki pages current after merge
419
+ agent-sdk init ./agents-md --template agents-md # keep AGENTS.md current from last week's PRs and Slack
417
420
  agent-sdk init ./my-reviewer --template security-reviewer # review PRs for security bugs
418
421
  agent-sdk init ./security-help --template security-help # answer security questions in Slack
419
422
  agent-sdk init ./my-triage --template triage-linear # comment on Linear issues
@@ -431,8 +434,9 @@ agent-sdk init # no directory: print the setup guide
431
434
  `@cursor/july` resolves for `dev` and `run`.
432
435
 
433
436
  Templates may ship `init.json`. On a TTY, `init` asks those questions
434
- before writing files. `pr-autofixer` and `security-help` ask for GitHub
435
- repos. Repeat
437
+ before writing files. `code-wiki`, `pr-autofixer`, `security-help`, and
438
+ `agents-md` ask for GitHub repos. `agents-md` also asks for Slack
439
+ channels. Repeat
436
440
  `--var id=value` to answer without a prompt.
437
441
  `--json` and non-TTY hosts skip the interview unless `--var` is set.
438
442
 
@@ -590,7 +594,8 @@ commands with an explicit `--json` flag skip this automatic check.
590
594
  agent-sdk deploy [--dir <path>] [--slug <slug> | --all] [--team <id>]
591
595
  [--repo <https-url>] [--ref <git-ref>] [--path <agent-path>]
592
596
  [--cursor-events-repo owner/name]...
593
- [--allow-domain <domain>]... [--no-wait] [--json]
597
+ [--allow-domain <domain>]... [--multi-tenant]
598
+ [--no-wait] [--json]
594
599
  ```
595
600
 
596
601
  Managed hosting requires team-admin permission and the team's
@@ -617,6 +622,12 @@ be a lowercase hostname with at least two labels and an alphabetic
617
622
  top-level domain. One leading `*.` wildcard is allowed. A deployment
618
623
  can declare at most 20 domains.
619
624
 
625
+ `--multi-tenant` adds a release to an existing Cursor-managed
626
+ (multi-tenant) product such as `security-reviewer`. It is valid only
627
+ for `architecture: "v2"` and cannot create a new multi-tenant
628
+ application — those stay on the operator seed path. Without the flag,
629
+ HTTP deploy stays single-tenant and a managed slug 409s.
630
+
620
631
  By default, the command polls every three seconds for up to ten minutes
621
632
  and succeeds only when the deployment reaches `running`. `--no-wait`
622
633
  returns after the deployment request is accepted. Multi-agent deploys
@@ -743,6 +754,8 @@ URL connections run a browser PKCE flow. Tokens are written to
743
754
  `mcp-auth.json` under the CLI config directory (override with
744
755
  `AGENT_SERVE_CONFIG_DIR`). Pass `--store` to upsert matching
745
756
  `MCP_OAUTH_<CONNECTION>_*` secrets on the hosted deployment.
757
+ `--store` is the path for the next deploy. Hosted Connect lets the
758
+ current process retry.
746
759
 
747
760
  Cursor-account connections authorize the hosted deployment's service
748
761
  account through the Cursor backend's connector consent flow. Those
@@ -821,6 +834,7 @@ agent-sdk slack icon <https-url-or-file> [--dir <path>] [--prod]
821
834
  [--slack-team <T…>] [--team <id>] [--json]
822
835
  agent-sdk slack init --manual [--dir <path>] [--name <name>]
823
836
  [--prefix <prefix> | --no-prefix] [--channel-posts]
837
+ [--install | --no-install] [--slack-team <T…>] [--prod]
824
838
  agent-sdk slack manifest [--dir <path>] [--name <name>]
825
839
  [--env dev|prod|both] [--channel-posts] [--print]
826
840
  agent-sdk slack doctor [--dir <path>] [--prefix <prefix> | --no-prefix] [--json]
@@ -849,17 +863,26 @@ a local png, jpg, or gif file of at most 512KB.
849
863
 
850
864
  `slack init` without `--manual` exits non-zero and writes no files. Use
851
865
  `slack create` for the dashboard wizard. `slack init --manual` writes
852
- the channel file, development and production manifests, `env.example`,
853
- and setup status under the project. You paste those manifests at
854
- api.slack.com. The command refuses to overwrite a target file. If a
855
- collision occurs, it exits non-zero; files created earlier in the run
856
- remain. The token prefix defaults to the directory basename normalized
857
- to uppercase snake case. Explicit `--prefix` values use the same
858
- normalization. For example, `pr-approver` becomes
859
- `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix` uses shared
860
- `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`. `--channel-posts` subscribes
861
- the manifests to channel-post events. The command always prints a JSON
862
- summary.
866
+ the channel file, development and production manifests, a Slack CLI
867
+ `.slack/` project (hook + manifests, committed with the repo). When
868
+ Slack CLI is logged in, it installs the app. Otherwise `next` asks
869
+ you to install it. `--install` requires that install. `--no-install`
870
+ skips it. `--prod` selects the deployed app.
871
+ `--slack-team` picks the workspace. Slack CLI keeps install tokens in
872
+ that process; copy `xoxb` and mint `xapp` (`connections:write`) into
873
+ `.env.local`. Tokens that appear in `.env` during that install are
874
+ copied onto the prefixed names. Paste `.slack/manifest.dev.json` at
875
+ api.slack.com when the Slack CLI is missing. Do not run
876
+ `slack deploy`. The command refuses to overwrite the channel file.
877
+ It updates the Slack CLI hook and manifests when `.slack/` already
878
+ exists. If a collision occurs, it exits non-zero; files created
879
+ earlier in the run remain. The token prefix defaults to the directory
880
+ basename normalized to uppercase snake case.
881
+ Explicit `--prefix` values use the same normalization. For example,
882
+ `pr-approver` becomes `PR_APPROVER_SLACK_BOT_TOKEN`. `--no-prefix`
883
+ uses shared `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`.
884
+ `--channel-posts` subscribes the manifests to channel-post events.
885
+ The command always prints a JSON summary.
863
886
 
864
887
  `slack manifest` regenerates selected manifest files. `--env` defaults
865
888
  to `both`, and `--name` defaults to the directory name. `--print` writes
@@ -35,8 +35,10 @@ Tokens come from env vars. Never hardcode them in the file.
35
35
  ## Host MCP OAuth
36
36
 
37
37
  For servers that speak OAuth, set `oauth: true` and authorize with the
38
- CLI. Tokens live in `mcp-auth.json` under the CLI config directory. `--store`
39
- copies them onto the hosted deployment as `MCP_OAUTH_<NAME>_*` secrets.
38
+ CLI or mid-run Connect. Tokens live in `mcp-auth.json` under the CLI
39
+ config directory. `--store` copies them onto the deployment as
40
+ `MCP_OAUTH_<NAME>_*` secrets. Hosted Connect lets the current
41
+ process retry.
40
42
 
41
43
  ```ts
42
44
  export default defineConnection({
@@ -48,6 +50,7 @@ export default defineConnection({
48
50
  ```bash
49
51
  agent-sdk mcp oauth inventory # browser PKCE → local mcp-auth.json
50
52
  agent-sdk mcp oauth inventory --store # also upsert deployment secrets
53
+ # Hosted Connect retries this process. Self-hosted stays file-only.
51
54
  ```
52
55
 
53
56
  Full walkthrough: [Host MCP OAuth](../guides/mcp-oauth.md). Companion
@@ -266,7 +269,7 @@ lazily on first use.
266
269
 
267
270
  Continue with these pages:
268
271
 
269
- - [Host MCP OAuth](../guides/mcp-oauth.md): `mcp oauth`, `--store`
272
+ - [Host MCP OAuth](../guides/mcp-oauth.md): `mcp oauth`, Connect, `--store`
270
273
  - [Agent-to-agent](../guides/agent-to-agent.md): peers in depth
271
274
  - [Tools](./tools.md): authored tools that wrap MCP connections
272
275
  - [Webhooks](../guides/webhooks.md): calling MCP connections from handlers
@@ -134,7 +134,8 @@ curl -X POST http://127.0.0.1:3000/<slug>/v1/tools/inspect_pr \
134
134
  It runs an authored server tool in-process: schema-validated, no model
135
135
  turn. An optional `"sessionId"` in the body runs it inside an existing
136
136
  session and records it on that session's stream (`409 session_busy`
137
- while a turn runs). Agent-execution tools are rejected with `400`, and
137
+ for a write-effect call while a turn runs; reads run alongside the
138
+ turn). Agent-execution tools are rejected with `400`, and
138
139
  unknown tools with `404` and the list of available names. For the
139
140
  semantics, see [Tools](./tools.md#call-a-tool-without-a-model-turn).
140
141
 
@@ -67,8 +67,10 @@ message. Interrupted turns record `turn.failed` with
67
67
  Slack `stop` / `@agent stop` does the same for that thread and clears
68
68
  pending coalesced nudges.
69
69
 
70
- Session-bound deterministic tool calls share the same execution lock.
71
- They return `409 session_busy` while a model turn is running.
70
+ Session-bound deterministic tool calls share the lock only for writes: a
71
+ write-effect call returns `409 session_busy` while a model turn is
72
+ running, a read-effect call runs alongside the turn (see
73
+ [Tools](./tools.md#call-a-tool-without-a-model-turn)).
72
74
 
73
75
  ## Which events can I stream?
74
76
 
@@ -263,7 +263,14 @@ when the call returns. Pass a `sessionId` (a body field over
263
263
  HTTP, `--session` on the CLI, `options.sessionId` programmatically) to
264
264
  run inside an existing session instead: the tool sees that session's
265
265
  workspace, and the call is recorded on the session's event stream.
266
- Session-bound calls return `409 session_busy` while a turn runs. When the
266
+ While a model turn is running, a session-bound call is admitted by its
267
+ effect: a read-effect call (a declared `effect: "read"`, or an advertised
268
+ MCP tool whose server annotates it read-only) runs alongside the turn,
269
+ reading the workspace as the turn has left it, and is recorded under its
270
+ own per-call `turnId` so trajectories keep it apart from the turn's own
271
+ calls; a write-effect call — including an undeclared tool, which counts
272
+ as a write — returns `409 session_busy` until the turn finishes, because
273
+ a running turn owns the workspace. When the
267
274
  session's harness cwd cannot be materialized, a read-effect call runs
268
275
  in a scratch workspace instead and the outcome carries
269
276
  `scratchWorkspace: true`; a write-effect call fails with
@@ -273,7 +280,7 @@ A session can also be addressed by its continuation token: an optional
273
280
  `continuationToken` (`<channelId>:<key>`, as `/v1/sessions` lists it;
274
281
  mutually exclusive with `sessionId`). A token that maps to a live
275
282
  session behaves exactly like passing that session's id — same ownership
276
- check, same `409 session_busy`, same event recording. A token with no
283
+ check, same busy semantics, same event recording. A token with no
277
284
  session behind it runs the call scratch-bound with the token's channel
278
285
  id and continuation key as the call's session identity, so a deployment
279
286
  whose tools resolve state from the continuation key can serve it with