@cursor/july 0.1.111 → 0.1.113

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 (441) hide show
  1. package/README.md +4 -0
  2. package/dist/bin/agent-serve.js +20 -4
  3. package/dist/channels/checks.d.ts +10 -0
  4. package/dist/channels/checks.d.ts.map +1 -1
  5. package/dist/channels/github/github-channel.d.ts +29 -19
  6. package/dist/channels/github/github-channel.d.ts.map +1 -1
  7. package/dist/channels/github/github-channel.js +29 -19
  8. package/dist/channels/origin/checks.d.ts +1 -1
  9. package/dist/channels/origin/checks.d.ts.map +1 -1
  10. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
  11. package/dist/channels/slack/agentic-delivery.js +2 -0
  12. package/dist/channels/slack/dispatch.d.ts +11 -1
  13. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  14. package/dist/channels/slack/dispatch.js +146 -39
  15. package/dist/channels/slack/placeholder.d.ts +26 -0
  16. package/dist/channels/slack/placeholder.d.ts.map +1 -1
  17. package/dist/channels/slack/placeholder.js +28 -0
  18. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  19. package/dist/channels/slack/slack-channel.js +9 -16
  20. package/dist/docs/404.html +2 -2
  21. package/dist/docs/assets/{app.Drol6mi6.js → app.CAeK13eM.js} +4 -4
  22. package/dist/docs/assets/building-with-agents.md.BBCx0AUo.js +9 -0
  23. package/dist/docs/assets/building-with-agents.md.BBCx0AUo.lean.js +1 -0
  24. package/dist/docs/assets/chunks/@localSearchIndexroot.Ck9E52Ls.js +1 -0
  25. package/dist/docs/assets/chunks/{VPLocalSearchBox.CdqoBZJX.js → VPLocalSearchBox.C9LbPHod.js} +1 -1
  26. package/dist/docs/assets/chunks/{arc.BVX3ycTn.js → arc.CmMq2zmS.js} +1 -1
  27. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CcChnMxX.js → architectureDiagram-Q4EWVU46.CCXB8Uj5.js} +1 -1
  28. package/dist/docs/assets/chunks/{baseUniq.xwtXO-yt.js → baseUniq.CyQo6eLe.js} +1 -1
  29. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.CijZ_taK.js → blockDiagram-DXYQGD6D.JYq6w91N.js} +1 -1
  30. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.0FBvwBvK.js → c4Diagram-AHTNJAMY.BRV8GPJJ.js} +1 -1
  31. package/dist/docs/assets/chunks/channel.BHiYmnZ4.js +1 -0
  32. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CELMmMDA.js → chunk-4BX2VUAB.Bv4ooYQR.js} +1 -1
  33. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.C4bhFtSm.js → chunk-4TB4RGXK.t4JtKPcj.js} +1 -1
  34. package/dist/docs/assets/chunks/{chunk-55IACEB6.ZnQ9gRRQ.js → chunk-55IACEB6.34lCHj9Y.js} +1 -1
  35. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DPlmglG-.js → chunk-EDXVE4YY.BSwrPNrt.js} +1 -1
  36. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.BrUk8pff.js → chunk-FMBD7UC4.Beeun-R-.js} +1 -1
  37. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CcmWIncu.js → chunk-OYMX7WX6.BUUFUcJc.js} +1 -1
  38. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.D65-cs8I.js → chunk-QZHKN3VN.B2XjHzN_.js} +1 -1
  39. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.qoXZpG9F.js → chunk-YZCP3GAM.CLYG8znk.js} +1 -1
  40. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.Degh8l90.js +1 -0
  41. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.Degh8l90.js +1 -0
  42. package/dist/docs/assets/chunks/clone.BIywbczV.js +1 -0
  43. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.8rYtqudO.js → cose-bilkent-S5V4N54A.DVEa6fZp.js} +1 -1
  44. package/dist/docs/assets/chunks/{dagre-KV5264BT.DrRP1fOh.js → dagre-KV5264BT.C9PZQK-S.js} +1 -1
  45. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DHj_xA2_.js → diagram-5BDNPKRD.DoN0uv3Y.js} +1 -1
  46. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.Bz_6nAKj.js → diagram-G4DWMVQ6.Czv3duqx.js} +1 -1
  47. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BWA0xSW9.js → diagram-MMDJMWI5.BinJ5kWb.js} +1 -1
  48. package/dist/docs/assets/chunks/{diagram-TYMM5635.CpTJLNJI.js → diagram-TYMM5635.DW326M4K.js} +1 -1
  49. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.-7AWWSrP.js → erDiagram-SMLLAGMA.U2pR_OA7.js} +1 -1
  50. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BTnQ742_.js → flowDiagram-DWJPFMVM.ByWJXeYK.js} +1 -1
  51. package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
  52. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.B5_HiiQ5.js → ganttDiagram-T4ZO3ILL.OquF0Rtg.js} +1 -1
  53. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CZcNTFZd.js → gitGraphDiagram-UUTBAWPF.Bpn01P7X.js} +1 -1
  54. package/dist/docs/assets/chunks/{graph.V2GLaab4.js → graph.CNRB6ETL.js} +1 -1
  55. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.7pZOkCCU.js → infoDiagram-42DDH7IO.CqhknMWi.js} +1 -1
  56. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DSMo3Qa3.js → ishikawaDiagram-UXIWVN3A.C6xpR2af.js} +1 -1
  57. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BNEgWN1S.js → journeyDiagram-VCZTEJTY.Cg5f7oB3.js} +1 -1
  58. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.B-4d4tC7.js → kanban-definition-6JOO6SKY.Cx9YTwlU.js} +1 -1
  59. package/dist/docs/assets/chunks/{layout.Dvbn9nSb.js → layout.ljS-wFtK.js} +1 -1
  60. package/dist/docs/assets/chunks/{linear.D2GM4p4b.js → linear.jSxNrsFC.js} +1 -1
  61. package/dist/docs/assets/chunks/{min.DVBtLK-B.js → min.Cum8AlQw.js} +1 -1
  62. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.CnJRI55x.js → mindmap-definition-QFDTVHPH.BLiysLpe.js} +1 -1
  63. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.CtoaTFlA.js → pieDiagram-DEJITSTG.BoIDyuKF.js} +1 -1
  64. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DtT24_vN.js → quadrantDiagram-34T5L4WZ.DLkpDytR.js} +1 -1
  65. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CjSO4o8f.js → requirementDiagram-MS252O5E.DqTVqSu2.js} +1 -1
  66. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.-wWiIVWa.js → sankeyDiagram-XADWPNL6.CG_6FF7j.js} +1 -1
  67. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.DSk8s4gX.js → sequenceDiagram-FGHM5R23.BIp9602K.js} +1 -1
  68. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BFKAsdkN.js → stateDiagram-FHFEXIEX.COSXsD9I.js} +1 -1
  69. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.qrxrbFsX.js +1 -0
  70. package/dist/docs/assets/chunks/{theme.C0MctGaz.js → theme.CXJ7PNwy.js} +2 -2
  71. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.TUNJbAFe.js → timeline-definition-GMOUNBTQ.CXdVqkLq.js} +1 -1
  72. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.C-RGNnk4.js → vennDiagram-DHZGUBPP.CZxGuc4r.js} +1 -1
  73. package/dist/docs/assets/chunks/{wardley-RL74JXVD.g5efOWmT.js → wardley-RL74JXVD.3oVgfqQk.js} +1 -1
  74. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DH4zt73Y.js → wardleyDiagram-NUSXRM2D.6_irCgGJ.js} +1 -1
  75. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.B-3k6bF6.js → xychartDiagram-5P7HB3ND.TRPe92m3.js} +1 -1
  76. package/dist/docs/assets/deployment.md.D2jQZuFx.js +32 -0
  77. package/dist/docs/assets/deployment.md.D2jQZuFx.lean.js +1 -0
  78. package/dist/docs/assets/evals.md.D3Y3Aixt.js +72 -0
  79. package/dist/docs/assets/evals.md.D3Y3Aixt.lean.js +1 -0
  80. package/dist/docs/assets/guides_agent-to-agent.md.CD4T5FIl.js +41 -0
  81. package/dist/docs/assets/guides_agent-to-agent.md.CD4T5FIl.lean.js +1 -0
  82. package/dist/docs/assets/guides_bitbucket.md.mpevW-VP.js +145 -0
  83. package/dist/docs/assets/guides_bitbucket.md.mpevW-VP.lean.js +1 -0
  84. package/dist/docs/assets/guides_cloud-agents.md.Cp1O3u-X.js +15 -0
  85. package/dist/docs/assets/guides_cloud-agents.md.Cp1O3u-X.lean.js +1 -0
  86. package/dist/docs/assets/guides_convert-automation.md.CqEyfP6Y.js +43 -0
  87. package/dist/docs/assets/guides_convert-automation.md.CqEyfP6Y.lean.js +1 -0
  88. package/dist/docs/assets/guides_github.md.BwpBp3ed.js +156 -0
  89. package/dist/docs/assets/guides_github.md.BwpBp3ed.lean.js +1 -0
  90. package/dist/docs/assets/guides_gitlab.md.DaEC3nMk.js +153 -0
  91. package/dist/docs/assets/guides_gitlab.md.DaEC3nMk.lean.js +1 -0
  92. package/dist/docs/assets/guides_grokbot-agents.md.CMhZNdEU.js +16 -0
  93. package/dist/docs/assets/guides_grokbot-agents.md.CMhZNdEU.lean.js +1 -0
  94. package/dist/docs/assets/guides_improve.md.Bnp4F99w.js +22 -0
  95. package/dist/docs/assets/guides_improve.md.Bnp4F99w.lean.js +1 -0
  96. package/dist/docs/assets/guides_jev.md.F5fAkkfN.js +189 -0
  97. package/dist/docs/assets/guides_jev.md.F5fAkkfN.lean.js +1 -0
  98. package/dist/docs/assets/guides_mcp-oauth.md.bSFakfCY.js +50 -0
  99. package/dist/docs/assets/guides_mcp-oauth.md.bSFakfCY.lean.js +1 -0
  100. package/dist/docs/assets/guides_opentelemetry.md.BKDxQmmd.js +35 -0
  101. package/dist/docs/assets/guides_opentelemetry.md.BKDxQmmd.lean.js +1 -0
  102. package/dist/docs/assets/guides_slack.md.Bo96y42E.js +70 -0
  103. package/dist/docs/assets/guides_slack.md.Bo96y42E.lean.js +1 -0
  104. package/dist/docs/assets/guides_webhooks.md.1A72_VEE.js +92 -0
  105. package/dist/docs/assets/guides_webhooks.md.1A72_VEE.lean.js +1 -0
  106. package/dist/docs/assets/hillclimbing.md.D4E1o5Sa.js +7 -0
  107. package/dist/docs/assets/hillclimbing.md.D4E1o5Sa.lean.js +1 -0
  108. package/dist/docs/assets/{index.md.BFVyY2KT.js → index.md.C-t81M5J.js} +2 -2
  109. package/dist/docs/assets/{index.md.BFVyY2KT.lean.js → index.md.C-t81M5J.lean.js} +1 -1
  110. package/dist/docs/assets/{quickstart.md.D3MjSZN-.js → quickstart.md.DAvVhuuU.js} +1 -1
  111. package/dist/docs/assets/{quickstart.md.D3MjSZN-.lean.js → quickstart.md.DAvVhuuU.lean.js} +1 -1
  112. package/dist/docs/assets/{reference_agent-config.md.CfVA-LZJ.js → reference_agent-config.md.DGPyw7ms.js} +1 -1
  113. package/dist/docs/assets/{reference_agent-config.md.CfVA-LZJ.lean.js → reference_agent-config.md.DGPyw7ms.lean.js} +1 -1
  114. package/dist/docs/assets/{reference_artifacts.md.Vf7qyIZ-.js → reference_artifacts.md.Bu_4HmsD.js} +1 -1
  115. package/dist/docs/assets/{reference_artifacts.md.Vf7qyIZ-.lean.js → reference_artifacts.md.Bu_4HmsD.lean.js} +1 -1
  116. package/dist/docs/assets/{reference_channels.md.icqLKcTc.js → reference_channels.md.nFWbzAic.js} +1 -1
  117. package/dist/docs/assets/{reference_channels.md.icqLKcTc.lean.js → reference_channels.md.nFWbzAic.lean.js} +1 -1
  118. package/dist/docs/assets/{reference_cli.md.B2dBL6L8.js → reference_cli.md.DLWDz9ij.js} +3 -1
  119. package/dist/docs/assets/{reference_cli.md.B2dBL6L8.lean.js → reference_cli.md.DLWDz9ij.lean.js} +1 -1
  120. package/dist/docs/assets/{reference_connections.md.Cb3U_c8n.js → reference_connections.md.Je9dMsdd.js} +2 -2
  121. package/dist/docs/assets/{reference_connections.md.Cb3U_c8n.lean.js → reference_connections.md.Je9dMsdd.lean.js} +1 -1
  122. package/dist/docs/assets/reference_evals.md.DNJzM_yf.js +57 -0
  123. package/dist/docs/assets/reference_evals.md.DNJzM_yf.lean.js +1 -0
  124. package/dist/docs/assets/reference_extensions.md.Cv5aLCz_.js +58 -0
  125. package/dist/docs/assets/reference_extensions.md.Cv5aLCz_.lean.js +1 -0
  126. package/dist/docs/assets/{reference_hooks.md.CZuynAxj.js → reference_hooks.md.B7uzNENk.js} +2 -2
  127. package/dist/docs/assets/{reference_hooks.md.CZuynAxj.lean.js → reference_hooks.md.B7uzNENk.lean.js} +1 -1
  128. package/dist/docs/assets/{reference_http-api.md.DTKcYE6L.js → reference_http-api.md.CduHavZ2.js} +1 -1
  129. package/dist/docs/assets/{reference_http-api.md.DTKcYE6L.lean.js → reference_http-api.md.CduHavZ2.lean.js} +1 -1
  130. package/dist/docs/assets/{reference_instructions.md.D7gkckK-.js → reference_instructions.md.CU1My5My.js} +1 -1
  131. package/dist/docs/assets/{reference_instructions.md.D7gkckK-.lean.js → reference_instructions.md.CU1My5My.lean.js} +1 -1
  132. package/dist/docs/assets/{reference_playground.md.D2YExv5K.js → reference_playground.md.Ch2d0Iqi.js} +1 -1
  133. package/dist/docs/assets/{reference_playground.md.D2YExv5K.lean.js → reference_playground.md.Ch2d0Iqi.lean.js} +1 -1
  134. package/dist/docs/assets/{reference_project-layout.md.DPxbUJyt.js → reference_project-layout.md.BGhgpy9V.js} +1 -1
  135. package/dist/docs/assets/{reference_project-layout.md.DPxbUJyt.lean.js → reference_project-layout.md.BGhgpy9V.lean.js} +1 -1
  136. package/dist/docs/assets/{reference_prompt.md.BQ5uAv1F.js → reference_prompt.md.Ccp0R53H.js} +1 -1
  137. package/dist/docs/assets/{reference_prompt.md.BQ5uAv1F.lean.js → reference_prompt.md.Ccp0R53H.lean.js} +1 -1
  138. package/dist/docs/assets/{reference_schedules.md.BasfZWO-.js → reference_schedules.md.B2Nm6FaD.js} +1 -1
  139. package/dist/docs/assets/{reference_schedules.md.BasfZWO-.lean.js → reference_schedules.md.B2Nm6FaD.lean.js} +1 -1
  140. package/dist/docs/assets/{reference_sessions.md.YKvIsWAx.js → reference_sessions.md.1_6Vyv7x.js} +1 -1
  141. package/dist/docs/assets/{reference_sessions.md.YKvIsWAx.lean.js → reference_sessions.md.1_6Vyv7x.lean.js} +1 -1
  142. package/dist/docs/assets/{reference_skills.md.rNgpsGd0.js → reference_skills.md.DjQkRefx.js} +1 -1
  143. package/dist/docs/assets/{reference_skills.md.rNgpsGd0.lean.js → reference_skills.md.DjQkRefx.lean.js} +1 -1
  144. package/dist/docs/assets/{reference_subagents.md.e5qitjJt.js → reference_subagents.md.Dl16gcBj.js} +2 -2
  145. package/dist/docs/assets/{reference_subagents.md.e5qitjJt.lean.js → reference_subagents.md.Dl16gcBj.lean.js} +1 -1
  146. package/dist/docs/assets/{reference_tools.md.BdCO2aHZ.js → reference_tools.md.B1dH1lpa.js} +3 -3
  147. package/dist/docs/assets/{reference_tools.md.BdCO2aHZ.lean.js → reference_tools.md.B1dH1lpa.lean.js} +1 -1
  148. package/dist/docs/assets/{templates_agentic-owners.md.Da_AGDlH.js → templates_agentic-owners.md.9M575F5C.js} +1 -1
  149. package/dist/docs/assets/{templates_agentic-owners.md.Da_AGDlH.lean.js → templates_agentic-owners.md.9M575F5C.lean.js} +1 -1
  150. package/dist/docs/assets/{templates_pr-autofixer.md.DqxocIGh.js → templates_pr-autofixer.md.ws0DDXDy.js} +1 -1
  151. package/dist/docs/assets/{templates_pr-autofixer.md.DqxocIGh.lean.js → templates_pr-autofixer.md.ws0DDXDy.lean.js} +1 -1
  152. package/dist/docs/assets/{templates_security-reviewer.md.Bhnvd8VE.js → templates_security-reviewer.md.KEFYXzfK.js} +1 -1
  153. package/dist/docs/assets/{templates_security-reviewer.md.Bhnvd8VE.lean.js → templates_security-reviewer.md.KEFYXzfK.lean.js} +1 -1
  154. package/dist/docs/assets/templates_thermo-quality-review.md.VNJ_mohX.js +3 -0
  155. package/dist/docs/assets/templates_thermo-quality-review.md.VNJ_mohX.lean.js +1 -0
  156. package/dist/docs/assets/templates_thermo-review.md.Hi3zWOkP.js +3 -0
  157. package/dist/docs/assets/templates_thermo-review.md.Hi3zWOkP.lean.js +1 -0
  158. package/dist/docs/assets/{templates_triage.md.BdBWO9Ic.js → templates_triage.md.CVGe_FG6.js} +1 -1
  159. package/dist/docs/assets/{templates_triage.md.BdBWO9Ic.lean.js → templates_triage.md.CVGe_FG6.lean.js} +1 -1
  160. package/dist/docs/assets/troubleshooting.md.mnfFG2Em.js +1 -0
  161. package/dist/docs/assets/troubleshooting.md.mnfFG2Em.lean.js +1 -0
  162. package/dist/docs/building-with-agents.html +44 -48
  163. package/dist/docs/building-with-agents.md +94 -82
  164. package/dist/docs/deployment.html +59 -78
  165. package/dist/docs/deployment.md +117 -363
  166. package/dist/docs/evals.html +85 -224
  167. package/dist/docs/evals.md +149 -673
  168. package/dist/docs/guides/agent-to-agent.html +74 -47
  169. package/dist/docs/guides/agent-to-agent.md +128 -46
  170. package/dist/docs/guides/bitbucket.html +179 -44
  171. package/dist/docs/guides/bitbucket.md +249 -48
  172. package/dist/docs/guides/cloud-agents.html +46 -40
  173. package/dist/docs/guides/cloud-agents.md +119 -66
  174. package/dist/docs/guides/convert-automation.html +80 -49
  175. package/dist/docs/guides/convert-automation.md +156 -147
  176. package/dist/docs/guides/github.html +184 -92
  177. package/dist/docs/guides/github.md +260 -245
  178. package/dist/docs/guides/gitlab.html +184 -45
  179. package/dist/docs/guides/gitlab.md +249 -50
  180. package/dist/docs/guides/grokbot-agents.html +48 -41
  181. package/dist/docs/guides/grokbot-agents.md +99 -53
  182. package/dist/docs/guides/improve.html +48 -40
  183. package/dist/docs/guides/improve.md +111 -58
  184. package/dist/docs/guides/jev.html +248 -0
  185. package/dist/docs/guides/jev.md +348 -0
  186. package/dist/docs/guides/mcp-oauth.html +74 -52
  187. package/dist/docs/guides/mcp-oauth.md +111 -121
  188. package/dist/docs/guides/opentelemetry.html +63 -54
  189. package/dist/docs/guides/opentelemetry.md +96 -165
  190. package/dist/docs/guides/slack.html +83 -59
  191. package/dist/docs/guides/slack.md +157 -227
  192. package/dist/docs/guides/webhooks.html +97 -230
  193. package/dist/docs/guides/webhooks.md +154 -385
  194. package/dist/docs/hashmap.json +1 -1
  195. package/dist/docs/hillclimbing.html +44 -38
  196. package/dist/docs/hillclimbing.md +101 -55
  197. package/dist/docs/index.html +38 -38
  198. package/dist/docs/index.md +2 -0
  199. package/dist/docs/llms-full.txt +3490 -3146
  200. package/dist/docs/llms.txt +22 -18
  201. package/dist/docs/quickstart.html +37 -37
  202. package/dist/docs/reference/agent-config.html +37 -37
  203. package/dist/docs/reference/artifacts.html +38 -38
  204. package/dist/docs/reference/channels.html +37 -37
  205. package/dist/docs/reference/cli.html +39 -37
  206. package/dist/docs/reference/cli.md +2 -0
  207. package/dist/docs/reference/connections.html +38 -38
  208. package/dist/docs/reference/connections.md +1 -1
  209. package/dist/docs/reference/evals.html +116 -0
  210. package/dist/docs/reference/evals.md +293 -0
  211. package/dist/docs/reference/extensions.html +80 -84
  212. package/dist/docs/reference/extensions.md +131 -202
  213. package/dist/docs/reference/hooks.html +39 -39
  214. package/dist/docs/reference/hooks.md +34 -34
  215. package/dist/docs/reference/http-api.html +37 -37
  216. package/dist/docs/reference/instructions.html +37 -37
  217. package/dist/docs/reference/playground.html +37 -37
  218. package/dist/docs/reference/project-layout.html +37 -37
  219. package/dist/docs/reference/prompt.html +37 -37
  220. package/dist/docs/reference/schedules.html +37 -37
  221. package/dist/docs/reference/sessions.html +37 -37
  222. package/dist/docs/reference/skills.html +37 -37
  223. package/dist/docs/reference/subagents.html +38 -38
  224. package/dist/docs/reference/subagents.md +1 -1
  225. package/dist/docs/reference/tools.html +38 -38
  226. package/dist/docs/reference/tools.md +4 -0
  227. package/dist/docs/templates/agentic-owners.html +38 -38
  228. package/dist/docs/templates/pr-autofixer.html +37 -37
  229. package/dist/docs/templates/security-reviewer.html +38 -38
  230. package/dist/docs/templates/thermo-quality-review.html +62 -0
  231. package/dist/docs/templates/thermo-quality-review.md +75 -0
  232. package/dist/docs/templates/thermo-review.html +62 -0
  233. package/dist/docs/templates/thermo-review.md +74 -0
  234. package/dist/docs/templates/triage.html +37 -37
  235. package/dist/docs/troubleshooting.html +38 -38
  236. package/dist/docs/troubleshooting.md +97 -66
  237. package/dist/extensions/cursor-cloud-agents/skills/handoff.md +3 -7
  238. package/dist/extensions/improve/extension.d.ts +3 -1
  239. package/dist/extensions/improve/extension.d.ts.map +1 -1
  240. package/dist/extensions/improve/extension.js +4 -2
  241. package/dist/extensions/improve/skills/yourself.js +1 -1
  242. package/dist/extensions/jev/extension.d.ts +43 -0
  243. package/dist/extensions/jev/extension.d.ts.map +1 -0
  244. package/dist/extensions/jev/extension.js +47 -0
  245. package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
  246. package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
  247. package/dist/extensions/jev/lib/evaluate.js +167 -0
  248. package/dist/extensions/jev/skills/gated-write.md +25 -0
  249. package/dist/extensions/jev/skills/questions.md +33 -0
  250. package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
  251. package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
  252. package/dist/extensions/jev/tools/evaluate.js +88 -0
  253. package/dist/extensions.d.ts +1 -1
  254. package/dist/extensions.d.ts.map +1 -1
  255. package/dist/extensions.js +2 -0
  256. package/dist/filesystem.d.ts +46 -2
  257. package/dist/filesystem.d.ts.map +1 -1
  258. package/dist/filesystem.js +149 -102
  259. package/dist/index.d.ts +2 -2
  260. package/dist/index.d.ts.map +1 -1
  261. package/dist/index.js +1 -1
  262. package/dist/internal/advertise-tools.d.ts.map +1 -1
  263. package/dist/internal/advertise-tools.js +6 -0
  264. package/dist/internal/cli-ax.d.ts +6 -0
  265. package/dist/internal/cli-ax.d.ts.map +1 -1
  266. package/dist/internal/cli-ax.js +72 -14
  267. package/dist/internal/continuation-identity.d.ts.map +1 -1
  268. package/dist/internal/continuation-identity.js +1 -0
  269. package/dist/internal/cursor-agent-template.d.ts +1 -1
  270. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  271. package/dist/internal/cursor-agent-template.js +2 -0
  272. package/dist/internal/discovery/connections.d.ts.map +1 -1
  273. package/dist/internal/discovery/connections.js +18 -0
  274. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  275. package/dist/internal/discovery/extensions.js +8 -4
  276. package/dist/internal/discovery/info.d.ts.map +1 -1
  277. package/dist/internal/discovery/info.js +1 -0
  278. package/dist/internal/filesystem/tools.d.ts.map +1 -1
  279. package/dist/internal/filesystem/tools.js +2 -2
  280. package/dist/internal/filesystem/walk.d.ts +7 -4
  281. package/dist/internal/filesystem/walk.d.ts.map +1 -1
  282. package/dist/internal/filesystem/walk.js +34 -11
  283. package/dist/internal/hosted-admission-adapter.d.ts +3 -0
  284. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  285. package/dist/internal/hosted-delivery-protocol.d.ts +20 -0
  286. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  287. package/dist/internal/hosted-delivery-protocol.js +51 -1
  288. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  289. package/dist/internal/hosted-delivery.js +23 -25
  290. package/dist/internal/hosted-execution-diag.d.ts +12 -4
  291. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  292. package/dist/internal/hosted-execution-diag.js +26 -4
  293. package/dist/internal/hosted-execution-flush.d.ts +1 -0
  294. package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
  295. package/dist/internal/hosted-execution-flush.js +4 -2
  296. package/dist/internal/init-project.d.ts.map +1 -1
  297. package/dist/internal/init-project.js +4 -0
  298. package/dist/internal/server.d.ts.map +1 -1
  299. package/dist/internal/server.js +111 -48
  300. package/dist/internal/session-engine.d.ts +4 -1
  301. package/dist/internal/session-engine.d.ts.map +1 -1
  302. package/dist/internal/session-engine.js +39 -9
  303. package/dist/internal/skill-catalog.d.ts +28 -0
  304. package/dist/internal/skill-catalog.d.ts.map +1 -0
  305. package/dist/internal/skill-catalog.js +44 -0
  306. package/dist/playground/assets/index-DSMAewbx.css +1 -0
  307. package/dist/playground/assets/index-De_lpFxE.js +67 -0
  308. package/dist/playground/index.html +2 -2
  309. package/dist/types.d.ts +32 -3
  310. package/dist/types.d.ts.map +1 -1
  311. package/docs/README.md +2 -0
  312. package/docs/building-with-agents.md +96 -84
  313. package/docs/deployment.md +118 -364
  314. package/docs/evals.md +149 -673
  315. package/docs/guides/agent-to-agent.md +130 -48
  316. package/docs/guides/bitbucket.md +250 -49
  317. package/docs/guides/cloud-agents.md +119 -67
  318. package/docs/guides/convert-automation.md +157 -148
  319. package/docs/guides/github.md +261 -246
  320. package/docs/guides/gitlab.md +250 -51
  321. package/docs/guides/grokbot-agents.md +100 -55
  322. package/docs/guides/improve.md +112 -59
  323. package/docs/guides/jev.md +353 -0
  324. package/docs/guides/mcp-oauth.md +112 -122
  325. package/docs/guides/opentelemetry.md +97 -166
  326. package/docs/guides/slack.md +158 -228
  327. package/docs/guides/webhooks.md +155 -386
  328. package/docs/hillclimbing.md +102 -56
  329. package/docs/reference/cli.md +2 -0
  330. package/docs/reference/connections.md +1 -1
  331. package/docs/reference/evals.md +298 -0
  332. package/docs/reference/extensions.md +132 -203
  333. package/docs/reference/hooks.md +34 -34
  334. package/docs/reference/subagents.md +1 -1
  335. package/docs/reference/tools.md +4 -0
  336. package/docs/templates/thermo-quality-review.md +80 -0
  337. package/docs/templates/thermo-review.md +79 -0
  338. package/docs/troubleshooting.md +98 -67
  339. package/package.json +8 -1
  340. package/skills/github/SKILL.md +21 -13
  341. package/src/bin/agent-serve.ts +24 -3
  342. package/src/channels/checks.ts +8 -0
  343. package/src/channels/github/github-channel.ts +29 -19
  344. package/src/channels/origin/checks.ts +3 -1
  345. package/src/channels/slack/agentic-delivery.ts +2 -0
  346. package/src/channels/slack/dispatch.ts +131 -4
  347. package/src/channels/slack/placeholder.ts +51 -0
  348. package/src/channels/slack/slack-channel.ts +9 -2
  349. package/src/extensions/cursor-cloud-agents/skills/handoff.md +3 -7
  350. package/src/extensions/improve/extension.ts +4 -2
  351. package/src/extensions/improve/skills/yourself.ts +1 -1
  352. package/src/extensions/jev/extension.ts +95 -0
  353. package/src/extensions/jev/lib/evaluate.ts +289 -0
  354. package/src/extensions/jev/skills/gated-write.md +25 -0
  355. package/src/extensions/jev/skills/questions.md +33 -0
  356. package/src/extensions/jev/tools/evaluate.ts +90 -0
  357. package/src/extensions.ts +2 -0
  358. package/src/filesystem.ts +168 -65
  359. package/src/index.ts +3 -0
  360. package/src/internal/advertise-tools.ts +6 -0
  361. package/src/internal/cli-ax.ts +88 -15
  362. package/src/internal/continuation-identity.ts +1 -0
  363. package/src/internal/cursor-agent-template.ts +2 -0
  364. package/src/internal/discovery/connections.ts +21 -0
  365. package/src/internal/discovery/extensions.ts +12 -4
  366. package/src/internal/discovery/info.ts +1 -0
  367. package/src/internal/filesystem/tools.ts +2 -0
  368. package/src/internal/filesystem/walk.ts +60 -15
  369. package/src/internal/hosted-admission-adapter.ts +3 -0
  370. package/src/internal/hosted-delivery-protocol.ts +82 -1
  371. package/src/internal/hosted-delivery.ts +23 -0
  372. package/src/internal/hosted-execution-diag.ts +33 -4
  373. package/src/internal/hosted-execution-flush.ts +4 -0
  374. package/src/internal/init-project.ts +4 -0
  375. package/src/internal/server.ts +130 -53
  376. package/src/internal/session-engine.ts +46 -8
  377. package/src/internal/skill-catalog.ts +69 -0
  378. package/src/types.ts +33 -3
  379. package/templates/thermo-quality-review/README.md +35 -0
  380. package/templates/thermo-quality-review/agent/agent.ts +8 -0
  381. package/templates/thermo-quality-review/agent/channels/github.ts +42 -0
  382. package/templates/thermo-quality-review/agent/instructions.md +43 -0
  383. package/templates/thermo-quality-review/agent/tools/post_findings.ts +70 -0
  384. package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
  385. package/templates/thermo-quality-review/evals/review.eval.ts +62 -0
  386. package/templates/thermo-quality-review/package.json +18 -0
  387. package/templates/thermo-quality-review/tsconfig.json +12 -0
  388. package/templates/thermo-review/README.md +35 -0
  389. package/templates/thermo-review/agent/agent.ts +8 -0
  390. package/templates/thermo-review/agent/channels/github.ts +42 -0
  391. package/templates/thermo-review/agent/instructions.md +40 -0
  392. package/templates/thermo-review/agent/tools/post_findings.ts +70 -0
  393. package/templates/thermo-review/evals/evals.config.ts +5 -0
  394. package/templates/thermo-review/evals/review.eval.ts +53 -0
  395. package/templates/thermo-review/package.json +18 -0
  396. package/templates/thermo-review/tsconfig.json +12 -0
  397. package/dist/docs/assets/building-with-agents.md.CEGVXkmO.js +0 -13
  398. package/dist/docs/assets/building-with-agents.md.CEGVXkmO.lean.js +0 -1
  399. package/dist/docs/assets/chunks/@localSearchIndexroot.DtXk1hy-.js +0 -1
  400. package/dist/docs/assets/chunks/channel.Bkv1N-gK.js +0 -1
  401. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CZDco1o8.js +0 -1
  402. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CZDco1o8.js +0 -1
  403. package/dist/docs/assets/chunks/clone.YSt_40_s.js +0 -1
  404. package/dist/docs/assets/chunks/framework.dypDpWZ3.js +0 -19
  405. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C4CLm481.js +0 -1
  406. package/dist/docs/assets/deployment.md.Dm4Qo3hp.js +0 -51
  407. package/dist/docs/assets/deployment.md.Dm4Qo3hp.lean.js +0 -1
  408. package/dist/docs/assets/evals.md.BLDRt5LH.js +0 -211
  409. package/dist/docs/assets/evals.md.BLDRt5LH.lean.js +0 -1
  410. package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.js +0 -14
  411. package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.lean.js +0 -1
  412. package/dist/docs/assets/guides_bitbucket.md.CTpCl__f.js +0 -10
  413. package/dist/docs/assets/guides_bitbucket.md.CTpCl__f.lean.js +0 -1
  414. package/dist/docs/assets/guides_cloud-agents.md.lSE_l7lH.js +0 -9
  415. package/dist/docs/assets/guides_cloud-agents.md.lSE_l7lH.lean.js +0 -1
  416. package/dist/docs/assets/guides_convert-automation.md.Ck6Cr68A.js +0 -12
  417. package/dist/docs/assets/guides_convert-automation.md.Ck6Cr68A.lean.js +0 -1
  418. package/dist/docs/assets/guides_github.md.D6ER29dG.js +0 -64
  419. package/dist/docs/assets/guides_github.md.D6ER29dG.lean.js +0 -1
  420. package/dist/docs/assets/guides_gitlab.md.P-TjBnS5.js +0 -14
  421. package/dist/docs/assets/guides_gitlab.md.P-TjBnS5.lean.js +0 -1
  422. package/dist/docs/assets/guides_grokbot-agents.md.WBZIOvkz.js +0 -9
  423. package/dist/docs/assets/guides_grokbot-agents.md.WBZIOvkz.lean.js +0 -1
  424. package/dist/docs/assets/guides_improve.md.BKaDuKKK.js +0 -14
  425. package/dist/docs/assets/guides_improve.md.BKaDuKKK.lean.js +0 -1
  426. package/dist/docs/assets/guides_mcp-oauth.md.DMNMpXtO.js +0 -28
  427. package/dist/docs/assets/guides_mcp-oauth.md.DMNMpXtO.lean.js +0 -1
  428. package/dist/docs/assets/guides_opentelemetry.md._CRfDyzH.js +0 -26
  429. package/dist/docs/assets/guides_opentelemetry.md._CRfDyzH.lean.js +0 -1
  430. package/dist/docs/assets/guides_slack.md.DdT8rmsj.js +0 -46
  431. package/dist/docs/assets/guides_slack.md.DdT8rmsj.lean.js +0 -1
  432. package/dist/docs/assets/guides_webhooks.md.aQW10HRe.js +0 -225
  433. package/dist/docs/assets/guides_webhooks.md.aQW10HRe.lean.js +0 -1
  434. package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.js +0 -1
  435. package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.lean.js +0 -1
  436. package/dist/docs/assets/reference_extensions.md.wlFD3cUR.js +0 -62
  437. package/dist/docs/assets/reference_extensions.md.wlFD3cUR.lean.js +0 -1
  438. package/dist/docs/assets/troubleshooting.md.BcgNoYtJ.js +0 -1
  439. package/dist/docs/assets/troubleshooting.md.BcgNoYtJ.lean.js +0 -1
  440. package/dist/playground/assets/index-BLlKgZtI.css +0 -1
  441. package/dist/playground/assets/index-CDS5p9sR.js +0 -67
