@cursor/july 0.1.107 → 0.1.109

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 (523) hide show
  1. package/AGENTS.md +2 -6
  2. package/README.md +13 -11
  3. package/dist/bin/agent-serve.js +30 -8
  4. package/dist/channels/bitbucket/api.d.ts +41 -0
  5. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  6. package/dist/channels/bitbucket/api.js +260 -0
  7. package/dist/channels/bitbucket/binding.d.ts +4 -0
  8. package/dist/channels/bitbucket/binding.d.ts.map +1 -1
  9. package/dist/channels/bitbucket/binding.js +16 -0
  10. package/dist/channels/bitbucket/index.d.ts +1 -1
  11. package/dist/channels/bitbucket/index.d.ts.map +1 -1
  12. package/dist/channels/bitbucket/index.js +1 -1
  13. package/dist/channels/github/github-channel.js +8 -5
  14. package/dist/channels/github/types.d.ts +5 -1
  15. package/dist/channels/github/types.d.ts.map +1 -1
  16. package/dist/channels/gitlab/api.d.ts +27 -0
  17. package/dist/channels/gitlab/api.d.ts.map +1 -1
  18. package/dist/channels/gitlab/api.js +88 -0
  19. package/dist/channels/gitlab/binding.d.ts +5 -0
  20. package/dist/channels/gitlab/binding.d.ts.map +1 -1
  21. package/dist/channels/gitlab/binding.js +10 -0
  22. package/dist/channels/gitlab/index.d.ts +1 -1
  23. package/dist/channels/gitlab/index.d.ts.map +1 -1
  24. package/dist/channels/gitlab/index.js +1 -1
  25. package/dist/channels/origin/origin-channel.d.ts.map +1 -1
  26. package/dist/channels/origin/origin-channel.js +27 -13
  27. package/dist/channels/origin/types.d.ts +5 -1
  28. package/dist/channels/origin/types.d.ts.map +1 -1
  29. package/dist/channels/slack/dispatch.d.ts +10 -0
  30. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  31. package/dist/channels/slack/dispatch.js +20 -3
  32. package/dist/channels/slack/slack-channel.d.ts +12 -5
  33. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  34. package/dist/channels/slack/slack-channel.js +59 -8
  35. package/dist/channels.d.ts +45 -0
  36. package/dist/channels.d.ts.map +1 -1
  37. package/dist/channels.js +106 -7
  38. package/dist/connections.d.ts +2 -1
  39. package/dist/connections.d.ts.map +1 -1
  40. package/dist/connections.js +2 -1
  41. package/dist/docs/404.html +2 -2
  42. package/dist/docs/assets/{app.CtuckIiL.js → app.Cr-wVbnB.js} +1 -1
  43. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.js → building-with-agents.md.D0KbSkJn.js} +2 -2
  44. package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.lean.js → building-with-agents.md.D0KbSkJn.lean.js} +1 -1
  45. package/dist/docs/assets/chunks/@localSearchIndexroot.CFVQ4S17.js +1 -0
  46. package/dist/docs/assets/chunks/{VPLocalSearchBox.Bkkhnu8K.js → VPLocalSearchBox.CVQERt56.js} +1 -1
  47. package/dist/docs/assets/chunks/{theme.DhpIe0Pa.js → theme.Dnsd3XOn.js} +2 -2
  48. package/dist/docs/assets/concepts.md.B4o63Gul.js +1 -0
  49. package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
  50. package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
  51. package/dist/docs/assets/evals.md.C7JLjoEP.js +211 -0
  52. package/dist/docs/assets/evals.md.C7JLjoEP.lean.js +1 -0
  53. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.js +10 -0
  54. package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.lean.js +1 -0
  55. package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
  56. package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
  57. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.TZaTZlfz.js} +13 -3
  58. package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.TZaTZlfz.lean.js} +1 -1
  59. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.js +14 -0
  60. package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.lean.js +1 -0
  61. package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
  62. package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
  63. package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
  64. package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
  65. package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
  66. package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.js → guides_webhooks.md.CJK484ex.js} +2 -2
  67. package/dist/docs/assets/{hillclimbing.md.CpTGTCle.js → hillclimbing.md.BOiVo1tf.js} +1 -1
  68. package/dist/docs/assets/index.md.DD9Q2XuJ.js +5 -0
  69. package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.DD9Q2XuJ.lean.js} +1 -1
  70. package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
  71. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.js → reference_channels.md.CAo-iK4j.js} +2 -2
  72. package/dist/docs/assets/{reference_channels.md.D-qTqwcq.lean.js → reference_channels.md.CAo-iK4j.lean.js} +1 -1
  73. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.js → reference_cli.md.Deg7849l.js} +7 -7
  74. package/dist/docs/assets/{reference_cli.md.Dm67hd2D.lean.js → reference_cli.md.Deg7849l.lean.js} +1 -1
  75. package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
  76. package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.ZAVUyuEX.js} +3 -3
  77. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.js → reference_hooks.md.BlM_bOg6.js} +3 -3
  78. package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.lean.js → reference_hooks.md.BlM_bOg6.lean.js} +1 -1
  79. package/dist/docs/assets/{reference_http-api.md.oySXBO8o.js → reference_http-api.md.BwaCo-VO.js} +1 -1
  80. package/dist/docs/assets/{reference_playground.md.4myJPxrf.js → reference_playground.md.DLnoaczX.js} +1 -1
  81. package/dist/docs/assets/{reference_playground.md.4myJPxrf.lean.js → reference_playground.md.DLnoaczX.lean.js} +1 -1
  82. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.js → reference_project-layout.md.BEU8MtQV.js} +3 -3
  83. package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.lean.js → reference_project-layout.md.BEU8MtQV.lean.js} +1 -1
  84. package/dist/docs/assets/reference_sessions.md.CyXV1MUw.js +1 -0
  85. package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
  86. package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
  87. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
  88. package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
  89. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.js +35 -0
  90. package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.lean.js +1 -0
  91. package/dist/docs/assets/skills_evals.md.DFxYPErF.js +25 -0
  92. package/dist/docs/assets/skills_evals.md.DFxYPErF.lean.js +1 -0
  93. package/dist/docs/assets/skills_framework-map.md.BxLSOhSY.js +1 -0
  94. package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.BxLSOhSY.lean.js} +1 -1
  95. package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
  96. package/dist/docs/assets/skills_index.md.DL7EHaQ-.js +1 -0
  97. package/dist/docs/assets/skills_index.md.DL7EHaQ-.lean.js +1 -0
  98. package/dist/docs/assets/{storage.md.BOHeqk2M.js → storage.md.BUrhJ-Zz.js} +4 -4
  99. package/dist/docs/assets/{storage.md.BOHeqk2M.lean.js → storage.md.BUrhJ-Zz.lean.js} +1 -1
  100. package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
  101. package/dist/docs/building-with-agents.html +5 -5
  102. package/dist/docs/building-with-agents.md +3 -2
  103. package/dist/docs/concepts.html +5 -5
  104. package/dist/docs/concepts.md +2 -4
  105. package/dist/docs/deployment.html +7 -7
  106. package/dist/docs/deployment.md +7 -2
  107. package/dist/docs/evals.html +161 -35
  108. package/dist/docs/evals.md +612 -296
  109. package/dist/docs/guides/agent-to-agent.html +4 -4
  110. package/dist/docs/guides/bitbucket.html +36 -0
  111. package/dist/docs/guides/bitbucket.md +84 -0
  112. package/dist/docs/guides/cloud-agents.html +6 -6
  113. package/dist/docs/guides/cloud-agents.md +4 -3
  114. package/dist/docs/guides/convert-automation.html +4 -4
  115. package/dist/docs/guides/github.html +17 -7
  116. package/dist/docs/guides/github.md +33 -1
  117. package/dist/docs/guides/gitlab.html +40 -0
  118. package/dist/docs/guides/gitlab.md +92 -0
  119. package/dist/docs/guides/grokbot-agents.html +6 -6
  120. package/dist/docs/guides/grokbot-agents.md +2 -2
  121. package/dist/docs/guides/human-in-the-loop.html +4 -4
  122. package/dist/docs/guides/improve.html +40 -0
  123. package/dist/docs/guides/improve.md +91 -0
  124. package/dist/docs/guides/mcp-oauth.html +4 -4
  125. package/dist/docs/guides/opentelemetry.html +5 -5
  126. package/dist/docs/guides/slack.html +7 -7
  127. package/dist/docs/guides/slack.md +2 -1
  128. package/dist/docs/guides/webhooks.html +6 -6
  129. package/dist/docs/guides/webhooks.md +4 -2
  130. package/dist/docs/hashmap.json +1 -1
  131. package/dist/docs/hillclimbing.html +6 -6
  132. package/dist/docs/hillclimbing.md +2 -2
  133. package/dist/docs/index.html +6 -6
  134. package/dist/docs/index.md +14 -6
  135. package/dist/docs/llms-full.txt +1274 -814
  136. package/dist/docs/llms.txt +7 -5
  137. package/dist/docs/quickstart.html +4 -4
  138. package/dist/docs/reference/agent-config.html +6 -6
  139. package/dist/docs/reference/agent-config.md +5 -2
  140. package/dist/docs/reference/artifacts.html +4 -4
  141. package/dist/docs/reference/channels.html +6 -6
  142. package/dist/docs/reference/channels.md +16 -3
  143. package/dist/docs/reference/cli.html +11 -11
  144. package/dist/docs/reference/cli.md +24 -15
  145. package/dist/docs/reference/connections.html +6 -6
  146. package/dist/docs/reference/connections.md +2 -1
  147. package/dist/docs/reference/extensions.html +8 -8
  148. package/dist/docs/reference/extensions.md +2 -3
  149. package/dist/docs/reference/hooks.html +7 -7
  150. package/dist/docs/reference/hooks.md +9 -12
  151. package/dist/docs/reference/http-api.html +6 -6
  152. package/dist/docs/reference/http-api.md +2 -3
  153. package/dist/docs/reference/instructions.html +4 -4
  154. package/dist/docs/reference/playground.html +5 -5
  155. package/dist/docs/reference/playground.md +0 -4
  156. package/dist/docs/reference/project-layout.html +7 -7
  157. package/dist/docs/reference/project-layout.md +1 -8
  158. package/dist/docs/reference/prompt.html +4 -4
  159. package/dist/docs/reference/result.html +4 -4
  160. package/dist/docs/reference/schedules.html +4 -4
  161. package/dist/docs/reference/sessions.html +5 -5
  162. package/dist/docs/reference/sessions.md +1 -2
  163. package/dist/docs/reference/skills.html +4 -4
  164. package/dist/docs/reference/subagents.html +4 -4
  165. package/dist/docs/reference/tools.html +4 -4
  166. package/dist/docs/scaffolding-agents.html +5 -5
  167. package/dist/docs/scaffolding-agents.md +2 -1
  168. package/dist/docs/skills/create-agent.html +6 -6
  169. package/dist/docs/skills/create-agent.md +1 -1
  170. package/dist/docs/skills/debug.html +5 -5
  171. package/dist/docs/skills/debug.md +1 -1
  172. package/dist/docs/skills/deploy.html +61 -0
  173. package/dist/docs/skills/deploy.md +161 -0
  174. package/dist/docs/skills/evals.html +8 -8
  175. package/dist/docs/skills/evals.md +44 -6
  176. package/dist/docs/skills/framework-map.html +5 -5
  177. package/dist/docs/skills/framework-map.md +5 -4
  178. package/dist/docs/skills/github.html +6 -6
  179. package/dist/docs/skills/github.md +1 -1
  180. package/dist/docs/skills/hillclimb.html +4 -4
  181. package/dist/docs/skills/index.html +6 -6
  182. package/dist/docs/skills/index.md +1 -1
  183. package/dist/docs/skills/mcp-auth.html +4 -4
  184. package/dist/docs/skills/otel.html +4 -4
  185. package/dist/docs/skills/setup-slack.html +4 -4
  186. package/dist/docs/storage.html +8 -8
  187. package/dist/docs/storage.md +15 -24
  188. package/dist/docs/templates/agentic-owners.html +4 -4
  189. package/dist/docs/templates/agents-md.html +4 -4
  190. package/dist/docs/templates/code-wiki.html +4 -4
  191. package/dist/docs/templates/demo.html +4 -4
  192. package/dist/docs/templates/grokbot-agents.html +4 -4
  193. package/dist/docs/templates/pr-autofixer.html +4 -4
  194. package/dist/docs/templates/security-help.html +4 -4
  195. package/dist/docs/templates/security-reviewer.html +4 -4
  196. package/dist/docs/templates/triage.html +4 -4
  197. package/dist/docs/troubleshooting.html +5 -5
  198. package/dist/docs/troubleshooting.md +1 -1
  199. package/dist/extensions/improve/extension.d.ts +46 -0
  200. package/dist/extensions/improve/extension.d.ts.map +1 -0
  201. package/dist/extensions/improve/extension.js +41 -0
  202. package/dist/extensions/improve/skills/yourself.d.ts +4 -0
  203. package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
  204. package/dist/extensions/improve/skills/yourself.js +43 -0
  205. package/dist/extensions.d.ts +2 -3
  206. package/dist/extensions.d.ts.map +1 -1
  207. package/dist/extensions.js +2 -5
  208. package/dist/index.d.ts +2 -3
  209. package/dist/index.d.ts.map +1 -1
  210. package/dist/index.js +1 -2
  211. package/dist/internal/authored-alias-hooks.d.ts +5 -0
  212. package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
  213. package/dist/internal/authored-alias-hooks.js +17 -0
  214. package/dist/internal/authored-loaders.d.ts +4 -0
  215. package/dist/internal/authored-loaders.d.ts.map +1 -1
  216. package/dist/internal/authored-loaders.js +21 -2
  217. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  218. package/dist/internal/builtin-tools/artifacts.js +2 -3
  219. package/dist/internal/channel-route-dispatch.d.ts +13 -0
  220. package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
  221. package/dist/internal/channel-route-dispatch.js +62 -0
  222. package/dist/internal/channel-state.d.ts +17 -0
  223. package/dist/internal/channel-state.d.ts.map +1 -0
  224. package/dist/internal/channel-state.js +78 -0
  225. package/dist/internal/cli-ax.d.ts +8 -2
  226. package/dist/internal/cli-ax.d.ts.map +1 -1
  227. package/dist/internal/cli-ax.js +100 -3
  228. package/dist/internal/cli-cursor.d.ts.map +1 -1
  229. package/dist/internal/cli-cursor.js +2 -0
  230. package/dist/internal/cli-deploy.d.ts.map +1 -1
  231. package/dist/internal/cli-deploy.js +38 -14
  232. package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
  233. package/dist/internal/cli-mcp-oauth.js +15 -0
  234. package/dist/internal/cli-mcp.d.ts.map +1 -1
  235. package/dist/internal/cli-mcp.js +12 -0
  236. package/dist/internal/cli-slack.d.ts.map +1 -1
  237. package/dist/internal/cli-slack.js +8 -2
  238. package/dist/internal/continuation-channel.d.ts.map +1 -1
  239. package/dist/internal/continuation-channel.js +2 -2
  240. package/dist/internal/continuation-identity.js +8 -3
  241. package/dist/internal/cursor/credentials.d.ts +8 -2
  242. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  243. package/dist/internal/cursor/credentials.js +27 -5
  244. package/dist/internal/deploy-client.d.ts +27 -0
  245. package/dist/internal/deploy-client.d.ts.map +1 -1
  246. package/dist/internal/deploy-client.js +32 -0
  247. package/dist/internal/deploy-manifest.d.ts +23 -0
  248. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  249. package/dist/internal/deploy-manifest.js +84 -1
  250. package/dist/internal/describe-error.d.ts +1 -0
  251. package/dist/internal/describe-error.d.ts.map +1 -1
  252. package/dist/internal/describe-error.js +25 -0
  253. package/dist/internal/discovery/agent.d.ts +1 -1
  254. package/dist/internal/discovery/agent.d.ts.map +1 -1
  255. package/dist/internal/discovery/agent.js +0 -5
  256. package/dist/internal/discovery/extension-overlay.d.ts +1 -2
  257. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  258. package/dist/internal/discovery/extension-overlay.js +0 -14
  259. package/dist/internal/discovery/extensions.d.ts +1 -2
  260. package/dist/internal/discovery/extensions.d.ts.map +1 -1
  261. package/dist/internal/discovery/extensions.js +4 -22
  262. package/dist/internal/discovery/info.d.ts.map +1 -1
  263. package/dist/internal/discovery/info.js +42 -24
  264. package/dist/internal/discovery/modules.js +0 -1
  265. package/dist/internal/discovery/project.d.ts.map +1 -1
  266. package/dist/internal/discovery/project.js +0 -16
  267. package/dist/internal/eval-runner.js +0 -1
  268. package/dist/internal/framework-file-storage.d.ts +4 -5
  269. package/dist/internal/framework-file-storage.d.ts.map +1 -1
  270. package/dist/internal/framework-file-storage.js +4 -5
  271. package/dist/internal/framework-storage-selection.d.ts +2 -2
  272. package/dist/internal/framework-storage-selection.js +2 -2
  273. package/dist/internal/guest-network.d.ts +4 -10
  274. package/dist/internal/guest-network.d.ts.map +1 -1
  275. package/dist/internal/guest-network.js +42 -26
  276. package/dist/internal/hosted-admission-adapter.d.ts +2 -0
  277. package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
  278. package/dist/internal/hosted-catch-protocol.d.ts +51 -0
  279. package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
  280. package/dist/internal/hosted-catch-protocol.js +103 -0
  281. package/dist/internal/hosted-catch.d.ts +40 -0
  282. package/dist/internal/hosted-catch.d.ts.map +1 -0
  283. package/dist/internal/hosted-catch.js +149 -0
  284. package/dist/internal/hosted-delivery-protocol.d.ts +41 -0
  285. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  286. package/dist/internal/hosted-delivery-protocol.js +249 -0
  287. package/dist/internal/hosted-delivery.d.ts +10 -1
  288. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  289. package/dist/internal/hosted-delivery.js +100 -22
  290. package/dist/internal/hosted-execution-diag.d.ts +4 -1
  291. package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
  292. package/dist/internal/hosted-execution-diag.js +13 -4
  293. package/dist/internal/hosted-execution-flush.d.ts +3 -0
  294. package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
  295. package/dist/internal/hosted-execution-flush.js +2 -4
  296. package/dist/internal/http-control-plane-session.d.ts +30 -0
  297. package/dist/internal/http-control-plane-session.d.ts.map +1 -0
  298. package/dist/internal/http-control-plane-session.js +83 -0
  299. package/dist/internal/init-scaffold.d.ts.map +1 -1
  300. package/dist/internal/init-scaffold.js +1 -2
  301. package/dist/internal/install-cursor-skills.d.ts +5 -2
  302. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  303. package/dist/internal/install-cursor-skills.js +25 -5
  304. package/dist/internal/legacy-command-guard.d.ts +22 -0
  305. package/dist/internal/legacy-command-guard.d.ts.map +1 -0
  306. package/dist/internal/legacy-command-guard.js +51 -0
  307. package/dist/internal/platform-timers.d.ts +7 -0
  308. package/dist/internal/platform-timers.d.ts.map +1 -1
  309. package/dist/internal/platform-timers.js +139 -0
  310. package/dist/internal/reminder-control-plane-protocol.d.ts +2 -0
  311. package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
  312. package/dist/internal/reminder-control-plane-protocol.js +9 -2
  313. package/dist/internal/reminder-runner.d.ts +8 -0
  314. package/dist/internal/reminder-runner.d.ts.map +1 -1
  315. package/dist/internal/reminder-runner.js +36 -9
  316. package/dist/internal/resolve-prod-target.d.ts +2 -0
  317. package/dist/internal/resolve-prod-target.d.ts.map +1 -1
  318. package/dist/internal/resolve-prod-target.js +13 -0
  319. package/dist/internal/run-client.d.ts +1 -1
  320. package/dist/internal/sdk-runner.d.ts.map +1 -1
  321. package/dist/internal/sdk-runner.js +5 -4
  322. package/dist/internal/server.d.ts.map +1 -1
  323. package/dist/internal/server.js +57 -70
  324. package/dist/internal/session-engine.d.ts +7 -41
  325. package/dist/internal/session-engine.d.ts.map +1 -1
  326. package/dist/internal/session-engine.js +110 -227
  327. package/dist/internal/storage-coordinator.d.ts +5 -19
  328. package/dist/internal/storage-coordinator.d.ts.map +1 -1
  329. package/dist/internal/storage-coordinator.js +3 -62
  330. package/dist/internal/storage-roles.d.ts +4 -9
  331. package/dist/internal/storage-roles.d.ts.map +1 -1
  332. package/dist/internal/storage-roles.js +2 -2
  333. package/dist/playground/assets/index-Bhxzrcf6.css +1 -0
  334. package/dist/playground/assets/index-CqLX5uF3.js +67 -0
  335. package/dist/playground/index.html +2 -2
  336. package/dist/storage-backends/cursor-hosted-v2.d.ts +4 -5
  337. package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -1
  338. package/dist/storage-backends/cursor-hosted-v2.js +4 -5
  339. package/dist/storage-backends/cursor-hosted.d.ts +7 -2
  340. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  341. package/dist/storage-backends/cursor-hosted.js +29 -31
  342. package/dist/storage-backends/file-kv.d.ts +9 -12
  343. package/dist/storage-backends/file-kv.d.ts.map +1 -1
  344. package/dist/storage-backends/file-kv.js +11 -47
  345. package/dist/storage-protocol.d.ts +3 -11
  346. package/dist/storage-protocol.d.ts.map +1 -1
  347. package/dist/storage-protocol.js +3 -11
  348. package/dist/storage.d.ts +8 -36
  349. package/dist/storage.d.ts.map +1 -1
  350. package/dist/storage.js +8 -44
  351. package/dist/types.d.ts +53 -62
  352. package/dist/types.d.ts.map +1 -1
  353. package/docs/README.md +14 -6
  354. package/docs/building-with-agents.md +3 -2
  355. package/docs/concepts.md +2 -4
  356. package/docs/deployment.md +7 -2
  357. package/docs/evals.md +613 -297
  358. package/docs/guides/bitbucket.md +89 -0
  359. package/docs/guides/cloud-agents.md +4 -3
  360. package/docs/guides/github.md +33 -1
  361. package/docs/guides/gitlab.md +97 -0
  362. package/docs/guides/grokbot-agents.md +2 -2
  363. package/docs/guides/improve.md +96 -0
  364. package/docs/guides/slack.md +2 -1
  365. package/docs/guides/webhooks.md +4 -2
  366. package/docs/hillclimbing.md +2 -2
  367. package/docs/reference/agent-config.md +5 -2
  368. package/docs/reference/channels.md +16 -3
  369. package/docs/reference/cli.md +24 -15
  370. package/docs/reference/connections.md +2 -1
  371. package/docs/reference/extensions.md +2 -3
  372. package/docs/reference/hooks.md +9 -12
  373. package/docs/reference/http-api.md +2 -3
  374. package/docs/reference/playground.md +0 -4
  375. package/docs/reference/project-layout.md +1 -8
  376. package/docs/reference/sessions.md +1 -2
  377. package/docs/scaffolding-agents.md +2 -1
  378. package/docs/skills/index.md +2 -2
  379. package/docs/storage.md +15 -24
  380. package/docs/troubleshooting.md +1 -1
  381. package/package.json +8 -7
  382. package/skills/create-agent/SKILL.md +1 -1
  383. package/skills/debug/SKILL.md +1 -1
  384. package/skills/deploy/SKILL.md +169 -0
  385. package/skills/evals/SKILL.md +45 -8
  386. package/skills/framework-map/SKILL.md +5 -4
  387. package/skills/github/SKILL.md +1 -1
  388. package/src/bin/agent-serve.ts +27 -2
  389. package/src/channels/bitbucket/api.ts +341 -0
  390. package/src/channels/bitbucket/binding.ts +25 -0
  391. package/src/channels/bitbucket/index.ts +2 -0
  392. package/src/channels/github/github-channel.ts +8 -8
  393. package/src/channels/github/types.ts +5 -0
  394. package/src/channels/gitlab/api.ts +123 -0
  395. package/src/channels/gitlab/binding.ts +12 -0
  396. package/src/channels/gitlab/index.ts +1 -0
  397. package/src/channels/origin/origin-channel.ts +29 -13
  398. package/src/channels/origin/types.ts +5 -0
  399. package/src/channels/slack/dispatch.ts +30 -0
  400. package/src/channels/slack/slack-channel.ts +69 -7
  401. package/src/channels.ts +157 -10
  402. package/src/connections.ts +2 -1
  403. package/src/extensions/improve/extension.ts +70 -0
  404. package/src/extensions/improve/skills/yourself.ts +50 -0
  405. package/src/extensions.ts +2 -6
  406. package/src/index.ts +0 -3
  407. package/src/internal/authored-alias-hooks.ts +32 -0
  408. package/src/internal/authored-loaders.ts +26 -2
  409. package/src/internal/builtin-tools/artifacts.ts +2 -3
  410. package/src/internal/channel-route-dispatch.ts +66 -0
  411. package/src/internal/channel-state.ts +96 -0
  412. package/src/internal/cli-ax.ts +111 -3
  413. package/src/internal/cli-cursor.ts +4 -1
  414. package/src/internal/cli-deploy.ts +50 -10
  415. package/src/internal/cli-mcp-oauth.ts +18 -0
  416. package/src/internal/cli-mcp.ts +11 -0
  417. package/src/internal/cli-slack.ts +15 -2
  418. package/src/internal/continuation-channel.ts +2 -1
  419. package/src/internal/continuation-identity.ts +10 -2
  420. package/src/internal/cursor/credentials.ts +35 -7
  421. package/src/internal/deploy-client.ts +54 -0
  422. package/src/internal/deploy-manifest.ts +115 -1
  423. package/src/internal/describe-error.ts +28 -0
  424. package/src/internal/discovery/agent.ts +1 -7
  425. package/src/internal/discovery/extension-overlay.ts +0 -18
  426. package/src/internal/discovery/extensions.ts +2 -26
  427. package/src/internal/discovery/info.ts +3 -13
  428. package/src/internal/discovery/modules.ts +0 -1
  429. package/src/internal/discovery/project.ts +0 -16
  430. package/src/internal/eval-runner.ts +0 -1
  431. package/src/internal/framework-file-storage.ts +4 -5
  432. package/src/internal/framework-storage-selection.ts +2 -2
  433. package/src/internal/guest-network.ts +43 -29
  434. package/src/internal/hosted-admission-adapter.ts +2 -0
  435. package/src/internal/hosted-catch-protocol.ts +130 -0
  436. package/src/internal/hosted-catch.ts +192 -0
  437. package/src/internal/hosted-delivery-protocol.ts +387 -0
  438. package/src/internal/hosted-delivery.ts +155 -22
  439. package/src/internal/hosted-execution-diag.ts +21 -3
  440. package/src/internal/hosted-execution-flush.ts +6 -3
  441. package/src/internal/http-control-plane-session.ts +104 -0
  442. package/src/internal/init-scaffold.ts +1 -2
  443. package/src/internal/install-cursor-skills.ts +38 -5
  444. package/src/internal/legacy-command-guard.ts +59 -0
  445. package/src/internal/platform-timers.ts +191 -0
  446. package/src/internal/reminder-control-plane-protocol.ts +15 -2
  447. package/src/internal/reminder-runner.ts +60 -9
  448. package/src/internal/resolve-prod-target.ts +15 -0
  449. package/src/internal/run-client.ts +1 -1
  450. package/src/internal/sdk-runner.ts +3 -2
  451. package/src/internal/server.ts +89 -95
  452. package/src/internal/session-engine.ts +155 -285
  453. package/src/internal/storage-coordinator.ts +5 -76
  454. package/src/internal/storage-roles.ts +4 -9
  455. package/src/storage-backends/cursor-hosted-v2.ts +4 -7
  456. package/src/storage-backends/cursor-hosted.ts +40 -38
  457. package/src/storage-backends/file-kv.ts +10 -51
  458. package/src/storage-protocol.ts +3 -17
  459. package/src/storage.ts +10 -101
  460. package/src/types.ts +58 -62
  461. package/templates/demo/README.md +10 -6
  462. package/templates/demo/agent/channels/github.ts +2 -0
  463. package/templates/demo/agent/channels/queue.ts +6 -2
  464. package/templates/demo/agent/lib/repos.ts +5 -0
  465. package/templates/demo/init.json +25 -0
  466. package/dist/ab.d.ts +0 -209
  467. package/dist/ab.d.ts.map +0 -1
  468. package/dist/ab.js +0 -246
  469. package/dist/docs/ab.html +0 -80
  470. package/dist/docs/ab.md +0 -332
  471. package/dist/docs/assets/ab.md.mlVgqvSk.js +0 -54
  472. package/dist/docs/assets/ab.md.mlVgqvSk.lean.js +0 -1
  473. package/dist/docs/assets/chunks/@localSearchIndexroot.DXXZxiMv.js +0 -1
  474. package/dist/docs/assets/concepts.md.DgEcZOfT.js +0 -1
  475. package/dist/docs/assets/evals.md.CbMoebP1.js +0 -85
  476. package/dist/docs/assets/evals.md.CbMoebP1.lean.js +0 -1
  477. package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
  478. package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
  479. package/dist/docs/assets/reference_sessions.md.CueyOHSL.js +0 -1
  480. package/dist/docs/assets/skills_ab.md.CsFNatVx.js +0 -26
  481. package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +0 -1
  482. package/dist/docs/assets/skills_evals.md.723kpUmA.js +0 -25
  483. package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +0 -1
  484. package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
  485. package/dist/docs/assets/skills_index.md.DKwIxzGg.js +0 -1
  486. package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +0 -1
  487. package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
  488. package/dist/docs/skills/ab.html +0 -52
  489. package/dist/docs/skills/ab.md +0 -50
  490. package/dist/internal/ab-collector.d.ts +0 -44
  491. package/dist/internal/ab-collector.d.ts.map +0 -1
  492. package/dist/internal/ab-collector.js +0 -142
  493. package/dist/internal/ab-fold.d.ts +0 -36
  494. package/dist/internal/ab-fold.d.ts.map +0 -1
  495. package/dist/internal/ab-fold.js +0 -175
  496. package/dist/internal/ab-snapshot.d.ts +0 -68
  497. package/dist/internal/ab-snapshot.d.ts.map +0 -1
  498. package/dist/internal/ab-snapshot.js +0 -208
  499. package/dist/internal/discovery/ab.d.ts +0 -9
  500. package/dist/internal/discovery/ab.d.ts.map +0 -1
  501. package/dist/internal/discovery/ab.js +0 -113
  502. package/dist/playground/assets/index-Bq2HpEQB.js +0 -67
  503. package/dist/playground/assets/index-CZKKNlmb.css +0 -1
  504. package/docs/ab.md +0 -337
  505. package/skills/ab/SKILL.md +0 -58
  506. package/src/ab.ts +0 -430
  507. package/src/internal/ab-collector.ts +0 -200
  508. package/src/internal/ab-fold.ts +0 -232
  509. package/src/internal/ab-snapshot.ts +0 -331
  510. package/src/internal/discovery/ab.ts +0 -131
  511. /package/dist/docs/assets/{concepts.md.DgEcZOfT.lean.js → concepts.md.B4o63Gul.lean.js} +0 -0
  512. /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
  513. /package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.lean.js → guides_webhooks.md.CJK484ex.lean.js} +0 -0
  514. /package/dist/docs/assets/{hillclimbing.md.CpTGTCle.lean.js → hillclimbing.md.BOiVo1tf.lean.js} +0 -0
  515. /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
  516. /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
  517. /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.ZAVUyuEX.lean.js} +0 -0
  518. /package/dist/docs/assets/{reference_http-api.md.oySXBO8o.lean.js → reference_http-api.md.BwaCo-VO.lean.js} +0 -0
  519. /package/dist/docs/assets/{reference_sessions.md.CueyOHSL.lean.js → reference_sessions.md.CyXV1MUw.lean.js} +0 -0
  520. /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
  521. /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
  522. /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
  523. /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  });
