@cursor/july 0.1.93 → 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 (318) hide show
  1. package/AGENTS.md +8 -20
  2. package/README.md +4 -26
  3. package/dist/channels/slack/attachments.js +2 -2
  4. package/dist/channels/slack/dispatch.d.ts +0 -7
  5. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  6. package/dist/channels/slack/dispatch.js +4 -7
  7. package/dist/channels/slack/eval-directive.d.ts +5 -12
  8. package/dist/channels/slack/eval-directive.d.ts.map +1 -1
  9. package/dist/channels/slack/eval-directive.js +8 -19
  10. package/dist/channels/slack/index.d.ts +0 -6
  11. package/dist/channels/slack/index.d.ts.map +1 -1
  12. package/dist/channels/slack/index.js +0 -6
  13. package/dist/channels/slack/setup.d.ts +4 -4
  14. package/dist/channels/slack/setup.d.ts.map +1 -1
  15. package/dist/channels/slack/setup.js +8 -15
  16. package/dist/channels/slack/slack-channel.d.ts +6 -13
  17. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  18. package/dist/channels/slack/slack-channel.js +15 -101
  19. package/dist/channels/slack/types.d.ts +12 -79
  20. package/dist/channels/slack/types.d.ts.map +1 -1
  21. package/dist/channels/slack/types.js +1 -15
  22. package/dist/client.d.ts +14 -0
  23. package/dist/client.d.ts.map +1 -0
  24. package/dist/client.js +12 -0
  25. package/dist/connections.d.ts +18 -9
  26. package/dist/connections.d.ts.map +1 -1
  27. package/dist/connections.js +17 -8
  28. package/dist/docs/404.html +2 -2
  29. package/dist/docs/ab.html +4 -4
  30. package/dist/docs/assets/{app.CjWU-x0z.js → app.CFDEas4I.js} +1 -1
  31. package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
  32. package/dist/docs/assets/chunks/{VPLocalSearchBox.Cxy8ySFQ.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
  33. package/dist/docs/assets/chunks/{theme.Dvq1Bktu.js → theme.Ct4NSiLm.js} +2 -2
  34. package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
  35. package/dist/docs/assets/{deployment.md.DoLFAzfm.js → deployment.md.D9msOFOW.js} +3 -8
  36. package/dist/docs/assets/{deployment.md.DoLFAzfm.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
  37. package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.js → guides_agent-to-agent.md.BDb0t1QV.js} +1 -1
  38. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
  39. package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
  40. package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.js → guides_convert-automation.md.B4sjlodG.js} +1 -1
  41. package/dist/docs/assets/{guides_github.md.DqJhuaN1.js → guides_github.md.Cnh2mL4a.js} +1 -1
  42. package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
  43. package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
  44. package/dist/docs/assets/{guides_slack.md.mqeNKs84.js → guides_slack.md.C32HsdKk.js} +5 -11
  45. package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
  46. package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
  47. package/dist/docs/assets/{index.md.B-lVR4wT.lean.js → index.md.DRakGHFe.lean.js} +1 -1
  48. package/dist/docs/assets/{quickstart.md.BrmfrrIr.js → quickstart.md.Nj_LjW_a.js} +1 -1
  49. package/dist/docs/assets/{reference_cli.md.D9KESDsD.js → reference_cli.md.Cw6_ICYG.js} +1 -1
  50. package/dist/docs/assets/{reference_connections.md.DB6SsN6U.js → reference_connections.md.BH8Oc0D0.js} +5 -5
  51. package/dist/docs/assets/{reference_connections.md.DB6SsN6U.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
  52. package/dist/docs/assets/{reference_hooks.md.BxN87gCw.js → reference_hooks.md.a8BJxMR5.js} +1 -1
  53. package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
  54. package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
  55. package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
  56. package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.8son6Hjm.js} +3 -3
  57. package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
  58. package/dist/docs/assets/{reference_tools.md.DuKvkYWG.js → reference_tools.md.BHeXn2id.js} +3 -3
  59. package/dist/docs/assets/{reference_tools.md.DuKvkYWG.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
  60. package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
  61. package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
  62. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
  63. package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
  64. package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
  65. package/dist/docs/building-with-agents.html +4 -4
  66. package/dist/docs/concepts.html +5 -5
  67. package/dist/docs/concepts.md +1 -0
  68. package/dist/docs/deployment.html +7 -12
  69. package/dist/docs/deployment.md +1 -20
  70. package/dist/docs/design/agsh.md +406 -0
  71. package/dist/docs/evals.html +4 -4
  72. package/dist/docs/guides/agent-to-agent.html +6 -6
  73. package/dist/docs/guides/agent-to-agent.md +2 -2
  74. package/dist/docs/guides/cloud-runtime.html +6 -6
  75. package/dist/docs/guides/cloud-runtime.md +1 -0
  76. package/dist/docs/guides/convert-automation.html +6 -6
  77. package/dist/docs/guides/convert-automation.md +1 -1
  78. package/dist/docs/guides/github.html +6 -6
  79. package/dist/docs/guides/github.md +4 -4
  80. package/dist/docs/guides/human-in-the-loop.html +4 -4
  81. package/dist/docs/guides/mcp-oauth.html +11 -13
  82. package/dist/docs/guides/mcp-oauth.md +10 -18
  83. package/dist/docs/guides/opentelemetry.html +5 -5
  84. package/dist/docs/guides/slack.html +9 -15
  85. package/dist/docs/guides/slack.md +9 -46
  86. package/dist/docs/guides/webhooks.html +4 -4
  87. package/dist/docs/hashmap.json +1 -1
  88. package/dist/docs/hillclimbing.html +4 -4
  89. package/dist/docs/index.html +6 -6
  90. package/dist/docs/index.md +0 -28
  91. package/dist/docs/llms-full.txt +712 -2830
  92. package/dist/docs/llms.txt +2 -16
  93. package/dist/docs/quickstart.html +6 -6
  94. package/dist/docs/quickstart.md +2 -3
  95. package/dist/docs/reference/agent-config.html +4 -4
  96. package/dist/docs/reference/artifacts.html +4 -4
  97. package/dist/docs/reference/channels.html +4 -4
  98. package/dist/docs/reference/cli.html +6 -6
  99. package/dist/docs/reference/cli.md +2 -1
  100. package/dist/docs/reference/connections.html +9 -9
  101. package/dist/docs/reference/connections.md +15 -11
  102. package/dist/docs/reference/hooks.html +6 -6
  103. package/dist/docs/reference/hooks.md +2 -3
  104. package/dist/docs/reference/http-api.html +6 -6
  105. package/dist/docs/reference/http-api.md +8 -0
  106. package/dist/docs/reference/instructions.html +4 -4
  107. package/dist/docs/reference/playground.html +4 -4
  108. package/dist/docs/reference/project-layout.html +8 -6
  109. package/dist/docs/reference/project-layout.md +5 -1
  110. package/dist/docs/reference/prompt.html +4 -4
  111. package/dist/docs/reference/schedules.html +4 -4
  112. package/dist/docs/reference/sessions.html +4 -4
  113. package/dist/docs/reference/skills.html +7 -7
  114. package/dist/docs/reference/subagents.html +6 -6
  115. package/dist/docs/reference/subagents.md +2 -2
  116. package/dist/docs/reference/tools.html +7 -7
  117. package/dist/docs/reference/tools.md +19 -3
  118. package/dist/docs/scaffolding-agents.html +4 -4
  119. package/dist/docs/storage.html +4 -4
  120. package/dist/docs/templates/agentic-owners.html +4 -4
  121. package/dist/docs/templates/demo.html +4 -4
  122. package/dist/docs/templates/pr-autofixer.html +6 -6
  123. package/dist/docs/templates/pr-autofixer.md +4 -3
  124. package/dist/docs/templates/security-reviewer.html +5 -5
  125. package/dist/docs/templates/security-reviewer.md +2 -3
  126. package/dist/docs/templates/triage.html +4 -4
  127. package/dist/docs/troubleshooting.html +5 -5
  128. package/dist/docs/troubleshooting.md +2 -2
  129. package/dist/index.d.ts +1 -1
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +1 -1
  132. package/dist/internal/advertise-tools.d.ts +11 -0
  133. package/dist/internal/advertise-tools.d.ts.map +1 -1
  134. package/dist/internal/advertise-tools.js +47 -9
  135. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  136. package/dist/internal/cli-mcp-oauth.js +7 -4
  137. package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
  138. package/dist/internal/convert-automation/convert-workflow.js +26 -15
  139. package/dist/internal/convert-automation/slug.d.ts +0 -2
  140. package/dist/internal/convert-automation/slug.d.ts.map +1 -1
  141. package/dist/internal/convert-automation/slug.js +0 -8
  142. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  143. package/dist/internal/cursor/account-mcp.js +5 -1
  144. package/dist/internal/discovery.d.ts.map +1 -1
  145. package/dist/internal/discovery.js +88 -13
  146. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  147. package/dist/internal/hosted-delivery.js +22 -9
  148. package/dist/internal/mcp-endpoint.js +3 -3
  149. package/dist/internal/mcp-host.d.ts +8 -7
  150. package/dist/internal/mcp-host.d.ts.map +1 -1
  151. package/dist/internal/mcp-host.js +8 -7
  152. package/dist/internal/peer-connections.d.ts.map +1 -1
  153. package/dist/internal/peer-connections.js +5 -1
  154. package/dist/internal/playground/static.d.ts +0 -3
  155. package/dist/internal/playground/static.d.ts.map +1 -1
  156. package/dist/internal/resolved-connections.d.ts.map +1 -1
  157. package/dist/internal/resolved-connections.js +5 -7
  158. package/dist/internal/server.d.ts.map +1 -1
  159. package/dist/internal/server.js +113 -172
  160. package/dist/internal/session-engine.d.ts +45 -10
  161. package/dist/internal/session-engine.d.ts.map +1 -1
  162. package/dist/internal/session-engine.js +208 -65
  163. package/dist/internal/tool-catalog.d.ts +31 -0
  164. package/dist/internal/tool-catalog.d.ts.map +1 -0
  165. package/dist/internal/tool-catalog.js +67 -0
  166. package/dist/playground/assets/{index-D9MFzhNE.js → index-B3JCyigB.js} +1 -1
  167. package/dist/playground/index.html +1 -1
  168. package/dist/types.d.ts +72 -23
  169. package/dist/types.d.ts.map +1 -1
  170. package/dist/types.js +19 -0
  171. package/docs/README.md +0 -28
  172. package/docs/concepts.md +1 -0
  173. package/docs/deployment.md +1 -20
  174. package/docs/design/agsh.md +406 -0
  175. package/docs/guides/agent-to-agent.md +2 -2
  176. package/docs/guides/cloud-runtime.md +1 -0
  177. package/docs/guides/convert-automation.md +1 -1
  178. package/docs/guides/github.md +4 -4
  179. package/docs/guides/mcp-oauth.md +10 -18
  180. package/docs/guides/slack.md +10 -47
  181. package/docs/quickstart.md +2 -3
  182. package/docs/reference/cli.md +2 -1
  183. package/docs/reference/connections.md +15 -11
  184. package/docs/reference/hooks.md +2 -3
  185. package/docs/reference/http-api.md +8 -0
  186. package/docs/reference/project-layout.md +5 -1
  187. package/docs/reference/subagents.md +2 -2
  188. package/docs/reference/tools.md +19 -3
  189. package/docs/templates/pr-autofixer.md +4 -3
  190. package/docs/templates/security-reviewer.md +2 -3
  191. package/docs/troubleshooting.md +2 -2
  192. package/package.json +9 -2
  193. package/skills/create-agent/SKILL.md +6 -13
  194. package/skills/debug/SKILL.md +2 -4
  195. package/skills/evals/SKILL.md +1 -1
  196. package/skills/framework-map/SKILL.md +3 -2
  197. package/skills/mcp-auth/SKILL.md +10 -13
  198. package/skills/setup-slack/SKILL.md +21 -137
  199. package/src/channels/slack/attachments.ts +2 -2
  200. package/src/channels/slack/dispatch.ts +2 -16
  201. package/src/channels/slack/eval-directive.ts +8 -27
  202. package/src/channels/slack/index.ts +0 -6
  203. package/src/channels/slack/setup.ts +8 -15
  204. package/src/channels/slack/slack-channel.ts +14 -125
  205. package/src/channels/slack/types.ts +12 -96
  206. package/src/client.ts +23 -0
  207. package/src/connections.ts +20 -7
  208. package/src/index.ts +2 -0
  209. package/src/internal/advertise-tools.ts +45 -7
  210. package/src/internal/cli-mcp-oauth.ts +6 -4
  211. package/src/internal/convert-automation/convert-workflow.ts +29 -17
  212. package/src/internal/convert-automation/slug.ts +0 -9
  213. package/src/internal/cursor/account-mcp.ts +4 -1
  214. package/src/internal/discovery.ts +104 -13
  215. package/src/internal/fixtures/units-server.ts +52 -0
  216. package/src/internal/hosted-delivery.ts +60 -28
  217. package/src/internal/mcp-endpoint.ts +3 -3
  218. package/src/internal/mcp-host.ts +8 -7
  219. package/src/internal/peer-connections.ts +4 -1
  220. package/src/internal/playground/static.ts +1 -3
  221. package/src/internal/resolved-connections.ts +8 -10
  222. package/src/internal/server.ts +151 -251
  223. package/src/internal/session-engine.ts +254 -69
  224. package/src/internal/tool-catalog.ts +106 -0
  225. package/src/types.ts +90 -23
  226. package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
  227. package/templates/triage/README.md +2 -1
  228. package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
  229. package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
  230. package/dist/channels/slack/cursor-account.d.ts +0 -87
  231. package/dist/channels/slack/cursor-account.d.ts.map +0 -1
  232. package/dist/channels/slack/cursor-account.js +0 -100
  233. package/dist/docs/assets/chunks/@localSearchIndexroot.ChpIC3Zy.js +0 -1
  234. package/dist/docs/assets/concepts.md.F6AiPorA.js +0 -1
  235. package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.js +0 -10
  236. package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.lean.js +0 -1
  237. package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.js +0 -5
  238. package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.lean.js +0 -1
  239. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
  240. package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
  241. package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.js +0 -8
  242. package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.lean.js +0 -1
  243. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
  244. package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
  245. package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.js +0 -22
  246. package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.lean.js +0 -1
  247. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +0 -2
  248. package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +0 -1
  249. package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.js +0 -11
  250. package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.lean.js +0 -1
  251. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
  252. package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
  253. package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.js +0 -19
  254. package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.lean.js +0 -1
  255. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
  256. package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
  257. package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.js +0 -25
  258. package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.lean.js +0 -1
  259. package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.js +0 -9
  260. package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.lean.js +0 -1
  261. package/dist/docs/assets/guides_slack.md.mqeNKs84.lean.js +0 -1
  262. package/dist/docs/assets/index.md.B-lVR4wT.js +0 -5
  263. package/dist/docs/assets/reference_http-api.md.C68BERYr.js +0 -11
  264. package/dist/docs/assets/reference_http-api.md.C68BERYr.lean.js +0 -1
  265. package/dist/docs/assets/reference_project-layout.md.WN9nwJht.js +0 -17
  266. package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.js +0 -1
  267. package/dist/docs/example-agents/approval-buddy.html +0 -36
  268. package/dist/docs/example-agents/approval-buddy.md +0 -266
  269. package/dist/docs/example-agents/benny.html +0 -31
  270. package/dist/docs/example-agents/benny.md +0 -173
  271. package/dist/docs/example-agents/bugbot.html +0 -37
  272. package/dist/docs/example-agents/bugbot.md +0 -229
  273. package/dist/docs/example-agents/codebase-wiki.html +0 -34
  274. package/dist/docs/example-agents/codebase-wiki.md +0 -167
  275. package/dist/docs/example-agents/codeowners-review.html +0 -34
  276. package/dist/docs/example-agents/codeowners-review.md +0 -192
  277. package/dist/docs/example-agents/concierge.html +0 -48
  278. package/dist/docs/example-agents/concierge.md +0 -200
  279. package/dist/docs/example-agents/index.html +0 -28
  280. package/dist/docs/example-agents/index.md +0 -99
  281. package/dist/docs/example-agents/knowledge-base.html +0 -37
  282. package/dist/docs/example-agents/knowledge-base.md +0 -168
  283. package/dist/docs/example-agents/oncall.html +0 -36
  284. package/dist/docs/example-agents/oncall.md +0 -212
  285. package/dist/docs/example-agents/security-reviewer.html +0 -45
  286. package/dist/docs/example-agents/security-reviewer.md +0 -265
  287. package/dist/docs/example-agents/slack-agent.html +0 -31
  288. package/dist/docs/example-agents/slack-agent.md +0 -142
  289. package/dist/docs/example-agents/weather-agent.html +0 -51
  290. package/dist/docs/example-agents/weather-agent.md +0 -297
  291. package/dist/internal/cursor-slack-relay.d.ts +0 -96
  292. package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
  293. package/dist/internal/cursor-slack-relay.js +0 -176
  294. package/docs/example-agents/approval-buddy.md +0 -271
  295. package/docs/example-agents/benny.md +0 -178
  296. package/docs/example-agents/bugbot.md +0 -234
  297. package/docs/example-agents/codebase-wiki.md +0 -172
  298. package/docs/example-agents/codeowners-review.md +0 -197
  299. package/docs/example-agents/concierge.md +0 -205
  300. package/docs/example-agents/index.md +0 -104
  301. package/docs/example-agents/knowledge-base.md +0 -173
  302. package/docs/example-agents/oncall.md +0 -217
  303. package/docs/example-agents/security-reviewer.md +0 -270
  304. package/docs/example-agents/slack-agent.md +0 -147
  305. package/docs/example-agents/weather-agent.md +0 -302
  306. package/src/channels/slack/cursor-account.ts +0 -202
  307. package/src/internal/cursor-slack-relay.ts +0 -249
  308. /package/dist/docs/assets/{concepts.md.F6AiPorA.lean.js → concepts.md.lwAgBIMI.lean.js} +0 -0
  309. /package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
  310. /package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
  311. /package/dist/docs/assets/{guides_github.md.DqJhuaN1.lean.js → guides_github.md.Cnh2mL4a.lean.js} +0 -0
  312. /package/dist/docs/assets/{quickstart.md.BrmfrrIr.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
  313. /package/dist/docs/assets/{reference_cli.md.D9KESDsD.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +0 -0
  314. /package/dist/docs/assets/{reference_hooks.md.BxN87gCw.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +0 -0
  315. /package/dist/docs/assets/{reference_project-layout.md.WN9nwJht.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
  316. /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
  317. /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
  318. /package/dist/docs/assets/{troubleshooting.md.vCWwvqcJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +0 -0
@@ -1,172 +0,0 @@
1
- ---
2
- title: "Build a feature wiki from merged pull requests"
3
- description: "Ingest every merged PR into per-feature wiki pages, consolidate with a daily digest schedule, and answer codebase questions with page citations."
4
- ---
5
-
6
- # Build a feature wiki from merged pull requests
7
-
8
- Codebase wiki keeps a living, feature-organized wiki of a repository.
9
- The GitHub channel acknowledges every closed pull request instantly,
10
- fetches a compact digest on the host, and spends a model turn only on
11
- merged PRs. The turn maps the change onto feature pages; a daily
12
- schedule writes a digest of what changed and rebuilds the index. Chat
13
- sessions answer codebase questions from the wiki with page citations.
14
-
15
- Use this project when documentation should accumulate from merges
16
- instead of being regenerated from scratch. Use
17
- [Knowledge base](./knowledge-base.md) when people should curate
18
- organizational context through conversation.
19
-
20
- [Browse the codebase wiki source.](../../examples/codebase-wiki/)
21
-
22
- ## Treat PRs as evidence and features as pages
23
-
24
- The wiki refuses to become a merge log:
25
-
26
- - The page tree is rigid: `index`, `features/<slug>`, and
27
- `digests/<yyyy-mm-dd>`. The store rejects anything else, so the wiki
28
- can't sprawl.
29
- - The `feature-mapping` skill requires a `wiki_search` before every
30
- write. A PR updates the page that owns its feature; a new page needs
31
- a genuinely new feature; chores change nothing.
32
- - Every touched page gets a dated changelog entry citing the PR
33
- number, so each fact traces back to a merge.
34
-
35
- The wiki itself is markdown on the serve host, in a wiki directory by
36
- default with a `CODEBASE_WIKI_DIR` override. Sessions are disposable;
37
- the wiki is the durable state.
38
-
39
- ## Follow a merged PR
40
-
41
- 1. GitHub delivers `pull_request` with action `closed`. The channel
42
- returns a task acknowledgement immediately.
43
- 2. The task fetches the digest with the host `gh` CLI: title, body,
44
- labels, changed files, and a bounded diff excerpt. No checkout.
45
- 3. The webhook payload can't say whether the PR merged, so the host
46
- checks `mergedAt` and skips abandoned PRs without a model turn.
47
- 4. For merged PRs, the task starts the turn with `pr/DIGEST.md` seeded
48
- through `workspaceFiles` and a `pr:<owner/repo#N>` continuation
49
- token, so redeliveries resume instead of double-ingesting.
50
- 5. The model follows `feature-mapping`: search, update or create
51
- feature pages, add changelog entries, and refresh `index` when pages
52
- were added.
53
-
54
- In chat, "ingest PR #123" runs the same flow through the `ingest_pr`
55
- tool, which writes the digest into the active session workspace.
56
-
57
- ## Map the wiki files
58
-
59
- | File | Purpose |
60
- | --- | --- |
61
- | [`agent/agent.ts`](../../examples/codebase-wiki/agent/agent.ts) | Selects the local runtime and model. |
62
- | [`agent/instructions.md`](../../examples/codebase-wiki/agent/instructions.md) | Splits the job into merge ingestion and wiki-cited Q&A. |
63
- | [`agent/lib/wiki-store.ts`](../../examples/codebase-wiki/agent/lib/wiki-store.ts) | Enforces the rigid page tree and owns reads, writes, and search. |
64
- | [`agent/lib/pr-digest.ts`](../../examples/codebase-wiki/agent/lib/pr-digest.ts) | Fetches PR metadata and diff, and formats `pr/DIGEST.md`. |
65
- | [`agent/tools/ingest_pr.ts`](../../examples/codebase-wiki/agent/tools/ingest_pr.ts) | Exposes host digest preparation for chat-driven backfills. |
66
- | [`agent/tools/wiki_read.ts`](../../examples/codebase-wiki/agent/tools/wiki_read.ts), [`wiki_search.ts`](../../examples/codebase-wiki/agent/tools/wiki_search.ts), [`wiki_write.ts`](../../examples/codebase-wiki/agent/tools/wiki_write.ts) | Read, search, and rewrite wiki pages. |
67
- | [`agent/skills/feature-mapping.md`](../../examples/codebase-wiki/agent/skills/feature-mapping.md) | Maps changes onto features and fixes the page and changelog shape. |
68
- | [`agent/schedules/daily-digest.md`](../../examples/codebase-wiki/agent/schedules/daily-digest.md) | Writes `digests/<date>`, rebuilds the index, and flags stale pages. |
69
- | [`agent/channels/github.ts`](../../examples/codebase-wiki/agent/channels/github.ts) | Acknowledges closed PRs and starts merged-only ingest turns. |
70
- | [`agent/storage.ts`](../../examples/codebase-wiki/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
71
- | [`evals/evals.config.ts`](../../examples/codebase-wiki/evals/evals.config.ts) | Caps eval run concurrency. |
72
- | [`evals/ingest.eval.ts`](../../examples/codebase-wiki/evals/ingest.eval.ts) | Gates ingest decisions against the wiki filesystem. |
73
-
74
- There is no MCP connection, subagent, hook, or A/B experiment.
75
-
76
- ## Prepare credentials and services
77
-
78
- You need:
79
-
80
- - Node 22.13 or newer.
81
- - An agent-runtime credential for model turns.
82
- - `gh` on `PATH` with read access to the PRs you ingest.
83
-
84
- The channel verifies webhook signatures when `GITHUB_WEBHOOK_SECRET` is
85
- set and narrows repositories with
86
- `CODEBASE_WIKI_REPOS=owner/repo,owner/other`. The agent never writes to
87
- GitHub. Its only side effects are wiki files on the serve host.
88
-
89
- ## Validate the surface
90
-
91
- ```bash
92
- agent-sdk validate --dir examples/codebase-wiki
93
- agent-sdk info --dir examples/codebase-wiki --json
94
- ```
95
-
96
- The manifest should report four server tools, one skill, one schedule,
97
- and the authored GitHub channel.
98
-
99
- ## Ingest without webhook plumbing
100
-
101
- Replay a real merged PR as a closed delivery:
102
-
103
- ```bash
104
- agent-sdk dev examples/codebase-wiki
105
-
106
- agent-sdk github replay https://github.com/owner/repo/pull/123 \
107
- --dir examples/codebase-wiki --action closed
108
- ```
109
-
110
- The reply is a 202 acknowledgement; the ingest continues in the task.
111
- Watch the session in the playground, then open the wiki directory on
112
- the serve host. Feature pages land under `features/`.
113
-
114
- Each ingested feature page carries an overview, a "How it works"
115
- section, and a changelog line citing the PR. Deterministic digest
116
- preparation works without a model turn:
117
-
118
- ```bash
119
- agent-sdk call ingest_pr \
120
- --dir examples/codebase-wiki \
121
- --input '{"pr":"https://github.com/owner/repo/pull/123"}'
122
- ```
123
-
124
- A PR closed without merging returns `merged: false` and a note telling
125
- the model to change nothing.
126
-
127
- ## Run the daily digest
128
-
129
- The schedule fires at 07:00 UTC. Under `agent-sdk dev`, trigger it by
130
- hand:
131
-
132
- ```bash
133
- curl -s -X POST http://127.0.0.1:3000/codebase-wiki/v1/dev/schedules/daily-digest
134
- ```
135
-
136
- The turn reads every feature changelog, writes
137
- `digests/<today>` grouped by feature with PR citations, rebuilds
138
- `index`, and reports one line per page it wrote. Entries dated today
139
- always count; a digest only claims a quiet day when no entry qualifies.
140
-
141
- ## Run the evals
142
-
143
- ```bash
144
- agent-sdk eval --dir examples/codebase-wiki --list
145
- agent-sdk eval --dir examples/codebase-wiki ingest/update-existing
146
- ```
147
-
148
- The cases seed a temp wiki through `CODEBASE_WIKI_DIR` and build
149
- digests with the same formatter the channel uses, so they run without
150
- GitHub or network access. The gates check the filesystem, not prose:
151
- a new feature page lands on a new slug, a related PR updates the
152
- existing page instead of duplicating it, an unmerged PR changes
153
- nothing, and the daily pass writes a digest naming both seeded
154
- features.
155
-
156
- ## Reuse the merge-ingestion pattern
157
-
158
- Copy this shape when events should accumulate into curated state:
159
-
160
- - Acknowledge webhooks with a task and decide host-side whether a
161
- model turn is worth spending.
162
- - Seed evidence through `workspaceFiles` so the model never fetches.
163
- - Constrain the durable store's shape in code and its content in a
164
- skill.
165
- - Add a consolidation schedule so incremental writes stay coherent.
166
-
167
- ## Where to go next
168
-
169
- - [GitHub webhooks](../guides/github.md)
170
- - [Schedules](../reference/schedules.md)
171
- - [Tools](../reference/tools.md)
172
- - [Evals](../evals.md)
@@ -1,197 +0,0 @@
1
- ---
2
- title: "Route PR reviews by code ownership"
3
- description: "Map changed paths to per-area review playbooks, fan one reviewer subagent out per area, and aggregate verdicts into a single approval decision."
4
- ---
5
-
6
- # Route PR reviews by code ownership
7
-
8
- Codeowners review gives each part of a codebase its own review. A
9
- CODEOWNERS-style table maps changed paths to review areas; each area
10
- has a markdown playbook with the team's rules for that domain; and one
11
- `area-reviewer` subagent runs per routed area, in parallel. A billing
12
- change gets the billing review, a migration gets the migration review,
13
- and an author's personal style rides along as advisory notes. The lead
14
- aggregates: approve only when every area approves.
15
-
16
- Use this project when review quality depends on domain-specific values
17
- instead of one generic checklist.
18
-
19
- [Browse the codeowners review source.](../../examples/codeowners-review/)
20
-
21
- ## Keep routing in code and judgment in playbooks
22
-
23
- The pipeline separates three concerns:
24
-
25
- - `reviews/REVIEWERS` routes. Host code matches every changed path
26
- against the table; every matching rule applies, and unmatched paths
27
- fall back to the `general` playbook. Routing is glob code with unit
28
- tests, not model judgment.
29
- - `reviews/<area>.md` judges. Each playbook is a severity-ordered rule
30
- list the team owns: billing mandates integer cents and idempotent
31
- webhooks, migrations forbid destructive DDL beside code changes,
32
- background jobs demand idempotency and dead-letter paths.
33
- - Subagents review. The lead reads nothing but the manifest and
34
- routes; each `area-reviewer` reads one playbook plus its files' diff
35
- hunks and returns a mechanical verdict: request changes on any High
36
- finding or two Mediums.
37
-
38
- Personal styles extend the same mechanism. `reviews/people/<login>.md`
39
- attaches automatically, as advisory notes, whenever that person authors
40
- the PR. Adding an area or a style is a markdown file plus at most one
41
- routing line.
42
-
43
- ## Follow a review
44
-
45
- 1. A PR arrives: a GitHub `pull_request` event, a chat message, or a
46
- bundled fixture reference.
47
- 2. `prepare_review` fetches metadata and the diff with the host `gh`
48
- CLI, routes every changed file, and writes the `pr/` evidence tree:
49
- `MANIFEST.md`, `ROUTES.md`, `diff.patch`, and a copy of each matched
50
- playbook.
51
- 3. The lead follows the `review-process` skill and issues one
52
- `area-reviewer` delegation per routed area, plus one per personal
53
- style, all in one step so they run in parallel.
54
- 4. Each reviewer reads its playbook, reviews only its files, and
55
- returns a verdict line with at most three findings.
56
- 5. The lead aggregates per-area sections and the overall verdict:
57
- APPROVE only when every non-advisory area approved.
58
-
59
- Nothing posts to GitHub. Verdicts live in the session; the
60
- [Approval Buddy guide](./approval-buddy.md) shows how to wire a real
61
- APPROVE and commit statuses on top of the same shape.
62
-
63
- ## Map the review files
64
-
65
- | File | Purpose |
66
- | --- | --- |
67
- | [`reviews/REVIEWERS`](../../examples/codeowners-review/reviews/REVIEWERS) | Routes path patterns to review areas. |
68
- | [`reviews/`](../../examples/codeowners-review/reviews/) | Holds the area playbooks and `people/<login>.md` styles. |
69
- | [`agent/lib/routing.ts`](../../examples/codeowners-review/agent/lib/routing.ts) | Parses the table, matches globs, and unions areas per file. |
70
- | [`agent/lib/prepare-review.ts`](../../examples/codeowners-review/agent/lib/prepare-review.ts) | Fetches PRs or fixtures and builds the evidence tree. |
71
- | [`agent/tools/prepare_review.ts`](../../examples/codeowners-review/agent/tools/prepare_review.ts) | Exposes host preparation as a typed server tool. |
72
- | [`agent/tools/list_review_areas.ts`](../../examples/codeowners-review/agent/tools/list_review_areas.ts) | Answers routing questions deterministically. |
73
- | [`agent/skills/review-process.md`](../../examples/codeowners-review/agent/skills/review-process.md) | Fixes the fan-out procedure and the verdict rule. |
74
- | [`agent/subagents/area-reviewer/`](../../examples/codeowners-review/agent/subagents/area-reviewer/) | Defines the one-area, one-playbook reviewer contract. |
75
- | [`agent/channels/github.ts`](../../examples/codeowners-review/agent/channels/github.ts) | Reviews opened, reopened, synchronized, and undrafted PRs. |
76
- | [`fixtures/`](../../examples/codeowners-review/fixtures/) | Ships two reviewable PRs with known planted findings. |
77
- | [`agent/storage.ts`](../../examples/codeowners-review/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
78
- | [`evals/evals.config.ts`](../../examples/codeowners-review/evals/evals.config.ts) | Caps eval run concurrency. |
79
- | [`evals/review.eval.ts`](../../examples/codeowners-review/evals/review.eval.ts) | Gates routing, fan-out, planted bugs, and verdicts. |
80
-
81
- There is no MCP connection, schedule, hook, A/B experiment, or custom
82
- storage.
83
-
84
- ## Prepare credentials and services
85
-
86
- You need:
87
-
88
- - Node 22.13 or newer.
89
- - An agent-runtime credential for model turns.
90
- - `gh` on `PATH` with read access to real PRs you review. The bundled
91
- fixtures need no network at all.
92
-
93
- The channel verifies webhook signatures when `GITHUB_WEBHOOK_SECRET` is
94
- set and narrows repositories with
95
- `CODEOWNERS_REVIEW_REPOS=owner/repo,owner/other`. Pushes re-review in
96
- the same session through the `pr:<label>` continuation token.
97
-
98
- ## Validate the surface
99
-
100
- ```bash
101
- agent-sdk validate --dir examples/codeowners-review
102
- agent-sdk info --dir examples/codeowners-review --json
103
- ```
104
-
105
- The manifest should report two server tools, one skill, one subagent,
106
- and the authored GitHub channel.
107
-
108
- ## Inspect routing without a model turn
109
-
110
- ```bash
111
- agent-sdk call list_review_areas --dir examples/codeowners-review --input '{}'
112
-
113
- agent-sdk call prepare_review \
114
- --dir examples/codeowners-review \
115
- --input '{"pr":"fixture:multi-area"}'
116
- ```
117
-
118
- The fixture routes to `billing`, `database-migrations`, and `frontend`,
119
- attaches `people/alice` because alice authored it, and returns the full
120
- evidence map. Point the same tool at a real PR URL and the routing runs
121
- against the live file list. The example table maps a hypothetical
122
- `src/` layout, so most real repositories route to `general` until you
123
- adapt `reviews/REVIEWERS`.
124
-
125
- ## Review the planted fixture
126
-
127
- ```bash
128
- agent-sdk dev examples/codeowners-review
129
- ```
130
-
131
- In the playground:
132
-
133
- > Review fixture:multi-area
134
-
135
- The fixture plants one violation per area: float dollar math in
136
- `src/billing/invoice.ts`, a `DROP COLUMN` plus a non-concurrent index
137
- in the migration, and a clickable `div` without loading states in the
138
- UI. The trace shows `prepare_review`, the evidence reads, four parallel
139
- `area-reviewer` cards, and an aggregated CHANGES REQUESTED verdict with
140
- each planted bug filed under its own area. The second fixture,
141
- `fixture:jobs-clean`, routes to `background-jobs` alone and ends in
142
- APPROVE.
143
-
144
- Review a real PR the same way:
145
-
146
- > Review https://github.com/owner/repo/pull/123
147
-
148
- Or replay one as a webhook delivery:
149
-
150
- ```bash
151
- agent-sdk github replay https://github.com/owner/repo/pull/123 \
152
- --dir examples/codeowners-review --action opened
153
- ```
154
-
155
- ## See how the verdict stays mechanical
156
-
157
- The reviewer contract computes verdicts from findings instead of
158
- letting the model pick a mood: findings first, then
159
- `request-changes` if any High exists or two Mediums do, otherwise
160
- `approve`. Pre-existing issues visible in context are scoped out, at
161
- most one advisory Low. The lead applies one rule on top: the PR is
162
- APPROVE only when every non-advisory area approved.
163
-
164
- ## Run the evals
165
-
166
- ```bash
167
- agent-sdk eval --dir examples/codeowners-review --list
168
- agent-sdk eval --dir examples/codeowners-review review/multi-area
169
- ```
170
-
171
- `review/multi-area` gates the whole pipeline: `prepare_review` runs, at
172
- least three subagent delegations happen, the reply carries every area
173
- section plus alice's advisory notes, the planted billing and migration
174
- bugs surface, and the verdict requests changes. `review/clean-approve`
175
- proves the approval path on the clean fixture, and
176
- `review/routing-question` gates that routing answers come from
177
- `list_review_areas`.
178
-
179
- ## Reuse the ownership-routing pattern
180
-
181
- Copy this shape when different code deserves different judgment:
182
-
183
- - Route with data and code, not prompt instructions. Tables and globs
184
- are testable.
185
- - Write one playbook per domain and keep each reviewer blind to the
186
- others.
187
- - Make verdicts mechanical so aggregation is arithmetic, not
188
- negotiation.
189
- - Ship fixtures with planted findings so the review quality itself is
190
- testable offline.
191
-
192
- ## Where to go next
193
-
194
- - [Approval Buddy](./approval-buddy.md) for posting real approvals
195
- - [Subagents](../reference/subagents.md)
196
- - [GitHub webhooks](../guides/github.md)
197
- - [Evals](../evals.md)
@@ -1,205 +0,0 @@
1
- ---
2
- title: "Compose agents with a concierge"
3
- description: "Delegate weather requests through a peer MCP connection while each agent keeps its own instructions, tools, context, and sessions."
4
- ---
5
-
6
- # Compose agents with a concierge
7
-
8
- Concierge answers general questions itself and sends every weather question
9
- to the weather agent. The connection is one file. The Agent SDK turns the target
10
- agent's MCP endpoint into tools the concierge can call.
11
-
12
- Use this example when two agents are useful on their own and one should
13
- delegate a narrow class of work to the other.
14
-
15
- [Browse the Concierge source.](../../examples/concierge/)
16
-
17
- ## Delegate through a peer MCP connection
18
-
19
- Concierge has no domain tool of its own. Its capability comes from a peer MCP
20
- connection:
21
-
22
- ```ts
23
- export default defineConnection({
24
- agent: "weather-agent",
25
- description:
26
- "The weather-agent peer: delegate weather questions with ask; it runs its own tools (live Open-Meteo data) in its own context.",
27
- });
28
- ```
29
-
30
- The filename
31
- [`weather.ts`](../../examples/concierge/agent/mcp-connections/weather.ts)
32
- makes the MCP server name `weather`. The `agent` field points to the sibling
33
- project's mount slug.
34
-
35
- This differs from a subagent. A peer keeps its own:
36
-
37
- - root instructions,
38
- - tools and MCP connections,
39
- - durable sessions,
40
- - playground, and
41
- - public MCP endpoint.
42
-
43
- An SDK subagent inherits the parent's execution surface and only its parent
44
- can invoke it. See [Agent-to-agent](../guides/agent-to-agent.md) for the full
45
- comparison.
46
-
47
- ## Follow a delegated request
48
-
49
- 1. A user asks Concierge what to pack for Paris.
50
- 2. [`instructions.md`](../../examples/concierge/agent/instructions.md)
51
- classifies packing advice as weather-related.
52
- 3. The model calls `weather.ask` with the city, timeframe, units, and the
53
- complete question.
54
- 4. The Agent SDK creates an MCP-channel session inside `weather-agent`.
55
- 5. Weather agent calls its own Open-Meteo tools and returns a reply.
56
- 6. If the turn exceeds the bounded MCP wait, `ask` returns
57
- `status: "running"`. Concierge calls `weather.check` with the returned
58
- `sessionId`.
59
- 7. Concierge relays the result and may add one sentence of travel advice.
60
-
61
- The weather session appears in the weather agent's playground. It doesn't
62
- share Concierge's conversation history.
63
-
64
- ## Map the delegation files
65
-
66
- | File | Purpose |
67
- | --- | --- |
68
- | [`agent/agent.ts`](../../examples/concierge/agent/agent.ts) | Describes the root agent and selects the local runtime. |
69
- | [`agent/instructions.md`](../../examples/concierge/agent/instructions.md) | Draws a strict weather-only delegation boundary. |
70
- | [`agent/mcp-connections/weather.ts`](../../examples/concierge/agent/mcp-connections/weather.ts) | Resolves the peer by its `weather-agent` slug. |
71
- | [`agent/storage.ts`](../../examples/concierge/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
72
-
73
- Concierge doesn't author channels, tools, skills, subagents, schedules,
74
- hooks, A/B experiments, or evals. The built-in HTTP and MCP surfaces still
75
- exist.
76
-
77
- Its own MCP endpoint exposes `ask` and `check`. It doesn't expose
78
- `call_tool` because Concierge has no server tools. The target weather agent
79
- does expose `call_tool`, so that tool also appears under Concierge's
80
- `weather` connection.
81
-
82
- ## Mount both agents
83
-
84
- A peer can only resolve within a multi-agent serve host. Validating Concierge
85
- alone checks its files, but serving it alone fails because `weather-agent`
86
- isn't mounted.
87
-
88
- From this package, validate both projects:
89
-
90
- ```bash
91
- agent-sdk validate --dir examples/concierge
92
- agent-sdk validate --dir examples/weather-agent
93
- ```
94
-
95
- Don't serve the repository's whole `examples/` directory for this proof.
96
- Several advanced examples subscribe to live GitHub events. Create an ignored
97
- two-project mount instead. Copy only the authored files needed for this proof,
98
- leaving Weather's Slack channels out:
99
-
100
- ```bash
101
- PAIR_DIR=$(mktemp -d "${TMPDIR:-/tmp}/concierge-weather.XXXXXX")
102
- mkdir -p "$PAIR_DIR/concierge" "$PAIR_DIR/weather-agent/agent"
103
- cp -R examples/concierge/agent "$PAIR_DIR/concierge/"
104
- cp examples/concierge/package.json "$PAIR_DIR/concierge/"
105
- cp examples/weather-agent/agent/{agent.ts,instructions.md,ab.ts,ab.config.ts} \
106
- "$PAIR_DIR/weather-agent/agent/"
107
- cp -R examples/weather-agent/agent/{tools,skills,mcp-connections,subagents,schedules,hooks,lib} \
108
- "$PAIR_DIR/weather-agent/agent/"
109
- cp -R examples/weather-agent/mcp "$PAIR_DIR/weather-agent/"
110
- cp examples/weather-agent/package.json "$PAIR_DIR/weather-agent/"
111
- agent-sdk dev "$PAIR_DIR"
112
- ```
113
-
114
- The host resolves the peer after it knows every mount. The local peer URL is
115
- `http://127.0.0.1:3000/weather-agent/v1/mcp`. You still need an agent-runtime
116
- credential for both model turns.
117
-
118
- ## Exercise delegation
119
-
120
- Send a weather request to the running Concierge:
121
-
122
- ```bash
123
- agent-sdk chat \
124
- --url http://127.0.0.1:3000/concierge \
125
- --message "What should I pack for Paris tomorrow?"
126
- ```
127
-
128
- Open both playgrounds:
129
-
130
- - `http://127.0.0.1:3000/concierge/playground`
131
- - `http://127.0.0.1:3000/weather-agent/playground`
132
-
133
- The Concierge transcript shows the MCP call. The weather playground shows a
134
- separate session on the `mcp` channel with live weather tool calls.
135
-
136
- Now send a general request:
137
-
138
- ```bash
139
- agent-sdk chat \
140
- --url http://127.0.0.1:3000/concierge \
141
- --message "Give me three ideas for a quiet weekend."
142
- ```
143
-
144
- The instructions tell Concierge to answer without delegating. This contrast is
145
- the proof loop: weather goes to the peer, unrelated work stays local.
146
-
147
- ## Preserve peer context
148
-
149
- `weather.ask` returns a peer `sessionId`. Passing it back to a later `ask`
150
- continues the same weather conversation. Concierge's instructions require
151
- this for follow-ups dependent on an earlier answer.
152
-
153
- Use a fresh call when the tasks are independent. Reuse the peer session when
154
- the second question needs facts or choices from the first.
155
-
156
- ## Keep delegation bounded
157
-
158
- The Agent SDK rejects unknown peer slugs and self-references during startup. It
159
- doesn't stop a cycle across several valid peers. If agent A delegates all work
160
- to B and B delegates all work to A, they can recurse.
161
-
162
- The prompt provides the guardrail here:
163
-
164
- - delegate every weather request,
165
- - include complete context, and
166
- - never delegate unrelated work.
167
-
168
- Write similarly narrow routing rules for each peer. A tool description helps
169
- the model choose the connection, but the always-on instructions own the
170
- policy.
171
-
172
- ## Use peers from cloud turns
173
-
174
- Local turns reach peers over loopback. A cloud VM can't reach the serve
175
- host's loopback address. Set a public URL when a cloud agent needs the peer:
176
-
177
- ```bash
178
- agent-sdk serve --dir "$PAIR_DIR" \
179
- --public-url https://agents.example.com \
180
- --bearer-token "$AGENT_TOKEN"
181
- ```
182
-
183
- The Agent SDK attaches the bearer token to peer calls. Without `--public-url`,
184
- cloud turns omit peer connections and the server logs a warning.
185
-
186
- ## Compose your own pair
187
-
188
- To compose your own agents:
189
-
190
- 1. Give each project a stable directory slug.
191
- 2. Add `agent/mcp-connections/<name>.ts` to the caller.
192
- 3. Set `agent` to the target slug.
193
- 4. Describe the exact work the peer owns.
194
- 5. Mount both projects from their parent directory.
195
- 6. Add evals for delegated and non-delegated requests.
196
-
197
- Keep the peer independently useful. If the specialist only makes sense inside
198
- one parent and needs no independent sessions, use a subagent instead.
199
-
200
- ## Where to go next
201
-
202
- - [Agent-to-agent](../guides/agent-to-agent.md)
203
- - [MCP connections](../reference/connections.md)
204
- - [Subagents](../reference/subagents.md)
205
- - [Sessions and streaming](../reference/sessions.md)
@@ -1,104 +0,0 @@
1
- ---
2
- title: "Choose the right Agent SDK example"
3
- description: "Compare the 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
- this package. 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 | Reviewers and triage overlap while the playground shows every stage. |
30
- | [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. |
31
- | [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. |
32
- | [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. |
33
-
34
- ## Pick a learning path
35
-
36
- Use this order when you want to learn the Agent SDK one capability at a time:
37
-
38
- 1. Start with [Weather agent](./weather-agent.md) to explore the filesystem
39
- conventions and cloud runtime.
40
- 2. Strip the project back to [Slack agent](./slack-agent.md) to see the
41
- minimum channel surface.
42
- 3. Read [Playbook router](./benny.md) when Slack should route requests into repo
43
- playbooks.
44
- 4. Continue to [Alert investigator](./oncall.md) when the intake is bot
45
- posts and the agent must pace its own engagement and re-checks.
46
- 5. Add composition with [Concierge](./concierge.md).
47
- 6. Study [PR evidence reviewer](./bugbot.md) before giving a model repository
48
- evidence.
49
- 7. Move policy into code with [Approval Buddy](./approval-buddy.md).
50
- 8. Study [Security Reviewer](./security-reviewer.md) for host-side PR
51
- work.
52
- 9. See parallel subagent delegation carry team judgment in
53
- [Codeowners review](./codeowners-review.md).
54
- 10. Curate team context through conversation with
55
- [Knowledge base](./knowledge-base.md), then let GitHub events maintain
56
- product documentation in [Codebase wiki](./codebase-wiki.md).
57
-
58
- ## Common prerequisites
59
-
60
- All examples require:
61
-
62
- - Node 22.13 or newer. Don't run the Agent SDK under Bun.
63
- - Workspace dependencies installed.
64
- - An agent-runtime credential for model turns.
65
-
66
- Several examples need more:
67
-
68
- - Account-linked Slack channels require a connected host account.
69
- - Alert investigator needs a dedicated Socket Mode app with channel-post
70
- events and membership in the watched alerts channel.
71
- - GitHub examples require access to the target repository. Codebase wiki and
72
- Codeowners review call the host `gh` CLI for PR data; the codeowners
73
- fixtures run without network.
74
- - Example agents use `cursorHostedStorage` in `agent/storage.ts` for hosted session storage. See [Storage](../storage.md).
75
-
76
- Each guide lists its own credentials, services, and side effects.
77
-
78
- ## Validate any example
79
-
80
- Discovery commands don't start a model turn:
81
-
82
- ```bash
83
- agent-sdk validate --dir examples/weather-agent
84
- agent-sdk info --dir examples/weather-agent --json
85
- ```
86
-
87
- Start one development server with `agent-sdk dev examples/<name>`.
88
- Concierge depends on Weather agent, so its guide creates an isolated
89
- two-project mount. Don't mount the whole examples directory to test one
90
- agent; several advanced examples subscribe to live GitHub events.
91
-
92
- ## Read by framework feature
93
-
94
- - [Concepts](../concepts.md) explains filesystem discovery and runtime
95
- boundaries.
96
- - [Project layout](../reference/project-layout.md) lists every authored
97
- folder.
98
- - [Tools](../reference/tools.md), [channels](../reference/channels.md), and
99
- [MCP connections](../reference/connections.md) cover the core extension
100
- points.
101
- - [Evals](../evals.md) and [live A/B metrics](../ab.md) cover measured
102
- iteration.
103
- - [Deployment](../deployment.md) covers credentials, auth, storage, and
104
- hosting.