@cursor/july 0.1.93 → 0.1.95

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 (440) hide show
  1. package/AGENTS.md +8 -20
  2. package/README.md +4 -26
  3. package/dist/channels/github/github-channel.d.ts.map +1 -1
  4. package/dist/channels/github/github-channel.js +14 -2
  5. package/dist/channels/github/types.d.ts +18 -3
  6. package/dist/channels/github/types.d.ts.map +1 -1
  7. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  8. package/dist/channels/origin/origin-channel.js +11 -3
  9. package/dist/channels/origin/origin-webhook.d.ts +11 -1
  10. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  11. package/dist/channels/origin/origin-webhook.js +23 -3
  12. package/dist/channels/origin/types.d.ts +8 -0
  13. package/dist/channels/origin/types.d.ts.map +1 -1
  14. package/dist/channels/slack/attachments.js +2 -2
  15. package/dist/channels/slack/dispatch.d.ts +0 -7
  16. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  17. package/dist/channels/slack/dispatch.js +4 -7
  18. package/dist/channels/slack/eval-directive.d.ts +5 -12
  19. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  20. package/dist/channels/slack/eval-directive.js +8 -19
  21. package/dist/channels/slack/index.d.ts +0 -6
  22. package/dist/channels/slack/index.d.ts.map +1 -1
  23. package/dist/channels/slack/index.js +0 -6
  24. package/dist/channels/slack/pr-ref.d.ts +7 -1
  25. package/dist/channels/slack/pr-ref.d.ts.map +1 -1
  26. package/dist/channels/slack/pr-ref.js +42 -23
  27. package/dist/channels/slack/setup.d.ts +4 -4
  28. package/dist/channels/slack/setup.d.ts.map +1 -1
  29. package/dist/channels/slack/setup.js +8 -15
  30. package/dist/channels/slack/slack-channel.d.ts +6 -13
  31. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  32. package/dist/channels/slack/slack-channel.js +15 -101
  33. package/dist/channels/slack/types.d.ts +12 -79
  34. package/dist/channels/slack/types.d.ts.map +1 -1
  35. package/dist/channels/slack/types.js +1 -15
  36. package/dist/client.d.ts +14 -0
  37. package/dist/client.d.ts.map +1 -0
  38. package/dist/client.js +12 -0
  39. package/dist/connections.d.ts +18 -9
  40. package/dist/connections.d.ts.map +1 -1
  41. package/dist/connections.js +17 -8
  42. package/dist/docs/404.html +2 -2
  43. package/dist/docs/ab.html +4 -4
  44. package/dist/docs/assets/{app.CjWU-x0z.js → app.BBj0klBO.js} +1 -1
  45. package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +1 -0
  46. package/dist/docs/assets/chunks/{VPLocalSearchBox.Cxy8ySFQ.js → VPLocalSearchBox.CUEXpL78.js} +1 -1
  47. package/dist/docs/assets/chunks/{theme.Dvq1Bktu.js → theme.DabmQnia.js} +2 -2
  48. package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
  49. package/dist/docs/assets/{deployment.md.DoLFAzfm.js → deployment.md.D9msOFOW.js} +3 -8
  50. package/dist/docs/assets/{deployment.md.DoLFAzfm.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
  51. package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.js → guides_agent-to-agent.md.BDb0t1QV.js} +1 -1
  52. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
  53. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
  54. package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.js → guides_convert-automation.md.B4sjlodG.js} +1 -1
  55. package/dist/docs/assets/{guides_github.md.DqJhuaN1.js → guides_github.md.Cnh2mL4a.js} +1 -1
  56. package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
  57. package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
  58. package/dist/docs/assets/{guides_slack.md.mqeNKs84.js → guides_slack.md.C32HsdKk.js} +5 -11
  59. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
  60. package/dist/docs/assets/index.md.BoHaMdeZ.js +5 -0
  61. package/dist/docs/assets/{index.md.B-lVR4wT.lean.js → index.md.BoHaMdeZ.lean.js} +1 -1
  62. package/dist/docs/assets/{quickstart.md.BrmfrrIr.js → quickstart.md.Nj_LjW_a.js} +1 -1
  63. package/dist/docs/assets/{reference_cli.md.D9KESDsD.js → reference_cli.md.BsMOxDvh.js} +4 -3
  64. package/dist/docs/assets/{reference_cli.md.D9KESDsD.lean.js → reference_cli.md.BsMOxDvh.lean.js} +1 -1
  65. package/dist/docs/assets/{reference_connections.md.DB6SsN6U.js → reference_connections.md.BH8Oc0D0.js} +5 -5
  66. package/dist/docs/assets/{reference_connections.md.DB6SsN6U.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
  67. package/dist/docs/assets/{reference_hooks.md.BxN87gCw.js → reference_hooks.md.a8BJxMR5.js} +1 -1
  68. package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
  69. package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
  70. package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
  71. package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
  72. package/dist/docs/assets/{reference_tools.md.DuKvkYWG.js → reference_tools.md.BHeXn2id.js} +3 -3
  73. package/dist/docs/assets/{reference_tools.md.DuKvkYWG.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
  74. package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
  75. package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
  76. package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
  77. package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
  78. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
  79. package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
  80. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
  81. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
  82. package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
  83. package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
  84. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
  85. package/dist/docs/building-with-agents.html +4 -4
  86. package/dist/docs/concepts.html +5 -5
  87. package/dist/docs/concepts.md +1 -0
  88. package/dist/docs/deployment.html +7 -12
  89. package/dist/docs/deployment.md +1 -20
  90. package/dist/docs/design/agsh.md +406 -0
  91. package/dist/docs/evals.html +4 -4
  92. package/dist/docs/guides/agent-to-agent.html +6 -6
  93. package/dist/docs/guides/agent-to-agent.md +2 -2
  94. package/dist/docs/guides/cloud-runtime.html +6 -6
  95. package/dist/docs/guides/cloud-runtime.md +1 -0
  96. package/dist/docs/guides/convert-automation.html +6 -6
  97. package/dist/docs/guides/convert-automation.md +1 -1
  98. package/dist/docs/guides/github.html +6 -6
  99. package/dist/docs/guides/github.md +4 -4
  100. package/dist/docs/guides/human-in-the-loop.html +4 -4
  101. package/dist/docs/guides/mcp-oauth.html +11 -13
  102. package/dist/docs/guides/mcp-oauth.md +10 -18
  103. package/dist/docs/guides/opentelemetry.html +5 -5
  104. package/dist/docs/guides/slack.html +9 -15
  105. package/dist/docs/guides/slack.md +9 -46
  106. package/dist/docs/guides/webhooks.html +4 -4
  107. package/dist/docs/hashmap.json +1 -1
  108. package/dist/docs/hillclimbing.html +4 -4
  109. package/dist/docs/index.html +6 -6
  110. package/dist/docs/index.md +3 -29
  111. package/dist/docs/llms-full.txt +756 -2810
  112. package/dist/docs/llms.txt +3 -16
  113. package/dist/docs/quickstart.html +6 -6
  114. package/dist/docs/quickstart.md +2 -3
  115. package/dist/docs/reference/agent-config.html +4 -4
  116. package/dist/docs/reference/artifacts.html +4 -4
  117. package/dist/docs/reference/channels.html +4 -4
  118. package/dist/docs/reference/cli.html +8 -7
  119. package/dist/docs/reference/cli.md +5 -2
  120. package/dist/docs/reference/connections.html +9 -9
  121. package/dist/docs/reference/connections.md +15 -11
  122. package/dist/docs/reference/hooks.html +6 -6
  123. package/dist/docs/reference/hooks.md +2 -3
  124. package/dist/docs/reference/http-api.html +6 -6
  125. package/dist/docs/reference/http-api.md +8 -0
  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 +8 -6
  129. package/dist/docs/reference/project-layout.md +5 -1
  130. package/dist/docs/reference/prompt.html +4 -4
  131. package/dist/docs/reference/schedules.html +4 -4
  132. package/dist/docs/reference/sessions.html +4 -4
  133. package/dist/docs/reference/skills.html +4 -4
  134. package/dist/docs/reference/subagents.html +6 -6
  135. package/dist/docs/reference/subagents.md +2 -2
  136. package/dist/docs/reference/tools.html +7 -7
  137. package/dist/docs/reference/tools.md +19 -3
  138. package/dist/docs/scaffolding-agents.html +4 -4
  139. package/dist/docs/storage.html +4 -4
  140. package/dist/docs/templates/agentic-owners.html +7 -7
  141. package/dist/docs/templates/agentic-owners.md +1 -1
  142. package/dist/docs/templates/demo.html +6 -6
  143. package/dist/docs/templates/demo.md +3 -2
  144. package/dist/docs/templates/pr-autofixer.html +6 -6
  145. package/dist/docs/templates/pr-autofixer.md +8 -13
  146. package/dist/docs/templates/security-help.html +30 -0
  147. package/dist/docs/templates/security-help.md +65 -0
  148. package/dist/docs/templates/security-reviewer.html +6 -6
  149. package/dist/docs/templates/security-reviewer.md +1 -3
  150. package/dist/docs/templates/triage.html +7 -7
  151. package/dist/docs/templates/triage.md +2 -6
  152. package/dist/docs/troubleshooting.html +5 -5
  153. package/dist/docs/troubleshooting.md +2 -2
  154. package/dist/files-backends/cursor-hosted.d.ts +6 -2
  155. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  156. package/dist/files-backends/cursor-hosted.js +2 -2
  157. package/dist/files.d.ts +2 -0
  158. package/dist/files.d.ts.map +1 -1
  159. package/dist/files.js +5 -0
  160. package/dist/index.d.ts +1 -1
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +1 -1
  163. package/dist/internal/advertise-tools.d.ts +11 -0
  164. package/dist/internal/advertise-tools.d.ts.map +1 -1
  165. package/dist/internal/advertise-tools.js +47 -9
  166. package/dist/internal/cli-deploy.d.ts.map +1 -1
  167. package/dist/internal/cli-deploy.js +135 -6
  168. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  169. package/dist/internal/cli-mcp-oauth.js +7 -4
  170. package/dist/internal/conversation-mirror.d.ts +82 -0
  171. package/dist/internal/conversation-mirror.d.ts.map +1 -0
  172. package/dist/internal/conversation-mirror.js +251 -0
  173. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  174. package/dist/internal/convert-automation/convert-workflow.js +26 -15
  175. package/dist/internal/convert-automation/slug.d.ts +0 -2
  176. package/dist/internal/convert-automation/slug.d.ts.map +1 -1
  177. package/dist/internal/convert-automation/slug.js +0 -8
  178. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  179. package/dist/internal/cursor/account-mcp.js +5 -1
  180. package/dist/internal/deferred-channel-session.d.ts +20 -0
  181. package/dist/internal/deferred-channel-session.d.ts.map +1 -0
  182. package/dist/internal/deferred-channel-session.js +62 -0
  183. package/dist/internal/deploy-client.d.ts +13 -1
  184. package/dist/internal/deploy-client.d.ts.map +1 -1
  185. package/dist/internal/deploy-client.js +11 -1
  186. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  187. package/dist/internal/deploy-manifest.js +11 -5
  188. package/dist/internal/discovery.d.ts.map +1 -1
  189. package/dist/internal/discovery.js +110 -15
  190. package/dist/internal/framework-storage-selection.d.ts +32 -16
  191. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  192. package/dist/internal/framework-storage-selection.js +51 -17
  193. package/dist/internal/hosted-admission-context.d.ts +20 -0
  194. package/dist/internal/hosted-admission-context.d.ts.map +1 -0
  195. package/dist/internal/hosted-admission-context.js +31 -0
  196. package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
  197. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  198. package/dist/internal/hosted-delivery-protocol.js +33 -1
  199. package/dist/internal/hosted-delivery.d.ts +4 -2
  200. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  201. package/dist/internal/hosted-delivery.js +97 -44
  202. package/dist/internal/hosted-managed-automation.d.ts +30 -0
  203. package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
  204. package/dist/internal/hosted-managed-automation.js +58 -0
  205. package/dist/internal/mcp-endpoint.js +3 -3
  206. package/dist/internal/mcp-host.d.ts +8 -7
  207. package/dist/internal/mcp-host.d.ts.map +1 -1
  208. package/dist/internal/mcp-host.js +8 -7
  209. package/dist/internal/peer-connections.d.ts.map +1 -1
  210. package/dist/internal/peer-connections.js +5 -1
  211. package/dist/internal/playground/static.d.ts +0 -3
  212. package/dist/internal/playground/static.d.ts.map +1 -1
  213. package/dist/internal/resolved-connections.d.ts.map +1 -1
  214. package/dist/internal/resolved-connections.js +5 -7
  215. package/dist/internal/review-comments.d.ts.map +1 -1
  216. package/dist/internal/review-comments.js +10 -98
  217. package/dist/internal/scm/pr-url.d.ts +14 -0
  218. package/dist/internal/scm/pr-url.d.ts.map +1 -0
  219. package/dist/internal/scm/pr-url.js +65 -0
  220. package/dist/internal/sdk-runner.d.ts +14 -0
  221. package/dist/internal/sdk-runner.d.ts.map +1 -1
  222. package/dist/internal/sdk-runner.js +41 -2
  223. package/dist/internal/server.d.ts.map +1 -1
  224. package/dist/internal/server.js +123 -174
  225. package/dist/internal/session-engine.d.ts +45 -10
  226. package/dist/internal/session-engine.d.ts.map +1 -1
  227. package/dist/internal/session-engine.js +217 -65
  228. package/dist/internal/tool-catalog.d.ts +31 -0
  229. package/dist/internal/tool-catalog.d.ts.map +1 -0
  230. package/dist/internal/tool-catalog.js +67 -0
  231. package/dist/playground/assets/index-CF7hUDnQ.css +1 -0
  232. package/dist/playground/assets/{index-D9MFzhNE.js → index-CZA1uEWA.js} +48 -48
  233. package/dist/playground/index.html +2 -2
  234. package/dist/storage-backends/cursor-hosted.d.ts +7 -2
  235. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  236. package/dist/storage-backends/cursor-hosted.js +2 -2
  237. package/dist/types.d.ts +72 -23
  238. package/dist/types.d.ts.map +1 -1
  239. package/dist/types.js +19 -0
  240. package/docs/README.md +3 -29
  241. package/docs/concepts.md +1 -0
  242. package/docs/deployment.md +1 -20
  243. package/docs/design/agsh.md +406 -0
  244. package/docs/guides/agent-to-agent.md +2 -2
  245. package/docs/guides/cloud-runtime.md +1 -0
  246. package/docs/guides/convert-automation.md +1 -1
  247. package/docs/guides/github.md +4 -4
  248. package/docs/guides/mcp-oauth.md +10 -18
  249. package/docs/guides/slack.md +10 -47
  250. package/docs/quickstart.md +2 -3
  251. package/docs/reference/cli.md +5 -2
  252. package/docs/reference/connections.md +15 -11
  253. package/docs/reference/hooks.md +2 -3
  254. package/docs/reference/http-api.md +8 -0
  255. package/docs/reference/project-layout.md +5 -1
  256. package/docs/reference/subagents.md +2 -2
  257. package/docs/reference/tools.md +19 -3
  258. package/docs/templates/agentic-owners.md +1 -1
  259. package/docs/templates/demo.md +3 -2
  260. package/docs/templates/pr-autofixer.md +8 -13
  261. package/docs/templates/security-help.md +70 -0
  262. package/docs/templates/security-reviewer.md +1 -3
  263. package/docs/templates/triage.md +2 -6
  264. package/docs/troubleshooting.md +2 -2
  265. package/package.json +9 -2
  266. package/skills/create-agent/SKILL.md +6 -13
  267. package/skills/debug/SKILL.md +2 -4
  268. package/skills/evals/SKILL.md +1 -1
  269. package/skills/framework-map/SKILL.md +3 -2
  270. package/skills/mcp-auth/SKILL.md +10 -13
  271. package/skills/setup-slack/SKILL.md +21 -137
  272. package/src/channels/github/github-channel.ts +23 -8
  273. package/src/channels/github/types.ts +19 -2
  274. package/src/channels/origin/origin-channel.ts +13 -1
  275. package/src/channels/origin/origin-webhook.ts +27 -3
  276. package/src/channels/origin/types.ts +8 -0
  277. package/src/channels/slack/attachments.ts +2 -2
  278. package/src/channels/slack/dispatch.ts +2 -16
  279. package/src/channels/slack/eval-directive.ts +8 -27
  280. package/src/channels/slack/index.ts +0 -6
  281. package/src/channels/slack/pr-ref.ts +56 -25
  282. package/src/channels/slack/setup.ts +8 -15
  283. package/src/channels/slack/slack-channel.ts +14 -125
  284. package/src/channels/slack/types.ts +12 -96
  285. package/src/client.ts +23 -0
  286. package/src/connections.ts +20 -7
  287. package/src/files-backends/cursor-hosted.ts +9 -3
  288. package/src/files.ts +11 -0
  289. package/src/index.ts +2 -0
  290. package/src/internal/advertise-tools.ts +45 -7
  291. package/src/internal/cli-deploy.ts +171 -7
  292. package/src/internal/cli-mcp-oauth.ts +6 -4
  293. package/src/internal/conversation-mirror.ts +330 -0
  294. package/src/internal/convert-automation/convert-workflow.ts +29 -17
  295. package/src/internal/convert-automation/slug.ts +0 -9
  296. package/src/internal/cursor/account-mcp.ts +4 -1
  297. package/src/internal/deferred-channel-session.ts +61 -0
  298. package/src/internal/deploy-client.ts +24 -1
  299. package/src/internal/deploy-manifest.ts +10 -5
  300. package/src/internal/discovery.ts +129 -15
  301. package/src/internal/fixtures/units-server.ts +52 -0
  302. package/src/internal/framework-storage-selection.ts +61 -19
  303. package/src/internal/hosted-admission-context.ts +37 -0
  304. package/src/internal/hosted-delivery-protocol.ts +44 -1
  305. package/src/internal/hosted-delivery.ts +155 -68
  306. package/src/internal/hosted-managed-automation.ts +72 -0
  307. package/src/internal/mcp-endpoint.ts +3 -3
  308. package/src/internal/mcp-host.ts +8 -7
  309. package/src/internal/peer-connections.ts +4 -1
  310. package/src/internal/playground/static.ts +1 -3
  311. package/src/internal/resolved-connections.ts +8 -10
  312. package/src/internal/review-comments.ts +10 -113
  313. package/src/internal/scm/pr-url.ts +95 -0
  314. package/src/internal/sdk-runner.ts +57 -2
  315. package/src/internal/server.ts +161 -251
  316. package/src/internal/session-engine.ts +266 -69
  317. package/src/internal/tool-catalog.ts +106 -0
  318. package/src/storage-backends/cursor-hosted.ts +10 -3
  319. package/src/types.ts +90 -23
  320. package/templates/agentic-owners/README.md +1 -1
  321. package/templates/agentic-owners/agent/agent.ts +0 -10
  322. package/templates/agentic-owners/agent/channels/github.ts +5 -14
  323. package/templates/agentic-owners/agent/lib/config.ts +0 -8
  324. package/templates/agentic-owners/agent/lib/review.ts +2 -15
  325. package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
  326. package/templates/demo/agent/agent.ts +0 -10
  327. package/templates/pr-autofixer/README.md +0 -2
  328. package/templates/pr-autofixer/agent/agent.ts +0 -11
  329. package/templates/pr-autofixer/agent/channels/slack.ts +1 -2
  330. package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
  331. package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
  332. package/templates/security-help/README.md +2 -2
  333. package/templates/security-help/agent/agent.ts +1 -2
  334. package/templates/security-help/agent/channels/slack.ts +0 -3
  335. package/templates/security-help/agent/instructions.md +9 -10
  336. package/templates/security-help/agent/skills/access-request.md +1 -1
  337. package/templates/security-help/agent/skills/faq.md +31 -0
  338. package/templates/security-help/agent/skills/security-playbooks.md +1 -1
  339. package/templates/security-help/package.json +1 -2
  340. package/templates/security-reviewer/agent/agent.ts +0 -10
  341. package/templates/triage/README.md +2 -1
  342. package/templates/triage/agent/agent.ts +0 -10
  343. package/templates/triage/agent/channels/queue.ts +1 -1
  344. package/templates/triage/agent/channels/webhook.ts +1 -3
  345. package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
  346. package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
  347. package/dist/channels/slack/cursor-account.d.ts +0 -87
  348. package/dist/channels/slack/cursor-account.d.ts.map +0 -1
  349. package/dist/channels/slack/cursor-account.js +0 -100
  350. package/dist/docs/assets/chunks/@localSearchIndexroot.ChpIC3Zy.js +0 -1
  351. package/dist/docs/assets/concepts.md.F6AiPorA.js +0 -1
  352. package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.js +0 -10
  353. package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.lean.js +0 -1
  354. package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.js +0 -5
  355. package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.lean.js +0 -1
  356. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
  357. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
  358. package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.js +0 -8
  359. package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.lean.js +0 -1
  360. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
  361. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
  362. package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.js +0 -22
  363. package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.lean.js +0 -1
  364. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +0 -2
  365. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +0 -1
  366. package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.js +0 -11
  367. package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.lean.js +0 -1
  368. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
  369. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
  370. package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.js +0 -19
  371. package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.lean.js +0 -1
  372. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
  373. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
  374. package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.js +0 -25
  375. package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.lean.js +0 -1
  376. package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.js +0 -9
  377. package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.lean.js +0 -1
  378. package/dist/docs/assets/guides_slack.md.mqeNKs84.lean.js +0 -1
  379. package/dist/docs/assets/index.md.B-lVR4wT.js +0 -5
  380. package/dist/docs/assets/reference_http-api.md.C68BERYr.js +0 -11
  381. package/dist/docs/assets/reference_http-api.md.C68BERYr.lean.js +0 -1
  382. package/dist/docs/assets/reference_project-layout.md.WN9nwJht.js +0 -17
  383. package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.js +0 -1
  384. package/dist/docs/example-agents/approval-buddy.html +0 -36
  385. package/dist/docs/example-agents/approval-buddy.md +0 -266
  386. package/dist/docs/example-agents/benny.html +0 -31
  387. package/dist/docs/example-agents/benny.md +0 -173
  388. package/dist/docs/example-agents/bugbot.html +0 -37
  389. package/dist/docs/example-agents/bugbot.md +0 -229
  390. package/dist/docs/example-agents/codebase-wiki.html +0 -34
  391. package/dist/docs/example-agents/codebase-wiki.md +0 -167
  392. package/dist/docs/example-agents/codeowners-review.html +0 -34
  393. package/dist/docs/example-agents/codeowners-review.md +0 -192
  394. package/dist/docs/example-agents/concierge.html +0 -48
  395. package/dist/docs/example-agents/concierge.md +0 -200
  396. package/dist/docs/example-agents/index.html +0 -28
  397. package/dist/docs/example-agents/index.md +0 -99
  398. package/dist/docs/example-agents/knowledge-base.html +0 -37
  399. package/dist/docs/example-agents/knowledge-base.md +0 -168
  400. package/dist/docs/example-agents/oncall.html +0 -36
  401. package/dist/docs/example-agents/oncall.md +0 -212
  402. package/dist/docs/example-agents/security-reviewer.html +0 -45
  403. package/dist/docs/example-agents/security-reviewer.md +0 -265
  404. package/dist/docs/example-agents/slack-agent.html +0 -31
  405. package/dist/docs/example-agents/slack-agent.md +0 -142
  406. package/dist/docs/example-agents/weather-agent.html +0 -51
  407. package/dist/docs/example-agents/weather-agent.md +0 -297
  408. package/dist/internal/cursor-slack-relay.d.ts +0 -96
  409. package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
  410. package/dist/internal/cursor-slack-relay.js +0 -176
  411. package/dist/playground/assets/index-D9N7-q97.css +0 -1
  412. package/docs/example-agents/approval-buddy.md +0 -271
  413. package/docs/example-agents/benny.md +0 -178
  414. package/docs/example-agents/bugbot.md +0 -234
  415. package/docs/example-agents/codebase-wiki.md +0 -172
  416. package/docs/example-agents/codeowners-review.md +0 -197
  417. package/docs/example-agents/concierge.md +0 -205
  418. package/docs/example-agents/index.md +0 -104
  419. package/docs/example-agents/knowledge-base.md +0 -173
  420. package/docs/example-agents/oncall.md +0 -217
  421. package/docs/example-agents/security-reviewer.md +0 -270
  422. package/docs/example-agents/slack-agent.md +0 -147
  423. package/docs/example-agents/weather-agent.md +0 -302
  424. package/src/channels/slack/cursor-account.ts +0 -202
  425. package/src/internal/cursor-slack-relay.ts +0 -249
  426. package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
  427. package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
  428. package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
  429. package/templates/security-help/agent/skills/security-first-pass.md +0 -15
  430. /package/dist/docs/assets/{concepts.md.F6AiPorA.lean.js → concepts.md.lwAgBIMI.lean.js} +0 -0
  431. /package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
  432. /package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
  433. /package/dist/docs/assets/{guides_github.md.DqJhuaN1.lean.js → guides_github.md.Cnh2mL4a.lean.js} +0 -0
  434. /package/dist/docs/assets/{quickstart.md.BrmfrrIr.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
  435. /package/dist/docs/assets/{reference_hooks.md.BxN87gCw.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +0 -0
  436. /package/dist/docs/assets/{reference_project-layout.md.WN9nwJht.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
  437. /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
  438. /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
  439. /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
  440. /package/dist/docs/assets/{troubleshooting.md.vCWwvqcJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +0 -0
package/src/types.ts CHANGED
@@ -553,8 +553,9 @@ export interface SlackNudgeHostApi {
553
553
  */
554
554
  export interface HostContext {
555
555
  /**
556
- * Authored MCP connections (`agent/mcp-connections/*`). Call a specific MCP
557
- * tool deterministically without going through the agent loop.
556
+ * Authored MCP connections (`agent/mcp-connections/*` and
557
+ * `agent/host-connections/*`). Call a specific MCP tool deterministically
558
+ * without going through the agent loop.
558
559
  */
559
560
  mcp: HostMcpRegistry;
560
561
  /**
@@ -921,6 +922,33 @@ export type ToolNeedsApproval<TInput> =
921
922
  */
922
923
  export type ToolEffect = "read" | "write";
923
924
 
925
+ /** Authored `defineConnection({ effects })` — one effect or a set. */
926
+ export type ConnectionEffects = ToolEffect | readonly ToolEffect[];
927
+
928
+ const TOOL_EFFECTS: readonly ToolEffect[] = ["read", "write"];
929
+
930
+ export function isToolEffect(value: unknown): value is ToolEffect {
931
+ return value === "read" || value === "write";
932
+ }
933
+
934
+ /**
935
+ * Normalize authored {@link ConnectionConfig.effects} to a unique list.
936
+ * Invalid values are left for discovery to reject — this only collapses
937
+ * `"read"` / `["read"]` / duplicates.
938
+ */
939
+ export function normalizeConnectionEffects(
940
+ effects: ConnectionEffects
941
+ ): ToolEffect[] {
942
+ const list = typeof effects === "string" ? [effects] : [...effects];
943
+ const unique: ToolEffect[] = [];
944
+ for (const effect of TOOL_EFFECTS) {
945
+ if (list.includes(effect)) {
946
+ unique.push(effect);
947
+ }
948
+ }
949
+ return unique;
950
+ }
951
+
924
952
  /**
925
953
  * A tool's declared {@link ToolEffect} — fixed, or decided per call from
926
954
  * validated input for tools that read or write depending on their arguments
@@ -1185,12 +1213,6 @@ export type ConnectionConfig = (
1185
1213
  ) & {
1186
1214
  /** Documentation only; shown in `info` output. */
1187
1215
  description?: string;
1188
- /**
1189
- * Omit from SDK `mcpServers` (model never sees it). Still available on
1190
- * `host.mcp` for server tools / channel handlers. Does not affect
1191
- * cloud-native account connectors provisioned by the platform.
1192
- */
1193
- hostOnly?: boolean;
1194
1216
  /**
1195
1217
  * Per-session auth: called at turn-build time with the session's
1196
1218
  * {@link SessionInfo}, returning headers merged over the transport's
@@ -1239,12 +1261,27 @@ export type ConnectionConfig = (
1239
1261
  * fails the turn — a turn never silently runs with a shrunken toolset.
1240
1262
  * Local runtime only, like all server tools: a `runtime: "cloud"` agent
1241
1263
  * fails discovery, and hybrid per-send cloud sessions refuse the turn.
1242
- * Not combinable with {@link hostOnly} (advertising puts the tools in
1243
- * the model's toolset; hostOnly means off the model — discovery rejects
1244
- * the pair). The listing runs once per turn; point this at endpoints
1245
- * that can answer `tools/list` cheaply.
1264
+ * The listing runs once per turn; point this at endpoints that can
1265
+ * answer `tools/list` cheaply.
1246
1266
  */
1247
1267
  advertiseTools?: boolean;
1268
+ /**
1269
+ * Intended effects of tools this connection serves. When set, only
1270
+ * tools whose classified effect is in this set are advertised — a
1271
+ * connection that wants reads never puts a write, or a tool nothing
1272
+ * classified, in the model's toolset.
1273
+ *
1274
+ * Classification is the same fail-closed read of MCP annotations the
1275
+ * dry-run gate uses (`readOnlyHint` / `destructiveHint`). A tool the
1276
+ * server does not classify is omitted, not guessed. Servers that leave
1277
+ * tools unannotated stay empty here until they annotate or a trusted
1278
+ * listing injects a known-read hint.
1279
+ *
1280
+ * Requires {@link advertiseTools}: this filters the named passthroughs
1281
+ * the model sees. A single value (`"read"`) and an array (`["read"]`)
1282
+ * are the same.
1283
+ */
1284
+ effects?: ConnectionEffects;
1248
1285
  };
1249
1286
 
1250
1287
  /**
@@ -1266,15 +1303,13 @@ export function isInlineStdioConnection(
1266
1303
  connection: ConnectionConfig
1267
1304
  ): connection is InlineStdioConnectionConfig & {
1268
1305
  description?: string;
1269
- hostOnly?: boolean;
1270
1306
  } {
1271
1307
  return "tools" in connection && connection.tools !== undefined;
1272
1308
  }
1273
1309
 
1274
1310
  /**
1275
1311
  * An MCP connection is available to the agent (SDK `mcpServers`), host
1276
- * (`ctx.host.mcp`), and channel/schedule handlers — unless `hostOnly`,
1277
- * which keeps it off the model surface only.
1312
+ * (`ctx.host.mcp`), and channel/schedule handlers.
1278
1313
  */
1279
1314
  export type ConnectionDefinition = ConnectionConfig &
1280
1315
  BrandedDefinition<"connection">;
@@ -1847,6 +1882,19 @@ export const DIRECT_TOOL_CALL_CHANNEL_ID = "direct";
1847
1882
  export interface CallToolOptions {
1848
1883
  /** Who is calling; becomes the tool context's session auth. */
1849
1884
  auth?: AuthContext | null;
1885
+ /**
1886
+ * Address the session by its wire continuation token
1887
+ * (`<channelId>:<key>`, as `/v1/sessions` lists it). A token that maps
1888
+ * to a live (or restorable) session behaves exactly like passing that
1889
+ * session's {@link sessionId} — ownership check, turn serialization, and
1890
+ * event recording included. A token with no session behind it runs the
1891
+ * call scratch-bound with the token's channel id and continuation key as
1892
+ * the call's session identity, so deployments whose tools resolve state
1893
+ * from the continuation key (e.g. VFS mounts rebuilt by a binding
1894
+ * resolver) can serve it with no live session. Mutually exclusive with
1895
+ * {@link sessionId}.
1896
+ */
1897
+ continuationToken?: string;
1850
1898
  /**
1851
1899
  * Run the tool inside an existing session: the tool sees that session's
1852
1900
  * info and materialized workspace, and the call is recorded on the
@@ -1878,6 +1926,14 @@ export interface ToolCallOutcome {
1878
1926
  durationMs: number;
1879
1927
  /** Present when the call ran inside an existing session. */
1880
1928
  sessionId?: string;
1929
+ /**
1930
+ * Present (true) when a session-bound call could not materialize the
1931
+ * session's harness cwd and ran in a scratch workspace instead. The
1932
+ * session identity still applied (read-effect calls only get here), but
1933
+ * `ctx.workspaceDir` was not the session workspace — callers rendering
1934
+ * results as session state should surface this.
1935
+ */
1936
+ scratchWorkspace?: true;
1881
1937
  }
1882
1938
 
1883
1939
  /**
@@ -2172,12 +2228,6 @@ export interface ChannelMeta {
2172
2228
  * by `info` so watched channels are auditable.
2173
2229
  */
2174
2230
  slackChannelPosts?: readonly string[];
2175
- /**
2176
- * For Slack packs riding the signed-in Cursor account's Slack connection
2177
- * (`slackChannel({ cursorAccount: true })`): inbound relays from
2178
- * `/v0/slack-events` instead of Socket Mode.
2179
- */
2180
- slackCursorAccount?: boolean;
2181
2231
  }
2182
2232
 
2183
2233
  export interface ChannelConfig<TState = JsonValue> {
@@ -2648,6 +2698,8 @@ export interface DiscoveredTool {
2648
2698
  * refused — see `decideToolCall`.
2649
2699
  */
2650
2700
  advertised?: true;
2701
+ /** Name of the advertising connection an advertised tool came from. */
2702
+ connection?: string;
2651
2703
  /**
2652
2704
  * Agent tools: script body materialized under
2653
2705
  * `.agent-serve/tools/<name>.sh`.
@@ -2672,11 +2724,15 @@ export interface DiscoveredConnection {
2672
2724
  name: string;
2673
2725
  transport: ConnectionTransport;
2674
2726
  description?: string;
2675
- hostOnly?: boolean;
2676
2727
  /** Per-session auth from {@link ConnectionConfig.auth} (http/sse only). */
2677
2728
  auth?: ConnectionAuthProvider;
2678
2729
  /** Advertise-by-name from {@link ConnectionConfig.advertiseTools}. */
2679
2730
  advertiseTools?: boolean;
2731
+ /**
2732
+ * Normalized intended effects from {@link ConnectionConfig.effects}.
2733
+ * Absent means every listed tool is advertised.
2734
+ */
2735
+ effects?: readonly ToolEffect[];
2680
2736
  }
2681
2737
 
2682
2738
  export interface DiscoveredChannel {
@@ -2749,6 +2805,11 @@ export interface ResolvedAgent {
2749
2805
  tools: DiscoveredTool[];
2750
2806
  skills: DiscoveredSkill[];
2751
2807
  connections: DiscoveredConnection[];
2808
+ /**
2809
+ * MCP connections from `agent/host-connections/`. Host tools and
2810
+ * `mcp oauth` see them; the model does not.
2811
+ */
2812
+ hostConnections?: DiscoveredConnection[];
2752
2813
  subagents: ResolvedAgent[];
2753
2814
  seedFiles: SeedFile[];
2754
2815
  }
@@ -2816,14 +2877,20 @@ export interface AgentProjectInfo {
2816
2877
  description: string;
2817
2878
  execution: ToolExecution;
2818
2879
  needsApproval: boolean;
2880
+ /**
2881
+ * The tool's declared {@link ToolEffect} when static, `"dynamic"` when
2882
+ * declared as a predicate. Absent when the author declared nothing —
2883
+ * "unknown", not "mutates".
2884
+ */
2885
+ effect?: ToolEffect | "dynamic";
2819
2886
  inputSchema: JsonSchemaObject;
2820
2887
  }>;
2821
2888
  skills: Array<{ name: string; description: string }>;
2822
2889
  connections: Array<{
2823
2890
  name: string;
2824
2891
  transport: string;
2825
- hostOnly?: boolean;
2826
2892
  advertiseTools?: boolean;
2893
+ effects?: readonly ToolEffect[];
2827
2894
  /**
2828
2895
  * Present only for `cursorAccount` connections: the connector-name
2829
2896
  * allowlist, or `"*"` for every connected server. Structured twin of the
@@ -58,7 +58,7 @@ policy only) opts paths out entirely.
58
58
  - One model turn per PR head assesses the diff against the base rubric
59
59
  (`agent/lib/owners/prompts/base-review.md`) plus matched rule prompts.
60
60
  - The model records a verdict with `record_review`; the host recomputes
61
- the policy and applies the deterministic decision approve, or request
61
+ the policy and applies the deterministic decision: approve, or request
62
62
  the policy owners (max 2, never the author) and leave one comment it
63
63
  keeps updated.
64
64
  - The model never writes to GitHub. Broken policy files fail closed with
@@ -1,18 +1,8 @@
1
- import { homedir } from "node:os";
2
- import { join } from "node:path";
3
1
  import { defineAgent } from "@cursor/july";
4
2
 
5
3
  export default defineAgent({
6
- model: {
7
- id: "grok-4.5",
8
- params: [
9
- { id: "effort", value: "high" },
10
- { id: "fast", value: "true" },
11
- ],
12
- },
13
4
  tools: ["read", "grep", "glob", "ls"],
14
5
  local: {
15
6
  sandbox: true,
16
- cwd: join(homedir(), ".cache", "agent-serve", "agentic-owners"),
17
7
  },
18
8
  });
@@ -22,10 +22,8 @@ const REVIEW_ACTIONS = new Set([
22
22
  let log: (line: string) => void = () => {};
23
23
 
24
24
  export default githubChannel({
25
- // With repos configured, the signed-in Cursor account supplies both the
26
- // PR event stream and a repo-scoped GitHub credential — no webhook or
27
- // GitHub App setup. Empty repos boots without the binding so a fresh
28
- // scaffold's `dev` / `eval` run; use `agent-sdk github replay` there.
25
+ // Empty `repos` skips the Cursor GitHub binding so `dev` / `eval` boot
26
+ // on a fresh scaffold.
29
27
  cursorAccount: config.repos.length > 0 ? { repos: config.repos } : undefined,
30
28
  // The model never writes to GitHub; record_review actuates host-side.
31
29
  deliverReplies: false,
@@ -33,9 +31,7 @@ export default githubChannel({
33
31
  log = (line) => args.logger(`[agentic-owners] ${line}`);
34
32
  },
35
33
  onPullRequest: async (ctx, pr) => {
36
- // A base retarget re-resolves the policy against the new base: the diff
37
- // and the governing policy files both changed, so the old verdict — and
38
- // any approval it produced — no longer covers this PR. The fresh
34
+ // A base retarget re-resolves policy against the new base. The fresh
39
35
  // actuation dismisses a leftover approve when the new decision holds.
40
36
  const baseRetargeted =
41
37
  pr.action === "edited" && pr.baseRefChangedFrom !== undefined;
@@ -54,9 +50,8 @@ export default githubChannel({
54
50
  try {
55
51
  const state = await loadReviewState(forge, log);
56
52
  if (!state.enrolled) {
57
- // Enrollment can end while an agent approval is live (base retarget,
58
- // owned files dropped); dismiss it instead of leaving it counting
59
- // toward branch protection under a policy that never granted it.
53
+ // Enrollment can end while an agent approval is live; dismiss it
54
+ // instead of leaving it counting toward branch protection.
60
55
  return {
61
56
  task: () =>
62
57
  dismissStaleApprovals(
@@ -69,14 +64,10 @@ export default githubChannel({
69
64
  auth: defaultGitHubAuth(ctx),
70
65
  message: renderReviewWake(state),
71
66
  title: `Review ${ctx.repository.fullName}#${pr.number}`,
72
- // Freeze the assessed head host-side: record_review reads this file
73
- // instead of trusting a model-supplied SHA, so a mid-turn push (or a
74
- // prompt-injected SHA) can never line up with the live head.
75
67
  workspaceFiles: { "pr/head.sha": state.pr.headSha },
76
68
  };
77
69
  } catch (error) {
78
70
  if (error instanceof AgenticOwnersConfigValidationError) {
79
- // Fail closed but visibly: comment the issues, review nothing.
80
71
  return { task: () => reportPolicyError(forge, error) };
81
72
  }
82
73
  throw error;
@@ -1,11 +1,3 @@
1
- /**
2
- * The one file to edit: which GitHub repositories the agent reviews.
3
- *
4
- * Setting it streams PR events and a repo-scoped GitHub credential through
5
- * your signed-in Cursor account (`agent-sdk login`) — no webhook or GitHub
6
- * App setup. While empty, the agent still runs locally against replayed
7
- * PRs (`agent-sdk github replay <pr-url>`).
8
- */
9
1
  const config = {
10
2
  repos: [] as string[], // e.g. ["acme/api"]
11
3
  };
@@ -1,8 +1,5 @@
1
- // Policy resolution and actuation over the GitHub API no repo checkout.
2
- // Every trusted input (policy files, rule prompts) is read from the PR's
3
- // **base ref**, so a PR cannot exempt itself by editing its own governance
4
- // files. Mirrors the Agentic Owners pipeline's `resolvePolicyForPr`, minus
5
- // the linguist-generated partition and content caching.
1
+ // Policy files and rule prompts are read from the PR's base ref so a PR
2
+ // cannot exempt itself by editing its own governance files.
6
3
 
7
4
  import {
8
5
  decideApproval,
@@ -297,12 +294,6 @@ export async function loadReviewState(
297
294
  };
298
295
  }
299
296
 
300
- /**
301
- * The model turn's wake message: composed rubric, PR context, and the
302
- * host-fetched diff. Fenced so author-controlled patch bytes cannot escape
303
- * into the trusted markdown (the fence outruns any backtick run inside the
304
- * patch).
305
- */
306
297
  /**
307
298
  * Filenames are author-controlled and render outside the diff fence: strip
308
299
  * control characters and backticks so a hostile path cannot fabricate
@@ -648,9 +639,6 @@ export async function actuateReview(input: {
648
639
  }).filter(
649
640
  (handle) => normalizeHandle(handle) !== normalizeHandle(pr.authorLogin ?? "")
650
641
  );
651
- // The full decision — policy verdict plus the governance / evidence
652
- // fail-closes — is computed in one place; from here on this function
653
- // only writes.
654
642
  const decision = decideApproval({
655
643
  matchedRules: state.matchedRules,
656
644
  riskLevel: verdict.riskLevel,
@@ -742,7 +730,6 @@ export async function actuateReview(input: {
742
730
  const alreadyRequested = new Set(
743
731
  pr.requestedReviewers.map(normalizeHandle)
744
732
  );
745
- // Adds fill only the remaining slots under the max-of-two rule.
746
733
  const newReviewers = decision.requestReviewers
747
734
  .filter((handle) => !alreadyRequested.has(normalizeHandle(handle)))
748
735
  .slice(
@@ -41,10 +41,8 @@ export default defineTool({
41
41
  "not a GitHub pull-request session — reviews start from the github channel (agent-sdk github replay <pr-url> to test locally)",
42
42
  };
43
43
  }
44
- // The channel wake froze the assessed head into the session workspace.
45
- // Reading it here (instead of accepting a model-supplied SHA) means a
46
- // mid-turn push can never line up with the live head: the actuation
47
- // compares wake-observed against live and skips on any mismatch.
44
+ // Wake froze the assessed head into the session workspace. A model-supplied
45
+ // SHA is never trusted.
48
46
  let assessedHeadSha: string;
49
47
  try {
50
48
  assessedHeadSha = (
@@ -1,18 +1,8 @@
1
- import { homedir } from "node:os";
2
- import { join } from "node:path";
3
1
  import { defineAgent } from "@cursor/july";
4
2
 
5
3
  export default defineAgent({
6
- model: {
7
- id: "grok-4.5",
8
- params: [
9
- { id: "effort", value: "high" },
10
- { id: "fast", value: "true" },
11
- ],
12
- },
13
4
  tools: ["read", "grep"],
14
5
  local: {
15
6
  sandbox: true,
16
- cwd: join(homedir(), ".cache", "agent-serve", "demo"),
17
7
  },
18
8
  });
@@ -34,8 +34,6 @@ enables auto-merge, or force-pushes.
34
34
  GitHub wakes (`cursorAccount`) resume an already-driven PR on comment,
35
35
  review, and failing CI. They do not start a session on `pull_request.opened`.
36
36
 
37
- Affinity and the webhook buffer live in `host.kv` (`agent/storage.ts`).
38
-
39
37
  ## Files to edit
40
38
 
41
39
  - `agent/lib/repos.ts`: repos Cursor relays SCM events for
@@ -1,19 +1,8 @@
1
- import { homedir } from "node:os";
2
- import { join } from "node:path";
3
1
  import { defineAgent } from "@cursor/july";
4
2
 
5
3
  export default defineAgent({
6
- model: {
7
- id: "grok-4.5",
8
- params: [
9
- { id: "effort", value: "high" },
10
- { id: "fast", value: "true" },
11
- ],
12
- },
13
- runtime: "local",
14
4
  local: {
15
5
  sandbox: true,
16
- cwd: join(homedir(), ".cache", "agent-serve", "pr-autofixer"),
17
6
  },
18
7
  cloud: {
19
8
  env: { type: "cloud" },
@@ -1,8 +1,7 @@
1
1
  import { slackChannel } from "@cursor/july/channels/slack";
2
2
 
3
3
  export default slackChannel({
4
- cursorAccount: true,
5
- agentName: "PrAutofixer",
4
+ envPrefix: "PR_AUTOFIXER",
6
5
  suggestedPromptsTitle: "Try asking",
7
6
  suggestedPrompts: [
8
7
  {
@@ -9,37 +9,25 @@ const PR_STATE_QUERY = `
9
9
  }
10
10
  `;
11
11
 
12
- export async function queryPullRequest<T>(input: {
12
+ export async function fetchPrState(input: {
13
13
  github: HostGitHubClient;
14
14
  pr: GithubPrRef;
15
- query: string;
16
- }): Promise<T | undefined> {
15
+ }): Promise<string | undefined> {
17
16
  try {
18
17
  const octokit = await input.github.getOctokit();
19
18
  const data = await octokit.graphql<{
20
- repository?: { pullRequest?: T | null } | null;
21
- }>(input.query, {
19
+ repository?: { pullRequest?: { state?: string } | null } | null;
20
+ }>(PR_STATE_QUERY, {
22
21
  owner: input.pr.owner,
23
22
  repo: input.pr.repo,
24
23
  number: input.pr.number,
25
24
  });
26
- return data.repository?.pullRequest ?? undefined;
25
+ return data.repository?.pullRequest?.state;
27
26
  } catch {
28
27
  return undefined;
29
28
  }
30
29
  }
31
30
 
32
- export async function fetchPrState(input: {
33
- github: HostGitHubClient;
34
- pr: GithubPrRef;
35
- }): Promise<string | undefined> {
36
- const node = await queryPullRequest<{ state?: string }>({
37
- ...input,
38
- query: PR_STATE_QUERY,
39
- });
40
- return node?.state;
41
- }
42
-
43
31
  export function isTerminalPrState(
44
32
  state: string | undefined
45
33
  ): state is "CLOSED" | "MERGED" {
@@ -1,4 +1,3 @@
1
- /** Repos Cursor relays SCM events for. Replace with your `owner/repo` list. */
2
1
  export const GITHUB_REPOS: readonly string[] = ["owner/repo"];
3
2
 
4
3
  export function githubRepos(): readonly string[] {
@@ -1,6 +1,6 @@
1
1
  # Security help
2
2
 
3
- Answers security questions in Slack from your FAQ files and takes a first
3
+ Answers security questions in Slack from your skills and takes a first
4
4
  look when someone pastes a GitHub pull request.
5
5
 
6
6
  ```bash
@@ -27,7 +27,7 @@ one in the playground.
27
27
 
28
28
  - `agent/lib/repos.ts`: repos it may read
29
29
  - `agent/channels/slack.ts`: channel ids to watch (`watch`)
30
- - `agent/knowledge/faq/`: answers for your company
30
+ - `agent/skills/faq.md`: answers for your company
31
31
  - `agent/skills/`: how to look at a PR, a leak, or an access ask
32
32
  - `agent/instructions.md`: routing
33
33
 
@@ -2,8 +2,7 @@ import { defineAgent } from "@cursor/july";
2
2
 
3
3
  export default defineAgent({
4
4
  name: "Security Help",
5
- description:
6
- "Answers security questions in Slack and takes a first look at a GitHub pull request.",
5
+ // Not DEFAULT_MODEL (grok-4.5).
7
6
  model: {
8
7
  id: "grok-4.6",
9
8
  params: [
@@ -56,9 +56,6 @@ const handleSlack: SlackMessageHandler = async (ctx, message) => {
56
56
 
57
57
  export default slackChannel({
58
58
  envPrefix: "SECURITY_HELP",
59
- policy: {
60
- blockExternals: true,
61
- },
62
59
  engagement: {
63
60
  channelPosts:
64
61
  watch.length === 0
@@ -1,20 +1,19 @@
1
1
  # Security help
2
2
 
3
- Answer security questions in Slack from the FAQ and skills.
3
+ Answer security questions in Slack from the skills.
4
4
  If you do not know, say so and ask a human.
5
5
 
6
- Open the skill or FAQ for the ask. Those files are under `agent/skills/` and `agent/knowledge/faq/`.
6
+ Open the skill for the ask.
7
7
 
8
- | If the ask is about | Open |
8
+ | If the ask is about | Skill |
9
9
  | --- | --- |
10
- | A GitHub pull request | `agent/skills/security-pr-first-pass.md` |
11
- | An access request | `agent/skills/access-request.md` |
12
- | A leak, alert, or incident | `agent/skills/security-playbooks.md` |
13
- | Who can approve, privacy, or policy | `agent/knowledge/faq/approvals.md` |
14
- | Phishing text, email, or a call | `agent/knowledge/faq/phishing.md` |
15
- | Which team or channel owns a request | `agent/knowledge/faq/channels.md` |
16
- | Another security question | `agent/skills/security-first-pass.md` |
10
+ | A GitHub pull request | security-pr-first-pass |
11
+ | An access request | access-request |
12
+ | A leak, alert, or incident | security-playbooks |
13
+ | Who can approve, privacy, phishing, or which channel | faq |
17
14
 
18
15
  A pull request earlier in the thread is not this one.
19
16
 
17
+ If this looks like production secrets out, an exploit, customer data out, malware, or an account takeover, they should stop it now and wait for a human.
18
+
20
19
  If you say an incident is over or a system is safe, show why. Looking at a pull request is not that.
@@ -4,7 +4,7 @@ description: use when Slack has an access request or request number
4
4
 
5
5
  # Access request
6
6
 
7
- This skill is the access request. SaaS or identity-group asks go to the team named in `agent/knowledge/faq/channels.md`.
7
+ This skill is the access request. SaaS or identity-group asks go to the team named in faq.
8
8
 
9
9
  Say what they asked for, why, and how long it lasts, from the request.
10
10
  Do not invent a grant that is not on the request.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: use for company answers on approvals, phishing, and which channel owns a request
3
+ ---
4
+
5
+ # Company FAQ
6
+
7
+ If a section does not name an owner or team, say you do not know and ask a human.
8
+
9
+ ## Approvals
10
+
11
+ Who can say yes depends on the request. If this file does not name an owner, ask a human for that topic.
12
+
13
+ Privacy questions (training, retention, where prompts sit) go to a privacy or security person.
14
+
15
+ ## Channels
16
+
17
+ `#security` is for security questions and phishing reports.
18
+
19
+ Name the channel that owns SaaS access, identity groups, laptops, and billing.
20
+ Until you do, say you do not know which team owns that request.
21
+
22
+ ## Phishing
23
+
24
+ `#security` is where phishing and unexpected texts, emails, or calls go.
25
+ If the thread is already about that, keep it there.
26
+
27
+ Leave the original message alone. Do not reply, click, or send a 2FA code on it.
28
+ Confirm unknown texts or calls over Slack or in person before acting.
29
+
30
+ If an account looks compromised, they should lock it now and wait for a human.
31
+ If security already gave a verdict in-thread, follow that.
@@ -6,7 +6,7 @@ description: use when Slack looks like a leak, alert, access, privacy, or incide
6
6
 
7
7
  If a production secret is already out, revoke or rotate it at the place that issued it, or turn it off there.
8
8
 
9
- For other alerts, follow the FAQ or runbook under `agent/knowledge/`.
9
+ For other alerts, follow faq.
10
10
  Do not call it safe without a human.
11
11
 
12
12
  If you cannot see who is affected, skip that.
@@ -8,8 +8,7 @@
8
8
  "dev": "agent-sdk dev"
9
9
  },
10
10
  "dependencies": {
11
- "@cursor/july": "latest",
12
- "zod": "^3.25.0"
11
+ "@cursor/july": "latest"
13
12
  },
14
13
  "devDependencies": {
15
14
  "@types/node": "^22.14.0",
@@ -1,18 +1,8 @@
1
- import { homedir } from "node:os";
2
- import { join } from "node:path";
3
1
  import { defineAgent } from "@cursor/july";
4
2
 
5
3
  export default defineAgent({
6
- model: {
7
- id: "grok-4.5",
8
- params: [
9
- { id: "effort", value: "high" },
10
- { id: "fast", value: "true" },
11
- ],
12
- },
13
4
  tools: ["read", "grep"],
14
5
  local: {
15
6
  sandbox: true,
16
- cwd: join(homedir(), ".cache", "agent-serve", "security-reviewer"),
17
7
  },
18
8
  });
@@ -43,4 +43,5 @@ on both issues. `agent-sdk eval` classifies and skips tracker writes.
43
43
  - `agent/instructions.md`: procedure around the rubric
44
44
  - `evals/triage.eval.ts`: three smoke cases
45
45
 
46
- `agent/lib/actuate.ts` talks to the tracker. The connection is host-only.
46
+ `agent/lib/actuate.ts` talks to the tracker. Writes go through
47
+ `record_triage` so the host owns comments, priority, and duplicate links.
@@ -1,18 +1,8 @@
1
- import { homedir } from "node:os";
2
- import { join } from "node:path";
3
1
  import { defineAgent } from "@cursor/july";
4
2
 
5
3
  export default defineAgent({
6
- model: {
7
- id: "grok-4.5",
8
- params: [
9
- { id: "effort", value: "high" },
10
- { id: "fast", value: "true" },
11
- ],
12
- },
13
4
  tools: ["read", "grep", "glob", "ls"],
14
5
  local: {
15
6
  sandbox: true,
16
- cwd: join(homedir(), ".cache", "agent-serve", "triage"),
17
7
  },
18
8
  });