12
12
  };
13
13
  import { continuationSource, normalizeIdentity, } from "../../internal/continuation-identity.js";
14
+ import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
14
15
  import { routeLocalIngressContinuation } from "../../internal/local-ingress.js";
15
16
  import { steeringEnabled } from "../../internal/steering.js";
16
17
  import { buildSlackBinding, slackContinuationKey } from "./api.js";
@@ -206,6 +207,9 @@ export function dispatchInboundMessage(args) {
206
207
  thread_ts: message.threadTs,
207
208
  event_id: args.eventId,
208
209
  });
210
+ if (args.propagateHandlerErrors === true) {
211
+ throw error;
212
+ }
209
213
  return;
210
214
  }
211
215
  if (decision === null || decision === undefined) {
@@ -291,6 +295,19 @@ export function dispatchInboundMessage(args) {
291
295
  }), title: (_4 = decision.title) !== null && _4 !== void 0 ? _4 : `slack:${message.channelId}:${message.threadTs}`, workspaceDir: decision.workspaceDir, workspaceFiles: media.workspaceFiles, images: media.images, cloud: decision.cloud, sdkAgentId: decision.sdkAgentId });
292
296
  try {
293
297
  const session = yield args.send(prompt, sendOptions);
298
+ if (isDeferredChannelSession(session)) {
299
+ // Hosted admission captured the send; the control plane allocates
300
+ // the session and runs the turn only after this delivery is
301
+ // acknowledged, so there is nothing to observe or coalesce yet.
302
+ log.info("session send captured (hosted admission)", {
303
+ kind,
304
+ continuation,
305
+ channel: message.channelId,
306
+ thread_ts: message.threadTs,
307
+ event_id: args.eventId,
308
+ });
309
+ return;
310
+ }
294
311
  log.info(session.coalesced === true ? "session coalesced" : "session start", {
295
312
  kind,
296
313
  session: session.id,
@@ -404,7 +421,7 @@ export function dispatchInboundFromEventBody(body, deps) {
404
421
  return false;
405
422
  }
406
423
  }
407
- deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "app_mention", message: mention, handler: deps.onAppMention, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: deps.evalCommandsEnabled, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
424
+ deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "app_mention", message: mention, handler: deps.onAppMention, propagateHandlerErrors: deps.propagateHandlerErrors, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: deps.evalCommandsEnabled, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
408
425
  ? {}
409
426
  : { hasContinuationSession: deps.hasContinuationSession })), (deps.isContinuationBusy === undefined
410
427
  ? {}
@@ -425,7 +442,7 @@ export function dispatchInboundFromEventBody(body, deps) {
425
442
  });
