@cursor/july 0.1.92 → 0.1.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/AGENTS.md +8 -20
  2. package/README.md +115 -182
  3. package/dist/channels/deployments/deployments-channel.d.ts +7 -0
  4. package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
  5. package/dist/channels/deployments/deployments-channel.js +26 -2
  6. package/dist/channels/deployments/types.d.ts +8 -0
  7. package/dist/channels/deployments/types.d.ts.map +1 -1
  8. package/dist/channels/github/github-channel.d.ts +3 -0
  9. package/dist/channels/github/github-channel.d.ts.map +1 -1
  10. package/dist/channels/github/github-channel.js +28 -56
  11. package/dist/channels/slack/attachments.js +2 -2
  12. package/dist/channels/slack/dispatch.d.ts +0 -7
  13. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  14. package/dist/channels/slack/dispatch.js +4 -7
  15. package/dist/channels/slack/eval-directive.d.ts +5 -12
  16. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  17. package/dist/channels/slack/eval-directive.js +8 -19
  18. package/dist/channels/slack/index.d.ts +0 -6
  19. package/dist/channels/slack/index.d.ts.map +1 -1
  20. package/dist/channels/slack/index.js +0 -6
  21. package/dist/channels/slack/setup.d.ts +4 -4
  22. package/dist/channels/slack/setup.d.ts.map +1 -1
  23. package/dist/channels/slack/setup.js +8 -15
  24. package/dist/channels/slack/slack-channel.d.ts +6 -13
  25. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  26. package/dist/channels/slack/slack-channel.js +15 -101
  27. package/dist/channels/slack/types.d.ts +12 -79
  28. package/dist/channels/slack/types.d.ts.map +1 -1
  29. package/dist/channels/slack/types.js +1 -15
  30. package/dist/client.d.ts +14 -0
  31. package/dist/client.d.ts.map +1 -0
  32. package/dist/client.js +12 -0
  33. package/dist/connections.d.ts +18 -9
  34. package/dist/connections.d.ts.map +1 -1
  35. package/dist/connections.js +17 -8
  36. package/dist/continuation.d.ts +1 -1
  37. package/dist/continuation.js +1 -1
  38. package/dist/docs/404.html +2 -2
  39. package/dist/docs/ab.html +8 -8
  40. package/dist/docs/ab.md +7 -13
  41. package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
  42. package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
  43. package/dist/docs/assets/{app.Bci6CM9E.js → app.CFDEas4I.js} +1 -1
  44. package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
  45. package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
  46. package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
  47. package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
  48. package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Ct4NSiLm.js} +2 -2
  49. package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
  50. package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.lwAgBIMI.lean.js} +1 -1
  51. package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.D9msOFOW.js} +9 -14
  52. package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
  53. package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
  54. package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
  55. package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.BDb0t1QV.js} +2 -2
  56. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
  57. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
  58. package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.B4sjlodG.js} +2 -2
  59. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.Cnh2mL4a.js} +5 -5
  60. package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.Cnh2mL4a.lean.js} +1 -1
  61. package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
  62. package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
  63. package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.C32HsdKk.js} +7 -13
  64. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
  65. package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
  66. package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
  67. package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
  68. package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.DRakGHFe.lean.js} +1 -1
  69. package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.Nj_LjW_a.js} +2 -2
  70. package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
  71. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
  72. package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
  73. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.Cw6_ICYG.js} +10 -11
  74. package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +1 -1
  75. package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.BH8Oc0D0.js} +7 -7
  76. package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
  77. package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +14 -0
  78. package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +1 -1
  79. package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
  80. package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
  81. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
  82. package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
  83. package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
  84. package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
  85. package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
  86. package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
  87. package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
  88. package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
  89. package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
  90. package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.8son6Hjm.js} +4 -4
  91. package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
  92. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.BHeXn2id.js} +3 -3
  93. package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
  94. package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
  95. package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
  96. package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
  97. package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
  98. package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
  99. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
  100. package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
  101. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
  102. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
  103. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
  104. package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +1 -1
  105. package/dist/docs/building-with-agents.html +7 -7
  106. package/dist/docs/building-with-agents.md +5 -11
  107. package/dist/docs/concepts.html +5 -8
  108. package/dist/docs/concepts.md +13 -17
  109. package/dist/docs/deployment.html +13 -18
  110. package/dist/docs/deployment.md +9 -30
  111. package/dist/docs/design/agsh.md +406 -0
  112. package/dist/docs/evals.html +10 -10
  113. package/dist/docs/evals.md +16 -37
  114. package/dist/docs/guides/agent-to-agent.html +6 -6
  115. package/dist/docs/guides/agent-to-agent.md +3 -3
  116. package/dist/docs/guides/cloud-runtime.html +6 -6
  117. package/dist/docs/guides/cloud-runtime.md +9 -25
  118. package/dist/docs/guides/convert-automation.html +7 -7
  119. package/dist/docs/guides/convert-automation.md +4 -4
  120. package/dist/docs/guides/github.html +9 -9
  121. package/dist/docs/guides/github.md +16 -28
  122. package/dist/docs/guides/human-in-the-loop.html +4 -4
  123. package/dist/docs/guides/mcp-oauth.html +11 -13
  124. package/dist/docs/guides/mcp-oauth.md +14 -22
  125. package/dist/docs/guides/opentelemetry.html +5 -5
  126. package/dist/docs/guides/slack.html +11 -17
  127. package/dist/docs/guides/slack.md +13 -50
  128. package/dist/docs/guides/webhooks.html +6 -6
  129. package/dist/docs/guides/webhooks.md +3 -3
  130. package/dist/docs/hashmap.json +1 -1
  131. package/dist/docs/hillclimbing.html +6 -6
  132. package/dist/docs/hillclimbing.md +1 -1
  133. package/dist/docs/index.html +6 -6
  134. package/dist/docs/index.md +0 -36
  135. package/dist/docs/llms-full.txt +965 -3633
  136. package/dist/docs/llms.txt +3 -18
  137. package/dist/docs/quickstart.html +6 -6
  138. package/dist/docs/quickstart.md +3 -4
  139. package/dist/docs/reference/agent-config.html +8 -8
  140. package/dist/docs/reference/agent-config.md +10 -15
  141. package/dist/docs/reference/artifacts.html +4 -4
  142. package/dist/docs/reference/channels.html +6 -6
  143. package/dist/docs/reference/channels.md +20 -31
  144. package/dist/docs/reference/cli.html +14 -15
  145. package/dist/docs/reference/cli.md +29 -38
  146. package/dist/docs/reference/connections.html +11 -11
  147. package/dist/docs/reference/connections.md +24 -25
  148. package/dist/docs/reference/hooks.html +6 -6
  149. package/dist/docs/reference/hooks.md +12 -17
  150. package/dist/docs/reference/http-api.html +7 -7
  151. package/dist/docs/reference/http-api.md +25 -37
  152. package/dist/docs/reference/instructions.html +6 -6
  153. package/dist/docs/reference/instructions.md +1 -1
  154. package/dist/docs/reference/playground.html +5 -5
  155. package/dist/docs/reference/playground.md +14 -19
  156. package/dist/docs/reference/project-layout.html +9 -7
  157. package/dist/docs/reference/project-layout.md +7 -3
  158. package/dist/docs/reference/prompt.html +6 -6
  159. package/dist/docs/reference/prompt.md +1 -1
  160. package/dist/docs/reference/schedules.html +6 -6
  161. package/dist/docs/reference/schedules.md +1 -2
  162. package/dist/docs/reference/sessions.html +5 -12
  163. package/dist/docs/reference/sessions.md +8 -19
  164. package/dist/docs/reference/skills.html +8 -8
  165. package/dist/docs/reference/skills.md +3 -3
  166. package/dist/docs/reference/subagents.html +6 -6
  167. package/dist/docs/reference/subagents.md +2 -2
  168. package/dist/docs/reference/tools.html +8 -8
  169. package/dist/docs/reference/tools.md +30 -19
  170. package/dist/docs/scaffolding-agents.html +5 -5
  171. package/dist/docs/scaffolding-agents.md +4 -5
  172. package/dist/docs/storage.html +9 -9
  173. package/dist/docs/storage.md +37 -80
  174. package/dist/docs/templates/agentic-owners.html +7 -7
  175. package/dist/docs/templates/agentic-owners.md +2 -2
  176. package/dist/docs/templates/demo.html +4 -4
  177. package/dist/docs/templates/pr-autofixer.html +6 -6
  178. package/dist/docs/templates/pr-autofixer.md +7 -9
  179. package/dist/docs/templates/security-reviewer.html +5 -5
  180. package/dist/docs/templates/security-reviewer.md +2 -3
  181. package/dist/docs/templates/triage.html +4 -4
  182. package/dist/docs/troubleshooting.html +5 -5
  183. package/dist/docs/troubleshooting.md +8 -8
  184. package/dist/index.d.ts +1 -1
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +1 -1
  187. package/dist/internal/advertise-tools.d.ts +11 -0
  188. package/dist/internal/advertise-tools.d.ts.map +1 -1
  189. package/dist/internal/advertise-tools.js +47 -9
  190. package/dist/internal/authored-alias-hooks.d.ts +14 -11
  191. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  192. package/dist/internal/authored-alias-hooks.js +14 -11
  193. package/dist/internal/authored-loaders.d.ts +7 -6
  194. package/dist/internal/authored-loaders.d.ts.map +1 -1
  195. package/dist/internal/authored-loaders.js +14 -10
  196. package/dist/internal/cli-deploy.d.ts +1 -1
  197. package/dist/internal/cli-deploy.js +5 -5
  198. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  199. package/dist/internal/cli-mcp-oauth.js +7 -4
  200. package/dist/internal/continuation-channel.d.ts +6 -3
  201. package/dist/internal/continuation-channel.d.ts.map +1 -1
  202. package/dist/internal/continuation-channel.js +44 -40
  203. package/dist/internal/continuation-identity.d.ts +17 -16
  204. package/dist/internal/continuation-identity.d.ts.map +1 -1
  205. package/dist/internal/continuation-identity.js +109 -36
  206. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  207. package/dist/internal/convert-automation/convert-workflow.js +26 -15
  208. package/dist/internal/convert-automation/slug.d.ts +0 -2
  209. package/dist/internal/convert-automation/slug.d.ts.map +1 -1
  210. package/dist/internal/convert-automation/slug.js +0 -8
  211. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  212. package/dist/internal/cursor/account-mcp.js +5 -1
  213. package/dist/internal/deploy-manifest.d.ts +2 -2
  214. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  215. package/dist/internal/deploy-manifest.js +4 -9
  216. package/dist/internal/discovery.d.ts.map +1 -1
  217. package/dist/internal/discovery.js +91 -13
  218. package/dist/internal/distribution.d.ts +4 -3
  219. package/dist/internal/distribution.d.ts.map +1 -1
  220. package/dist/internal/distribution.js +4 -3
  221. package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
  222. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
  223. package/dist/internal/hosted-delivery-protocol.js +70 -0
  224. package/dist/internal/hosted-delivery.d.ts +35 -0
  225. package/dist/internal/hosted-delivery.d.ts.map +1 -0
  226. package/dist/internal/hosted-delivery.js +239 -0
  227. package/dist/internal/http-channel.d.ts.map +1 -1
  228. package/dist/internal/http-channel.js +1 -1
  229. package/dist/internal/mcp-endpoint.js +3 -3
  230. package/dist/internal/mcp-host.d.ts +8 -7
  231. package/dist/internal/mcp-host.d.ts.map +1 -1
  232. package/dist/internal/mcp-host.js +8 -7
  233. package/dist/internal/peer-connections.d.ts.map +1 -1
  234. package/dist/internal/peer-connections.js +5 -1
  235. package/dist/internal/playground/static.d.ts +0 -3
  236. package/dist/internal/playground/static.d.ts.map +1 -1
  237. package/dist/internal/resolved-connections.d.ts.map +1 -1
  238. package/dist/internal/resolved-connections.js +5 -7
  239. package/dist/internal/review-comments.d.ts +186 -63
  240. package/dist/internal/review-comments.d.ts.map +1 -1
  241. package/dist/internal/review-comments.js +350 -168
  242. package/dist/internal/server.d.ts.map +1 -1
  243. package/dist/internal/server.js +134 -175
  244. package/dist/internal/session-engine.d.ts +50 -10
  245. package/dist/internal/session-engine.d.ts.map +1 -1
  246. package/dist/internal/session-engine.js +221 -68
  247. package/dist/internal/shallow-clone.d.ts +8 -2
  248. package/dist/internal/shallow-clone.d.ts.map +1 -1
  249. package/dist/internal/shallow-clone.js +17 -10
  250. package/dist/internal/tool-catalog.d.ts +31 -0
  251. package/dist/internal/tool-catalog.d.ts.map +1 -0
  252. package/dist/internal/tool-catalog.js +67 -0
  253. package/dist/playground/assets/{index-DDvyC2z6.js → index-B3JCyigB.js} +2 -2
  254. package/dist/playground/index.html +1 -1
  255. package/dist/types.d.ts +81 -40
  256. package/dist/types.d.ts.map +1 -1
  257. package/dist/types.js +19 -0
  258. package/docs/README.md +0 -36
  259. package/docs/ab.md +7 -13
  260. package/docs/building-with-agents.md +5 -11
  261. package/docs/concepts.md +13 -17
  262. package/docs/deployment.md +9 -30
  263. package/docs/design/agsh.md +406 -0
  264. package/docs/evals.md +16 -37
  265. package/docs/guides/agent-to-agent.md +3 -3
  266. package/docs/guides/cloud-runtime.md +9 -25
  267. package/docs/guides/convert-automation.md +4 -4
  268. package/docs/guides/github.md +16 -28
  269. package/docs/guides/mcp-oauth.md +14 -22
  270. package/docs/guides/slack.md +14 -51
  271. package/docs/guides/webhooks.md +3 -3
  272. package/docs/hillclimbing.md +1 -1
  273. package/docs/quickstart.md +3 -4
  274. package/docs/reference/agent-config.md +10 -15
  275. package/docs/reference/channels.md +20 -31
  276. package/docs/reference/cli.md +29 -38
  277. package/docs/reference/connections.md +24 -25
  278. package/docs/reference/hooks.md +12 -17
  279. package/docs/reference/http-api.md +26 -38
  280. package/docs/reference/instructions.md +1 -1
  281. package/docs/reference/playground.md +14 -19
  282. package/docs/reference/project-layout.md +7 -3
  283. package/docs/reference/prompt.md +1 -1
  284. package/docs/reference/schedules.md +1 -2
  285. package/docs/reference/sessions.md +8 -19
  286. package/docs/reference/skills.md +3 -3
  287. package/docs/reference/subagents.md +2 -2
  288. package/docs/reference/tools.md +30 -19
  289. package/docs/scaffolding-agents.md +4 -5
  290. package/docs/storage.md +37 -80
  291. package/docs/templates/agentic-owners.md +2 -2
  292. package/docs/templates/pr-autofixer.md +7 -9
  293. package/docs/templates/security-reviewer.md +2 -3
  294. package/docs/troubleshooting.md +8 -8
  295. package/package.json +16 -2
  296. package/skills/create-agent/SKILL.md +6 -13
  297. package/skills/debug/SKILL.md +2 -4
  298. package/skills/evals/SKILL.md +1 -1
  299. package/skills/framework-map/SKILL.md +3 -2
  300. package/skills/mcp-auth/SKILL.md +10 -13
  301. package/skills/setup-slack/SKILL.md +21 -137
  302. package/src/channels/deployments/deployments-channel.ts +32 -2
  303. package/src/channels/deployments/types.ts +8 -0
  304. package/src/channels/github/github-channel.ts +71 -21
  305. package/src/channels/slack/attachments.ts +2 -2
  306. package/src/channels/slack/dispatch.ts +2 -16
  307. package/src/channels/slack/eval-directive.ts +8 -27
  308. package/src/channels/slack/index.ts +0 -6
  309. package/src/channels/slack/setup.ts +8 -15
  310. package/src/channels/slack/slack-channel.ts +14 -125
  311. package/src/channels/slack/types.ts +12 -96
  312. package/src/client.ts +23 -0
  313. package/src/connections.ts +20 -7
  314. package/src/continuation.ts +1 -1
  315. package/src/index.ts +2 -0
  316. package/src/internal/advertise-tools.ts +45 -7
  317. package/src/internal/authored-alias-hooks.ts +14 -11
  318. package/src/internal/authored-loaders.ts +14 -10
  319. package/src/internal/cli-deploy.ts +5 -5
  320. package/src/internal/cli-mcp-oauth.ts +6 -4
  321. package/src/internal/continuation-channel.ts +62 -45
  322. package/src/internal/continuation-identity.ts +123 -38
  323. package/src/internal/convert-automation/convert-workflow.ts +29 -17
  324. package/src/internal/convert-automation/slug.ts +0 -9
  325. package/src/internal/cursor/account-mcp.ts +4 -1
  326. package/src/internal/deploy-manifest.ts +5 -9
  327. package/src/internal/discovery.ts +107 -13
  328. package/src/internal/distribution.ts +4 -3
  329. package/src/internal/fixtures/units-server.ts +52 -0
  330. package/src/internal/hosted-delivery-protocol.ts +114 -0
  331. package/src/internal/hosted-delivery.ts +359 -0
  332. package/src/internal/http-channel.ts +0 -2
  333. package/src/internal/mcp-endpoint.ts +3 -3
  334. package/src/internal/mcp-host.ts +8 -7
  335. package/src/internal/peer-connections.ts +4 -1
  336. package/src/internal/playground/static.ts +1 -3
  337. package/src/internal/resolved-connections.ts +8 -10
  338. package/src/internal/review-comments.ts +542 -229
  339. package/src/internal/server.ts +180 -253
  340. package/src/internal/session-engine.ts +279 -70
  341. package/src/internal/shallow-clone.ts +30 -16
  342. package/src/internal/tool-catalog.ts +106 -0
  343. package/src/types.ts +99 -40
  344. package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
  345. package/templates/triage/README.md +2 -1
  346. package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
  347. package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
  348. package/dist/channels/slack/cursor-account.d.ts +0 -87
  349. package/dist/channels/slack/cursor-account.d.ts.map +0 -1
  350. package/dist/channels/slack/cursor-account.js +0 -100
  351. package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
  352. package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
  353. package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
  354. package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.js +0 -10
  355. package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.lean.js +0 -1
  356. package/dist/docs/assets/example-agents_benny.md.C40vHRLc.js +0 -7
  357. package/dist/docs/assets/example-agents_benny.md.C40vHRLc.lean.js +0 -1
  358. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
  359. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
  360. package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.js +0 -8
  361. package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.lean.js +0 -1
  362. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
  363. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
  364. package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.js +0 -23
  365. package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.lean.js +0 -1
  366. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
  367. package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
  368. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
  369. package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
  370. package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.js +0 -11
  371. package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.lean.js +0 -1
  372. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
  373. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
  374. package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.js +0 -19
  375. package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.lean.js +0 -1
  376. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
  377. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
  378. package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.js +0 -25
  379. package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +0 -1
  380. package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.js +0 -9
  381. package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.lean.js +0 -1
  382. package/dist/docs/assets/guides_slack.md.DiUmk_Oi.lean.js +0 -1
  383. package/dist/docs/assets/index.md.BAaMXLFd.js +0 -5
  384. package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
  385. package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
  386. package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
  387. package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
  388. package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
  389. package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.js +0 -17
  390. package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
  391. package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
  392. package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
  393. package/dist/docs/example-agents/approval-buddy.html +0 -36
  394. package/dist/docs/example-agents/approval-buddy.md +0 -266
  395. package/dist/docs/example-agents/benny.html +0 -33
  396. package/dist/docs/example-agents/benny.md +0 -182
  397. package/dist/docs/example-agents/bugbot.html +0 -37
  398. package/dist/docs/example-agents/bugbot.md +0 -229
  399. package/dist/docs/example-agents/codebase-wiki.html +0 -34
  400. package/dist/docs/example-agents/codebase-wiki.md +0 -170
  401. package/dist/docs/example-agents/codeowners-review.html +0 -34
  402. package/dist/docs/example-agents/codeowners-review.md +0 -192
  403. package/dist/docs/example-agents/concierge.html +0 -49
  404. package/dist/docs/example-agents/concierge.md +0 -201
  405. package/dist/docs/example-agents/fsd.html +0 -41
  406. package/dist/docs/example-agents/fsd.md +0 -329
  407. package/dist/docs/example-agents/index.html +0 -28
  408. package/dist/docs/example-agents/index.md +0 -102
  409. package/dist/docs/example-agents/knowledge-base.html +0 -37
  410. package/dist/docs/example-agents/knowledge-base.md +0 -168
  411. package/dist/docs/example-agents/oncall.html +0 -36
  412. package/dist/docs/example-agents/oncall.md +0 -212
  413. package/dist/docs/example-agents/security-reviewer.html +0 -45
  414. package/dist/docs/example-agents/security-reviewer.md +0 -265
  415. package/dist/docs/example-agents/slack-agent.html +0 -31
  416. package/dist/docs/example-agents/slack-agent.md +0 -142
  417. package/dist/docs/example-agents/weather-agent.html +0 -51
  418. package/dist/docs/example-agents/weather-agent.md +0 -296
  419. package/dist/internal/cursor-slack-relay.d.ts +0 -96
  420. package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
  421. package/dist/internal/cursor-slack-relay.js +0 -176
  422. package/docs/example-agents/approval-buddy.md +0 -271
  423. package/docs/example-agents/benny.md +0 -187
  424. package/docs/example-agents/bugbot.md +0 -234
  425. package/docs/example-agents/codebase-wiki.md +0 -175
  426. package/docs/example-agents/codeowners-review.md +0 -197
  427. package/docs/example-agents/concierge.md +0 -206
  428. package/docs/example-agents/fsd.md +0 -334
  429. package/docs/example-agents/index.md +0 -107
  430. package/docs/example-agents/knowledge-base.md +0 -173
  431. package/docs/example-agents/oncall.md +0 -217
  432. package/docs/example-agents/security-reviewer.md +0 -270
  433. package/docs/example-agents/slack-agent.md +0 -147
  434. package/docs/example-agents/weather-agent.md +0 -301
  435. package/src/channels/slack/cursor-account.ts +0 -202
  436. package/src/internal/cursor-slack-relay.ts +0 -249
  437. /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
  438. /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
  439. /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
  440. /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
  441. /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
  442. /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
  443. /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
  444. /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
  445. /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
  446. /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
  447. /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
  448. /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