@@ -1,59 +1,37 @@
1
1
  ---
2
- title: "Agent-to-agent"
3
- description: "Wire two Agent SDK agents on one host so one can ask the other."
2
+ title: "Peer agents"
3
+ description: "Let one Agent SDK agent consult an independent specialist, continue its session, or call its deterministic tools."
4
4
  ---
5
5
 
6
- # Agent-to-agent
6
+ # Peer agents
7
7
 
8
- Point one agent at another on the same host. The peer keeps its own
9
- session, instructions, and tools.
8
+ A peer connection lets one agent ask another agent on the same host for
9
+ help. The specialist keeps its own instructions, tools, and session,
10
+ while the caller decides when to delegate and returns the answer to the
11
+ user. Co-host both projects under one `agent-sdk` process.
10
12
 
11
- ## Peer or subagent?
12
-
13
- Use a [subagent](../reference/subagents.md) to split one job into roles
14
- inside a single agent. Use a peer when the specialist is a full agent
15
- you would run on its own.
16
-
17
- | | Subagent (`agent/subagents/<id>/`) | Peer (`defineConnection({ agent })`) |
18
- | --- | --- | --- |
19
- | Runs as | a child of this agent | an agent on the same host |
20
- | Tools, MCP connections, sessions | the parent's | its own |
21
- | Who can reach it | only the parent | other agents, MCP clients, its playground |
22
-
23
- ## How do I wire two agents?
13
+ ## Delegate a question to a specialist
24
14
 