426
443
  return false;
427
444
  }
428
- deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "direct_message", message: dm, handler: deps.onDirectMessage, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: deps.evalCommandsEnabled, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
445
+ deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "direct_message", message: dm, handler: deps.onDirectMessage, propagateHandlerErrors: deps.propagateHandlerErrors, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: deps.evalCommandsEnabled, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
429
446
  ? {}
430
447
  : { hasContinuationSession: deps.hasContinuationSession })), (deps.isContinuationBusy === undefined
431
448
  ? {}
@@ -440,7 +457,7 @@ export function dispatchInboundFromEventBody(body, deps) {
440
457
  }
441
458
  const reaction = parseReactionAddedEvent(body);
442
459
  if (reaction !== null && deps.onReactionAdded !== undefined) {
443
- deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "reaction_added", message: reaction, handler: deps.onReactionAdded, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: false, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
460
+ deps.waitUntil(dispatchInboundMessage(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ kind: "reaction_added", message: reaction, handler: deps.onReactionAdded, propagateHandlerErrors: deps.propagateHandlerErrors, send: deps.send, credentials: deps.credentials, host: deps.host, artifacts: deps.artifacts, log, evalCommandsEnabled: false, followUpStatus: deps.followUpStatus, blockExternals: deps.blockExternals }, continuationArg(deps.continuation)), (deps.hasContinuationSession === undefined
444
461
  ? {}
445
462
  : { hasContinuationSession: deps.hasContinuationSession })), (deps.isContinuationBusy === undefined
446
463
  ? {}
@@ -1,10 +1,17 @@
1
1
  /**
2
- * `slackChannel()` — platform channel pack for Slack (Socket Mode).
2
+ * `slackChannel()` — platform channel pack for Slack.
3
3
  *
4
- * Inbound events arrive over a WebSocket (`SLACK_APP_TOKEN`); no public
5
- * Request URL or Events HTTP route is required. When `toolApprovals`
6
- * is enabled, Approve/Deny buttons arrive as Socket Mode `interactive`
7
- * envelopes.
4
+ * Local / self-hosted transport is Socket Mode: inbound events arrive over
5
+ * a WebSocket (`SLACK_APP_TOKEN`); no public Request URL or Events HTTP
6
+ * route is required. When `toolApprovals` is enabled, Approve/Deny buttons
7
+ * arrive as Socket Mode `interactive` envelopes.
8
+ *
9
+ * Hosted v2 transport is the control plane's Events API ingest: the CP
10
+ * verifies the managed app's signature, fans out on the declared
11
+ * `slackEventTypes` (`app_mention`, `message`), and delivers the full
12
+ * `event_callback` body through hosted admission — the attached adapter
13
+ * routes it through the same inbound dispatch as Socket Mode. Without an
14
+ * app token the socket transport idles, so a hosted pod never needs one.
8
15
  */
9
16
  import type { ChannelDefinition } from "../../types.js";
10
17
  import type { SlackChannelOptions, SlackChannelState, SlackCredentials } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"slack-channel.d.ts","sourceRoot":"","sources":["../../../src/channels/slack/slack-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAEV,iBAAiB,EAMlB,MAAM,gBAAgB,CAAC;AA4CxB,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB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 +1,17 @@
1
1
  /**
2
- * `slackChannel()` — platform channel pack for Slack (Socket Mode).
2
+ * `slackChannel()` — platform channel pack for Slack.
3
3
  *
4
- * Inbound events arrive over a WebSocket (`SLACK_APP_TOKEN`); no public
5
- * Request URL or Events HTTP route is required. When `toolApprovals`
6
- * is enabled, Approve/Deny buttons arrive as Socket Mode `interactive`
7
- * envelopes.
4
+ * Local / self-hosted transport is Socket Mode: inbound events arrive over
5
+ * a WebSocket (`SLACK_APP_TOKEN`); no public Request URL or Events HTTP
6
+ * route is required. When `toolApprovals` is enabled, Approve/Deny buttons
7
+ * arrive as Socket Mode `interactive` envelopes.
8
+ *
9
+ * Hosted v2 transport is the control plane's Events API ingest: the CP
10
+ * verifies the managed app's signature, fans out on the declared
11
+ * `slackEventTypes` (`app_mention`, `message`), and delivers the full
12
+ * `event_callback` body through hosted admission — the attached adapter
13
+ * routes it through the same inbound dispatch as Socket Mode. Without an
14
+ * app token the socket transport idles, so a hosted pod never needs one.
8
15
  */
9
16
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
10
17
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -16,7 +23,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
16
23
  });
17
24
  };