@@ -1,271 +0,0 @@
1
- ---
2
- title: "Keep PR approval policy deterministic with Approval Buddy"
3
- description: "Separate code-owned eligibility from model-owned review, then connect GitHub, Slack, subagents, durable storage, and evals."
4
- ---
5
-
6
- # Keep PR approval policy deterministic with Approval Buddy
7
-
8
- Approval Buddy approves eligible pull requests from a fixed roster and
9
- declines every other request. GitHub still blocks self-approval when the stamp
10
- identity authored the PR. Code decides eligibility. The model prepares
11
- evidence, runs two specialist reviews, and passes their findings to the
12
- approval tool without changing the policy decision.
13
-
14
- Use this example when an agent can make a judgment inside a workflow, but
15
- authorization and the final side effect must stay in deterministic code.
16
-
17
- [Browse the Approval Buddy source.](../../examples/approval-buddy/)
18
-
19
- ## Keep approval policy in code
20
-
21
- Approval Buddy draws three hard boundaries:
22
-
23
- - `prepare_review` and `approve_pr` re-read the live PR and apply the same
24
- eligibility rules.
25
- - Two subagents inspect prepared evidence, but their findings never grant or
26
- block approval.
27
- - Only `approve_pr` posts the GitHub review.
28
-
29
- A spoofed webhook, Slack message, or model claim can't add someone to the
30
- buddy roster. The mutating tool checks the source of truth immediately before it
31
- acts.
32
-
33
- ## Follow the intended stamp flow
34
-
35
- The root instructions ask the model to run this sequence for a qualifying PR:
36
-
37
- 1. A non-draft `pull_request` event arrives with action `opened`, `reopened`,
38
- or `ready_for_review`.
39
- 2. The GitHub channel checks its repository allowlist and starts a session.
40
- 3. `turn.started` posts a pending commit status.
41
- 4. The model calls `prepare_review`.
42
- 5. Host code fetches the live PR. It checks the author, open state, merged
43
- state, and draft state.
44
- 6. A qualifying PR gets `pr/MANIFEST.md`, `pr/meta.json`, and
45
- `pr/diff.patch` in the session workspace. Diffs above 2,000,000
46
- characters are truncated and marked in metadata.
47
- 7. The model calls both review subagents through the built-in `task` tool.
48
- 8. It concatenates their contracted replies and calls `approve_pr`.
49
- 9. `approve_pr` re-runs eligibility, posts an `APPROVE` review, and returns
50
- the outcome.
51
- 10. The channel posts a final commit status. A self-approval block also gets
52
- a short timeline comment because no approval review can appear.
53
-
54
- Ineligible PRs skip evidence and subagents. The model still calls
55
- `approve_pr` so the deterministic tool returns the formal decline reason.
56
-
57
- Steps 4 through 9 are prompt-driven. The channel doesn't enforce tool order
58
- or prove both subagents ran, and `approve_pr` accepts missing findings. A
59
- failed turn clears the pending status with a green non-blocking result without
60
- approving the PR.
61
-
62
- ## Map the framework features
63
-
64
- | Capability | Source | Role |
65
- | --- | --- | --- |
66
- | Root agent and policy prompt | [`agent/agent.ts`](../../examples/approval-buddy/agent/agent.ts), [`agent/instructions.md`](../../examples/approval-buddy/agent/instructions.md) | Configure the local agent and describe orchestration order. |
67
- | GitHub channel | [`agent/channels/github.ts`](../../examples/approval-buddy/agent/channels/github.ts) | Filter wakes, lease GitHub access, and publish status events. |
68
- | Slack channel | [`agent/channels/slack.ts`](../../examples/approval-buddy/agent/channels/slack.ts) | Accept approval-bot stamp and qualification requests. |
69
- | Server tools | [`agent/tools/`](../../examples/approval-buddy/agent/tools/) | Prepare evidence, approve, list buddies, and search GIFs. |
70
- | Deterministic policy | [`agent/lib/approve.ts`](../../examples/approval-buddy/agent/lib/approve.ts), [`agent/lib/buddies.ts`](../../examples/approval-buddy/agent/lib/buddies.ts) | Own the roster and live eligibility checks. |
71
- | Review subagents | [`agent/subagents/`](../../examples/approval-buddy/agent/subagents/) | Run deep audit and code-quality passes over the same evidence. |
72
- | Storage | [`agent/storage.ts`](../../examples/approval-buddy/agent/storage.ts) | Persist sessions and events with `cursorHostedStorage` (Bugbot `agent_serve_*`). |
73
- | Live A/B experiment | [`agent/ab.ts`](../../examples/approval-buddy/agent/ab.ts) | Compare baseline responses with a concise, presentation-only treatment (`concise-results`). |
74
- | Evals and unit tests | [`evals/`](../../examples/approval-buddy/evals/), [`agent/lib/`](../../examples/approval-buddy/agent/lib/) | Protect routing, output contracts, policy, and GitHub behavior. |
75
-
76
- There are no authored skills, MCP connections, schedules, reminders, hooks,
77
- sandbox seeds, or tool approvals.
78
-
79
- ## Prepare credentials
80
-
81
- You need:
82
-
83
- - Node 22.13 or newer.
84
- - An agent-runtime credential.
85
- - GitHub access to read PRs, post reviews, create commit statuses, and
86
- post the self-approval visibility comment.
87
-
88
- Optional GIF selection uses:
89
-
90
- - `GIPHY_API_KEY` or `APPROVAL_BUDDY_GIPHY_API_KEY`,
91
- - `APPROVAL_BUDDY_STAMP_GIF`, or
92
- - severity-specific `APPROVAL_BUDDY_STAMP_GIF_<LEVEL>` variables.
93
-
94
- If you enable Giphy in a hosted copy, declare its secret and
95
- `api.giphy.com` egress.
96
-
97
- ## Validate without approving a PR
98
-
99
- ```bash
100
- agent-sdk validate --dir examples/approval-buddy
101
- agent-sdk info --dir examples/approval-buddy --json
102
- ```
103
-
104
- List the deterministic roster:
105
-
106
- ```bash
107
- agent-sdk call list_buddies \
108
- --dir examples/approval-buddy \
109
- --input '{}'
110
- ```
111
-
112
- Set a known merged PR, then run the read-only precheck:
113
-
114
- ```bash
115
- MERGED_PR_URL=https://github.com/your-org/your-repo/pull/123
116
- agent-sdk call prepare_review \
117
- --dir examples/approval-buddy \
118
- --input "{\"prUrl\":\"$MERGED_PR_URL\"}"
119
- ```
120
-
121
- The result should decline because the PR is no longer open. `prepare_review`
122
- never posts an approval.
123
-
124
- > [!CAUTION]
125
- > Don't use `agent-sdk call approve_pr` as a smoke test. The tool has no
126
- > `needsApproval` gate and posts a real GitHub review when the PR qualifies.
127
-
128
- ## See why preparation is separate
129
-
130
- `prepare_review` is read-only. It checks policy before fetching a large diff,
131
- so declined requests don't spend review-agent work.
132
-
133
- Direct calls return the evidence file map because their scratch workspace is
134
- deleted after the call. In-session calls write the tree to
135
- `ctx.workspaceDir`, where both subagents can read it.
136
-
137
- `approve_pr` repeats the live check instead of trusting preparation. A PR can
138
- close, merge, become a draft, or change author-related context between the two
139
- steps. Revalidation keeps the final write bound to current state.
140
-
141
- This is a reusable two-tool pattern:
142
-
143
- - a read-only tool prepares and explains the decision,
144
- - a mutating tool repeats policy at the side-effect boundary.
145
-
146
- ## Fan out two review contracts
147
-
148
- The two discovered subagents have different contracts:
149
-
150
- - The security reviewer reports bugs, breaking changes, and security findings
151
- with `High`, `Medium`, or `Low` tags.
152
- - The code-quality reviewer reports maintainability and structure concerns
153
- with `Blocker`, `Major`, or `Minor` tags.
154
-
155
- The parent calls both through the harness `task` tool. They inherit the root
156
- agent's execution surface and read the same `pr/` workspace. The prompt asks
157
- the parent not to rewrite either reply. The review body trims the combined
158
- text and caps it at 16,000 characters.
159
-
160
- Findings are informational. A high-severity finding doesn't veto the stamp.
161
- That policy is explicit in the root instructions and approval code.
162
-
163
- ## Trace GitHub channel behavior
164
-
165
- The channel uses `githubChannel` with:
166
-
167
- - a configured repository allowlist on the account-linked GitHub transport,
168
- - a second optional `APPROVAL_BUDDY_REPOS` wake filter,
169
- - `deliverReplies: false`,
170
- - progress reactions disabled, and
171
- - event handlers for turn start, `approve_pr` results, and failed turns.
172
-
173
- The source requests `contents-write`, even though the documented workflow
174
- posts reviews, statuses, and comments. When adapting the example, start with
175
- `pr-write` and opt up only if a tool must push code.
176
-
177
- Every terminal status is green by design. Declines and crashed turns are
178
- informational, not merge-blocking. This is a product decision in the example,
179
- not an Agent SDK default.
180
-
181
- A successful turn that never calls `approve_pr` leaves the pending status in
182
- place. The channel clears it on `approve_pr` results and `turn.failed`, but
183
- has no `turn.completed` fallback.
184
-
185
- `github replay` reaches the same channel and can post a real approval, status,
186
- or comment. Use replay only against a repository and PR created for this
187
- test.
188
-
189
- ## Use Slack for explicit requests
190
-
191
- Start the dev server:
192
-
193
- ```bash
194
- agent-sdk dev examples/approval-buddy
195
- ```
196
-
197
- Then ask through the signed-in account-linked Slack connection:
198
-
199
- > Would this PR qualify for a stamp?
200
-
201
- The instructions route qualification questions to `prepare_review` only. A
202
- stamp request runs the complete flow and may approve the PR.
203
-
204
- This channel uses the account-linked transport instead of a dedicated Socket
205
- Mode app.
206
-
207
- ## See how durable storage fits
208
-
209
- `defineStorage` replaces the default local session store with a shared,
210
- durable key-value adapter. Approval Buddy chooses:
211
-
212
- - a 15-second write debounce,
213
- - startup restoration for up to 200 sessions, and
214
- - a 14-day restore window.
215
-
216
- That policy fits long-lived Slack threads and a small webhook fleet. The
217
- security reviewer uses the same adapter with lazy restore, which fits its
218
- shorter sessions.
219
-
220
- ## Run the regression suite
221
-
222
- List the four eval cases:
223
-
224
- ```bash
225
- agent-sdk eval --dir examples/approval-buddy --list
226
- ```
227
-
228
- The suite covers:
229
-
230
- - buddy-list routing,
231
- - declining a merged PR,
232
- - using only `prepare_review` for a qualification question, and
233
- - the combined findings headings and severity format over seeded evidence.
234
-
235
- Run the safe qualification case:
236
-
237
- ```bash
238
- agent-sdk eval \
239
- --dir examples/approval-buddy \
240
- qualify/merged-pr-question \
241
- --json
242
- ```
243
-
244
- The qualification case reads a live merged PR. The seeded format case shown
245
- by `--list` uses a planted auth-bypass diff
246
- and checks for a `task` call, both headings, and severity tags. It doesn't
247
- prove both named subagents ran or whether their output reached `approve_pr`.
248
- Unit tests under `agent/lib/` cover policy, self-approval handling, evidence
249
- limits, status mapping, GIF selection, and severity parsing.
250
-
251
- ## Reuse the policy boundary
252
-
253
- Keep these properties when you replace the buddy policy:
254
-
255
- 1. Put authorization in typed code.
256
- 2. Fetch the source of truth inside both prepare and mutate steps.
257
- 3. Give the model evidence only after the request qualifies.
258
- 4. Treat specialist findings as data, not authority.
259
- 5. Keep the core domain mutation in one named tool. Treat channel status and
260
- visibility writes as separate, audited effects.
261
- 6. Add a human approval gate if your policy still needs operator consent.
262
- 7. Test read-only routing separately from mutation.
263
-
264
- ## Where to go next
265
-
266
- - [GitHub](../guides/github.md)
267
- - [Tools](../reference/tools.md)
268
- - [Subagents](../reference/subagents.md)
269
- - [Storage](../storage.md)
270
- - [Slack](../guides/slack.md)
271
- - [Evals](../evals.md)
@@ -1,187 +0,0 @@
1
- ---
2
- title: "Route Slack work through repository playbooks"
3
- description: "Combine account-linked chat, allowlisted Socket Mode channel watching, inherited repository skills, and a custom local workspace."
4
- ---
5
-
6
- # Route Slack work through repository playbooks
7
-
8
- This agent is a Slack teammate for a product team. Mentions and direct
9
- messages reach it through an account-linked transport. New top-level posts in
10
- an allowlisted issue channel reach it through a dedicated Slack app, even
11
- without a mention. The agent then selects a repository playbook for triage,
12
- reproduction, fixes, reviews, on-call work, or design critique.
13
-
14
- Use this example when Slack is the intake surface and your durable procedures
15
- already live as repository skills.
16
-
17
- [Browse the current playbook-router source.](../../examples/benny/)
18
-
19
- ## Combine two Slack transports with repo skills
20
-
21
- The playbook router uniquely combines three decisions:
22
-
23
- - Two Slack transports serve different engagement modes.
24
- - `local.cwd` keeps session workspaces inside the monorepo.
25
- - Instructions route work to inherited repository playbooks
26
- instead of authored `agent/skills/`.
27
-
28
- The result is a thin agent project over a mature procedure library.
29
-
30
- ## Follow an issue report
31
-
32
- 1. A teammate creates a top-level post in the allowlisted issue channel.
33
- 2. The dedicated Socket Mode channel accepts the allowlisted channel.
34
- 3. A 15-second debounce lets edits settle. Deleting the post during that
35
- window cancels the dispatch.
36
- 4. The Agent SDK creates a thread-scoped session and sends the report to the
37
- playbook router.
38
- 5. The instructions select the matching triage playbook.
39
- 6. The harness finds the repository root, opens the inherited playbook, and
40
- follows its procedure.
41
- 7. The agent posts only in the source thread and reports the evidence it
42
- gathered.
43
-
44
- Mentions and direct messages follow the same agent instructions. They don't
45
- need the watched-channel path.
46
-
47
- ## Map the playbook router files
48
-
49
- | File | Purpose |
50
- | --- | --- |
51
- | [`agent/agent.ts`](../../examples/benny/agent/agent.ts) | Names the agent, selects its model, and keeps the harness under `.agent-serve/harness`. |
52
- | [`agent/instructions.md`](../../examples/benny/agent/instructions.md) | Defines engagement rules, evidence policy, and the playbook routing map. |
53
- | [`agent/channels/slack.ts`](../../examples/benny/agent/channels/slack.ts) | Handles account-linked mentions and direct messages. |
54
- | [`agent/channels/slack-app.ts`](../../examples/benny/agent/channels/slack-app.ts) | Runs the dedicated app and watches one allowlisted channel. |
55
- | [`agent/storage.ts`](../../examples/benny/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
56
- | [`evals/evals.config.ts`](../../examples/benny/evals/evals.config.ts) | Caps eval run concurrency. |
57
- | [`evals/smoke.eval.ts`](../../examples/benny/evals/smoke.eval.ts) | Checks the agent identity and expected triage route. |
58
-
59
- The playbook router authors no tools, MCP connections, subagents, schedules, hooks, A/B
60
- experiments, or sandbox seeds.
61
-
62
- ## See why `local.cwd` matters
63
-
64
- The Agent SDK normally keeps an ephemeral `run` or `eval` workspace outside a
65
- large monorepo. This prevents ancestor instruction and repository-rule files
66
- from leaking into an unrelated agent.
67
-
68
- The playbook router needs the opposite. Its procedures live at the repository
69
- root, so
70
- `agent.ts` sets:
71
-
72
- ```ts
73
- local: {
74
- cwd: ".agent-serve/harness",
75
- }
76
- ```
77
-
78
- Each harness workspace lands under
79
- `examples/benny/.agent-serve/harness/<sessionId>`. Walking up the directory
80
- tree reaches the host repository and its inherited playbook directory.
81
-
82
- Those playbooks are inherited context. `agent-sdk info` reports zero authored
83
- skills for the agent. Copying this project into another repository removes
84
- its main procedures unless you copy or replace the skill library too.
85
-
86
- ## Connect both Slack paths
87
-
88
- The account-linked path needs an agent-runtime login and a connected Slack
89
- account:
90
-
91
- ```bash
92
- agent-sdk login
93
- agent-sdk whoami
94
- ```
95
-
96
- It routes explicit mentions without a dedicated Slack token on the host.
97
-
98
- For the watched-channel path, configure a dedicated Socket Mode app with:
99
-
100
- - subscribe to `message.channels` and `message.groups`,
101
- - have an App-Level Token with `connections:write`, and
102
- - be a member of the watched channel.
103
-
104
- Run `agent-sdk slack create --dir examples/benny --channel-posts` for a
105
- dedicated Socket Mode app, then `agent-sdk slack doctor`.
106
-
107
- Missing dedicated-app tokens leave that channel idle. They don't stop the
108
- account-linked channel.
109
-
110
- ## Validate and start the server
111
-
112
- ```bash
113
- agent-sdk validate --dir examples/benny
114
- agent-sdk info --dir examples/benny --json
115
- agent-sdk dev examples/benny
116
- ```
117
-
118
- The info output should show two Slack channels and no authored skill. That
119
- combination confirms the example is using inherited playbooks.
120
-
121
- ## Exercise each engagement mode
122
-
123
- Test the explicit account-linked path by asking:
124
-
125
- > Which playbook would you use to triage a product UI bug?
126
-
127
- Test the dedicated app:
128
-
129
- 1. Create a top-level post in the allowlisted issue channel.
130
- 2. Don't mention the bot.
131
- 3. Wait for the debounce window.
132
- 4. Confirm the agent replies in the post's thread.
133
-
134
- Thread replies don't trigger the proactive watch. Mentions still use Slack's
135
- normal mention path. Bot-authored posts are ignored to prevent loops.
136
-
137
- The channel uses the default handler after filtering. It doesn't apply a
138
- second code-level classifier, so every accepted top-level post spends a model
139
- turn and reaches the prompt.
140
-
141
- ## Inspect thread continuity
142
-
143
- The Agent SDK keys Slack sessions by channel and thread timestamp. A follow-up in
144
- the same thread resumes the conversation and workspace. A new top-level issue
145
- gets a new session.
146
-
147
- This lets a playbook gather evidence over several turns without mixing two
148
- reports. The playground shows both the account-linked and dedicated-app
149
- sessions while the dev server runs.
150
-
151
- ## Run the smoke eval
152
-
153
- ```bash
154
- agent-sdk eval --dir examples/benny --list
155
- agent-sdk eval --dir examples/benny smoke --json
156
- ```
157
-
158
- The case asks for the agent identity and the playbook used for issue triage.
159
- It checks the configured identity and route label.
160
-
161
- This is a lexical smoke test. It doesn't prove Slack delivery, skill
162
- selection, skill loading, procedure execution, or thread-only behavior. Add
163
- fixture-backed evals around the playbooks when you reuse this design.
164
-
165
- ## Build a playbook-routed teammate
166
-
167
- Use this structure when your organization already has tested skills:
168
-
169
- 1. Put the playbooks under a stable repository path.
170
- 2. Set `local.cwd` so harness workspaces can inherit that path.
171
- 3. Write a short routing table in `instructions.md`.
172
- 4. Use account-linked Slack for explicit requests.
173
- 5. Add a dedicated app only for allowlisted proactive intake.
174
- 6. Keep the channel allowlist narrow and debounce edited posts.
175
- 7. Add an eval for every important request-to-playbook route.
176
-
177
- If the procedures should ship with the agent, put them under
178
- `agent/skills/` instead. Authored skills appear in the manifest and travel
179
- with the project.
180
-
181
- ## Where to go next
182
-
183
- - [Slack](../guides/slack.md)
184
- - [Agent config](../reference/agent-config.md)
185
- - [Skills](../reference/skills.md)
186
- - [Sessions and streaming](../reference/sessions.md)
187
- - [Evals](../evals.md)
@@ -1,234 +0,0 @@
1
- ---
2
- title: "Review prepared pull-request evidence"
3
- description: "Fetch a PR on the host, seed a trimmed diff-first workspace, and run a GitHub-read-only review through HTTP, Slack, or an eval."
4
- ---
5
-
6
- # Review prepared pull-request evidence
7
-
8
- This GitHub-read-only reviewer uses host code to fetch the PR
9
- with `gh` and `git`, builds a trimmed `pr/` evidence tree, then hands that tree
10
- to the model. The model reads the diff, loads a review skill, and returns at
11
- most three high-confidence findings.
12
-
13
- Use this example when the host should control evidence collection and the
14
- model shouldn't browse or mutate the source repository.
15
-
16
- [Browse the current reviewer source.](../../examples/bugbot/)
17
-
18
- ## Separate evidence preparation from review
19
-
20
- The reviewer separates preparation from judgment:
21
-
22
- - Host code owns GitHub and Git access.
23
- - A server tool turns untrusted PR input into bounded workspace files.
24
- - A custom channel seeds those files before the model starts.
25
- - An on-demand skill defines the review procedure and output contract.
26
- - The model returns chat text. No path posts a GitHub review.
27
-
28
- This architecture gives the model a purpose-built evidence package instead of
29
- a checkout.
30
-
31
- ## Follow a review
32
-
33
- The custom HTTP path runs this sequence:
34
-
35
- 1. `POST /v1/channels/review/` receives a PR reference.
36
- 2. The handler calls `prepare_pr` without a model turn.
37
- 3. Host code reads PR metadata and the unified diff.
38
- 4. It reuses a matching checkout, force-fetching the PR ref there when the
39
- commit is missing. Without a matching checkout, it uses a temporary bare
40
- cache.
41
- 5. It creates `pr/MANIFEST.md`, `pr/meta.json`, `pr/diff.patch`, and selected
42
- small files and rules.
43
- 6. `send({ workspaceFiles })` creates the model session with that evidence.
44
- 7. The model reads the manifest and diff, then loads `pr-review`.
45
- 8. The channel returns session and playground URLs while the review streams.
46
-
47
- If a normal chat starts without evidence, the model can call `prepare_pr`
48
- mid-turn. That form writes the same files into the active session workspace.
49
-
50
- ## Map the evidence-review files
51
-
52
- | File | Purpose |
53
- | --- | --- |
54
- | [`agent/agent.ts`](../../examples/bugbot/agent/agent.ts) | Selects the local runtime and model. |
55
- | [`agent/instructions.md`](../../examples/bugbot/agent/instructions.md) | Requires diff-first review and confines model work to `pr/`. |
56
- | [`agent/tools/prepare_pr.ts`](../../examples/bugbot/agent/tools/prepare_pr.ts) | Exposes host preparation as a typed server tool. |
57
- | [`agent/lib/prepare-pr.ts`](../../examples/bugbot/agent/lib/prepare-pr.ts) | Parses PR references, runs `gh` and `git`, and builds the evidence map. |
58
- | [`agent/channels/review.ts`](../../examples/bugbot/agent/channels/review.ts) | Provides the loopback-only prepare-and-send HTTP route. |
59
- | [`agent/channels/slack.ts`](../../examples/bugbot/agent/channels/slack.ts) | Extracts PR references and prepares evidence for mentions and direct messages. |
60
- | [`agent/skills/pr-review.md`](../../examples/bugbot/agent/skills/pr-review.md) | Sets finding limits, severities, and the machine-readable review format. |
61
- | [`agent/lib/log.ts`](../../examples/bugbot/agent/lib/log.ts) | Writes timing logs for the host tools to stderr. |
62
- | [`agent/storage.ts`](../../examples/bugbot/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
63
- | [`evals/evals.config.ts`](../../examples/bugbot/evals/evals.config.ts) | Caps eval run concurrency. |
64
- | [`evals/review/smoke.eval.ts`](../../examples/bugbot/evals/review/smoke.eval.ts) | Seeds fake evidence and checks the review path without GitHub. |
65
-
66
- There is no authored GitHub channel, MCP connection, subagent, schedule,
67
- hook, A/B experiment, approval, or custom storage.
68
-
69
- ## Prepare the host
70
-
71
- You need:
72
-
73
- - Node 22.13 or newer.
74
- - An agent-runtime credential for model turns and account-linked Slack.
75
- - `gh` and `git` on `PATH`.
76
- - `gh` access to the target PR.
77
- - Network access to GitHub and a writable temporary directory.
78
-
79
- The preparer can prefer a configured local checkout. Its `origin` must match
80
- the target repository. Otherwise the reviewer uses its bare cache. It never
81
- checks out the PR into the serve host's working tree.
82
-
83
- ## Validate the surface
84
-
85
- ```bash
86
- agent-sdk validate --dir examples/bugbot
87
- agent-sdk info --dir examples/bugbot --json
88
- ```
89
-
90
- The manifest should show one server tool, one skill, and two authored
91
- channels.
92
-
93
- ## Inspect evidence without a model turn
94
-
95
- Call the preparation tool directly:
96
-
97
- ```bash
98
- agent-sdk call prepare_pr \
99
- --dir examples/bugbot \
100
- --input '{"pr":"https://github.com/owner/repo/pull/123"}'
101
- ```
102
-
103
- Direct tool calls use a scratch workspace removed after the call.
104
- `prepare_pr` detects this path and returns the complete file map in its
105
- result. In a model session, it writes the files and returns a smaller summary.
106
-
107
- The evidence builder applies explicit limits:
108
-
109
- | Evidence | Limit |
110
- | --- | --- |
111
- | Post-change file | 12,000 characters |
112
- | One rule file | 8,000 characters |
113
- | Combined rules | 12,000 characters |
114
- | PR body in metadata | 2,000 characters |
115
-
116
- Large files remain visible in `diff.patch`. The manifest records which full
117
- files or rules were omitted.
118
-
119
- The per-file limits aren't an aggregate context cap. Every changed file below
120
- 12,000 characters can be included. The diff command has a 12 MiB output
121
- buffer; a larger diff fails preparation instead of being truncated.
122
-
123
- ## Run the HTTP review path
124
-
125
- Start the server:
126
-
127
- ```bash
128
- agent-sdk dev examples/bugbot
129
- ```
130
-
131
- From another terminal:
132
-
133
- ```bash
134
- curl -s -X POST \
135
- http://127.0.0.1:3000/bugbot/v1/channels/review/ \
136
- -H 'content-type: application/json' \
137
- -d '{"pr":"https://github.com/owner/repo/pull/123"}'
138
- ```
139
-
140
- The route returns `status: "started"`, a continuation token, and session and
141
- playground URLs. Open the session URL to watch the model read the evidence and
142
- produce findings.
143
-
144
- The channel declares `localDevStrict()`. Direct loopback callers can use it.
145
- Proxy-forwarding headers and non-loopback hosts are rejected.
146
-
147
- Send a follow-up by passing the returned key:
148
-
149
- ```bash
150
- curl -s -X POST \
151
- http://127.0.0.1:3000/bugbot/v1/channels/review/ \
152
- -H 'content-type: application/json' \
153
- -d '{"pr":"owner/repo#123","key":"<continuation-token>"}'
154
- ```
155
-
156
- The follow-up resumes the session without fetching a new evidence tree.
157
-
158
- ## Run the Slack path
159
-
160
- The account-linked Slack channel handles review-bot mentions and direct
161
- messages:
162
-
163
- > Review https://github.com/owner/repo/pull/123
164
-
165
- Slack handlers don't receive the channel `callTool` helper. This example calls
166
- the shared `preparePrReview` host function, then returns `workspaceFiles` in
167
- the Slack message preparation result. The model sees the same evidence and
168
- prompt as the HTTP path.
169
-
170
- If a message contains no PR reference, the handler asks for one. Thread
171
- follow-ups keep the same session.
172
-
173
- ## See how the skill constrains review
174
-
175
- `pr-review.md` tells the model to:
176
-
177
- - read the manifest and unified diff first,
178
- - open at most one supporting file or rules file when a hunk is ambiguous,
179
- - avoid shell, network, `gh`, and `git`,
180
- - report no more than three findings,
181
- - keep each description under 120 words, and
182
- - emit the machine-readable review contract.
183
-
184
- The root instructions set the evidence boundary. The skill holds the reusable
185
- review procedure. Keeping those roles separate lets another agent reuse the
186
- same skill with different intake channels.
187
-
188
- ## Run the fixture-backed eval
189
-
190
- ```bash
191
- agent-sdk eval --dir examples/bugbot --list
192
- agent-sdk eval --dir examples/bugbot review/smoke --json
193
- ```
194
-
195
- The eval constructs a `PreparedPrReview`, seeds its file map through
196
- `workspaceFiles`, and checks for at least one read call with no shell call. It
197
- doesn't assert which evidence file was read or whether the skill loaded. It
198
- accepts either a formatted review or a clean result.
199
-
200
- This case tests review behavior without GitHub credentials or network data.
201
- Add fixtures with reachable bugs when you need stricter location and severity
202
- checks.
203
-
204
- ## Keep the side-effect boundary clear
205
-
206
- The reviewer makes no remote GitHub writes. It doesn't author a GitHub channel and
207
- doesn't call a review API. Host preparation does write session evidence and
208
- force-update `refs/pull/<N>/head` in either its bare cache or a matching local
209
- checkout when the commit is missing. Every result ends with a note saying no
210
- GitHub review was posted.
211
-
212
- If you add publishing later, keep it in a separate tool. This preserves a
213
- read-only preparation and review path safe to run in evals.
214
-
215
- ## Reuse the evidence handoff
216
-
217
- Use host-prepared workspaces when:
218
-
219
- - external APIs should stay off the model's tool surface,
220
- - context needs hard size limits,
221
- - the model should inspect a snapshot instead of a live checkout, or
222
- - several channels need the same preparation.
223
-
224
- Return `workspaceFiles` from direct host preparation, write into
225
- `ctx.workspaceDir` for mid-turn recovery, and encode the reading order in both
226
- the manifest and a skill.
227
-
228
- ## Where to go next
229
-
230
- - [Webhooks and custom channels](../guides/webhooks.md)
231
- - [Tools](../reference/tools.md)
232
- - [Skills](../reference/skills.md)
233
- - [Slack](../guides/slack.md)
234
- - [Evals](../evals.md)