@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,334 +0,0 @@
1
- ---
2
- title: "Hand PR triage to managed remote agents"
3
- description: "Coordinate local chat, per-PR remote sessions, GitHub wake buffering, workflow MCP enrollment, durable affinity, findings, and reminders."
4
- ---
5
-
6
- # Hand PR triage to managed remote agents
7
-
8
- The remote PR coordinator keeps chat and routing on the local serve host,
9
- then hands each pull request to a managed remote agent with a real checkout.
10
- The same remote conversation resumes when a user drives the PR again, GitHub
11
- reports a change, or a merge-conflict reminder fires.
12
-
13
- This example is Cursor-internal. For your own repos, scaffold
14
- [PR autofixer](../templates/pr-autofixer.md) instead.
15
-
16
- The workflow backend enrolls each remote run with a workflow MCP. Its tools
17
- and the host's findings routes read and write the same external findings
18
- service.
19
-
20
- Use this example when repository work is too heavy or concurrent for local
21
- worktrees, but the host should still own intake, session identity, policy, and
22
- bookkeeping.
23
-
24
- [Browse the current coordinator source.](../../examples/fsd/)
25
-
26
- ## Resume one remote agent across every PR wake
27
-
28
- The coordinator uses a hybrid runtime:
29
-
30
- - Ordinary playground and Slack chat run locally.
31
- - The `drive_pr` server tool creates a remote session for one PR.
32
- - The remote worker gets the repository and PR reference.
33
- - An `agent.bound` hook records the remote run id and enrolls the run into a
34
- workflow MCP.
35
- - Webhooks and reminders resume the same remote agent through durable
36
- PR-to-agent affinity.
37
-
38
- No other example moves one logical conversation across local chat, remote
39
- execution, event wakes, and timed follow-ups.
40
-
41
- ## Follow a chat request
42
-
43
- 1. A user asks local chat or Slack to drive a PR.
44
- 2. The root model calls `drive_pr` with the PR, mode, and optional hint.
45
- 3. The tool calls `ctx.send("drive", ...)` with a per-session `cloud` block
46
- to attach the PR.
47
- 4. The Agent SDK creates or resumes the `drive` session keyed by
48
- `pr:owner/repo#N`.
49
- 5. The remote runtime provisions the agent and emits `agent.bound`.
50
- 6. The enrollment hook writes PR affinity and calls the workflow backend to
51
- attach run-scoped MCP tools.
52
- 7. `drive_pr` waits for remote binding, then returns the agent id and URL.
53
- If binding exceeds its wait window, those fields can be `null` while work
54
- continues.
55
- 8. The remote agent reads the host-prepared PR brief, checks unresolved state,
56
- and records findings through the workflow MCP.
57
- 9. The host forwards a validated fallback output block when MCP wasn't
58
- available for the turn.
59
-
60
- The local chat agent doesn't have the target checkout, `gh`, `git`, or the
61
- workflow MCP. Its job is coordination.
62
-
63
- A request for a merged or closed PR finishes before provisioning. That result
64
- has `status: "finished"` and no remote session.
65
-
66
- ## Map the framework features
67
-
68
- | Capability | Source | Role |
69
- | --- | --- | --- |
70
- | Hybrid config | [`agent/agent.ts`](../../examples/fsd/agent/agent.ts) | Keep chat local, set remote-runtime defaults, disable automatic PR creation, and isolate local harness workspaces. |
71
- | Root instructions | [`agent/instructions.md`](../../examples/fsd/agent/instructions.md) | Separate local coordination from remote triage and define suggest/apply policy. |
72
- | Drive tool | [`agent/tools/drive_pr.ts`](../../examples/fsd/agent/tools/drive_pr.ts) | Hand a chat request to the `drive` channel and wait for remote binding. |
73
- | Drive channel | [`agent/channels/drive.ts`](../../examples/fsd/agent/channels/drive.ts) | Start remote work and expose findings read/write routes. |
74
- | GitHub channel | [`agent/channels/github.ts`](../../examples/fsd/agent/channels/github.ts) | Buffer PR, comment, review, check, and status wakes. |
75
- | Slack channel | [`agent/channels/slack.ts`](../../examples/fsd/agent/channels/slack.ts) | Route Slack requests to the local coordinator. |
76
- | Hooks | [`agent/hooks/enroll-fsd.ts`](../../examples/fsd/agent/hooks/enroll-fsd.ts), [`agent/hooks/record-outputs.ts`](../../examples/fsd/agent/hooks/record-outputs.ts) | Bind remote identity, enroll MCP, and forward fallback findings. |
77
- | Affinity and buffering | [`agent/lib/pr-affinity.ts`](../../examples/fsd/agent/lib/pr-affinity.ts), [`agent/lib/webhook-buffer.ts`](../../examples/fsd/agent/lib/webhook-buffer.ts) | Persist PR identity, sticky mode, and pending wakes. |
78
- | Reminders | [`agent/lib/merge-conflict-watch.ts`](../../examples/fsd/agent/lib/merge-conflict-watch.ts) | Recheck merge conflicts every 30 minutes. |
79
- | Workflow client | [`agent/lib/fsd-platform.ts`](../../examples/fsd/agent/lib/fsd-platform.ts) | Enroll external runs and read or record findings. |
80
- | Storage | [`agent/storage.ts`](../../examples/fsd/agent/storage.ts) | Persist sessions and events with `cursorHostedStorage`. |
81
-
82
- The coordinator has no authored skill, subagent, MCP connection, static
83
- schedule, A/B experiment, eval, or tool approval.
84
-
85
- The workflow MCP is dynamic. Backend enrollment attaches it to the remote run,
86
- so there is no file under `agent/mcp-connections/`.
87
-
88
- ## Understand local and remote workspaces
89
-
90
- The root config sets `runtime: "local"` because `drive_pr` is a server tool.
91
- It also supplies remote-runtime defaults through the `cloud` configuration:
92
-
93
- ```ts
94
- local: {
95
- cwd: join(homedir(), ".cache", "agent-serve", "fsd"),
96
- },
97
- cloud: {
98
- env: { type: "cloud" },
99
- autoCreatePR: false,
100
- },
101
- ```
102
-
103
- The local cwd sits outside the monorepo, so inherited repository instructions
104
- don't affect coordinator chat.
105
-
106
- Remote sessions get a repository attachment with the target PR. The worker starts
107
- from the PR base and creates an automation side branch from the PR head only when
108
- code context or a fix is needed. The serve host never checks out target code.
109
-
110
- ## Prepare access
111
-
112
- You need:
113
-
114
- - Node 22.13 or newer.
115
- - An agent-runtime user credential.
116
- - Access to a managed remote runtime.
117
- - Access to the target GitHub PR.
118
- - Access to the workflow backend and findings store.
119
-
120
- Keep the affinity and webhook-buffer files on durable storage for a
121
- long-lived host.
122
-
123
- ## Validate without starting remote work
124
-
125
- ```bash
126
- agent-sdk validate --dir examples/fsd
127
- agent-sdk info --dir examples/fsd --json
128
- agent-sdk github events --dir examples/fsd --json
129
- ```
130
-
131
- These commands inspect discovery and declared GitHub events. They don't
132
- provision a remote agent.
133
-
134
- ## Choose suggest or apply
135
-
136
- Every PR has a sticky mode:
137
-
138
- | Mode | Required remote behavior |
139
- | --- | --- |
140
- | `suggest` | May create verified commits on the VM's local side branch. Instructions require no pushes, comments, PR edits, or workflow actions. Records exact fixes and actions as findings for the owner. |
141
- | `apply` | Pushes verified fixes to the existing PR head and may update metadata, reply to threads, mark a draft ready, rebase, or rerun CI. |
142
-
143
- The remote instructions forbid merging, enabling auto-merge, force-pushing,
144
- and opening a new PR in both modes. `autoCreatePR: false` also disables the
145
- SDK's automatic PR creation. The other restrictions are prompt policy, not a
146
- deterministic host gate. `suggest` is the default.
147
-
148
- The selected mode is stored beside PR affinity. Webhooks and reminders reuse
149
- it. Re-driving a PR can change the host-side mode. Backend enrollment records
150
- the mode at first enrollment, so each later host prompt repeats the current
151
- authoritative mode.
152
-
153
- > [!CAUTION]
154
- > `apply` writes to the user's PR branch and triggers CI. Use `suggest` for
155
- > development. Both modes provision a billed remote agent and can write
156
- > structured findings to the findings service. `drive_pr` has no approval gate,
157
- > and suggest/apply restrictions depend on the remote agent following its
158
- > instructions.
159
-
160
- ## Start a suggest-mode drive
161
-
162
- Run the host:
163
-
164
- ```bash
165
- agent-sdk dev examples/fsd
166
- ```
167
-
168
- From chat:
169
-
170
- > Drive https://github.com/owner/repo/pull/123 in suggest mode.
171
-
172
- Or call the coordinator tool:
173
-
174
- ```bash
175
- agent-sdk call drive_pr \
176
- --dir examples/fsd \
177
- --input '{"pr":"https://github.com/owner/repo/pull/123","mode":"suggest"}'
178
- ```
179
-
180
- For an open PR, the tool waits up to 60 seconds for remote binding and returns:
181
-
182
- - the normalized PR label,
183
- - session and continuation ids,
184
- - the remote-agent id and URL when binding completes in that window,
185
- - `status: "started"`, and
186
- - the merge-conflict reminder id.
187
-
188
- It doesn't wait for findings. A slow binding can return `null` identifiers.
189
- Open the returned agent URL when present to follow the remote run.
190
-
191
- ## Use the HTTP drive surface
192
-
193
- The custom channel starts the same orchestration:
194
-
195
- ```bash
196
- curl -s -X POST \
197
- http://127.0.0.1:3000/fsd/v1/channels/drive/ \
198
- -H 'content-type: application/json' \
199
- -d '{"pr":"owner/repo#123","mode":"suggest"}'
200
- ```
201
-
202
- This route returns as soon as the channel session exists. The remote-agent id
203
- can still be `null` at that point. Triage continues in the background.
204
-
205
- Read findings later:
206
-
207
- ```bash
208
- curl -s \
209
- 'http://127.0.0.1:3000/fsd/v1/channels/drive/findings?pr=owner/repo%23123'
210
- ```
211
-
212
- The external findings service is the source of truth. The local host doesn't keep a second
213
- findings database.
214
-
215
- The channel also exposes `POST /findings` as a testing surface. It validates
216
- outputs, then writes them to the findings service for a PR already bound by this
217
- host. The route has no approval gate. Keep it under the default loopback auth
218
- or another trusted boundary.
219
-
220
- ## Keep one remote agent per PR
221
-
222
- Within the `drive` channel, the stable continuation token
223
- `pr:owner/repo#N` resumes the same session. GitHub sessions are scoped to
224
- another channel, so a continuation token alone can't bridge them.
225
-
226
- The enrollment hook closes that gap:
227
-
228
- 1. Read the PR from the continuation token or host-authored session title.
229
- 2. Record PR to `sdkAgentId` affinity after `agent.bound`.
230
- 3. Seed later sessions with the same remote id.
231
- 4. Retry workflow MCP enrollment after a completed turn when the first RPC
232
- failed.
233
-
234
- This lets Slack, HTTP drive, GitHub, and reminders talk to one remote
235
- conversation without sharing one channel session.
236
-
237
- ## Buffer GitHub wakes
238
-
239
- The GitHub channel handles pull requests, comments, reviews, check suites,
240
- check runs, and selected status events. It doesn't send payload details to the
241
- model. It asks the remote agent to refresh live source of truth.
242
-
243
- The buffer:
244
-
245
- - groups events by PR,
246
- - waits three seconds for a burst to settle,
247
- - re-buffers while CI settles,
248
- - skips a flush when the PR session is busy,
249
- - tries to write its snapshot before acknowledging a wake, and
250
- - restores pending entries when the channel starts.
251
-
252
- Closing a PR discards its pending entry and cancels its reminders.
253
-
254
- Snapshot persistence is best-effort. Write failures are swallowed silently,
255
- so a delivery can still be acknowledged without a durable snapshot.
256
-
257
- This is the high-volume counterpart to a direct `{ auth }` GitHub wake. See
258
- [GitHub](../guides/github.md#handle-high-event-volume) for the reusable
259
- pattern.
260
-
261
- ## Add merge-conflict checks
262
-
263
- Starting a drive arms one recurring reminder per PR. Every 30 minutes the host
264
- checks mergeability:
265
-
266
- - closed or merged stops the reminder,
267
- - clean skips delivery,
268
- - conflicting sends a follow-up to the owning session, and
269
- - a busy session skips the wake.
270
-
271
- This uses runtime reminders, not a static `agent/schedules/` file. The host
272
- creates, lists, replaces, and cancels reminders through `host.reminders`.
273
- Development mode doesn't fire reminder timers automatically. Dispatch one
274
- through the dev reminder endpoint for a manual proof, or use non-dev `serve`
275
- to run the 30-minute cadence.
276
-
277
- The reminder's `run` handler lives in memory. After a host restart, the Agent SDK
278
- disarms it with `handler_lost_on_restart`; a later drive or webhook path can
279
- arm a fresh handler. Persisted reminder metadata alone doesn't keep the check
280
- running.
281
-
282
- ## Record findings with MCP or a fallback
283
-
284
- After enrollment, the remote agent receives workflow tools for:
285
-
286
- - recording and updating outputs,
287
- - listing current outputs,
288
- - reading PR metadata,
289
- - reading CI state, and
290
- - reading review comments.
291
-
292
- The main output is a structured workflow suggestion or code-change reference.
293
- The remote prompt requires findings as soon as each action becomes clear.
294
-
295
- If enrollment races or MCP is unavailable, the agent writes one fenced
296
- fallback JSON block. The host validates allowed kinds, actions, statuses, and
297
- the 140-character finding body before forwarding it to the same findings
298
- service. The output hook catches fallback blocks from webhook and reminder
299
- turns.
300
-
301
- ## Verify the host logic
302
-
303
- The coordinator has no filesystem evals. Its unit tests cover mode parsing, drive
304
- orchestration, affinity, webhook durability, CI settlement, output parsing,
305
- reminders, and Slack configuration:
306
-
307
- ```bash
308
- pnpm exec vitest run examples/fsd/agent/lib
309
- ```
310
-
311
- Use those tests for host policy. Use a dedicated test PR and suggest mode for
312
- the end-to-end remote path.
313
-
314
- ## Build another hybrid coordinator
315
-
316
- Use this architecture when each work item needs a real checkout:
317
-
318
- 1. Keep conversational intake local.
319
- 2. Open a remote session only after the request identifies a work item.
320
- 3. Give the work item a stable continuation key.
321
- 4. Persist its remote-agent id for cross-channel resume.
322
- 5. Coalesce noisy events before spending another turn.
323
- 6. Put the current mode and permissions in every host prompt.
324
- 7. Record outputs incrementally in a durable sink.
325
- 8. Add reminders for state requiring periodic rechecks.
326
-
327
- ## Where to go next
328
-
329
- - [Cloud runtime](../guides/cloud-runtime.md)
330
- - [GitHub](../guides/github.md)
331
- - [Webhooks and custom channels](../guides/webhooks.md)
332
- - [Schedules and reminders](../reference/schedules.md)
333
- - [Sessions and streaming](../reference/sessions.md)
334
- - [Deployment](../deployment.md)
@@ -1,107 +0,0 @@
1
- ---
2
- title: "Choose the right Agent SDK example"
3
- description: "Compare all twelve example agents by runtime, channels, tools, state, and the framework pattern each one teaches."
4
- ---
5
-
6
- # Choose the right Agent SDK example
7
-
8
- The examples progress from one-channel assistants to durable, event-driven
9
- workflows. Start with the smallest agent for your use case. Each guide
10
- explains its request flow, framework features, verification path, and reusable
11
- design.
12
-
13
- The source projects live under
14
- [`examples/`](../../examples/). Run the commands below from
15
- `packages/agent-serve`. See [Run the CLI](/#run-the-cli) if the
16
- `agent-sdk` command isn't installed.
17
-
18
- ## Compare the examples
19
-
20
- | Agent | Runtime | Intake | Framework focus | What sets it apart |
21
- | --- | --- | --- | --- | --- |
22
- | [Weather agent](./weather-agent.md) | Cloud | HTTP and two Slack transports | Tools, stdio MCP, skill, subagent, schedule, hooks, A/B, and evals | It demonstrates the broad cloud-runtime surface in one domain. |
23
- | [Slack agent](./slack-agent.md) | Local | Account-linked Slack | Channel identity, threads, and suggested prompts | It reaches Slack without authored tools. |
24
- | [Concierge](./concierge.md) | Local | Built-in HTTP | Peer MCP and multi-agent serving | It delegates to a separate agent with its own tools, sessions, and context. |
25
- | [Playbook router](./benny.md) | Local with repo context | Two Slack transports | Channel watching, inherited skills, custom cwd, and an eval | An allowlisted Slack channel becomes an intake queue for repo playbooks. |
26
- | [Alert investigator](./oncall.md) | Local | Watched Slack alerts channel | Bot-post channel watching, per-thread debounce, reminder tools, and host Slack calls | Every alert gets a thread-pinned investigation that schedules its own re-checks. |
27
- | [PR evidence reviewer](./bugbot.md) | Local | Custom HTTP and Slack | Host tool, skill, seeded workspaces, and an eval | The model receives a prepared diff-first evidence tree instead of a checkout. |
28
- | [Approval Buddy](./approval-buddy.md) | Local | GitHub and Slack | Policy tools, two subagents, durable storage, and evals | Code decides whether a PR may be approved. Reviews stay informational. |
29
- | [Security Reviewer](./security-reviewer.md) | Local host pipeline | GitHub and chat | Staged tools, parallel SDK agents, progress UI, durable storage, A/B, and evals | Lives in `factory/security-reviewer/`. Reviewers and triage overlap while the playground shows every stage. |
30
- | [Remote PR coordinator](./fsd.md) | Local coordinator and remote PR sessions | HTTP, GitHub, and Slack | Remote handoff, hooks, affinity, buffering, reminders, and workflow MCP | One remote conversation follows a PR across chat, webhooks, and timed wakes. |
31
- | [Knowledge base](./knowledge-base.md) | Local | Built-in HTTP chat | Durable host-side state, a conventions skill, a schedule, unit tests, and evals | People curate shared facts in chat, and fresh sessions retrieve them from markdown. |
32
- | [Codebase wiki](./codebase-wiki.md) | Local | GitHub and chat | Task-dispatch webhooks, seeded digests, a mapping skill, a schedule, and evals | Merged PRs accumulate into per-feature wiki pages with a daily digest. |
33
- | [Codeowners review](./codeowners-review.md) | Local | GitHub, chat, and fixtures | Ownership routing in code, playbook data files, parallel subagents, and evals | Each product area reviews with its own playbook, and verdicts aggregate mechanically. |
34
-
35
- ## Pick a learning path
36
-
37
- Use this order when you want to learn the Agent SDK one capability at a time:
38
-
39
- 1. Start with [Weather agent](./weather-agent.md) to explore the filesystem
40
- conventions and cloud runtime.
41
- 2. Strip the project back to [Slack agent](./slack-agent.md) to see the
42
- minimum channel surface.
43
- 3. Read [Playbook router](./benny.md) when Slack should route requests into repo
44
- playbooks.
45
- 4. Continue to [Alert investigator](./oncall.md) when the intake is bot
46
- posts and the agent must pace its own engagement and re-checks.
47
- 5. Add composition with [Concierge](./concierge.md).
48
- 6. Study [PR evidence reviewer](./bugbot.md) before giving a model repository
49
- evidence.
50
- 7. Move policy into code with [Approval Buddy](./approval-buddy.md).
51
- 8. Compare [Security Reviewer](./security-reviewer.md) and
52
- [Remote PR coordinator](./fsd.md) for host-side versus remote PR work.
53
- 9. See parallel subagent delegation carry team judgment in
54
- [Codeowners review](./codeowners-review.md).
55
- 10. Curate team context through conversation with
56
- [Knowledge base](./knowledge-base.md), then let GitHub events maintain
57
- product documentation in [Codebase wiki](./codebase-wiki.md).
58
-
59
- ## Common prerequisites
60
-
61
- All examples require:
62
-
63
- - Node 22.13 or newer. Don't run the Agent SDK under Bun.
64
- - Workspace dependencies installed.
65
- - An agent-runtime credential for model turns.
66
-
67
- Several examples need more:
68
-
69
- - Account-linked Slack channels require a connected host account.
70
- - Alert investigator needs a dedicated Socket Mode app with channel-post
71
- events and membership in the watched alerts channel.
72
- - GitHub examples require access to the target repository. Codebase wiki and
73
- Codeowners review call the host `gh` CLI for PR data; the codeowners
74
- fixtures run without network.
75
- - Example agents use `cursorHostedStorage` (`agent/storage.ts`) for Cursor-hosted session storage (control-plane proxy).
76
- - Remote PR coordinator starts remote agent sessions and needs access to its
77
- workflow backend.
78
-
79
- Each guide lists its own credentials, services, and side effects.
80
-
81
- ## Validate any example
82
-
83
- Discovery commands don't start a model turn:
84
-
85
- ```bash
86
- agent-sdk validate --dir examples/weather-agent
87
- agent-sdk info --dir examples/weather-agent --json
88
- ```
89
-
90
- Start one development server with `agent-sdk dev examples/<name>`.
91
- Concierge depends on Weather agent, so its guide creates an isolated
92
- two-project mount. Don't mount the whole examples directory to test one
93
- agent; several advanced examples subscribe to live GitHub events.
94
-
95
- ## Read by framework feature
96
-
97
- - [Concepts](../concepts.md) explains filesystem discovery and runtime
98
- boundaries.
99
- - [Project layout](../reference/project-layout.md) lists every authored
100
- folder.
101
- - [Tools](../reference/tools.md), [channels](../reference/channels.md), and
102
- [MCP connections](../reference/connections.md) cover the core extension
103
- points.
104
- - [Evals](../evals.md) and [live A/B metrics](../ab.md) cover measured
105
- iteration.
106
- - [Deployment](../deployment.md) covers credentials, auth, storage, and
107
- hosting.
@@ -1,173 +0,0 @@
1
- ---
2
- title: "Build a team knowledge base through conversation"
3
- description: "Teach an agent about people, systems, decisions, and preferences; store that knowledge as markdown and retrieve it in fresh sessions."
4
- ---
5
-
6
- # Build a team knowledge base through conversation
7
-
8
- Knowledge base turns conversations into shared team context. Teach the agent
9
- about people, systems, decisions, and standing preferences. Three server
10
- tools read, search, and write human-readable markdown pages; a conventions
11
- skill shapes each write; and a daily schedule merges duplicates and rebuilds
12
- the index. A fresh session retrieves what an earlier conversation captured.
13
-
14
- Use this project when people should curate organizational knowledge through
15
- chat. Use [Codebase wiki](./codebase-wiki.md) when merged PRs should maintain
16
- feature documentation instead.
17
-
18
- [Browse the knowledge base source.](../../examples/knowledge-base/)
19
-
20
- ## Keep shared knowledge on the filesystem
21
-
22
- The knowledge base lives outside any session workspace, in
23
- `.agent-serve/wiki/` by default. `KNOWLEDGE_BASE_DIR` overrides the location,
24
- and the tools resolve it on every call, so tests and evals can point the same
25
- code at a temp directory.
26
-
27
- The store enforces its own safety:
28
-
29
- - Page ids are one to three lowercase kebab-case segments, so a page id
30
- can't escape the wiki directory.
31
- - Pages cap at 64 KiB. Oversized writes fail with instructions to split
32
- the page.
33
- - `wiki_write` replaces whole pages. The instructions require reading a
34
- page before updating it, so rewrites carry existing facts forward.
35
-
36
- Every page is plain markdown. You can open the wiki in an editor,
37
- review it in a PR, or grep it.
38
-
39
- ## Follow a fact through the agent
40
-
41
- 1. You tell the agent something durable: a system, an owner, a standing
42
- preference.
43
- 2. The instructions require a `wiki_search` before claiming knowledge
44
- and a `wiki_write` after learning something worth keeping.
45
- 3. The `wiki-conventions` skill picks the page id (`staging-database`,
46
- `people/jane-doe`), the page shape, and the dated fact format.
47
- 4. The tool writes the page under the durable wiki root and returns
48
- whether it created or updated the page.
49
- 5. A later session, on any channel, finds the fact with `wiki_search`
50
- and cites the knowledge-base page in its answer.
51
-
52
- Ephemeral chatter stays out. The instructions tell the model to skip
53
- one-off questions and to ask before saving anything borderline.
54
-
55
- ## Map the knowledge-base files
56
-
57
- | File | Purpose |
58
- | --- | --- |
59
- | [`agent/agent.ts`](../../examples/knowledge-base/agent/agent.ts) | Selects the local runtime and model. |
60
- | [`agent/instructions.md`](../../examples/knowledge-base/agent/instructions.md) | Sets the read-before-answer and save-after-learning policy. |
61
- | [`agent/lib/wiki-store.ts`](../../examples/knowledge-base/agent/lib/wiki-store.ts) | Validates page ids, lists, reads, writes, and searches the knowledge base. |
62
- | [`agent/tools/wiki_read.ts`](../../examples/knowledge-base/agent/tools/wiki_read.ts) | Reads one page or lists every page with titles and timestamps. |
63
- | [`agent/tools/wiki_search.ts`](../../examples/knowledge-base/agent/tools/wiki_search.ts) | Searches titles and bodies with per-page match lines. |
64
- | [`agent/tools/wiki_write.ts`](../../examples/knowledge-base/agent/tools/wiki_write.ts) | Creates or replaces a page and reports created versus updated. |
65
- | [`agent/skills/wiki-conventions.md`](../../examples/knowledge-base/agent/skills/wiki-conventions.md) | Names pages, shapes them, and dates every fact. |
66
- | [`agent/schedules/gardener.md`](../../examples/knowledge-base/agent/schedules/gardener.md) | Merges duplicates, rebuilds the index, and flags stale facts daily. |
67
- | [`agent/lib/wiki-store.test.ts`](../../examples/knowledge-base/agent/lib/wiki-store.test.ts) | Unit-tests slug safety and store round-trips. |
68
- | [`agent/storage.ts`](../../examples/knowledge-base/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
69
- | [`evals/evals.config.ts`](../../examples/knowledge-base/evals/evals.config.ts) | Caps eval run concurrency. |
70
- | [`evals/knowledge.eval.ts`](../../examples/knowledge-base/evals/knowledge.eval.ts) | Seeds a temp knowledge base and gates recall, save, and no-write decisions. |
71
-
72
- There is no authored channel, MCP connection, subagent, hook, or A/B
73
- experiment. The wiki directory is the durable knowledge store.
74
-
75
- ## Prepare the example
76
-
77
- You need:
78
-
79
- - Node 22.13 or newer.
80
- - An agent-runtime credential for model turns.
81
-
82
- Nothing else. The wiki is created on first write.
83
-
84
- ## Validate the surface
85
-
86
- ```bash
87
- agent-sdk validate --dir examples/knowledge-base
88
- agent-sdk info --dir examples/knowledge-base --json
89
- ```
90
-
91
- The manifest should report three server tools, one skill, and one
92
- schedule.
93
-
94
- ## Exercise the store without a model turn
95
-
96
- ```bash
97
- agent-sdk call wiki_write \
98
- --dir examples/knowledge-base \
99
- --input '{"page":"staging-database","content":"# Staging database\n\n- Port: 6432 (recorded 2026-07-19)\n"}'
100
-
101
- agent-sdk call wiki_search \
102
- --dir examples/knowledge-base \
103
- --input '{"query":"6432"}'
104
-
105
- agent-sdk call wiki_read --dir examples/knowledge-base --input '{}'
106
- ```
107
-
108
- Invalid page ids fail fast. Try `{"page":"../escape"}` and the tool
109
- returns the validation error instead of touching the filesystem.
110
-
111
- ## Prove recall across sessions
112
-
113
- ```bash
114
- agent-sdk dev examples/knowledge-base
115
- ```
116
-
117
- Teach it something in the playground:
118
-
119
- > Remember: our staging database is Postgres at
120
- > staging-db.internal.example.com, port 6432 via PgBouncer. Jane Doe
121
- > owns it.
122
-
123
- The trace shows the conventions skill load, then `wiki_write` calls
124
- for `staging-database`, `people/jane-doe`, and `index`. Start a new
125
- session and ask:
126
-
127
- > What port does our staging database use, and who owns it?
128
-
129
- The fresh session finds the answer with `wiki_search` and `wiki_read`
130
- and cites the pages. The conversation history is empty; the wiki is the
131
- source of truth.
132
-
133
- ## Run the gardener
134
-
135
- The `gardener` schedule fires at 06:00 UTC and rewrites the wiki for
136
- consistency: merge near-duplicate pages, rebuild `index`, and flag
137
- facts older than 90 days. Under `agent-sdk dev`, timers don't auto-fire.
138
- Trigger it by hand:
139
-
140
- ```bash
141
- curl -s -X POST http://127.0.0.1:3000/knowledge-base/v1/dev/schedules/gardener
142
- ```
143
-
144
- ## Run the evals
145
-
146
- ```bash
147
- agent-sdk eval --dir examples/knowledge-base --list
148
- agent-sdk eval --dir examples/knowledge-base knowledge/recall
149
- ```
150
-
151
- The eval file seeds a temp directory through `KNOWLEDGE_BASE_DIR`
152
- inside the cases, so the durable knowledge base never sees test data.
153
- `knowledge/recall` proves the fact comes from disk, not the conversation.
154
- `knowledge/save`
155
- gates the write decision, and `knowledge/no-write-on-ephemera` proves small
156
- talk stays out of the knowledge base.
157
-
158
- ## Reuse the knowledge-base pattern
159
-
160
- Copy this shape when an agent needs durable, inspectable team knowledge:
161
-
162
- - Resolve the storage root lazily behind an environment override.
163
- - Validate identifiers in the store, not in the prompt.
164
- - Put naming and structure conventions in a skill so writes stay
165
- consistent.
166
- - Add a consolidation schedule instead of letting pages rot.
167
-
168
- ## Where to go next
169
-
170
- - [Tools](../reference/tools.md)
171
- - [Skills](../reference/skills.md)
172
- - [Schedules](../reference/schedules.md)
173
- - [Evals](../evals.md)