18
25
  import { allowAll, defineChannel } from "../../channels.js";
26
+ import { skipped, withPropagatingBackgroundErrors, } from "../../internal/channel-dispatch.js";
19
27
  import { continuationSource, normalizeIdentity, } from "../../internal/continuation-identity.js";
28
+ import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
20
29
  import { slackContinuationKey } from "./api.js";
21
30
  import { normalizeBotMentionAllowlist, SLACK_BOT_MENTION_DEFAULTS, SlackBotMentionGate, } from "./bot-mentions.js";
22
31
  import { createChannelPostWatcher, resolveChannelNames, SlackChannelAllowlist, } from "./channel-watch.js";
@@ -97,6 +106,18 @@ export function slackChannel(authored = {}) {
97
106
  normalizeBotMentionAllowlist(botMentions.allowFrom);
98
107
  }
99
108
  const eventIds = createEventIdDedupe();
109
+ // Hosted v2 event capability, matching what the engagement flags can
110
+ // dispatch: mentions ride `app_mention`; DMs and watched channel posts
111
+ // both arrive as `message`. Membership of `slack.thread/v2` admits
112
+ // exactly these two, so `reaction_added` (hosted follow-up only inside
113
+ // an existing thread) is deliberately not declared.
114
+ const slackEventTypes = [];
115
+ if (mentionsEnabled) {
116
+ slackEventTypes.push("app_mention");
117
+ }
118
+ if (directMessagesEnabled || channelPosts !== undefined) {
119
+ slackEventTypes.push("message");
120
+ }
100
121
  const toolApprovals = options.toolApprovals === true;
101
122
  const interactivity = options.interactivity === true;
102
123
  const onBlockAction = options.onBlockAction;