25
- Put both projects in one directory:
26
-
27
- ```
28
- agents/
29
- concierge/
30
- agent/instructions.md
31
- agent/mcp-connections/weather.ts
32
- weather-agent/
33
- agent/instructions.md
34
- ```
35
-
36
- `weather-agent` is a normal Agent SDK project. On the concierge, add a
37
- connection. Set `agent` to the peer's slug, which is its directory
38
- name:
15
+ Ask the concierge about the weather and it hands the question to the
16
+ specialist. The weather agent answers in its own context, then the
17
+ concierge returns that answer to you.
39
18
 
40
19
  ```ts
41
- // agents/concierge/agent/mcp-connections/weather.ts
20
+ // agent/mcp-connections/weather.ts
42
21
  import { defineConnection } from "@cursor/july/connections";
43
22
 
44
23
  export default defineConnection({
45
24
  agent: "weather-agent",
46
- description: "Delegate weather questions to the weather agent.",
25
+ description: "Delegate weather questions to the weather specialist.",
47
26
  });
48
27
  ```
49
28
 
50
- The filename is the MCP server name. The concierge model sees the peer
51
- under `weather`. See
52
- [HTTP API](../reference/http-api.md#mcp-endpoint) for the MCP tools.
29
+ Give the concierge a narrow routing rule:
53
30
 
54
- In the concierge `instructions.md`, say when to ask: "When a request
55
- needs weather, ask the `weather` peer." Scope the line to the work the
56
- peer should handle. If two agents can ask each other, they will loop.
31
+ ```md
32
+ When a request needs current weather, ask the `weather` peer. Return its
33
+ answer.
34
+ ```
57
35
 
58
36
  ```bash
59
37
  agent-sdk dev ./agents
@@ -61,15 +39,119 @@ agent-sdk chat --url http://127.0.0.1:3000/concierge \
61
39
  --message "What's the weather in Paris right now?"
62
40
  ```
63
41
 
64
- Cursor-managed hosting deploys one agent per slug. Keep peers on one
65
- self-hosted process. Cloud-runtime turns need `--public-url` and
66
- `--bearer-token`. See [Deployment](../deployment.md).
42
+ The connection filename is the MCP server name the concierge calls, and
43
+ `agent` is the specialist's mount slug, normally its directory name.
44
+
45
+ ## Continue the specialist's session
46
+
47
+ Ask a follow-up about the same forecast and the specialist picks up
48
+ where it left off, with its own instructions and tool history still in
49
+ place. The first `ask` returns `{ status, sessionId, reply }` as text on
50
+ the `callTool` result. Parse `sessionId` and pass it on the next `ask`
51
+ so the peer remembers its earlier work instead of starting fresh.
52
+
53
+ ```ts
54
+ const first = await ctx.host.mcp.callTool("weather", "ask", {
55
+ message: "What's the weather in Paris right now?",
56
+ });
57
+ const firstText = first.content.find((part) => part.type === "text");
58
+ if (firstText?.text === undefined) {
59
+ throw new Error("weather ask returned no text payload");
60
+ }
61
+ const { sessionId } = JSON.parse(firstText.text) as { sessionId: string };
62
+
63
+ await ctx.host.mcp.callTool("weather", "ask", {
64
+ message: "How does that compare with tomorrow?",
65
+ sessionId,
66
+ });
67
+ ```
68
+
69
+ If the specialist is still working, `ask` returns `status: "running"`
70
+ with the session ID, and you can do other work before calling `check`.
71
+
72
+ ```ts
73
+ await ctx.host.mcp.callTool("weather", "check", {
74
+ sessionId,
75
+ waitSeconds: 20,
76
+ });
77
+ ```
78
+
79
+ The peer owns this session. Follow-ups stay on the specialist and leave
80
+ the concierge's conversation unchanged.
81
+
82
+ ## Call a deterministic peer tool
83
+
84
+ You need a forecast for Paris, and the weather agent already has
85
+ `get_forecast`. Host code calls that tool in the specialist's workspace
86
+ and the forecast comes back to the concierge, with no second model turn.
87
+
88
+ ```ts
89
+ const result = await ctx.host.mcp.callTool("weather", "call_tool", {
90
+ toolName: "get_forecast",
91
+ input: { city: "Paris" },
92
+ });
93
+ const part = result.content.find((item) => item.type === "text");
94
+ if (part?.text === undefined) {
95
+ return { ok: false, forecast: null };
96
+ }
97
+ const payload = JSON.parse(part.text) as {
98
+ isError?: boolean;
99
+ result?: unknown;
100
+ };
101
+
102
+ return {
103
+ ok: result.isError !== true && payload.isError !== true,
104
+ forecast: payload.result ?? null,
105
+ };
106
+ ```
107
+
108
+ `call_tool` appears only when the peer declares at least one
109
+ deterministic server tool.
110
+
111
+ ## Peer or subagent?
112
+
113
+ Use a [subagent](../reference/subagents.md) to split one agent's job
114
+ into roles that share its project. Use a peer when the specialist is a
115
+ complete agent you would also run, inspect, or expose on its own.
116
+
117
+ | | Subagent | Peer |
118
+ | --- | --- | --- |
119
+ | Context | Child role inside one agent | Independent agent and session |
120
+ | Tools and connections | Inherits the parent project | Owns its project surface |
121
+ | Reachability | Parent only | Other co-hosted agents and MCP clients |
122
+
123
+ ## Affinity
124
+
125
+ Follow-up `ask` and `check` calls resume the same specialist session
126
+ and run as the caller. Those turns show up in the peer's playground;
127
+ only that caller can continue or check the session.
128
+
129
+ ## Practices
130
+
131
+ - Give each caller a one-way routing rule so agent A cannot send work
132
+ to B and receive the same request back.
133
+
134
+ - Prefer `ask` when the specialist should reason. Use `call_tool` when
135
+ host code already knows which server tool to run.
136
+
137
+ - Cursor-managed hosting deploys one agent per slug. Use
138
+ [subagents](../reference/subagents.md) there instead of peer
139
+ connections.
140
+
141
+ ## Other hosts
142
+
143
+ Peers need the default multi-agent layout and one shared process;
144
+ unknown slugs and self-references fail at startup.
67
145
 
68
- Unknown slugs and self-references fail `serve` at startup. Peers need
69
- the default multi-agent layout.
146
+ For a self-hosted caller, expose the shared process with `--public-url`
147
+ and protect it with `--bearer-token`. The
148
+ [Deployment guide](../deployment.md) owns that hosting setup.
70
149
 
71
- ## What's next
150
+ ## Related
72
151
 
73
- - [MCP connections](../reference/connections.md#peer-mcp-connection): `{ agent }`
152
+ - [MCP connections](../reference/connections.md#peer-mcp-connection):
153
+ peer configuration and connection naming
154
+ - [MCP endpoint](../reference/http-api.md#mcp-endpoint): exact `ask`,
155
+ `check`, and `call_tool` schemas
74
156
  - [Subagents](../reference/subagents.md): specialists inside one agent
75
- - [HTTP API](../reference/http-api.md#mcp-endpoint): `/v1/mcp`
157
+ - [Deployment](../deployment.md): secure shared-host setup
@@ -1,89 +1,290 @@
1
1
  ---
2
2
  title: "Bitbucket"
3
- description: "Wake your agent from pull requests, comments, and pushes on Bitbucket Cloud or Bitbucket Data Center."
3
+ description: "Review pull requests, answer comments, and triage pushes on Bitbucket Cloud or Data Center."
4
4
  ---
5
5
 
6
6
  # Bitbucket agents
7
7
 
8
- Use `bitbucketChannel()` for Bitbucket Cloud and Bitbucket Data Center. The
9
- channel detects the source from each signed payload and normalizes Data Center
10
- events to the Bitbucket Cloud event vocabulary.
8
+ A Bitbucket agent wakes from a verified repository event, reads the
9
+ current pull-request or commit state, and writes the result back to
10
+ Bitbucket. `bitbucketChannel()` gives the same hooks and normalized
11
+ payloads on Bitbucket Cloud and Data Center.
11
12
 
12
- ## Define the channel
13
+ ## Review a pull request
13
14
 
14
- Author `agent/channels/bitbucket.ts`:
15
+ Creating a pull request, or pushing new commits to a Data Center pull
16
+ request, starts a review. The hook reads the current diff through the
17
+ repository-bound API, the model returns a verdict, and the completed
18
+ answer appears as a comment on the pull request.
15
19
 
16
20
  ```ts
17
- import { bitbucketChannel } from "@cursor/july/channels/bitbucket";
21
+ // agent/channels/bitbucket.ts
22
+ import {
23
+ bitbucketChannel,
24
+ bitbucketChannelStateForEvent,
25
+ defaultBitbucketAuth,
26
+ } from "@cursor/july/channels/bitbucket";
27
+ import {
28
+ postPullRequestComment,
29
+ setPushTriageStatus,
30
+ } from "../lib/bitbucket.js";
18
31
 
19
- export default bitbucketChannel({});
32
+ export default bitbucketChannel({
33
+ repos: ["acme/widgets"],
34
+ onPullRequest: async (ctx, pullRequest) => {
35
+ if (pullRequest.draft) {
36
+ return null;
37
+ }
38
+ const hasNewCommits =
39
+ pullRequest.action === "updated" &&
40
+ pullRequest.previousHeadSha !== undefined &&
41
+ pullRequest.previousHeadSha !== pullRequest.headSha;
42
+ if (pullRequest.action !== "created" && !hasNewCommits) {
43
+ return null;
44
+ }
45
+
46
+ const diff = await ctx.bitbucket.api.getPullRequestDiff(pullRequest.id);
47
+ return {
48
+ // `auth` starts a model turn running as the event sender.
49
+ auth: defaultBitbucketAuth(ctx),
50
+ message: `Review ${ctx.repository.fullName}#${pullRequest.id}.`,
51
+ context: [`<bitbucket_diff>${diff}</bitbucket_diff>`],
52
+ };
53
+ },
54
+ events: {
55
+ async "message.completed"(event, channel, ctx) {
56
+ if (ctx.session.purpose === "eval") {
57
+ return;
58
+ }
59
+ if (event.data.finishReason === "tool_call" || event.data.text === "") {
60
+ return;
61
+ }
62
+ const pullRequestId = channel.state.pullRequestId;
63
+ if (
64
+ !channel.state.eventType?.startsWith("pullrequest:") ||
65
+ pullRequestId === null
66
+ ) {
67
+ return;
68
+ }
69
+ await postPullRequestComment(
70
+ channel.state,
71
+ pullRequestId,
72
+ event.data.text
73
+ );
74
+ },
75
+ },
76
+ });
20
77
  ```
21
78
 
22
- Without `onPullRequest`, new pull requests start turns. Data Center updates
23
- also start turns when the source branch has new commits. Comments and pushes
24
- are opt-in through `onPullRequestComment` and `onPush`. Use `onEvent` for
25
- other event types. Set `webhookEvents` when managed event delivery must
26
- subscribe to an event that only `onEvent` handles.
79
+ `postPullRequestComment` is a small wrapper around the normalized
80
+ Bitbucket API. Configure it with the same token and API base described
81
+ under [Connect](#connect). It takes the repository and PR ID from the
82
+ verified event state, so the model never chooses where its review is
83
+ posted.
27
84
 
28
- Filter comment hooks by author before starting a turn. This prevents comments
29
- posted by the agent from triggering another turn.
85
+ ## Answer a pull-request comment
30
86
 
31
- `ctx.bitbucket.api` can read pull requests, post comments, and create build
32
- statuses. See the [Channels reference](../reference/channels.md) for hook
33
- return values and session behavior.
87
+ Mentioning `@cursor-reviewer` in a PR comment resumes that pull
88
+ request's conversation, and the first example's reply sink posts the
89
+ answer back to the same PR. The author guard ignores comments written
90
+ by the agent, preventing each reply from starting another turn.
34
91
 
35
- ## Connect Bitbucket
92
+ ```ts
93
+ const AGENT_USERNAME = "cursor-reviewer";
36
94
 
37
- Set a repository hook secret and API token:
95
+ onPullRequestComment: (ctx, comment) => {
96
+ if (comment.author?.username === AGENT_USERNAME) {
97
+ return null;
98
+ }
99
+ if (!comment.body.includes(`@${AGENT_USERNAME}`)) {
100
+ return null;
101
+ }
102
+ return {
103
+ auth: defaultBitbucketAuth(ctx),
104
+ message: comment.body,
105
+ };
106
+ },
107
+ ```
38
108
 
39
- ```bash
40
- BITBUCKET_WEBHOOK_SECRET=...
41
- BITBUCKET_TOKEN=...
109
+ Add this property to the same `bitbucketChannel()` declaration as the
110
+ review handler.
111
+
112
+ ## Triage a push to `main`
113
+
114
+ A push to `main` immediately adds a running `cursor/push-triage` build
115
+ status to the new commit. The webhook is acknowledged while the model
116
+ investigates, then the status reports whether that triage turn
117
+ completed.
118
+
119
+ ```ts
120
+ onPush: (ctx, push) => {
121
+ const change = push.changes.find(
122
+ candidate =>
123
+ candidate.name === "main" && candidate.after !== undefined
124
+ );
125
+ if (change?.after === undefined) {
126
+ return null;
127
+ }
128
+ const sha = change.after;
129
+
130
+ return {
131
+ // `task` runs this host sequence after the webhook is acknowledged.
132
+ task: async ({ send }) => {
133
+ await ctx.bitbucket.setBuildStatus({
134
+ sha,
135
+ key: "cursor/push-triage",
136
+ state: "INPROGRESS",
137
+ name: "Cursor push triage",
138
+ description: "Investigating push to main",
139
+ });
140
+
141
+ await send(`Triage push ${sha} on ${ctx.repository.fullName}.`, {
142
+ auth: defaultBitbucketAuth(ctx),
143
+ title: `Bitbucket push ${sha}`,
144
+ state: {
145
+ ...bitbucketChannelStateForEvent({
146
+ repository: ctx.repository,
147
+ headSha: sha,
148
+ eventType: ctx.eventType,
149
+ }),
150
+ },
151
+ });
152
+ },
153
+ };
154
+ },
155
+ ```
156
+
157
+ Extend the `events` map so the turn's terminal event concludes the
158
+ status through the same provider wrapper:
159
+
160
+ ```ts
161
+ async "message.completed"(event, channel, ctx) {
162
+ if (
163
+ ctx.session.purpose !== "eval" &&
164
+ channel.state.eventType === "repo:push" &&
165
+ channel.state.headSha !== null &&
166
+ event.data.finishReason !== "tool_call"
167
+ ) {
168
+ await setPushTriageStatus(
169
+ channel.state,
170
+ "SUCCESSFUL",
171
+ "Push triage complete"
172
+ );
173
+ return;
174
+ }
175
+
176
+ // Continue with the pull-request reply branch from the first example.
177
+ },
178
+ async "turn.failed"(_event, channel, ctx) {
179
+ if (
180
+ ctx.session.purpose === "eval" ||
181
+ channel.state.eventType !== "repo:push" ||
182
+ channel.state.headSha === null
183
+ ) {
184
+ return;
185
+ }
186
+ await setPushTriageStatus(
187
+ channel.state,
188
+ "FAILED",
189
+ "Push triage failed"
190
+ );
191
+ },
42
192
  ```
43
193
 
44
- Add a repository webhook for
45
- `https://<your-host>/<slug>/v1/channels/bitbucket`. Use the same secret on
46
- both sides. The channel verifies the `X-Hub-Signature` HMAC before it parses
47
- the payload.
194
+ This status reports the triage run, not the health of the pushed commit
195
+ itself.
196
+
197
+ ## Events
198
+
199
+ Use `onPullRequest`, `onPullRequestComment`, or `onPush` for the events
200
+ shown above. Each hook returns one of three decisions:
201
+
202
+ | Return | What happens |
203
+ | --- | --- |
204
+ | `{ auth }` | Start a model turn as the Bitbucket event sender |
205
+ | `{ task }` | Acknowledge the webhook, then run host code that may also call `send` |
206
+ | `null` | Skip the event |
207
+
208
+ The [Channels reference](../reference/channels.md) covers the remaining
209
+ hook and session behavior.
48
210
 
49
- Bitbucket Cloud uses its 2.0 API by default. Data Center also needs its REST
50
- API base:
211
+ ## Pull-request affinity
212
+
213
+ Every pull-request event and comment for the same repository and PR ID
214
+ resumes one agent session. A new PR, later commits, and a mention in the
215
+ discussion therefore share the same conversation across both Bitbucket
216
+ dialects.
217
+
218
+ ## Call Bitbucket through `ctx.bitbucket`
219
+
220
+ Each hook receives an API client already bound to the repository and
221
+ dialect from the verified delivery. Use `ctx.bitbucket.api` for
222
+ pull-request reads and comments, `setBuildStatus()` for one status
223
+ update, or `createCheck()` when a status changes throughout longer
224
+ work.
225
+
226
+ The repository does not come from model output. Keep API calls on this
227
+ bound client so the event decides where reads and writes go.
228
+
229
+ ## Connect
230
+
231
+ On Cursor-managed hosting, use the signed-in Cursor account and list
232
+ the repositories that may wake the agent:
233
+
234
+ ```ts
235
+ export default bitbucketChannel({
236
+ cursorAccount: {
237
+ repos: ["acme/widgets"],
238
+ },
239
+ });
240
+ ```
241
+
242
+ `cursorAccount` covers event delivery and API calls made through
243
+ `ctx.bitbucket` inside hooks. The `postPullRequestComment` and
244
+ `setPushTriageStatus` wrappers are separate REST clients, so configure
245
+ their Bitbucket API credential too.
246
+
247
+ For direct webhooks, configure the repository hook secret, API token,
248
+ and allowed repositories. Data Center also needs its REST API base:
51
249
 
52
250
  ```ts
53
251
  export default bitbucketChannel({
54
- apiBaseUrl: "https://bitbucket.example.com/rest/api/1.0",
55
252
  repos: ["PLATFORM/api"],
253
+ webhookSecret: () => process.env.BITBUCKET_WEBHOOK_SECRET,
254
+ token: () => process.env.BITBUCKET_TOKEN ?? "",
255
+ apiBaseUrl: "https://bitbucket.example.com/rest/api/1.0",
56
256
  });
57
257
  ```
58
258
 
59
- You can set `BITBUCKET_API_BASE_URL` instead.
259
+ Without `webhookSecret`, the direct production route stays
260
+ loopback-only. Setting it admits deliveries signed with the matching
261
+ repository-hook secret; `token` authorizes the API reads and writes in
262
+ the examples.
263
+
264
+ Register the repository webhook at
265
+ `https://<your-host>/<slug>/v1/channels/bitbucket` with the same secret.
266
+ For Bitbucket Cloud, omit `apiBaseUrl`.
60
267
 
61
268
  ## Test locally
62
269
 
63
- Start the agent, then replay a pull request you can read:
270
+ Replay lets you exercise the same hooks with a pull request you can
271
+ read before registering a live repository webhook.
64
272
 
65
273
  ```bash
66
274
  agent-sdk dev
67
275
  agent-sdk bitbucket replay \
68
- https://bitbucket.example.com/projects/PLATFORM/repos/api/pull-requests/42
69
- ```
70
-
71
- Replay supports Bitbucket Cloud and Data Center URLs. `BITBUCKET_TOKEN` needs
72
- pull request read access. The command reads the pull request, creates a payload
73
- in the matching dialect, and sends it through the same channel route. Use
74
- `--events '*'` to replay the supported events declared by the channel. Use
75
- `--dry-run --out fixtures/bitbucket` to save fixtures.
76
-
77
- ```bash
78
- agent-sdk bitbucket events --dir .
79
- agent-sdk bitbucket forward --dir .
276
+ https://bitbucket.example.com/projects/PLATFORM/repos/api/pull-requests/42 \
277
+ --events '*'
80
278
  ```
81
279
 
82
- `forward` prints the repository-hook and HTTPS tunnel setup for live
83
- deliveries.
280
+ Use `--dry-run --out fixtures/bitbucket` to save the payloads instead of
281
+ posting them. `BITBUCKET_TOKEN` needs read access to the pull request.
84
282
 
85
283
  ## Related
86
284
 
87
- - [Channels reference](../reference/channels.md)
88
- - [Webhooks and custom channels](./webhooks.md)
89
- - [Evals](../evals.md)
285
+ - [Channels reference](../reference/channels.md): channel hooks,
286
+ dispatch decisions, and session behavior
287
+ - [Webhooks and custom channels](./webhooks.md): direct webhook auth
288
+ and reply delivery
289
+ - [Evals](../evals.md): turn saved Bitbucket payloads into regression
290
+ fixtures