@@ -127,9 +148,9 @@ export function slackChannel(authored = {}) {
127
148
  let channelWatch;
128
149
  let botMentionGate;
129
150
  function inboundDeps(args) {
151
+ var _a;
130
152
  return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ send: args.send, continuation: options.continuation, waitUntil: args.waitUntil, onAppMention,
131
- onDirectMessage }, (onReactionAdded === undefined ? {} : { onReactionAdded })), { credentials,
132
- eventIds, host: args.host, artifacts: args.artifacts, log: getLog(), mentionsEnabled,
153
+ onDirectMessage }, (onReactionAdded === undefined ? {} : { onReactionAdded })), { credentials, eventIds: (_a = args.eventIds) !== null && _a !== void 0 ? _a : eventIds, propagateHandlerErrors: args.propagateHandlerErrors, host: args.host, artifacts: args.artifacts, log: getLog(), mentionsEnabled,
133
154
  directMessagesEnabled,
134
155
  evalCommandsEnabled,
135
156
  followUpStatus,
@@ -149,7 +170,10 @@ export function slackChannel(authored = {}) {
149
170
  auth: [allowAll()],
150
171
  state: emptySlackChannelState(),
151
172
  routes: [],
152
- meta: Object.assign(Object.assign({ kind: "slack" }, (channelPosts === undefined
173
+ meta: Object.assign(Object.assign({ kind: "slack",
174
+ // Omitted (not empty) when nothing dispatches, so fanout never
175
+ // materializes a subscription with no event types.
176
+ slackEventTypes: slackEventTypes.length === 0 ? undefined : slackEventTypes }, (channelPosts === undefined
153
177
  ? {}
154
178
  : { slackChannelPosts: [...channelPosts.allow] })), { deprecations: reply.deprecations }),
155
179
  receive(input_1, _a) {
@@ -379,5 +403,32 @@ export function slackChannel(authored = {}) {
379
403
  }),
380
404
  });
381
405
  slackChannelOptionsByDefinition.set(definition, options);
406
+ attachHostedAdmissionAdapter(definition, {
407
+ kind: "slack",
408
+ prepareArgs: withPropagatingBackgroundErrors,
409
+ // The payload is the full `event_callback` body the CP verified — the
410
+ // same shape Socket Mode unwraps — so it routes through the same
411
+ // inbound dispatch. Outcomes: a captured `send` overrides the fallback
412
+ // tag below, so `skipped` surfaces when the engagement rules declined
413
+ // (`not_engaged`) or no handler takes the shape (`not_dispatchable`);
414
+ // a throwing handler rejects `waitUntil` (propagateHandlerErrors) and
415
+ // hosted admission answers a retryable 503, like the PR adapters.
416
+ // The channel-level event_id dedupe is deliberately bypassed with a
417
+ // fresh instance per delivery: the control plane's app-scoped ingress
418
+ // claim already dedupes Slack retries, and on a warm pod the local set
419
+ // would otherwise swallow the control plane's own retry of a delivery
420
+ // that failed after the id was marked handled.
421
+ dispatch: (_a) => __awaiter(this, [_a], void 0, function* ({ payload, args }) {
422
+ const dispatched = dispatchInboundFromEventBody(payload, inboundDeps({
423
+ send: args.send,
424
+ waitUntil: args.waitUntil,
425
+ host: args.host,
426
+ artifacts: args.artifacts,
427
+ eventIds: createEventIdDedupe(),
428
+ propagateHandlerErrors: true,
429
+ }));
430
+ return skipped(dispatched ? "not_engaged" : "not_dispatchable");
431
+ }),
432
+ });
382
433
  return definition;
383
434
  }
@@ -131,4 +131,49 @@ export declare function allowAll(): AuthPolicy;
131
131
  export declare function publicEndpoint(): AuthPolicy;
132
132
  /** True when a policy was created by {@link publicEndpoint}. */
133
133
  export declare function isPublicEndpointPolicy(policy: AuthPolicy): boolean;
134
+ /**
135
+ * What `deploy` extracts from a {@link sharedSecretAuth} /
136
+ * {@link hmacSignatureAuth} policy into the manifest: the control plane runs
137
+ * the same check with the deployment secret of the same name before any
138
+ * compute starts. `secret` is a name, never a value.
139
+ */
140
+ export type CatchAuthDeclaration = {
141
+ kind: "header";
142
+ header: string;
143
+ secret: string;
144
+ } | {
145
+ kind: "hmac-sha256";
146
+ header: string;
147
+ secret: string;
148
+ prefix?: string;
149
+ }
150
+ /** `publicEndpoint()`: the handler verifies; the control plane only rate limits. */
151
+ | {
152
+ kind: "public";
153
+ };
154
+ /** The catch declaration a policy carries, if it is a catch-capable policy. */
155
+ export declare function catchAuthDeclaration(policy: AuthPolicy): CatchAuthDeclaration | undefined;
156
+ /**
157
+ * Admit requests whose `header` equals the secret named `secret` (an
158
+ * `Authorization: Bearer <secret>` header also matches). Locally the value
159
+ * is `process.env[secret]`; hosted, the deployment secret of that name. On
160
+ * Cursor hosting this ALSO declares the channel's routes reachable through
161
+ * the control-plane catch API, which runs the same comparison before any
162
+ * compute exists. An unset secret admits nothing.
163
+ */
164
+ export declare function sharedSecretAuth(options: {
165
+ header: string;
166
+ secret: string;
167
+ }): AuthPolicy;
168
+ /**
169
+ * Admit requests whose `header` carries the hex HMAC-SHA256 of the raw body
170
+ * under the secret named `secret` (optionally behind a literal `prefix`
171
+ * such as `sha256=`). Same local / hosted / catch semantics as
172
+ * {@link sharedSecretAuth}.
173
+ */
174
+ export declare function hmacSignatureAuth(options: {
175
+ header: string;
176
+ secret: string;
177
+ prefix?: string;
178
+ }): AuthPolicy;
134
179
  //# sourceMappingURL=channels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KA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U,CAO3C;AAED,gEAAgE;AAChE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAMlE"}
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,WAAW,EACX,aAAa,GACd,MAAM,sBAAsB,CAAC;AAS9B,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,YAAY,EAEZ,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,SAAS,EAEV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,kCAAkC,EAClC,2BAA2B,EAC3B,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,+BAA+B;AAC/B,wBAAgB,aAAa,CAAC,MAAM,GAAG,SAAS,EAC9C,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,iBAAiB,CAAC,MAAM,CAAC,CAW3B;AAED;;;GAGG;AACH,w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
package/dist/channels.js CHANGED
@@ -57,23 +57,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57
57
  };
58
58
  export { openCiCheck, resumeCiCheck, } from "./channels/checks.js";
59
59
  import { Buffer } from "node:buffer";
60
- import { timingSafeEqual } from "node:crypto";
60
+ import { createHmac, timingSafeEqual } from "node:crypto";
61
61
  import { brandDefinition } from "./internal/brand.js";
62
62
  import { normalizeIdentity } from "./internal/continuation-identity.js";
63
+ import { attachCatchAdmission } from "./internal/hosted-catch.js";
64
+ import { attachHttpControlPlaneAdmission } from "./internal/http-control-plane-session.js";
63
65
  import { isLoopbackAddress, isLoopbackHostname } from "./internal/net.js";
64
66
  /** Define a custom channel. */
65
67
  export function defineChannel(config) {
66
- return brandDefinition("channel", config);
68
+ const definition = brandDefinition("channel", config);
69
+ if (config.routes !== undefined && config.routes.length > 0) {
70
+ // Hosted: the control plane catches declared routes and replays them
71
+ // here. Provider packs attach their own admission afterwards.
72
+ attachCatchAdmission(definition, config.routes);
73
+ }
74
+ return definition;
67
75
  }
68
76
  /**
69
77
  * Configure the built-in HTTP session channel. Only meaningful as the
70
78
  * default export of `agent/channels/http.ts`.
71
79
  */
72
80
  export function httpChannel(config = {}) {
73
- if (config.continuation !== undefined) {
74
- return brandDefinition("http-channel", Object.assign(Object.assign({}, config), { continuation: normalizeIdentity(config.continuation, "http") }));
75
- }
76
- return brandDefinition("http-channel", config);
81
+ const definition = config.continuation !== undefined
82
+ ? brandDefinition("http-channel", Object.assign(Object.assign({}, config), { continuation: normalizeIdentity(config.continuation, "http") }))
83
+ : brandDefinition("http-channel", config);
84
+ attachHttpControlPlaneAdmission(definition);
85
+ return definition;
77
86
  }
78
87
  // ============================================================================
79
88
  // Route verbs
@@ -322,9 +331,99 @@ export function publicEndpoint() {
322
331
  principalId: "anonymous",
323
332
  principalType: "user",
324
333
  });
325
- return Object.assign(policy, { [PUBLIC_ENDPOINT_MARKER]: true });
334
+ // On the v2 control plane this also makes the channel's routes catchable
335
+ // with handler-side verification (the v1 alias posture): the CP admits
336
+ // every request on a declared route and the handler rejects bad ones.
337
+ return markCatchAuth(Object.assign(policy, { [PUBLIC_ENDPOINT_MARKER]: true }), { kind: "public" });
326
338
  }
327
339
  /** True when a policy was created by {@link publicEndpoint}. */
328
340
  export function isPublicEndpointPolicy(policy) {
329
341
  return (policy[PUBLIC_ENDPOINT_MARKER] === true);
330
342
  }
343
+ const CATCH_AUTH_MARKER = Symbol.for("agent-serve.catch-auth");
344
+ function markCatchAuth(policy, declaration) {
345
+ return Object.assign(policy, { [CATCH_AUTH_MARKER]: declaration });
346
+ }
347
+ /** The catch declaration a policy carries, if it is a catch-capable policy. */
348
+ export function catchAuthDeclaration(policy) {
349
+ const declaration = policy[CATCH_AUTH_MARKER];
350
+ return typeof declaration === "object" && declaration !== null
351
+ ? declaration
352
+ : undefined;
353
+ }
354
+ function presentedHeaderSecret(headerName, value) {
355
+ if (headerName === "authorization" &&
356
+ value.toLowerCase().startsWith("bearer ")) {
357
+ return value.slice("bearer ".length).trim();
358
+ }
359
+ return value.trim();
360
+ }
361
+ /**
362
+ * Admit requests whose `header` equals the secret named `secret` (an
363
+ * `Authorization: Bearer <secret>` header also matches). Locally the value
364
+ * is `process.env[secret]`; hosted, the deployment secret of that name. On
365
+ * Cursor hosting this ALSO declares the channel's routes reachable through
366
+ * the control-plane catch API, which runs the same comparison before any
367
+ * compute exists. An unset secret admits nothing.
368
+ */
369
+ export function sharedSecretAuth(options) {
370
+ const header = options.header.toLowerCase();
371
+ const policy = (request) => {
372
+ const expected = process.env[options.secret];
373
+ const presented = request.headers.get(header);
374
+ if (expected === undefined ||
375
+ expected.length === 0 ||
376
+ presented === null ||
377
+ !constantTimeEquals(presentedHeaderSecret(header, presented), expected)) {
378
+ return null;
379
+ }
380
+ return {
381
+ authenticator: "shared-secret",
382
+ principalId: "webhook",
383
+ principalType: "service",
384
+ };
385
+ };
386
+ return markCatchAuth(policy, {
387
+ kind: "header",
388
+ header,
389
+ secret: options.secret,
390
+ });
391
+ }
392
+ /**
393
+ * Admit requests whose `header` carries the hex HMAC-SHA256 of the raw body
394
+ * under the secret named `secret` (optionally behind a literal `prefix`
395
+ * such as `sha256=`). Same local / hosted / catch semantics as
396
+ * {@link sharedSecretAuth}.
397
+ */
398
+ export function hmacSignatureAuth(options) {
399
+ var _a;
400
+ const header = options.header.toLowerCase();
401
+ const prefix = (_a = options.prefix) !== null && _a !== void 0 ? _a : "";
402
+ const policy = (request) => __awaiter(this, void 0, void 0, function* () {
403
+ var _a;
404
+ const secret = process.env[options.secret];
405
+ const presented = (_a = request.headers.get(header)) === null || _a === void 0 ? void 0 : _a.trim();
406
+ if (secret === undefined ||
407
+ secret.length === 0 ||
408
+ presented === undefined ||
409
+ !presented.startsWith(prefix)) {
410
+ return null;
411
+ }
412
+ const body = Buffer.from(yield request.clone().arrayBuffer());
413
+ const expected = createHmac("sha256", secret).update(body).digest("hex");
414
+ if (!constantTimeEquals(presented.slice(prefix.length).toLowerCase(), expected)) {
415
+ return null;
416
+ }
417
+ return {
418
+ authenticator: "hmac-signature",
419
+ principalId: "webhook",
420
+ principalType: "service",
421
+ };
422
+ });
423
+ return markCatchAuth(policy, {
424
+ kind: "hmac-sha256",
425
+ header,
426
+ secret: options.secret,
427
+ prefix: options.prefix,
428
+ });
429
+ }
@@ -65,7 +65,8 @@
65
65
  * executes **on the Cursor backend** with the account's stored OAuth
66
66
  * credentials, so the agent gets Linear / Notion / Slack / … tools with
67
67
  * zero token plumbing and no OAuth secrets on this host. Requires the host
68
- * to be signed in (`agent-sdk login` or `CURSOR_API_KEY`):
68
+ * to be signed in (`agent-sdk login`, `CURSOR_API_KEY`, or
69
+ * `CURSOR_SERVICE_ACCOUNT_KEY`):
69
70
  *
70
71
  * ```ts
71
72
  * // agent/mcp-connections/account.ts — every connected server (no allowlist)
@@ -1 +1 @@
1
- {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../src/connections.ts"],"names":[],"mappings":"AAAA;;;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B"}
@@ -65,7 +65,8 @@
65
65
  * executes **on the Cursor backend** with the account's stored OAuth
66
66
  * credentials, so the agent gets Linear / Notion / Slack / … tools with
67
67
  * zero token plumbing and no OAuth secrets on this host. Requires the host
68
- * to be signed in (`agent-sdk login` or `CURSOR_API_KEY`):
68
+ * to be signed in (`agent-sdk login`, `CURSOR_API_KEY`, or
69
+ * `CURSOR_SERVICE_ACCOUNT_KEY`):
69
70
  *
70
71
  * ```ts
71
72
  * // agent/mcp-connections/account.ts — every connected server (no allowlist)
@@ -9,7 +9,7 @@
9
9
  <link rel="preload stylesheet" href="/docs/assets/style.DCD_zyg3.css" as="style">
10
10
  <link rel="preload stylesheet" href="/docs/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/docs/assets/app.CtuckIiL.js"></script>
12
+ <script type="module" src="/docs/assets/app.Cr-wVbnB.js"></script>
13
13
  <link rel="preload" href="/docs/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
14
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
15
15
  <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
@@ -18,7 +18,7 @@
18
18
  </head>
19
19
  <body>
20
20
  <div id="app"></div>
21
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"ab.md\":\"mlVgqvSk\",\"building-with-agents.md\":\"CUSWxlP_\",\"concepts.md\":\"DgEcZOfT\",\"deployment.md\":\"MFPKqsqI\",\"evals.md\":\"CbMoebP1\",\"guides_agent-to-agent.md\":\"BDb0t1QV\",\"guides_cloud-agents.md\":\"DS8RIjwx\",\"guides_convert-automation.md\":\"B4sjlodG\",\"guides_github.md\":\"c0gdGJ-D\",\"guides_grokbot-agents.md\":\"DVqdhBKb\",\"guides_human-in-the-loop.md\":\"By1G2T3_\",\"guides_mcp-oauth.md\":\"Dp6cDP7f\",\"guides_opentelemetry.md\":\"SCRMskno\",\"guides_slack.md\":\"9oHPye9o\",\"guides_webhooks.md\":\"DKdA43Qm\",\"hillclimbing.md\":\"CpTGTCle\",\"index.md\":\"BW_6tOgR\",\"quickstart.md\":\"DdQOF7Y8\",\"reference_agent-config.md\":\"CHNpiyp4\",\"reference_artifacts.md\":\"Dior32Qw\",\"reference_channels.md\":\"D-qTqwcq\",\"reference_cli.md\":\"Dm67hd2D\",\"reference_connections.md\":\"Di6jJAXF\",\"reference_extensions.md\":\"CGmMLblt\",\"reference_hooks.md\":\"Ddt5DdgJ\",\"reference_http-api.md\":\"oySXBO8o\",\"reference_instructions.md\":\"CR7XSsGk\",\"reference_playground.md\":\"4myJPxrf\",\"reference_project-layout.md\":\"DuBu9a96\",\"reference_prompt.md\":\"DnaD5dNK\",\"reference_result.md\":\"BK5SxDrf\",\"reference_schedules.md\":\"DI_JrHgq\",\"reference_sessions.md\":\"CueyOHSL\",\"reference_skills.md\":\"l2ezAcaN\",\"reference_subagents.md\":\"CfsIloPm\",\"reference_tools.md\":\"aGrn99hP\",\"scaffolding-agents.md\":\"em43xlY1\",\"skills_ab.md\":\"CsFNatVx\",\"skills_create-agent.md\":\"BVoWPcan\",\"skills_debug.md\":\"CDbPhHfg\",\"skills_evals.md\":\"723kpUmA\",\"skills_framework-map.md\":\"haibFyoB\",\"skills_github.md\":\"D0JahM8c\",\"skills_hillclimb.md\":\"B_zJerxA\",\"skills_index.md\":\"DKwIxzGg\",\"skills_mcp-auth.md\":\"DGvFP3HE\",\"skills_otel.md\":\"B5Ddv1xH\",\"skills_setup-slack.md\":\"BBgx8lUz\",\"storage.md\":\"BOHeqk2M\",\"templates_agentic-owners.md\":\"BZSH4N9z\",\"templates_agents-md.md\":\"CXSMZljE\",\"templates_code-wiki.md\":\"CDYZIBFN\",\"templates_demo.md\":\"BeQX9V3H\",\"templates_grokbot-agents.md\":\"c1s6Flp9\",\"templates_pr-autofixer.md\":\"Bds_XWcV\",\"templates_security-help.md\":\"C3Ny_Qr2\",\"templates_security-reviewer.md\":\"lshxbCLK\",\"templates_triage.md\":\"Co4UNzkZ\",\"troubleshooting.md\":\"Cus_YZga\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"sdkVersion\":\"0.1.107\",\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Templates\",\"link\":\"/templates/demo\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Convert a Cursor Automation\",\"link\":\"/guides/convert-automation\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Demo agent\",\"link\":\"/templates/demo\"},{\"text\":\"Grok Bot agents\",\"link\":\"/templates/grokbot-agents\"},{\"text\":\"Code wiki\",\"link\":\"/templates/code-wiki\"},{\"text\":\"Living AGENTS.md\",\"link\":\"/templates/agents-md\"},{\"text\":\"Security reviewer\",\"link\":\"/templates/security-reviewer\"},{\"text\":\"Security help\",\"link\":\"/templates/security-help\"},{\"text\":\"Agentic Owners\",\"link\":\"/templates/agentic-owners\"},{\"text\":\"PR autofixer\",\"link\":\"/templates/pr-autofixer\"},{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Live A/B metrics\",\"link\":\"/ab\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Coding-agent skills\",\"collapsed\":true,\"items\":[{\"text\":\"Overview\",\"link\":\"/skills/\"},{\"text\":\"ab\",\"link\":\"/skills/ab\"},{\"text\":\"create-agent\",\"link\":\"/skills/create-agent\"},{\"text\":\"debug\",\"link\":\"/skills/debug\"},{\"text\":\"evals\",\"link\":\"/skills/evals\"},{\"text\":\"framework-map\",\"link\":\"/skills/framework-map\"},{\"text\":\"github\",\"link\":\"/skills/github\"},{\"text\":\"hillclimb\",\"link\":\"/skills/hillclimb\"},{\"text\":\"mcp-auth\",\"link\":\"/skills/mcp-auth\"},{\"text\":\"otel\",\"link\":\"/skills/otel\"},{\"text\":\"setup-slack\",\"link\":\"/skills/setup-slack\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cursor cloud agents\",\"link\":\"/guides/cloud-agents\"},{\"text\":\"Cursor Grok Bot agents\",\"link\":\"/guides/grokbot-agents\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Extensions\",\"link\":\"/reference/extensions\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Turn result\",\"link\":\"/reference/result\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
21
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"building-with-agents.md\":\"D0KbSkJn\",\"concepts.md\":\"B4o63Gul\",\"deployment.md\":\"JenwuCCB\",\"evals.md\":\"C7JLjoEP\",\"guides_agent-to-agent.md\":\"BDb0t1QV\",\"guides_bitbucket.md\":\"DZPzmUjU\",\"guides_cloud-agents.md\":\"BsloyHdY\",\"guides_convert-automation.md\":\"B4sjlodG\",\"guides_github.md\":\"TZaTZlfz\",\"guides_gitlab.md\":\"BmqwQfdG\",\"guides_grokbot-agents.md\":\"DyV-WArv\",\"guides_human-in-the-loop.md\":\"By1G2T3_\",\"guides_improve.md\":\"BGVk32bK\",\"guides_mcp-oauth.md\":\"Dp6cDP7f\",\"guides_opentelemetry.md\":\"SCRMskno\",\"guides_slack.md\":\"D4RVMM4G\",\"guides_webhooks.md\":\"CJK484ex\",\"hillclimbing.md\":\"BOiVo1tf\",\"index.md\":\"DD9Q2XuJ\",\"quickstart.md\":\"DdQOF7Y8\",\"reference_agent-config.md\":\"CvoL6pof\",\"reference_artifacts.md\":\"Dior32Qw\",\"reference_channels.md\":\"CAo-iK4j\",\"reference_cli.md\":\"Deg7849l\",\"reference_connections.md\":\"BojkC6c5\",\"reference_extensions.md\":\"ZAVUyuEX\",\"reference_hooks.md\":\"BlM_bOg6\",\"reference_http-api.md\":\"BwaCo-VO\",\"reference_instructions.md\":\"CR7XSsGk\",\"reference_playground.md\":\"DLnoaczX\",\"reference_project-layout.md\":\"BEU8MtQV\",\"reference_prompt.md\":\"DnaD5dNK\",\"reference_result.md\":\"BK5SxDrf\",\"reference_schedules.md\":\"DI_JrHgq\",\"reference_sessions.md\":\"CyXV1MUw\",\"reference_skills.md\":\"l2ezAcaN\",\"reference_subagents.md\":\"CfsIloPm\",\"reference_tools.md\":\"aGrn99hP\",\"scaffolding-agents.md\":\"Kctn3OVb\",\"skills_create-agent.md\":\"Q3h6Je-e\",\"skills_debug.md\":\"CVjCXMFF\",\"skills_deploy.md\":\"CWqi_ZxW\",\"skills_evals.md\":\"DFxYPErF\",\"skills_framework-map.md\":\"BxLSOhSY\",\"skills_github.md\":\"hgFX_oKY\",\"skills_hillclimb.md\":\"B_zJerxA\",\"skills_index.md\":\"DL7EHaQ-\",\"skills_mcp-auth.md\":\"DGvFP3HE\",\"skills_otel.md\":\"B5Ddv1xH\",\"skills_setup-slack.md\":\"BBgx8lUz\",\"storage.md\":\"BUrhJ-Zz\",\"templates_agentic-owners.md\":\"BZSH4N9z\",\"templates_agents-md.md\":\"CXSMZljE\",\"templates_code-wiki.md\":\"CDYZIBFN\",\"templates_demo.md\":\"BeQX9V3H\",\"templates_grokbot-agents.md\":\"c1s6Flp9\",\"templates_pr-autofixer.md\":\"Bds_XWcV\",\"templates_security-help.md\":\"C3Ny_Qr2\",\"templates_security-reviewer.md\":\"lshxbCLK\",\"templates_triage.md\":\"Co4UNzkZ\",\"troubleshooting.md\":\"CYEAO9bM\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Agent SDK\",\"description\":\"Filesystem-first framework for building and serving Cursor agents.\",\"base\":\"/docs/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"sdkVersion\":\"0.1.109\",\"nav\":[{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Guides\",\"link\":\"/guides/webhooks\"},{\"text\":\"Templates\",\"link\":\"/templates/demo\"},{\"text\":\"Reference\",\"link\":\"/reference/project-layout\"}],\"search\":{\"provider\":\"local\"},\"outline\":{\"level\":[2,3]},\"sidebar\":[{\"text\":\"Getting started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Quickstart\",\"link\":\"/quickstart\"},{\"text\":\"Scaffold an agent with Cursor\",\"link\":\"/scaffolding-agents\"},{\"text\":\"Convert a Cursor Automation\",\"link\":\"/guides/convert-automation\"},{\"text\":\"Concepts\",\"link\":\"/concepts\"}]},{\"text\":\"Templates\",\"items\":[{\"text\":\"Demo agent\",\"link\":\"/templates/demo\"},{\"text\":\"Grok Bot agents\",\"link\":\"/templates/grokbot-agents\"},{\"text\":\"Code wiki\",\"link\":\"/templates/code-wiki\"},{\"text\":\"Living AGENTS.md\",\"link\":\"/templates/agents-md\"},{\"text\":\"Security reviewer\",\"link\":\"/templates/security-reviewer\"},{\"text\":\"Security help\",\"link\":\"/templates/security-help\"},{\"text\":\"Agentic Owners\",\"link\":\"/templates/agentic-owners\"},{\"text\":\"PR autofixer\",\"link\":\"/templates/pr-autofixer\"},{\"text\":\"Triage agent\",\"link\":\"/templates/triage\"}]},{\"text\":\"Improving agents\",\"items\":[{\"text\":\"Building agents with agents\",\"link\":\"/building-with-agents\"},{\"text\":\"Evals\",\"link\":\"/evals\"},{\"text\":\"Storage\",\"link\":\"/storage\"},{\"text\":\"Hillclimbing\",\"link\":\"/hillclimbing\"}]},{\"text\":\"Coding-agent skills\",\"collapsed\":true,\"items\":[{\"text\":\"Overview\",\"link\":\"/skills/\"},{\"text\":\"create-agent\",\"link\":\"/skills/create-agent\"},{\"text\":\"debug\",\"link\":\"/skills/debug\"},{\"text\":\"deploy\",\"link\":\"/skills/deploy\"},{\"text\":\"evals\",\"link\":\"/skills/evals\"},{\"text\":\"framework-map\",\"link\":\"/skills/framework-map\"},{\"text\":\"github\",\"link\":\"/skills/github\"},{\"text\":\"hillclimb\",\"link\":\"/skills/hillclimb\"},{\"text\":\"mcp-auth\",\"link\":\"/skills/mcp-auth\"},{\"text\":\"otel\",\"link\":\"/skills/otel\"},{\"text\":\"setup-slack\",\"link\":\"/skills/setup-slack\"}]},{\"text\":\"Guides\",\"items\":[{\"text\":\"Webhooks & custom channels\",\"link\":\"/guides/webhooks\"},{\"text\":\"GitHub\",\"link\":\"/guides/github\"},{\"text\":\"GitLab\",\"link\":\"/guides/gitlab\"},{\"text\":\"Bitbucket\",\"link\":\"/guides/bitbucket\"},{\"text\":\"Slack\",\"link\":\"/guides/slack\"},{\"text\":\"Human-in-the-loop approvals\",\"link\":\"/guides/human-in-the-loop\"},{\"text\":\"Agent-to-agent\",\"link\":\"/guides/agent-to-agent\"},{\"text\":\"Host MCP OAuth\",\"link\":\"/guides/mcp-oauth\"},{\"text\":\"Cursor cloud agents\",\"link\":\"/guides/cloud-agents\"},{\"text\":\"Cursor Grok Bot agents\",\"link\":\"/guides/grokbot-agents\"},{\"text\":\"Self-improvement\",\"link\":\"/guides/improve\"},{\"text\":\"OpenTelemetry\",\"link\":\"/guides/opentelemetry\"}]},{\"text\":\"Operating\",\"items\":[{\"text\":\"Deployment\",\"link\":\"/deployment\"},{\"text\":\"Fix common problems\",\"link\":\"/troubleshooting\"}]},{\"text\":\"Reference\",\"collapsed\":false,\"items\":[{\"text\":\"Project layout\",\"link\":\"/reference/project-layout\"},{\"text\":\"Agent config\",\"link\":\"/reference/agent-config\"},{\"text\":\"Instructions\",\"link\":\"/reference/instructions\"},{\"text\":\"Tools\",\"link\":\"/reference/tools\"},{\"text\":\"prompt\",\"link\":\"/reference/prompt\"},{\"text\":\"Skills\",\"link\":\"/reference/skills\"},{\"text\":\"MCP Connections\",\"link\":\"/reference/connections\"},{\"text\":\"Subagents\",\"link\":\"/reference/subagents\"},{\"text\":\"Extensions\",\"link\":\"/reference/extensions\"},{\"text\":\"Channels\",\"link\":\"/reference/channels\"},{\"text\":\"Schedules & reminders\",\"link\":\"/reference/schedules\"},{\"text\":\"Hooks\",\"link\":\"/reference/hooks\"},{\"text\":\"Artifacts\",\"link\":\"/reference/artifacts\"},{\"text\":\"Turn result\",\"link\":\"/reference/result\"},{\"text\":\"Sessions & streaming\",\"link\":\"/reference/sessions\"},{\"text\":\"Playground\",\"link\":\"/reference/playground\"},{\"text\":\"CLI\",\"link\":\"/reference/cli\"},{\"text\":\"HTTP API\",\"link\":\"/reference/http-api\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
22
22
 
23
23
  </body>
24
24
  </html>
@@ -1 +1 @@
1
- import{R as p}from"./chunks/theme.DhpIe0Pa.js";import{R as s,a3 as i,a4 as u,a5 as c,a6 as l,a7 as f,a8 as d,a9 as m,aa as h,ab as g,ac as A,d as v,u as R,v as w,s as y,ad as C,ae as P,af as b,a2 as E}from"./chunks/framework.BCISBCiQ.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
1
+ import{R as p}from"./chunks/theme.Dnsd3XOn.js";import{R as s,a3 as i,a4 as u,a5 as c,a6 as l,a7 as f,a8 as d,a9 as m,aa as h,ab as g,ac as A,d as v,u as R,v as w,s as y,ad as C,ae as P,af as b,a2 as E}from"./chunks/framework.BCISBCiQ.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
@@ -1,4 +1,4 @@
1
- import{_ as a,c as t,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent.","frontmatter":{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent."},"headers":[],"relativePath":"building-with-agents.md","filePath":"building-with-agents.md"}'),n={name:"building-with-agents.md"};function l(h,e,r,o,d,c){return i(),t("div",null,[...e[0]||(e[0]=[s(`<h1 id="building-agents-with-agents" tabindex="-1">Building agents with agents <a class="header-anchor" href="#building-agents-with-agents" aria-label="Permalink to &quot;Building agents with agents&quot;">​</a></h1><p>Give a coding agent the goal. The built-in skills guide it through scaffolding, channels, verification, evals, and measured improvement.</p><h2 id="what-can-a-coding-agent-build-for-me" tabindex="-1">What can a coding agent build for me? <a class="header-anchor" href="#what-can-a-coding-agent-build-for-me" aria-label="Permalink to &quot;What can a coding agent build for me?&quot;">​</a></h2><p>A coding agent can take an Agent SDK project from an idea to a verified first version. It can:</p><ul><li>Create the project and choose the smallest useful surface</li><li>Add tools, skills, channels, MCP connections, and approval gates</li><li>Run a real turn and inspect its trace</li><li>Add evals for the behavior you want to keep</li><li>Improve the agent against fixed inputs</li></ul><p>This works because the project surface lives in files. The CLI also returns structured JSON and records each run as an NDJSON trace. Your coding agent can inspect what the framework discovered, run the agent, and verify the result without reading terminal prose.</p><h2 id="how-do-i-create-an-agent-with-the-built-in-skill" tabindex="-1">How do I create an agent with the built-in skill? <a class="header-anchor" href="#how-do-i-create-an-agent-with-the-built-in-skill" aria-label="Permalink to &quot;How do I create an agent with the built-in skill?&quot;">​</a></h2><p>Have the coding agent read <a href="./skills/create-agent.html"><code>skills/create-agent/SKILL.md</code></a> and follow it.</p><p>The skill asks about your agent&#39;s purpose, runtime, model, channels, MCP connections, and capabilities. It then shows you a plan, writes the project, and verifies the result.</p><p>For example:</p><blockquote><p>Use the Agent SDK create-agent skill to build a PR triage agent reachable through GitHub. It should summarize failed checks, require approval before posting a review, and include one smoke eval.</p></blockquote><p>The skill starts with a small surface: short instructions, one or two tools, the channels you chose, and a smoke eval. You can add more after the first end-to-end turn works.</p><h2 id="which-built-in-skill-should-i-use" tabindex="-1">Which built-in skill should I use? <a class="header-anchor" href="#which-built-in-skill-should-i-use" aria-label="Permalink to &quot;Which built-in skill should I use?&quot;">​</a></h2><p>The package ships task-specific guides under <a href="./skills/"><code>skills/</code></a>:</p><table tabindex="0"><thead><tr><th>What you want to do</th><th>Skill</th></tr></thead><tbody><tr><td>Understand the project layout and runtimes</td><td><a href="./skills/framework-map.html"><code>framework-map</code></a></td></tr><tr><td>Create and verify a new agent</td><td><a href="./skills/create-agent.html"><code>create-agent</code></a></td></tr><tr><td>Write fixtures and regression checks</td><td><a href="./skills/evals.html"><code>evals</code></a></td></tr><tr><td>Live A/B metrics on traffic (<code>defineAB</code>)</td><td><a href="./skills/ab.html"><code>ab</code></a></td></tr><tr><td>Export OpenTelemetry traces</td><td><a href="./skills/otel.html"><code>otel</code></a></td></tr><tr><td>Improve an agent against fixed inputs</td><td><a href="./skills/hillclimb.html"><code>hillclimb</code></a></td></tr><tr><td>Add GitHub webhooks and replay events</td><td><a href="./skills/github.html"><code>github</code></a></td></tr><tr><td>Connect an agent to Slack</td><td><a href="./skills/setup-slack.html"><code>setup-slack</code></a></td></tr><tr><td>Authorize host MCP OAuth</td><td><a href="./skills/mcp-auth.html"><code>mcp-auth</code></a></td></tr><tr><td>Diagnose a local run</td><td><a href="./skills/debug.html"><code>debug</code></a></td></tr></tbody></table><p>Point your coding agent at the matching <code>SKILL.md</code>. The guide contains the workflow, commands, and common mistakes for that task.</p><h2 id="how-does-a-coding-agent-verify-its-work" tabindex="-1">How does a coding agent verify its work? <a class="header-anchor" href="#how-does-a-coding-agent-verify-its-work" aria-label="Permalink to &quot;How does a coding agent verify its work?&quot;">​</a></h2><p>The coding agent should discover the project, test each server tool, run a real turn, and finish with evals:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> validate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
1
+ import{_ as t,c as a,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent.","frontmatter":{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent."},"headers":[],"relativePath":"building-with-agents.md","filePath":"building-with-agents.md"}'),n={name:"building-with-agents.md"};function l(h,e,r,o,d,c){return i(),a("div",null,[...e[0]||(e[0]=[s(`<h1 id="building-agents-with-agents" tabindex="-1">Building agents with agents <a class="header-anchor" href="#building-agents-with-agents" aria-label="Permalink to &quot;Building agents with agents&quot;">​</a></h1><p>Give a coding agent the goal. The built-in skills guide it through scaffolding, channels, verification, deployment, evals, and measured improvement.</p><h2 id="what-can-a-coding-agent-build-for-me" tabindex="-1">What can a coding agent build for me? <a class="header-anchor" href="#what-can-a-coding-agent-build-for-me" aria-label="Permalink to &quot;What can a coding agent build for me?&quot;">​</a></h2><p>A coding agent can take an Agent SDK project from an idea to a verified first version. It can:</p><ul><li>Create the project and choose the smallest useful surface</li><li>Add tools, skills, channels, MCP connections, and approval gates</li><li>Run a real turn and inspect its trace</li><li>Add evals for the behavior you want to keep</li><li>Improve the agent against fixed inputs</li></ul><p>This works because the project surface lives in files. The CLI also returns structured JSON and records each run as an NDJSON trace. Your coding agent can inspect what the framework discovered, run the agent, and verify the result without reading terminal prose.</p><h2 id="how-do-i-create-an-agent-with-the-built-in-skill" tabindex="-1">How do I create an agent with the built-in skill? <a class="header-anchor" href="#how-do-i-create-an-agent-with-the-built-in-skill" aria-label="Permalink to &quot;How do I create an agent with the built-in skill?&quot;">​</a></h2><p>Have the coding agent read <a href="./skills/create-agent.html"><code>skills/create-agent/SKILL.md</code></a> and follow it.</p><p>The skill asks about your agent&#39;s purpose, runtime, model, channels, MCP connections, and capabilities. It then shows you a plan, writes the project, and verifies the result.</p><p>For example:</p><blockquote><p>Use the Agent SDK create-agent skill to build a PR triage agent reachable through GitHub. It should summarize failed checks, require approval before posting a review, and include one smoke eval.</p></blockquote><p>The skill starts with a small surface: short instructions, one or two tools, the channels you chose, and a smoke eval. You can add more after the first end-to-end turn works.</p><h2 id="which-built-in-skill-should-i-use" tabindex="-1">Which built-in skill should I use? <a class="header-anchor" href="#which-built-in-skill-should-i-use" aria-label="Permalink to &quot;Which built-in skill should I use?&quot;">​</a></h2><p>The package ships task-specific guides under <a href="./skills/"><code>skills/</code></a>:</p><table tabindex="0"><thead><tr><th>What you want to do</th><th>Skill</th></tr></thead><tbody><tr><td>Understand the project layout and runtimes</td><td><a href="./skills/framework-map.html"><code>framework-map</code></a></td></tr><tr><td>Create and verify a new agent</td><td><a href="./skills/create-agent.html"><code>create-agent</code></a></td></tr><tr><td>Write fixtures and regression checks</td><td><a href="./skills/evals.html"><code>evals</code></a></td></tr><tr><td>Export OpenTelemetry traces</td><td><a href="./skills/otel.html"><code>otel</code></a></td></tr><tr><td>Improve an agent against fixed inputs</td><td><a href="./skills/hillclimb.html"><code>hillclimb</code></a></td></tr><tr><td>Add GitHub webhooks and replay events</td><td><a href="./skills/github.html"><code>github</code></a></td></tr><tr><td>Connect an agent to Slack</td><td><a href="./skills/setup-slack.html"><code>setup-slack</code></a></td></tr><tr><td>Authorize host MCP OAuth</td><td><a href="./skills/mcp-auth.html"><code>mcp-auth</code></a></td></tr><tr><td>Deploy with an attached service account</td><td><a href="./skills/deploy.html"><code>deploy</code></a></td></tr><tr><td>Diagnose a local run</td><td><a href="./skills/debug.html"><code>debug</code></a></td></tr></tbody></table><p>Point your coding agent at the matching <code>SKILL.md</code>. The guide contains the workflow, commands, and common mistakes for that task.</p><h2 id="how-does-a-coding-agent-verify-its-work" tabindex="-1">How does a coding agent verify its work? <a class="header-anchor" href="#how-does-a-coding-agent-verify-its-work" aria-label="Permalink to &quot;How does a coding agent verify its work?&quot;">​</a></h2><p>The coding agent should discover the project, test each server tool, run a real turn, and finish with evals:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> validate</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
2
2
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span></span>
3
3
  <span class="line"></span>
4
4
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> call</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> inspect_pr</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
@@ -10,4 +10,4 @@ import{_ as a,c as t,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const k
10
10
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> trajectory</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --events</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">state-roo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">t</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/traces/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">sessionI</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">d</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.ndjson</span></span>
11
11
  <span class="line"></span>
12
12
  <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> eval</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --list</span></span>
13
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> eval</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span></span></code></pre></div><p><code>serve</code> boots without an API key, which is enough to check channel mounts and the playground shell. Model turns need a credential. When the environment lacks one, finish every key-free check, then hand the <code>run</code> and <code>eval</code> commands to the operator.</p><p>Test server tools with <code>call</code> before tuning the prompt. It runs a tool in-process with schema validation and no model turn. If the tool returns the wrong data, a prompt change won&#39;t fix it.</p><p><code>validate</code> and <code>run</code> do not type-check the project. Run the project&#39;s TypeScript check before shipping. Tool results must also be JSON-shaped. Use object literals or <code>type</code> aliases for <code>execute</code> return types instead of <code>interface</code> types.</p><h2 id="how-do-i-improve-the-agent-after-its-first-run" tabindex="-1">How do I improve the agent after its first run? <a class="header-anchor" href="#how-do-i-improve-the-agent-after-its-first-run" aria-label="Permalink to &quot;How do I improve the agent after its first run?&quot;">​</a></h2><p>Scaffolding proves the agent runs. It says nothing about quality. Once a smoke turn passes, give the hillclimb skill:</p><ol><li><strong>Fixtures</strong>: one to three fixed inputs, such as a PR URL, a canonical question, or a saved webhook payload</li><li><strong>Success criteria</strong>: correct tool choice, fewer tool calls, lower wall time, or better output</li><li><strong>The freeze line</strong>: the API contract, output shape, and existing evals that must stay unchanged</li></ol><p>Have the coding agent read <a href="./skills/hillclimb.html"><code>skills/hillclimb/SKILL.md</code></a>. It measures the current run, proposes one change, remeasures the same fixtures, and adds an eval for each kept improvement.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./quickstart.html">Create your first agent</a></li><li><a href="./scaffolding-agents.html">Scaffold an agent with Cursor</a></li><li><a href="./skills/">Coding-agent skills</a></li><li><a href="./evals.html">Evals</a></li><li><a href="./hillclimbing.html">Hillclimbing</a></li><li><a href="./reference/cli.html">CLI reference</a></li></ul>`,28)])])}const g=a(n,[["render",l]]);export{k as __pageData,g as default};
13
+ <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> eval</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --json</span></span></code></pre></div><p><code>serve</code> boots without an API key, which is enough to check channel mounts and the playground shell. Model turns need a credential. When the environment lacks one, finish every key-free check, then hand the <code>run</code> and <code>eval</code> commands to the operator.</p><p>Test server tools with <code>call</code> before tuning the prompt. It runs a tool in-process with schema validation and no model turn. If the tool returns the wrong data, a prompt change won&#39;t fix it.</p><p><code>validate</code> and <code>run</code> do not type-check the project. Run the project&#39;s TypeScript check before shipping. Tool results must also be JSON-shaped. Use object literals or <code>type</code> aliases for <code>execute</code> return types instead of <code>interface</code> types.</p><h2 id="how-do-i-improve-the-agent-after-its-first-run" tabindex="-1">How do I improve the agent after its first run? <a class="header-anchor" href="#how-do-i-improve-the-agent-after-its-first-run" aria-label="Permalink to &quot;How do I improve the agent after its first run?&quot;">​</a></h2><p>Scaffolding proves the agent runs. It says nothing about quality. Once a smoke turn passes, give the hillclimb skill:</p><ol><li><strong>Fixtures</strong>: one to three fixed inputs, such as a PR URL, a canonical question, or a saved webhook payload</li><li><strong>Success criteria</strong>: correct tool choice, fewer tool calls, lower wall time, or better output</li><li><strong>The freeze line</strong>: the API contract, output shape, and existing evals that must stay unchanged</li></ol><p>Have the coding agent read <a href="./skills/hillclimb.html"><code>skills/hillclimb/SKILL.md</code></a>. It measures the current run, proposes one change, remeasures the same fixtures, and adds an eval for each kept improvement.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to &quot;Related&quot;">​</a></h2><ul><li><a href="./quickstart.html">Create your first agent</a></li><li><a href="./scaffolding-agents.html">Scaffold an agent with Cursor</a></li><li><a href="./skills/">Coding-agent skills</a></li><li><a href="./evals.html">Evals</a></li><li><a href="./hillclimbing.html">Hillclimbing</a></li><li><a href="./reference/cli.html">CLI reference</a></li></ul>`,28)])])}const g=t(n,[["render",l]]);export{k as __pageData,g as default};
@@ -1 +1 @@
1
- import{_ as a,c as t,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent.","frontmatter":{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent."},"headers":[],"relativePath":"building-with-agents.md","filePath":"building-with-agents.md"}'),n={name:"building-with-agents.md"};function l(h,e,r,o,d,c){return i(),t("div",null,[...e[0]||(e[0]=[s("",28)])])}const g=a(n,[["render",l]]);export{k as __pageData,g as default};
1
+ import{_ as t,c as a,o as i,ag as s}from"./chunks/framework.BCISBCiQ.js";const k=JSON.parse('{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent.","frontmatter":{"title":"Building agents with agents","description":"Use the built-in skills to have a coding agent create, verify, and improve your agent."},"headers":[],"relativePath":"building-with-agents.md","filePath":"building-with-agents.md"}'),n={name:"building-with-agents.md"};function l(h,e,r,o,d,c){return i(),a("div",null,[...e[0]||(e[0]=[s("",28)])])}const g=t(n,[["render",l]]);export{k as __pageData,g as default};