@cursor/bdk 0.2.25 → 0.2.27

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 (449) hide show
  1. package/AGENTS.md +3 -18
  2. package/CHANGELOG.md +3 -0
  3. package/dist/artifacts.d.ts +1 -1
  4. package/dist/artifacts.js +1 -1
  5. package/dist/bin/agent-serve.js +25 -21
  6. package/dist/channels/bitbucket/api.d.ts +2 -2
  7. package/dist/channels/bitbucket/api.d.ts.map +1 -1
  8. package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
  9. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +2 -2
  10. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
  11. package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
  12. package/dist/channels/deployments/deployments-channel.js +1 -1
  13. package/dist/channels/github/cursor-account.d.ts +7 -0
  14. package/dist/channels/github/cursor-account.d.ts.map +1 -1
  15. package/dist/channels/github/cursor-account.js +22 -5
  16. package/dist/channels/github/github-channel.js +1 -1
  17. package/dist/channels/github/replay.d.ts +1 -1
  18. package/dist/channels/github/replay.d.ts.map +1 -1
  19. package/dist/channels/gitlab/api.d.ts +2 -2
  20. package/dist/channels/gitlab/api.d.ts.map +1 -1
  21. package/dist/channels/gitlab/gitlab-channel.js +1 -1
  22. package/dist/channels/issues/issues-channel.js +1 -1
  23. package/dist/channels/origin/api.d.ts +4 -4
  24. package/dist/channels/origin/api.d.ts.map +1 -1
  25. package/dist/channels/origin/origin-channel.js +1 -1
  26. package/dist/channels/origin/origin-webhook.d.ts +3 -3
  27. package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
  28. package/dist/channels/pagerduty/pagerduty-webhook.d.ts +2 -2
  29. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -1
  30. package/dist/channels/runs/runs-channel.js +1 -1
  31. package/dist/channels/slack/agentic-delivery.d.ts +2 -1
  32. package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
  33. package/dist/channels/slack/agentic-delivery.js +6 -10
  34. package/dist/channels/slack/agentic-signals.d.ts +2 -7
  35. package/dist/channels/slack/agentic-signals.d.ts.map +1 -1
  36. package/dist/channels/slack/agentic-signals.js +4 -3
  37. package/dist/channels/slack/api.d.ts +1 -0
  38. package/dist/channels/slack/api.d.ts.map +1 -1
  39. package/dist/channels/slack/api.js +3 -0
  40. package/dist/channels/slack/constants.d.ts +2 -0
  41. package/dist/channels/slack/constants.d.ts.map +1 -1
  42. package/dist/channels/slack/constants.js +2 -0
  43. package/dist/channels/slack/defaults.d.ts.map +1 -1
  44. package/dist/channels/slack/defaults.js +3 -2
  45. package/dist/channels/slack/dispatch.d.ts +9 -0
  46. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  47. package/dist/channels/slack/dispatch.js +3 -0
  48. package/dist/channels/slack/inbound.d.ts.map +1 -1
  49. package/dist/channels/slack/inbound.js +24 -20
  50. package/dist/channels/slack/interactive.d.ts +2 -0
  51. package/dist/channels/slack/interactive.d.ts.map +1 -1
  52. package/dist/channels/slack/interactive.js +1 -0
  53. package/dist/channels/slack/live-delivery.d.ts +3 -0
  54. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  55. package/dist/channels/slack/live-delivery.js +5 -0
  56. package/dist/channels/slack/reply-options.d.ts +9 -0
  57. package/dist/channels/slack/reply-options.d.ts.map +1 -1
  58. package/dist/channels/slack/reply-options.js +31 -1
  59. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  60. package/dist/channels/slack/slack-channel.js +7 -0
  61. package/dist/channels/slack/stream.d.ts +5 -1
  62. package/dist/channels/slack/stream.d.ts.map +1 -1
  63. package/dist/channels/slack/types.d.ts +29 -0
  64. package/dist/channels/slack/types.d.ts.map +1 -1
  65. package/dist/channels.d.ts +1 -1
  66. package/dist/channels.js +1 -1
  67. package/dist/docs/404.html +3 -3
  68. package/dist/docs/assets/{app.BjS1QEI4.js → app.wA5xBBcd.js} +4 -4
  69. package/dist/docs/assets/changelog.md.BvHRIiMH.js +1 -0
  70. package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +1 -0
  71. package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +1 -0
  72. package/dist/docs/assets/chunks/{VPLocalSearchBox.BOuvjb5Y.js → VPLocalSearchBox.C29HLCVL.js} +2 -2
  73. package/dist/docs/assets/chunks/{arc.3WR6Jf-y.js → arc.BOaoYWmh.js} +1 -1
  74. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.Dtb6Dqh6.js → architectureDiagram-Q4EWVU46.MfG0itQh.js} +1 -1
  75. package/dist/docs/assets/chunks/{baseUniq.BUyrgrZE.js → baseUniq.CUeJciCF.js} +1 -1
  76. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BVLV_voZ.js → blockDiagram-DXYQGD6D.BrXMZRtK.js} +1 -1
  77. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.jXJ1q70M.js → c4Diagram-AHTNJAMY.DfkDHeB9.js} +1 -1
  78. package/dist/docs/assets/chunks/channel.D2BTz0L-.js +1 -0
  79. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.zz1SMBvK.js → chunk-4BX2VUAB.xKz8CiXK.js} +1 -1
  80. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.CzYKuv3I.js → chunk-4TB4RGXK.kkfBh4zk.js} +1 -1
  81. package/dist/docs/assets/chunks/{chunk-55IACEB6.C7_tcJZD.js → chunk-55IACEB6.BClJGb94.js} +1 -1
  82. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DeTwQPVO.js → chunk-EDXVE4YY.P9BpQ9L3.js} +1 -1
  83. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DhMTl7ut.js → chunk-FMBD7UC4.R4iYi58S.js} +1 -1
  84. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Me7f5hEp.js → chunk-OYMX7WX6.Cpn8L1dw.js} +1 -1
  85. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.D0E0Bb6g.js → chunk-QZHKN3VN.BLftECqU.js} +1 -1
  86. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.CdOOBFYL.js → chunk-YZCP3GAM.BWDV1AYt.js} +1 -1
  87. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +1 -0
  88. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +1 -0
  89. package/dist/docs/assets/chunks/clone.CldT1lbQ.js +1 -0
  90. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BNbGESzN.js → cose-bilkent-S5V4N54A.DGpAcJ55.js} +1 -1
  91. package/dist/docs/assets/chunks/{dagre-KV5264BT.zU7Lu_xJ.js → dagre-KV5264BT.BBXxGEaD.js} +1 -1
  92. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.B9qOdE5h.js → diagram-5BDNPKRD.EKqOwmK2.js} +1 -1
  93. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.D8X-sf77.js → diagram-G4DWMVQ6.CB8pdkoZ.js} +1 -1
  94. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.CW7MvMlE.js → diagram-MMDJMWI5.aHh4WGg9.js} +1 -1
  95. package/dist/docs/assets/chunks/{diagram-TYMM5635.J489G0Nd.js → diagram-TYMM5635.YIsbRH20.js} +1 -1
  96. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.BkW7tGfs.js → erDiagram-SMLLAGMA.B3bTCW_e.js} +1 -1
  97. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.jc9iWORD.js → flowDiagram-DWJPFMVM.M81hXIXZ.js} +1 -1
  98. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.B-UQfd9E.js → ganttDiagram-T4ZO3ILL.BKg7WY--.js} +1 -1
  99. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.DFzrTSlJ.js → gitGraphDiagram-UUTBAWPF.CLEMZgO3.js} +1 -1
  100. package/dist/docs/assets/chunks/{graph.C5IB6_e_.js → graph.DS38W_Q-.js} +1 -1
  101. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DwF0-c8L.js → infoDiagram-42DDH7IO.BTiWTi82.js} +1 -1
  102. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.fBaTqzE7.js → ishikawaDiagram-UXIWVN3A.DcqY_KQL.js} +1 -1
  103. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CM8gDVJy.js → journeyDiagram-VCZTEJTY.0lQNZ40U.js} +1 -1
  104. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.YiD1p0LB.js → kanban-definition-6JOO6SKY.L5sKlf7X.js} +1 -1
  105. package/dist/docs/assets/chunks/{layout.6Um-DVJT.js → layout.7u4gFhQa.js} +1 -1
  106. package/dist/docs/assets/chunks/{linear.DcTeg4Hn.js → linear.D5v33SOb.js} +1 -1
  107. package/dist/docs/assets/chunks/{min.CIxkY8Fe.js → min.Dc9uCxf9.js} +1 -1
  108. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.D4QM_voR.js → mindmap-definition-QFDTVHPH.B56nGoB_.js} +1 -1
  109. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.nmB309G1.js → pieDiagram-DEJITSTG.Cba8e8lS.js} +1 -1
  110. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D1HtZR3C.js → quadrantDiagram-34T5L4WZ.2YjBycHF.js} +1 -1
  111. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CZgQWob-.js → requirementDiagram-MS252O5E.D4P5RqVI.js} +1 -1
  112. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DtiBfU-P.js → sankeyDiagram-XADWPNL6.C0Hn8NUm.js} +1 -1
  113. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Cld4gDSt.js → sequenceDiagram-FGHM5R23.BZm7EaoT.js} +1 -1
  114. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DatP823_.js → stateDiagram-FHFEXIEX.DcR4f3X2.js} +1 -1
  115. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +1 -0
  116. package/dist/docs/assets/chunks/{theme.D5jbBys7.js → theme.DvfKzyXq.js} +2 -2
  117. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.DwQLI2be.js → timeline-definition-GMOUNBTQ.CgDh96vg.js} +1 -1
  118. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.a5yMfnsa.js → vennDiagram-DHZGUBPP.B4fagbC8.js} +1 -1
  119. package/dist/docs/assets/chunks/{wardley-RL74JXVD.B-FXivgT.js → wardley-RL74JXVD.Ck68omim.js} +1 -1
  120. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.Dz--Opy3.js → wardleyDiagram-NUSXRM2D.DBUg0bvz.js} +1 -1
  121. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.Dl8w8TeT.js → xychartDiagram-5P7HB3ND.DnKSGQE1.js} +1 -1
  122. package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.js → guides_hooks.md.B2XfGX50.js} +7 -3
  123. package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.js → guides_mcp-oauth.md.Cxq2TxBB.js} +3 -3
  124. package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.lean.js → guides_mcp-oauth.md.Cxq2TxBB.lean.js} +1 -1
  125. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
  126. package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
  127. package/dist/docs/assets/{guides_slack.md.Bn-WupSE.js → guides_slack.md.ClIyi7FI.js} +8 -3
  128. package/dist/docs/assets/{guides_slack.md.Bn-WupSE.lean.js → guides_slack.md.ClIyi7FI.lean.js} +1 -1
  129. package/dist/docs/assets/{reference_agent-config.md.IplwL25I.js → reference_agent-config.md.CZrbHOfT.js} +8 -4
  130. package/dist/docs/assets/{reference_agent-config.md.IplwL25I.lean.js → reference_agent-config.md.CZrbHOfT.lean.js} +1 -1
  131. package/dist/docs/assets/{reference_channels.md.Bxaa020x.js → reference_channels.md.CNNIS6K7.js} +1 -1
  132. package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.js → reference_hooks.md.CROr0QgC.js} +13 -7
  133. package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.lean.js → reference_hooks.md.CROr0QgC.lean.js} +1 -1
  134. package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.js → reference_schedules.md.BqWnJES4.js} +3 -3
  135. package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
  136. package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
  137. package/dist/docs/assets/{reference_skills.md.C2GWh7g8.js → reference_skills.md.Ckddg6KX.js} +3 -3
  138. package/dist/docs/assets/{reference_tools.md.-6pypsWt.js → reference_tools.md.Bo0UfT0a.js} +1 -1
  139. package/dist/docs/assets/{style.nMsabY-V.css → style.B9o0luvp.css} +1 -1
  140. package/dist/docs/building-with-agents.html +37 -37
  141. package/dist/docs/changelog.html +60 -0
  142. package/dist/docs/changelog.md +114 -0
  143. package/dist/docs/deployment.html +37 -37
  144. package/dist/docs/evals.html +37 -37
  145. package/dist/docs/guides/agent-to-agent.html +37 -37
  146. package/dist/docs/guides/bitbucket.html +37 -37
  147. package/dist/docs/guides/cloud-agents.html +37 -37
  148. package/dist/docs/guides/convert-automation.html +37 -37
  149. package/dist/docs/guides/export-grokbot.html +37 -37
  150. package/dist/docs/guides/github.html +37 -37
  151. package/dist/docs/guides/gitlab.html +37 -37
  152. package/dist/docs/guides/grokbot-agents.html +37 -37
  153. package/dist/docs/guides/hooks.html +45 -41
  154. package/dist/docs/guides/hooks.md +7 -3
  155. package/dist/docs/guides/improve.html +37 -37
  156. package/dist/docs/guides/jev.html +37 -37
  157. package/dist/docs/guides/mcp-oauth.html +39 -39
  158. package/dist/docs/guides/mcp-oauth.md +12 -0
  159. package/dist/docs/guides/migrate.html +37 -37
  160. package/dist/docs/guides/opentelemetry.html +62 -70
  161. package/dist/docs/guides/opentelemetry.md +149 -179
  162. package/dist/docs/guides/pagerduty.html +37 -37
  163. package/dist/docs/guides/slack.html +44 -39
  164. package/dist/docs/guides/slack.md +41 -0
  165. package/dist/docs/guides/webhooks.html +37 -37
  166. package/dist/docs/hashmap.json +1 -1
  167. package/dist/docs/hillclimbing.html +37 -37
  168. package/dist/docs/index.html +37 -37
  169. package/dist/docs/llms-full.txt +422 -193
  170. package/dist/docs/llms.txt +2 -1
  171. package/dist/docs/quickstart.html +37 -37
  172. package/dist/docs/reference/agent-config.html +44 -40
  173. package/dist/docs/reference/agent-config.md +30 -1
  174. package/dist/docs/reference/artifacts.html +37 -37
  175. package/dist/docs/reference/channels.html +38 -38
  176. package/dist/docs/reference/channels.md +5 -1
  177. package/dist/docs/reference/cli.html +37 -37
  178. package/dist/docs/reference/connections.html +37 -37
  179. package/dist/docs/reference/evals.html +37 -37
  180. package/dist/docs/reference/extensions.html +37 -37
  181. package/dist/docs/reference/hooks.html +49 -43
  182. package/dist/docs/reference/hooks.md +10 -5
  183. package/dist/docs/reference/http-api.html +37 -37
  184. package/dist/docs/reference/instructions.html +37 -37
  185. package/dist/docs/reference/memory.html +37 -37
  186. package/dist/docs/reference/playground.html +36 -36
  187. package/dist/docs/reference/project-layout.html +37 -37
  188. package/dist/docs/reference/prompt.html +37 -37
  189. package/dist/docs/reference/schedules.html +40 -40
  190. package/dist/docs/reference/sessions.html +58 -37
  191. package/dist/docs/reference/sessions.md +46 -1
  192. package/dist/docs/reference/skills.html +40 -40
  193. package/dist/docs/reference/subagents.html +37 -37
  194. package/dist/docs/reference/tools.html +39 -39
  195. package/dist/docs/reference/tools.md +3 -3
  196. package/dist/docs/templates/agentic-owners.html +37 -37
  197. package/dist/docs/templates/grokbot-agents.html +37 -37
  198. package/dist/docs/templates/security-reviewer.html +37 -37
  199. package/dist/docs/templates/thermo-quality-review.html +37 -37
  200. package/dist/docs/templates/thermo-review.html +37 -37
  201. package/dist/docs/templates/triage.html +37 -37
  202. package/dist/docs/troubleshooting.html +36 -36
  203. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  204. package/dist/extensions/cursor-cloud-agents/extension.js +15 -15
  205. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +4 -1
  206. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
  207. package/dist/extensions/cursor-cloud-agents/lib/backend.js +2 -6
  208. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
  209. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +1 -1
  210. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -1
  211. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +1 -1
  212. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +1 -1
  213. package/dist/extensions/cursor-cloud-agents/tools/launch.js +1 -1
  214. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  215. package/dist/extensions/cursor-cloud-agents/tools/reply.js +1 -1
  216. package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -1
  217. package/dist/extensions/cursor-grokbot-agents/extension.js +7 -3
  218. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +1 -1
  219. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +1 -1
  220. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +1 -1
  221. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -1
  222. package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +1 -1
  223. package/dist/extensions/cursor-grokbot-agents/tools/ask.js +1 -1
  224. package/dist/extensions/cursor-grokbot-agents/tools/check.js +1 -1
  225. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +1 -1
  226. package/dist/extensions/cursor-grokbot-agents/tools/list.js +1 -1
  227. package/dist/extensions/improve/extension.js +1 -1
  228. package/dist/extensions/jev/extension.js +2 -2
  229. package/dist/extensions/jev/tools/evaluate.js +3 -3
  230. package/dist/extensions/slack-communication/extension.js +1 -1
  231. package/dist/extensions/slack-communication/tools/delete-message.js +1 -1
  232. package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -1
  233. package/dist/extensions/slack-communication/tools/edit-message.js +3 -6
  234. package/dist/extensions/slack-communication/tools/post-card.js +1 -1
  235. package/dist/extensions/slack-communication/tools/post-file.js +1 -1
  236. package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -1
  237. package/dist/extensions/slack-communication/tools/post-update.js +3 -6
  238. package/dist/extensions/slack-communication/tools/react.js +1 -1
  239. package/dist/extensions/slack-communication/tools/set-status.js +1 -1
  240. package/dist/extensions.d.ts +1 -1
  241. package/dist/extensions.js +1 -1
  242. package/dist/filesystem.d.ts +26 -5
  243. package/dist/filesystem.d.ts.map +1 -1
  244. package/dist/filesystem.js +91 -18
  245. package/dist/index.d.ts +14 -11
  246. package/dist/index.d.ts.map +1 -1
  247. package/dist/index.js +8 -4
  248. package/dist/internal/as-of.d.ts +2 -0
  249. package/dist/internal/as-of.d.ts.map +1 -1
  250. package/dist/internal/as-of.js +2 -0
  251. package/dist/internal/builtin-tools/reminders.js +1 -1
  252. package/dist/internal/cli-deploy.d.ts.map +1 -1
  253. package/dist/internal/cli-deploy.js +18 -10
  254. package/dist/internal/continuation.d.ts +3 -0
  255. package/dist/internal/continuation.d.ts.map +1 -0
  256. package/dist/internal/continuation.js +1 -0
  257. package/dist/internal/conversation-mirror.d.ts +5 -0
  258. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  259. package/dist/internal/conversation-mirror.js +12 -1
  260. package/dist/internal/convert-automation/convert-workflow.js +1 -1
  261. package/dist/internal/convert-grokbot/answers.d.ts.map +1 -1
  262. package/dist/internal/convert-grokbot/answers.js +10 -8
  263. package/dist/internal/convert-grokbot/recipe.d.ts +1 -1
  264. package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -1
  265. package/dist/internal/convert-grokbot/recipe.js +1 -1
  266. package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
  267. package/dist/internal/cursor/account-mcp.js +2 -0
  268. package/dist/internal/cursor/backend-client.d.ts +8 -3
  269. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  270. package/dist/internal/cursor/backend-client.js +8 -3
  271. package/dist/internal/cursor/credentials.d.ts +2 -2
  272. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  273. package/dist/internal/cursor/credentials.js +1 -1
  274. package/dist/internal/cursor-account-mcp-auth.d.ts +6 -2
  275. package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
  276. package/dist/internal/cursor-account-mcp-auth.js +15 -6
  277. package/dist/internal/deferred-channel-session.d.ts +5 -4
  278. package/dist/internal/deferred-channel-session.d.ts.map +1 -1
  279. package/dist/internal/deferred-channel-session.js +6 -4
  280. package/dist/internal/deploy-client.d.ts +5 -0
  281. package/dist/internal/deploy-client.d.ts.map +1 -1
  282. package/dist/internal/deploy-client.js +3 -3
  283. package/dist/internal/deploy-manifest.js +2 -2
  284. package/dist/internal/describe-error.d.ts +2 -0
  285. package/dist/internal/describe-error.d.ts.map +1 -1
  286. package/dist/internal/describe-error.js +2 -0
  287. package/dist/internal/discovery/agent.d.ts.map +1 -1
  288. package/dist/internal/discovery/agent.js +29 -9
  289. package/dist/internal/discovery/context.d.ts.map +1 -1
  290. package/dist/internal/discovery/context.js +1 -2
  291. package/dist/internal/discovery/cursor-plugin.js +8 -8
  292. package/dist/internal/discovery/extensions.js +15 -8
  293. package/dist/internal/discovery/info.d.ts +2 -2
  294. package/dist/internal/discovery/info.d.ts.map +1 -1
  295. package/dist/internal/discovery/info.js +6 -9
  296. package/dist/internal/discovery/instrumentation.d.ts +10 -0
  297. package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
  298. package/dist/internal/discovery/instrumentation.js +29 -0
  299. package/dist/internal/discovery/modules.d.ts.map +1 -1
  300. package/dist/internal/discovery/modules.js +4 -4
  301. package/dist/internal/discovery/project-public.d.ts +16 -0
  302. package/dist/internal/discovery/project-public.d.ts.map +1 -0
  303. package/dist/internal/discovery/project-public.js +54 -0
  304. package/dist/internal/discovery/project.d.ts.map +1 -1
  305. package/dist/internal/discovery/project.js +13 -3
  306. package/dist/internal/discovery/services.d.ts +5 -4
  307. package/dist/internal/discovery/services.d.ts.map +1 -1
  308. package/dist/internal/discovery/services.js +12 -6
  309. package/dist/internal/docs-site.d.ts +2 -5
  310. package/dist/internal/docs-site.d.ts.map +1 -1
  311. package/dist/internal/docs-site.js +2 -5
  312. package/dist/internal/event-mapper.d.ts.map +1 -1
  313. package/dist/internal/event-mapper.js +1 -0
  314. package/dist/internal/factory-resource-channel.d.ts +1 -1
  315. package/dist/internal/factory-resource-channel.d.ts.map +1 -1
  316. package/dist/internal/filesystem/nearest.d.ts +1 -0
  317. package/dist/internal/filesystem/nearest.d.ts.map +1 -1
  318. package/dist/internal/filesystem/nearest.js +1 -0
  319. package/dist/internal/filesystem/tools.d.ts.map +1 -1
  320. package/dist/internal/filesystem/tools.js +1 -1
  321. package/dist/internal/handleAgentServeTrigger.d.ts +10 -0
  322. package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
  323. package/dist/internal/handleAgentServeTrigger.js +3 -0
  324. package/dist/internal/hmac-secret-values.d.ts +1 -1
  325. package/dist/internal/hmac-secret-values.d.ts.map +1 -1
  326. package/dist/internal/host-otel.d.ts +1 -1
  327. package/dist/internal/host-otel.d.ts.map +1 -1
  328. package/dist/internal/host-otel.js +5 -0
  329. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  330. package/dist/internal/hosted-delivery.js +6 -2
  331. package/dist/internal/http-channel.d.ts.map +1 -1
  332. package/dist/internal/http-channel.js +1 -0
  333. package/dist/internal/ids.d.ts +8 -0
  334. package/dist/internal/ids.d.ts.map +1 -1
  335. package/dist/internal/ids.js +20 -0
  336. package/dist/internal/init-scaffold.js +1 -1
  337. package/dist/internal/interview/agent-questions.d.ts +1 -1
  338. package/dist/internal/interview/agent-questions.d.ts.map +1 -1
  339. package/dist/internal/interview/agent-questions.js +1 -1
  340. package/dist/internal/interview/question.d.ts +2 -2
  341. package/dist/internal/interview/question.d.ts.map +1 -1
  342. package/dist/internal/interview/question.js +2 -2
  343. package/dist/internal/json-schema.d.ts.map +1 -1
  344. package/dist/internal/json-schema.js +3 -7
  345. package/dist/internal/mcp-endpoint.d.ts +16 -4
  346. package/dist/internal/mcp-endpoint.d.ts.map +1 -1
  347. package/dist/internal/mcp-endpoint.js +18 -6
  348. package/dist/internal/mcp-host.d.ts +9 -0
  349. package/dist/internal/mcp-host.d.ts.map +1 -1
  350. package/dist/internal/mcp-host.js +15 -0
  351. package/dist/internal/otel/collector.d.ts +5 -0
  352. package/dist/internal/otel/collector.d.ts.map +1 -1
  353. package/dist/internal/otel/collector.js +24 -5
  354. package/dist/internal/otel/config.d.ts +31 -21
  355. package/dist/internal/otel/config.d.ts.map +1 -1
  356. package/dist/internal/otel/config.js +121 -140
  357. package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
  358. package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
  359. package/dist/internal/otel/conversation-span-processor.js +34 -0
  360. package/dist/internal/otel/customer.d.ts +52 -0
  361. package/dist/internal/otel/customer.d.ts.map +1 -0
  362. package/dist/internal/otel/customer.js +727 -0
  363. package/dist/internal/otel/runtime.d.ts +12 -16
  364. package/dist/internal/otel/runtime.d.ts.map +1 -1
  365. package/dist/internal/otel/runtime.js +30 -234
  366. package/dist/internal/otel-env.d.ts +6 -0
  367. package/dist/internal/otel-env.d.ts.map +1 -0
  368. package/dist/internal/otel-env.js +5 -0
  369. package/dist/internal/reminder-runner.d.ts +9 -4
  370. package/dist/internal/reminder-runner.d.ts.map +1 -1
  371. package/dist/internal/reminder-runner.js +12 -10
  372. package/dist/internal/reminder-schedule.d.ts +1 -0
  373. package/dist/internal/reminder-schedule.d.ts.map +1 -1
  374. package/dist/internal/reminder-schedule.js +1 -0
  375. package/dist/internal/sdk-runner.d.ts +8 -0
  376. package/dist/internal/sdk-runner.d.ts.map +1 -1
  377. package/dist/internal/sdk-runner.js +190 -14
  378. package/dist/internal/server.d.ts +4 -1
  379. package/dist/internal/server.d.ts.map +1 -1
  380. package/dist/internal/server.js +25 -24
  381. package/dist/internal/session-engine.d.ts +35 -3
  382. package/dist/internal/session-engine.d.ts.map +1 -1
  383. package/dist/internal/session-engine.js +213 -41
  384. package/dist/internal/slack-provision-client.js +1 -1
  385. package/dist/internal/store-api-protocol.d.ts +1 -1
  386. package/dist/internal/store-api-protocol.d.ts.map +1 -1
  387. package/dist/internal/store-api-protocol.js +1 -1
  388. package/dist/internal/update-check.d.ts +2 -2
  389. package/dist/internal/update-check.d.ts.map +1 -1
  390. package/dist/internal/update-check.js +3 -3
  391. package/dist/internal/workspace.d.ts +10 -0
  392. package/dist/internal/workspace.d.ts.map +1 -1
  393. package/dist/internal/workspace.js +47 -1
  394. package/dist/internal/zod3-datetime.d.ts +12 -0
  395. package/dist/internal/zod3-datetime.d.ts.map +1 -0
  396. package/dist/internal/zod3-datetime.js +17 -0
  397. package/dist/otel-public.d.ts +2 -3
  398. package/dist/otel-public.d.ts.map +1 -1
  399. package/dist/otel-public.js +2 -2
  400. package/dist/otel.d.ts +3 -102
  401. package/dist/otel.d.ts.map +1 -1
  402. package/dist/otel.js +61 -97
  403. package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
  404. package/dist/playground/assets/index-B3_YohwW.js +62 -0
  405. package/dist/playground/assets/index-Cn3-adsJ.css +1 -0
  406. package/dist/playground/index.html +2 -2
  407. package/dist/public-deprecated.d.ts +36 -0
  408. package/dist/public-deprecated.d.ts.map +1 -0
  409. package/dist/public-deprecated.js +39 -0
  410. package/dist/tools.d.ts +3 -3
  411. package/dist/tools.d.ts.map +1 -1
  412. package/dist/tools.js +1 -1
  413. package/dist/types.d.ts +262 -97
  414. package/dist/types.d.ts.map +1 -1
  415. package/docs/changelog.md +119 -0
  416. package/docs/guides/hooks.md +7 -3
  417. package/docs/guides/mcp-oauth.md +12 -0
  418. package/docs/guides/opentelemetry.md +149 -184
  419. package/docs/guides/slack.md +41 -0
  420. package/docs/reference/agent-config.md +30 -1
  421. package/docs/reference/channels.md +5 -1
  422. package/docs/reference/hooks.md +10 -5
  423. package/docs/reference/sessions.md +46 -1
  424. package/docs/reference/tools.md +3 -3
  425. package/package.json +35 -8
  426. package/schemas/grokbot-answers.schema.json +11 -0
  427. package/skills/framework-map/SKILL.md +2 -1
  428. package/skills/otel/SKILL.md +28 -48
  429. package/templates/code-wiki/evals/wiki.eval.ts +2 -2
  430. package/dist/docs/assets/chunks/@localSearchIndexroot.oGqZumnJ.js +0 -1
  431. package/dist/docs/assets/chunks/channel.Dt4aweTm.js +0 -1
  432. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DGUHZs6j.js +0 -1
  433. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DGUHZs6j.js +0 -1
  434. package/dist/docs/assets/chunks/clone.DWf3k0Z0.js +0 -1
  435. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C0571l4D.js +0 -1
  436. package/dist/docs/assets/guides_opentelemetry.md.DBQtp7_V.js +0 -45
  437. package/dist/docs/assets/guides_opentelemetry.md.DBQtp7_V.lean.js +0 -1
  438. package/dist/docs/assets/reference_sessions.md.C8FXuGwk.js +0 -1
  439. package/dist/docs/assets/reference_sessions.md.C8FXuGwk.lean.js +0 -1
  440. package/dist/playground/assets/cursor-icons-16-DmHBTm1-.woff2 +0 -0
  441. package/dist/playground/assets/index-BdMwybMt.css +0 -1
  442. package/dist/playground/assets/index-CHk6O92d.js +0 -62
  443. package/templates/grokbot-agents/.gitignore +0 -4
  444. package/templates/security-help/.gitignore +0 -4
  445. /package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.lean.js → guides_hooks.md.B2XfGX50.lean.js} +0 -0
  446. /package/dist/docs/assets/{reference_channels.md.Bxaa020x.lean.js → reference_channels.md.CNNIS6K7.lean.js} +0 -0
  447. /package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.lean.js → reference_schedules.md.BqWnJES4.lean.js} +0 -0
  448. /package/dist/docs/assets/{reference_skills.md.C2GWh7g8.lean.js → reference_skills.md.Ckddg6KX.lean.js} +0 -0
  449. /package/dist/docs/assets/{reference_tools.md.-6pypsWt.lean.js → reference_tools.md.Bo0UfT0a.lean.js} +0 -0
@@ -143,6 +143,125 @@ works; a measured climb proves it works better on fixed inputs.
143
143
 
144
144
  ---
145
145
 
146
+ Source: /docs/changelog.md
147
+
148
+ # Changelog
149
+
150
+ ## 0.2.27 (2026-10-16)
151
+
152
+ ### Breaking changes
153
+
154
+ - Each `handle.agents` entry is `{ slug, url, info }`. It no longer has `project`. Read `info` instead.
155
+
156
+ ### Behavior changes
157
+
158
+ - `@cursor/bdk` requires `@cursor/sdk` 1.0.38.
159
+ - In project info, a function `needsApproval` is `"dynamic"` instead of `true`.
160
+ - Project info has `schemaVersion: 1` and `architecture`. Diagnostic paths are relative to the project directory.
161
+ - `handle.project` is deprecated. Use `handle.agents`.
162
+ - `loadAgentProject`, `loadAgentProjects`, and `projectInfo` are deprecated. Use `loadProject`.
163
+ - `root` on `defineAgent` is deprecated. Use `fs`. Setting both is an error.
164
+
165
+ ### New
166
+
167
+ - `loadProject(dir)` loads a project without serving it. Its `info` matches `GET /v1/info`. Pass `{ strict: true }` to fail on warnings.
168
+ - `serve` accepts a directory or a `Project` from `loadProject`.
169
+ - `defineAgent({ fs })` mounts your filesystem at `/`. BDK mounts `/tmp` and `/agent/skills` over it.
170
+ - With `fs`, the agent's skills are read-only at `/agent/skills/<name>/SKILL.md`. Set `skills: false` to keep your own `/agent/skills`.
171
+ - Listing a directory includes the files of mounts nested under it.
172
+
173
+ ### Fixes
174
+
175
+ - A local agent can use a model variant that needs Max Mode, such as Grok 4.7 with a 500k context window.
176
+ - A session that has been idle for 10 minutes releases its memory. Its next turn resumes the conversation.
177
+
178
+ ## 0.2.26 (2026-10-16)
179
+
180
+ ### Breaking changes
181
+
182
+ - `serve({ otel })` is removed. Delete `bot/otel.ts`, `agent/otel.ts`, and `bot/instrumentation.ts`. Set `OTEL_*` variables. Read [Migrating from serve({ otel })](/docs/guides/opentelemetry.md#migrating-from-serve-otel).
183
+
184
+ ### Behavior changes
185
+
186
+ - `ctx.host.otel` is deprecated. It still runs for this release. The first call emits one deprecation warning. Set `OTEL_*` variables. Record with `metrics.getMeter` and `trace.getTracer` from `@opentelemetry/api`.
187
+ - A span started during a turn or a tool gets `cursor.conversation.id` from the active context when the span does not set it. A metric does not. Call `currentConversationId` from `@cursor/bdk/otel` and set the attribute yourself. See [OpenTelemetry](/docs/guides/opentelemetry.md#what-you-can-record).
188
+ - A turn waits for MCP OAuth only when a person can connect. That is a playground or HTTP chat turn, or a Slack message on a channel that shows Connect. `toolApprovals: true` shows Connect, and so does `buildToolApprovalEvents` in `events`. A schedule, a reminder, a webhook, an eval, or a Slack channel without Connect does not wait. A required connection fails with `Reconnect <connection>`. An optional connection is skipped.
189
+ - A turn never waits to authorize an `optional` connection, also in the playground.
190
+ - A turn that waits for MCP OAuth stops after 10 minutes with `Reconnect <connection>`. `interrupt()` also stops the wait.
191
+ - `bdk deploy` rejects a source host other than GitHub, gitlab.com, or Origin.
192
+ - A new scaffold imports `zod/v4`. A zod 3 schema and a zod 4 schema both still parse.
193
+ - `bdk deploy` with no terminal lists a connector that needs sign-in as pending.
194
+
195
+ ### New
196
+
197
+ - `bdk deploy` deploys a bot from a gitlab.com repository.
198
+ - When you omit `--cursor-events-repo`, a GitLab deploy watches that project. A nested group is part of the path.
199
+ - When that deploy cannot watch the project, the deploy still finishes. The CLI says the deployment is not watching the project.
200
+ - An agentic Slack reply can set `cards: { display: "plan" }`. Slack shows the `post-card` steps from that turn as one checklist.
201
+ - A `title` names that checklist. A title has at most 256 characters.
202
+ - With no `cards` option, Slack keeps one card for each step.
203
+ - `send()` returns a delivery id. Set `deliveryId` to choose it. `nudge.delivered` and `message.received` include that id.
204
+
205
+ ### Fixes
206
+
207
+ - Public helper signatures use portable types. A webhook body is a `string` or a `Uint8Array`. An environment map is `Record<string, string | undefined>`.
208
+ - `HostFilesApi.read` takes a `HostFileTextEncoding`. A `Buffer` and `process.env` still type-check.
209
+ - OpenTelemetry ends each tool span when that tool finishes.
210
+ - With no OpenTelemetry endpoint, the process holds at most 2048 spans and 2048 log records.
211
+ - A follow-up after a redeploy resumes the same agent. A changed workspace path does not start a new conversation.
212
+ - In a Slack Connect channel, sender checks use the workspace where the app is installed.
213
+ - A `cursorAccount` GitHub GraphQL call includes the repository.
214
+ - A Slack bot with a lapsed MCP connection replies with a reconnect message.
215
+
216
+ ## 0.2.25 (2026-10-14)
217
+
218
+ ### New
219
+
220
+ - `bdk validate --json` writes one JSON object. Each diagnostic has a code.
221
+
222
+ ### Fixes
223
+
224
+ - OpenTelemetry metrics follow `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`. The default stays delta.
225
+ - `ctx.host.github.getOctokit()` tries again after a failed lookup. A later call can succeed after a GitHub token becomes available.
226
+
227
+ ## 0.2.24 (2026-10-13)
228
+
229
+ ### Breaking changes
230
+
231
+ - Install `zod` in the project. The peer range is `^3.25.0` or `^4.0.0`. A new scaffold imports `zod/v3`.
232
+
233
+ ### Behavior changes
234
+
235
+ - `setContinuationToken(null)` releases the continuation key. The next delivery starts a new session.
236
+ - Model fallback continues when a blocked model sends progress updates and no assistant text. Those updates are `user-message-appended`, `step-started`, and `step-completed`.
237
+ - Read a secret inside a handler, a tool, or a callback. A `process.env` read while the module is still loading returns an empty value on a Cursor-managed deploy.
238
+ - In the Agentic Approver template, a `paths` glob is relative to the policy directory.
239
+ - The package depends on `tsx` 4.23.15.
240
+
241
+ ### New
242
+
243
+ - `hmacSignatureAuth` takes an optional `separator`. One header can then carry several HMAC signatures. PagerDuty uses a comma.
244
+ - `cursorCloudAgents` accepts `cloud.teamMcpServers`. The launch uses the team MCP servers you name.
245
+
246
+ ### Fixes
247
+
248
+ - On Cursor-managed hosting, OpenTelemetry reads the endpoint, the headers, and the resource after secrets load. You can remove a workaround that reads `OTEL_EXPORTER_OTLP_HEADERS` again.
249
+
250
+ ## 0.2.23 (2026-10-09)
251
+
252
+ ### Behavior changes
253
+
254
+ - `bdk migrate` rewrites a URL-secret MCP peer to `defineConnection({ agent })` in the migration pull request.
255
+ - `bdk migrate` prints a checklist after the migration. It says when there is nothing to migrate.
256
+ - `bdk slack create --prod` says the deployment redeploys by itself.
257
+ - `bdk deploy` on a folder of several agents prints one command per agent. You run each command to deploy that agent.
258
+
259
+ ### New
260
+
261
+ - A Slack app can opt in to the `chat:write.customize` scope. A post can then set its username and its icon. An app that leaves the scope off keeps its current scopes.
262
+
263
+ ---
264
+
146
265
  Source: /docs/deployment.md
147
266
 
148
267
  # Deploy a BDK project
@@ -2520,8 +2639,13 @@ so the dashboard reflects live traffic instead of the test suite.
2520
2639
 
2521
2640
  ```ts
2522
2641
  // bot/hooks/usage.ts
2642
+ import { metrics } from "@opentelemetry/api";
2523
2643
  import { defineHook } from "@cursor/bdk/hooks";
2524
2644
 
2645
+ const meter = metrics.getMeter("acme");
2646
+ const inputTokens = meter.createCounter("acme.tokens.input");
2647
+ const outputTokens = meter.createCounter("acme.tokens.output");
2648
+
2525
2649
  export default defineHook({
2526
2650
  events: {
2527
2651
  async "turn.completed"(event, ctx) {
@@ -2532,9 +2656,8 @@ export default defineHook({
2532
2656
  return;
2533
2657
  }
2534
2658
 
2535
- const { inputTokens, outputTokens } = event.data.usage;
2536
- ctx.host.otel.increment("acme.tokens.input", inputTokens);
2537
- ctx.host.otel.increment("acme.tokens.output", outputTokens);
2659
+ inputTokens.add(event.data.usage.inputTokens);
2660
+ outputTokens.add(event.data.usage.outputTokens);
2538
2661
  },
2539
2662
  },
2540
2663
  });
@@ -3106,6 +3229,18 @@ bdk serve --dir . --dev
3106
3229
 
3107
3230
  Connect authorizes the process that is running now.
3108
3231
 
3232
+ A turn waits for Connect only when a person can click it:
3233
+
3234
+ - A playground or HTTP chat turn.
3235
+ - A Slack message, when the channel shows Connect. `slackChannel({ toolApprovals: true })` shows
3236
+ Connect, and so does `buildToolApprovalEvents` in `events`.
3237
+
3238
+ The wait stops after 10 minutes, or when the turn is interrupted. Other
3239
+ turns do not wait. These are schedules, reminders, webhooks, evals, and
3240
+ Slack channels without Connect. A required connection fails the call with
3241
+ `Reconnect <connection>`. An `optional` connection is skipped, also in the
3242
+ playground. Authorize those connections ahead of time with `mcp oauth`.
3243
+
3109
3244
  ## Keep privileged tools behind a wrapper
3110
3245
 
3111
3246
  Put a connection under `bot/host-connections/` when the model should
@@ -3369,21 +3504,14 @@ peer connections, and secrets, then verify a hosted turn. The
3369
3504
 
3370
3505
  Source: /docs/guides/opentelemetry.md
3371
3506
 
3372
- # Observe an agent with OpenTelemetry
3507
+ # OpenTelemetry
3373
3508
 
3374
- OpenTelemetry connects an agent turn to the observability system your
3375
- team already uses. Once you configure an OTLP collector, each request,
3376
- model turn, tool call, and subagent appears alongside token, tool, and
3377
- cost metrics from the serve process.
3378
-
3379
- Export is opt-in. Nothing leaves the process until you configure a
3380
- destination.
3381
-
3382
- ## Connect an OTLP collector
3383
-
3384
- Set the collector endpoint, start the agent, and send it a message. You
3385
- should see an `agent_sdk.http` request span and an `agent_sdk.turn`
3386
- trace, with any tool or subagent work nested under the turn.
3509
+ BDK exports traces, metrics, and logs to an OTLP collector. You
3510
+ configure that with standard `OTEL_*` environment variables. There is
3511
+ no `defineOtel` or `register()` hook. `ctx.host.otel` is deprecated.
3512
+ It still runs for this release and logs one warning per process. Set
3513
+ `OTEL_*` variables and record with `metrics.getMeter` and
3514
+ `trace.getTracer` from `@opentelemetry/api`.
3387
3515
 
3388
3516
  ```bash
3389
3517
  export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.example.com
@@ -3393,217 +3521,194 @@ export OTEL_SERVICE_NAME=incident-agent
3393
3521
  bdk serve --dir . --dev
3394
3522
  ```
3395
3523
 
3396
- Metrics use delta temporality by default. For Grafana Cloud, set
3524
+ The default protocol is OTLP/HTTP protobuf. Set
3525
+ `OTEL_EXPORTER_OTLP_PROTOCOL=http/json` when the collector only accepts
3526
+ JSON. `grpc` is not supported. BDK logs a warning and uses
3527
+ `http/protobuf`.
3528
+
3529
+ Metrics use delta temporality by default. BDK logs that default when
3530
+ export starts. For Grafana Cloud or Prometheus, set
3397
3531
  `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` to `cumulative`.
3398
3532
  Grafana Cloud rejects delta metrics.
3399
3533
 
3400
- The default protocol is OTLP/HTTP protobuf. If you already call
3401
- `serve()` from TypeScript, you can configure the same destination in
3402
- code:
3534
+ BDK installs trace, metric, and log providers before it imports
3535
+ `bot/agent.ts`. A meter, tracer, or logger created at module scope
3536
+ binds to those providers. Exporters attach when the process has the
3537
+ `OTEL_*` variables. On a hosted agent that is the first request, after
3538
+ secrets are in the environment.
3403
3539
 
3404
- ```ts
3405
- import { serve } from "@cursor/bdk";
3540
+ With no OTLP endpoint, BDK adds no exporters. Outbound `fetch` does
3541
+ not gain a `traceparent` header. The session collector stays disabled.
3406
3542
 
3407
- await serve(".", {
3408
- otel: {
3409
- serviceName: "incident-agent",
3410
- exporters: [
3411
- {
3412
- url: "https://otel.example.com",
3413
- headers: {
3414
- Authorization: `Bearer ${process.env.OTEL_TOKEN ?? ""}`,
3415
- },
3416
- },
3417
- ],
3418
- },
3419
- });
3420
- ```
3421
-
3422
- Use environment variables when you start the agent with
3423
- `bdk serve`. Use `serve({ otel })` when your TypeScript
3424
- application starts the server itself. When that application
3425
- already uses OpenTelemetry, BDK sends its traces, metrics, and
3426
- logs to the collector configured here.
3427
-
3428
- ## Export from a hosted agent
3543
+ ## Variables
3429
3544
 
3430
- Set the collector endpoint and headers as secrets, and add the
3545
+ | Variable | Effect |
3546
+ | --- | --- |
3547
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | Base URL. BDK appends `/v1/traces`, `/v1/metrics`, and `/v1/logs`. |
3548
+ | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Traces URL, used as written. It wins over the base URL. |
3549
+ | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Metrics URL, used as written. It wins over the base URL. |
3550
+ | `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Logs URL, used as written. It wins over the base URL. |
3551
+ | `OTEL_EXPORTER_OTLP_HEADERS` | Headers on every export. Values are URL-encoded. Read again on each export. |
3552
+ | `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` (default) or `http/json`. gRPC is not supported. |
3553
+ | `OTEL_SERVICE_NAME` | `service.name`. Default is the agent name, then `unknown_service:node`. |
3554
+ | `OTEL_RESOURCE_ATTRIBUTES` | Resource attributes, including `service.namespace`, `service.version`, and `deployment.environment.name`. |
3555
+ | `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | `delta` (default), `cumulative`, or `lowmemory`. Use `cumulative` for Grafana Cloud. |
3556
+ | `OTEL_LOGS_EXPORTER` | `otlp` turns logs on. Unset, `none`, and `console` leave OTLP logs off. |
3557
+ | `OTEL_SDK_DISABLED` | `true` turns export off. |
3558
+ | `OTEL_TRACES_EXPORTER` | `none` turns traces off. |
3559
+ | `OTEL_METRICS_EXPORTER` | `none` turns metrics off. |
3560
+ | `OTEL_LOG_USER_PROMPTS` | `1` puts prompt text on log records. |
3561
+ | `OTEL_LOG_TOOL_CONTENT` | `1` puts tool payloads on log records. |
3562
+
3563
+ ## Hosted agents
3564
+
3565
+ Set the endpoint, headers, and service name as secrets. Add the
3431
3566
  collector host to `hosting.egressDomains`. The host is a hostname
3432
- with no scheme and no path. The first request loads the secrets,
3433
- and export starts with those headers.
3567
+ with no scheme and no path.
3434
3568
 
3435
3569
  ```ts
3436
- // bot/agent.ts
3437
- import { defineAgent } from "@cursor/bdk";
3438
-
3439
3570
  export default defineAgent({
3440
3571
  hosting: {
3441
3572
  egressDomains: ["otlp-gateway-prod-us-east-0.grafana.net"],
3442
- secretNames: ["OTEL_EXPORTER_OTLP_ENDPOINT", "OTEL_EXPORTER_OTLP_HEADERS"],
3573
+ secretNames: [
3574
+ "OTEL_EXPORTER_OTLP_ENDPOINT",
3575
+ "OTEL_EXPORTER_OTLP_HEADERS",
3576
+ "OTEL_SERVICE_NAME",
3577
+ ],
3443
3578
  },
3444
3579
  });
3445
3580
  ```
3446
3581
 
3447
- ```bash
3448
- bdk secrets set my-agent OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_HEADERS
3449
- ```
3582
+ Secrets arrive with the first request that has an endpoint. That
3583
+ request's export uses those headers and `service.name`. A later
3584
+ `bdk secrets set` updates headers on the next export, including a
3585
+ rotated key. BDK also replaces the exporter when the URL, protocol,
3586
+ or signal list changes. `service.name` is fixed on the first export
3587
+ that attaches. Redeploy to change the service name.
3450
3588
 
3451
- `OTEL_EXPORTER_OTLP_HEADERS` is a comma-separated list of
3452
- `name=value` pairs. Each value is URL-encoded, so a space is
3453
- `%20` (`Authorization=Basic%20...`).
3589
+ ## What you can record
3454
3590
 
3455
- A later `bdk secrets set` changes the headers on the next export.
3456
- You do not redeploy to rotate a token. The URL, service name,
3457
- resource attributes, signals, sample ratio, metric export interval,
3458
- and metrics temporality stay as they were on the first export.
3459
- Redeploy to change one of those. BDK logs a warning when one of them
3460
- changes on a running agent.
3591
+ Create the tracer, meter, and logger at module scope.
3461
3592
 
3462
- When an exporter host is missing from `hosting.egressDomains`, BDK
3463
- logs an error that names the host. Add the host and redeploy.
3593
+ ```ts
3594
+ import { metrics, trace } from "@opentelemetry/api";
3595
+ import { logs } from "@opentelemetry/api-logs";
3464
3596
 
3465
- Spans and metrics from before the first request are not exported,
3466
- including spans from channel `onStart`. If the OpenTelemetry config
3467
- fails, BDK logs the error and the request still completes.
3597
+ const tracer = trace.getTracer("incident-agent");
3598
+ const lookups = metrics.getMeter("incident-agent").createCounter("incident.lookups");
3599
+ const logger = logs.getLogger("incident-agent");
3600
+ ```
3468
3601
 
3469
- Logs stay off until `serve({ otel })` sets `logs`, or until
3470
- `OTEL_LOGS_EXPORTER` is `otlp`. Prompt text and tool payloads stay
3471
- off until you set `OTEL_LOG_USER_PROMPTS` or
3472
- `OTEL_LOG_TOOL_CONTENT`.
3602
+ Record during a request, after secrets have loaded. A span or a log
3603
+ record that ends before the exporters attach is still exported. BDK
3604
+ holds up to 2048 spans and 2048 log records until the exporters
3605
+ attach, then sends them. BDK drops each record past that limit. A
3606
+ metric recorded before the first collect is included in that collect.
3473
3607
 
3474
- ## Follow one conversation
3608
+ BDK also records HTTP spans, token counts, and tool calls on the
3609
+ session. Those spans carry `cursor.conversation.id`. A span you start
3610
+ with `trace.getTracer` during a turn or a tool call gets the same
3611
+ attribute from the active context. A value you set on the span stays.
3612
+ BDK does not overwrite it. The id stays in this process. It is not
3613
+ propagated.
3475
3614
 
3476
- Copy the complete session ID from the playground or session API, then
3477
- filter your observability system on either `agent_sdk.session_id` or
3478
- `cursor.conversation.id`. Every turn in that conversation carries the
3479
- same value, including follow-ups and tool work.
3615
+ A metric does not get `cursor.conversation.id`. Read the id and set
3616
+ the attribute yourself.
3480
3617
 
3481
- The trace shape stays small:
3618
+ ```ts
3619
+ import { metrics } from "@opentelemetry/api";
3620
+ import { currentConversationId } from "@cursor/bdk/otel";
3482
3621
 
3483
- ```text
3484
- request: agent_sdk.http
3622
+ const lookups = metrics.getMeter("incident-agent").createCounter("incident.lookups");
3485
3623
 
3486
- turn: agent_sdk.turn
3487
- |- agent_sdk.tool
3488
- `- agent_sdk.subagent
3489
- `- agent_sdk.tool
3624
+ lookups.add(1, { "cursor.conversation.id": currentConversationId() });
3490
3625
  ```
3491
3626
 
3492
- A conversation can produce several turn traces, so use the session ID
3493
- as the join key instead of expecting one long-lived session span.
3627
+ Prompt text and tool payloads stay off log records unless logs are on
3628
+ (`OTEL_LOGS_EXPORTER=otlp`) and you set `OTEL_LOG_USER_PROMPTS` or
3629
+ `OTEL_LOG_TOOL_CONTENT`.
3494
3630
 
3495
- ### Subagents
3631
+ ## Limits
3496
3632
 
3497
- A subagent's tool calls are `agent_sdk.tool` spans under its
3498
- `agent_sdk.subagent` span. Its `reasoning.completed` and
3499
- `message.completed` events sit on that span too, so the subagent span
3500
- shows where its time went. Time between two tool spans is the model
3501
- choosing the next step. A subagent that fails or is cancelled ends its
3502
- span with ERROR status when it stops.
3633
+ These are not supported yet.
3503
3634
 
3504
- ### Computer use
3635
+ - Custom span processors, samplers, and views.
3636
+ - Bringing your own OpenTelemetry SDK.
3637
+ - Library auto-instrumentation.
3638
+ - A `register()` hook. There is no ticket for it yet.
3639
+ - `OTEL_TRACES_SAMPLER` and `OTEL_METRIC_EXPORT_INTERVAL` that arrive
3640
+ only with hosted secrets. BDK reads them when it builds the provider,
3641
+ which is before that secret load. Set them on the process, then
3642
+ restart. BDK logs a warning when a later value differs.
3505
3643
 
3506
- Each computer use action is an `agent_sdk.tool` span with
3507
- `cursor.tool.name` set to `computerUse`, under the computer use
3508
- subagent's span. A failed action has ERROR status. These attributes
3509
- describe the action without typed text, coordinates, or screenshots:
3644
+ Do not import your own SDK providers next to BDK's. BDK logs a warning
3645
+ when a module replaces a provider BDK registered. The global API then
3646
+ uses that module's provider. BDK shuts down a provider it created
3647
+ only when that provider is not the one it registered.
3510
3648
 
3511
- | Attribute | Value |
3512
- | --- | --- |
3513
- | `agent_sdk.computer.actions` | The action type, such as `click`, `type`, or `screenshot` |
3514
- | `agent_sdk.computer.executor_duration_ms` | Time the desktop took to run the action and capture the screen |
3515
- | `agent_sdk.computer.settle_ms` | Part of that time spent waiting for the screen to settle |
3649
+ ## Migrating from serve({ otel })
3516
3650
 
3517
- The two durations appear only on actions that succeed.
3651
+ `serve({ otel })` is removed. Delete the option. Set the same
3652
+ values with `OTEL_*` variables. Delete `bot/otel.ts`,
3653
+ `agent/otel.ts`, and `bot/instrumentation.ts`. Do not call
3654
+ `defineOtel`.
3518
3655
 
3519
- To export the full actions, turn on tool content as shown in
3520
- [Control what leaves the process](#control-what-leaves-the-process).
3521
- Tool content includes the text the agent typed, which can contain
3522
- passwords.
3656
+ BDK sends each signal to one URL. A second exporter for the same
3657
+ signal has no variable.
3523
3658
 
3524
- ## Add domain telemetry
3525
-
3526
- Use `ctx.host.otel` when your dashboard should answer questions the
3527
- built-in telemetry cannot, such as which incident a turn handled or how
3528
- long approval took. Attributes appear on the active turn and tool
3529
- spans, while counters and histograms give you metrics to graph and
3530
- alert on.
3659
+ | Old option | Set this instead |
3660
+ | --- | --- |
3661
+ | `serviceName` | `OTEL_SERVICE_NAME` |
3662
+ | `serviceVersion` | `service.version` in `OTEL_RESOURCE_ATTRIBUTES` |
3663
+ | `resourceAttributes` | `OTEL_RESOURCE_ATTRIBUTES`. Separate pairs with commas. URL-encode each value. |
3664
+ | `exporters[].url` | `OTEL_EXPORTER_OTLP_ENDPOINT`. BDK appends `/v1/traces`, `/v1/metrics`, and `/v1/logs`. |
3665
+ | `exporters[].url` with `signals` | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, or `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`. BDK uses that URL as written. |
3666
+ | `exporters[].headers` | `OTEL_EXPORTER_OTLP_HEADERS`. Separate pairs with commas. URL-encode each value. |
3667
+ | `exporters[].protocol` | `OTEL_EXPORTER_OTLP_PROTOCOL`. Use `http/protobuf` or `http/json`. For one signal, use `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`, `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`, or `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`. |
3668
+ | `exporters[].signals` | Set the signal URL above. Set `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_LOGS_EXPORTER` to `none` to stop that signal. |
3669
+ | `traces: false` | `OTEL_TRACES_EXPORTER=none` |
3670
+ | `traces: true` | Leave `OTEL_TRACES_EXPORTER` unset. Traces start when an endpoint is set. |
3671
+ | `traces.sampleRatio` | `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG` set to the ratio. Set both before the process starts. |
3672
+ | `metrics: false` | `OTEL_METRICS_EXPORTER=none` |
3673
+ | `metrics: true` | Leave `OTEL_METRICS_EXPORTER` unset. Metrics start when a metrics URL is set. |
3674
+ | `metrics.exportIntervalMillis` | `OTEL_METRIC_EXPORT_INTERVAL`, in milliseconds. Set it before the process starts. |
3675
+ | `logs: false` | Leave `OTEL_LOGS_EXPORTER` unset, or set it to `none`. |
3676
+ | `logs: true` | `OTEL_LOGS_EXPORTER=otlp` |
3677
+ | `logs.userPrompts` | `OTEL_LOGS_EXPORTER=otlp` and `OTEL_LOG_USER_PROMPTS=1` |
3678
+ | `logs.toolContent` | `OTEL_LOGS_EXPORTER=otlp` and `OTEL_LOG_TOOL_CONTENT=1` |
3679
+ | `otel: false` | Set no endpoint, or set `OTEL_SDK_DISABLED=true`. |
3680
+
3681
+ Before:
3531
3682
 
3532
3683
  ```ts
3533
- ctx.host.otel.setAttributes({
3534
- "support.ticket_id": "INC-123",
3535
- "support.queue": "p1",
3536
- });
3537
-
3538
- ctx.host.otel.increment("support.ticket.resolved", {
3539
- outcome: "fixed",
3540
- });
3541
-
3542
- ctx.host.otel.record("support.approval.duration_ms", 1420, {
3543
- outcome: "approved",
3684
+ await serve(".", {
3685
+ otel: {
3686
+ serviceName: "incident-agent",
3687
+ exporters: [
3688
+ {
3689
+ url: "https://otel.example.com",
3690
+ headers: { Authorization: `Bearer ${process.env.OTEL_TOKEN ?? ""}` },
3691
+ },
3692
+ ],
3693
+ },
3544
3694
  });
3545
3695
  ```
3546
3696
 
3547
- This API is available in tools, hooks, and channel handlers. A
3548
- session-bound context adds `cursor.conversation.id` and
3549
- `agent_sdk.agent` automatically, so custom measurements join the
3550
- first-party telemetry without extra plumbing.
3551
-
3552
- Prefix custom names with your team or agent. First-party metric names
3553
- and join keys are reserved, and this surface does not create custom
3554
- spans.
3555
-
3556
- ## Choose signals
3557
-
3558
- Once export has a destination, traces and metrics are on by default;
3559
- logs remain off until you opt in.
3560
-
3561
- | Signal | What appears |
3562
- | --- | --- |
3563
- | Traces | HTTP requests, turns, tools, and subagents |
3564
- | Metrics | Token usage, tool calls, cost, and BDK session or turn counts |
3565
- | Logs | Session events, after you enable log export |
3566
-
3567
- The first metrics to look for are `cursor.token.usage`,
3568
- `cursor.tool.calls`, and `cursor.cost.usage`. Configure
3569
- `traces: false`, `metrics: false`, or `logs: true` under
3570
- `serve({ otel })` when you need a different signal mix.
3571
-
3572
- ## Control what leaves the process
3573
-
3574
- Traces include structure, tool names, usage metrics, and span
3575
- status. A failed tool's span status and its `action.result` log
3576
- include a short failure reason.
3577
- A tool or subagent that is still open when the turn ends gets
3578
- ERROR status with the reason `no result`. User prompts, tool
3579
- arguments, and full tool results stay off the wire until you opt in.
3580
-
3581
- Turn on logs first, then opt into prompt or tool content separately:
3697
+ After:
3582
3698
 
3583
3699
  ```bash
3584
- export OTEL_LOGS_EXPORTER=otlp
3585
- export OTEL_LOG_USER_PROMPTS=1
3586
- export OTEL_LOG_TOOL_CONTENT=1
3700
+ export OTEL_SERVICE_NAME=incident-agent
3701
+ export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.example.com
3702
+ export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20$OTEL_TOKEN"
3703
+ bdk serve --dir . --dev
3587
3704
  ```
3588
3705
 
3589
- `OTEL_LOG_USER_PROMPTS` exports user text. `OTEL_LOG_TOOL_CONTENT`
3590
- exports tool inputs, outputs, and failure details. Enable either only
3591
- when the collector's access and retention policies are appropriate for
3592
- that data.
3593
-
3594
- The same controls are available as
3595
- `logs: { userPrompts, toolContent }` under `serve({ otel })`.
3596
-
3597
- ## Related
3706
+ On a hosted agent, put the same names in `hosting.secretNames`. Add
3707
+ the collector host to `hosting.egressDomains`. Then run:
3598
3708
 
3599
- - [`skills/otel/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/otel/SKILL.md): compact
3600
- configuration and custom-metric reference for coding agents
3601
- - [Hooks](/docs/reference/hooks.md): emit domain telemetry from session
3602
- events
3603
- - [Deployment](/docs/deployment.md): declare `hosting.egressDomains`
3604
- and set collector secrets on a hosted agent
3605
- - [Cursor enterprise OpenTelemetry Export](https://cursor.com/docs/enterprise/opentelemetry-export):
3606
- send organization-wide Cursor telemetry to the same collector
3709
+ ```bash
3710
+ bdk secrets set my-agent OTEL_SERVICE_NAME OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_HEADERS
3711
+ ```
3607
3712
 
3608
3713
  ---
3609
3714
 
@@ -4046,6 +4151,47 @@ export default slackChannel({
4046
4151
  });
4047
4152
  ```
4048
4153
 
4154
+ ### Show steps as cards or as a checklist
4155
+
4156
+ The agent calls `post-card` to show one step of its work, such as
4157
+ "Scan the repo". Each card has an `id`, a `title`, a `status`, and
4158
+ optional `details`. When the agent calls `post-card` again with the same
4159
+ `id`, Slack updates that card. The agent uses this to move a step from
4160
+ `in_progress` to `complete`.
4161
+
4162
+ `cards` sets how Slack draws these steps:
4163
+
4164
+ | `cards` | What Slack shows | Use it when |
4165
+ | --- | --- | --- |
4166
+ | `{ display: "timeline" }` (default) | Each step is a separate card in the thread. | The turn has one or two short steps. |
4167
+ | `{ display: "plan" }` | All steps from one turn are in one checklist. | The turn has several steps, and readers want to see progress in one place. |
4168
+
4169
+ This bot shows its steps as one checklist with the title "Release check":
4170
+
4171
+ ```ts
4172
+ export default slackChannel({
4173
+ reply: {
4174
+ mode: "agentic",
4175
+ cards: { display: "plan", title: "Release check" },
4176
+ },
4177
+ });
4178
+ ```
4179
+
4180
+ Know these rules for a plan:
4181
+
4182
+ - The `title` is optional. It can have at most 256 characters.
4183
+ - You set the `title` in the channel configuration. The agent cannot
4184
+ change the title.
4185
+ - Each turn starts a new checklist with the same title.
4186
+ - The `pending` status shows a step that has not started. Use `pending`
4187
+ only in a plan.
4188
+ - `slackChannel` stops at startup if `cards` is not valid. For example,
4189
+ a `title` with `display: "timeline"` stops startup.
4190
+
4191
+ `display` is Slack's
4192
+ [`task_display_mode`](https://docs.slack.dev/reference/methods/chat.startStream/),
4193
+ and the channel sends `title` as a `plan_update` chunk.
4194
+
4049
4195
  ## Wake on a channel post
4050
4196
 
4051
4197
  This example watches `#triage-alerts`, so any substantial top-level
@@ -5078,6 +5224,8 @@ export default defineAgent({
5078
5224
  | `concurrency` | `{ maxRunningTurns? }` | Agent-wide concurrent turn limit. See [Concurrency](#concurrency). |
5079
5225
  | `builtinTools` | `{ reminders? }` | Framework-provided model-facing tools, opted in per capability. See [Built-in tools](#built-in-tools). |
5080
5226
  | `tools` | `ToolName[]` | Allowlist of built-in harness tools offered to the model. Unset = the model's full standard toolset. See [Harness tools](#harness-tools). |
5227
+ | `fs` | `FileSystem` or `(ctx) => FileSystem` | Custom file tree for the session. `root` is the deprecated name. See [Custom filesystem](#custom-filesystem). |
5228
+ | `skills` | `false` or `(ctx) => FileSystem` | Replaces the skills tree mounted at `/agent/skills`, or turns that mount off. |
5081
5229
 
5082
5230
  ## Model
5083
5231
 
@@ -5155,6 +5303,13 @@ rejects `hosting.image` on any other agent. A deploy pins the image it
5155
5303
  finds, so after you push a new image under the same name, deploy again
5156
5304
  to pick it up.
5157
5305
 
5306
+ ## Custom filesystem
5307
+
5308
+ `fs` is mounted at `/`. BDK mounts `/tmp` and `/agent/skills` over it.
5309
+
5310
+ `root` is the deprecated name of `fs`. Set one of them. A tree that already
5311
+ has `/agent/skills` fails session start unless `skills` is `false`.
5312
+
5158
5313
  ## Harness tools
5159
5314
 
5160
5315
  Use `tools` to limit which built-in Cursor harness tools the model can
@@ -5237,15 +5392,35 @@ const handle = await serve("./my-agent", {
5237
5392
  });
5238
5393
  console.log(`listening on ${handle.url}`);
5239
5394
  // handle.callTool(...), handle.dispatchSchedule("heartbeat"),
5240
- // handle.createReminder(...), handle.project, await handle.close()
5395
+ // handle.createReminder(...), handle.agents, await handle.close()
5241
5396
  ```
5242
5397
 
5398
+ `handle.agents` lists each mount as `slug`, `url`, and `info`. `handle.project` is the first agent's project. It is deprecated.
5399
+
5243
5400
  Host settings match the documented [CLI](/docs/reference/cli.md) `serve` flags.
5244
5401
  `serve()` also accepts `discovery` (project-loading options) and
5245
5402
  `mode: "single" | "multi"`. Pass `apiKey` or use the same Cursor
5246
5403
  credential as the CLI: `CURSOR_API_KEY`, `CURSOR_API_KEY_FILE`,
5247
5404
  `CURSOR_SERVICE_ACCOUNT_KEY`, or `bdk login`.
5248
5405
 
5406
+ ## Inspect a project in tests
5407
+
5408
+ `loadProject(dir)` reads one project and does not serve it. The result is a `Project`. The only field is `info`. That object matches the `GET /v1/info` body for the project. `bdk info --json` on a project directory prints `{ agents: [{ slug, ...info }] }`. It prints the bare object only when the single mount slug is empty.
5409
+
5410
+ ```ts
5411
+ import { loadProject } from "@cursor/bdk";
5412
+
5413
+ const project = await loadProject("./my-agent");
5414
+ console.log(project.info.name);
5415
+ console.log(project.info.tools.map((tool) => tool.name));
5416
+ ```
5417
+
5418
+ `loadProject` throws `ProjectLoadError` when discovery reports an error. Pass `{ strict: true }` to throw on a warning as well. `error.diagnostics` lists the findings. Each `path` is relative to the project directory. A path outside that directory starts with `../`. `loadProject` does not take `importModule`. `serve` still accepts `discovery.importModule` for that override.
5419
+
5420
+ `info.local` is `{ cwd }` when the project sets a cwd. The serve banner reads `agents[].info`.
5421
+
5422
+ `serve` accepts that `Project` or a directory path.
5423
+
5249
5424
  ## Related
5250
5425
 
5251
5426
  - [Instructions](/docs/reference/instructions.md): the required half of a minimal
@@ -5490,11 +5665,15 @@ Each handler receives the Fetch `Request` and a typed arguments object.
5490
5665
  | `purpose` | Use `"eval"` to mark a new session as regression traffic |
5491
5666
  | `dryRun` | Run read tools and stub write tools for a new session |
5492
5667
  | `asOf` | Freeze a new session at an ISO-8601 instant with a timezone |
5668
+ | `deliveryId` | Name this send on the session's events, at most 256 characters. Defaults to a fresh `dlv_…` ID |
5493
5669
 
5494
5670
  `send` returns a `ChannelSession`. Its `id` identifies the session,
5495
5671
  `continuationToken` contains its current channel key, and `isNew` says
5496
5672
  whether this call created it. A coalesced call also returns
5497
- `coalesced: true`.
5673
+ `coalesced: true`. `deliveryId` names this send on the event where the
5674
+ message reaches the agent; see
5675
+ [Track which follow-up reached the agent](/docs/reference/sessions.md#track-which-follow-up-reached-the-agent).
5676
+ A hosted channel's `send` returns the same ID before the session exists.
5498
5677
 
5499
5678
  ## Events
5500
5679
 
@@ -7544,20 +7723,26 @@ Author `bot/hooks/<name>.ts` with `defineHook` from
7544
7723
 
7545
7724
  ```ts
7546
7725
  // bot/hooks/usage.ts
7726
+ import { metrics } from "@opentelemetry/api";
7547
7727
  import { defineHook } from "@cursor/bdk/hooks";
7548
7728
 
7729
+ const meter = metrics.getMeter("acme");
7730
+ const inputTokens = meter.createCounter("acme.tokens.input");
7731
+ const outputTokens = meter.createCounter("acme.tokens.output");
7732
+ const turnFailed = meter.createCounter("acme.turn.failed");
7733
+
7549
7734
  export default defineHook({
7550
7735
  events: {
7551
7736
  async "turn.completed"(event, ctx) {
7552
7737
  if (ctx.session.purpose === "eval" || event.data.usage === undefined) {
7553
7738
  return;
7554
7739
  }
7555
- const { inputTokens, outputTokens } = event.data.usage;
7556
- ctx.host.otel.increment("acme.tokens.input", inputTokens);
7557
- ctx.host.otel.increment("acme.tokens.output", outputTokens);
7740
+ const usage = event.data.usage;
7741
+ inputTokens.add(usage.inputTokens);
7742
+ outputTokens.add(usage.outputTokens);
7558
7743
  },
7559
7744
  async "turn.failed"(_event, ctx) {
7560
- ctx.host.otel.increment("acme.turn.failed", { channel: ctx.channel.id });
7745
+ turnFailed.add(1, { channel: ctx.channel.id });
7561
7746
  },
7562
7747
  },
7563
7748
  });
@@ -7609,7 +7794,6 @@ exported from `@cursor/bdk`.
7609
7794
  | `ctx.channel` | `{ id, continuationToken }`. The token is `null` when the session can't take follow-ups |
7610
7795
  | `ctx.host.kv` | Durable JSON, shared by every session of the agent. Prefix keys with `ctx.session.id` for per-session state |
7611
7796
  | `ctx.host.files` | Durable files, bound to this session. Pass `{ scope: "deployment" }` for agent-wide files |
7612
- | `ctx.host.otel` | Counters, histograms, and tags, attributed to this session |
7613
7797
  | `ctx.host.mcp`, `ctx.host.github`, `ctx.host.slack` | The same shared clients tools get |
7614
7798
  | `ctx.host.reminders` | Per-session [reminders](/docs/reference/schedules.md#reminders), the same API tools get |
7615
7799
  | `ctx.artifacts` | Session-bound [artifacts](/docs/reference/artifacts.md) facade: `tag` fills in `sessionId` and `turnId` |
@@ -8601,6 +8785,51 @@ the session is already busy depends on the channel:
8601
8785
  Pass `admission: "coalesce"` on `send()` to opt into the Slack policy from
8602
8786
  other callers. Omit it (or pass `"preempt"`) to keep interrupt semantics.
8603
8787
 
8788
+ ### Track which follow-up reached the agent
8789
+
8790
+ Every `send()` returns a `deliveryId`. Pass your own as the `deliveryId`
8791
+ option, such as the webhook delivery ID you already hold, or omit it to
8792
+ get a fresh `dlv_…` ID. A coalesced follow-up reaches the agent in one of
8793
+ two ways, and the ID is on the event for that path:
8794
+
8795
+ | Path | Event | Field |
8796
+ | --- | --- | --- |
8797
+ | Steered into the running turn | `nudge.delivered` | `data.deliveryId` |
8798
+ | Fell back to the next turn | That turn's `message.received` | `data.deliveryIds` |
8799
+
8800
+ `message.received` lists every send its prompt carries, in arrival order.
8801
+ Follow-ups queued behind a busy turn drain into one turn, so the list can
8802
+ hold several IDs. A direct send that starts a turn gets a one-item list.
8803
+
8804
+ ```ts
8805
+ // In a route or channel hook: name the steer after the webhook delivery.
8806
+ await send(`Incident ${incident.id} was acknowledged.`, {
8807
+ continuationToken: incident.id,
8808
+ admission: "coalesce",
8809
+ deliveryId: webhookId,
8810
+ });
8811
+
8812
+ // In the channel's `events` map:
8813
+ const steered = new Set<string>();
8814
+ const prompted = new Set<string>();
8815
+ const events: ChannelEventHandlers = {
8816
+ "nudge.delivered": async (event) => {
8817
+ if (event.data.deliveryId !== undefined) {
8818
+ steered.add(event.data.deliveryId);
8819
+ }
8820
+ },
8821
+ "message.received": async (event) => {
8822
+ for (const id of event.data.deliveryIds ?? []) {
8823
+ prompted.add(id);
8824
+ }
8825
+ },
8826
+ };
8827
+ ```
8828
+
8829
+ A local Slack session can also pick up follow-ups at a tool boundary from
8830
+ its own thread store. That `nudge.delivered` has no `deliveryId`, which
8831
+ tells it apart from a steered send.
8832
+
8604
8833
  `POST /v1/session/:id/stop` interrupts a turn without sending a new
8605
8834
  message. The stream records `turn.failed` with `status: "cancelled"`;
8606
8835
  the session stays a chat session and can take another follow-up. A
@@ -8619,7 +8848,7 @@ within one session. The `at` field is an ISO-8601 timestamp.
8619
8848
  | Phase | Events | What they tell you |
8620
8849
  | --- | --- | --- |
8621
8850
  | Session | `session.started`, `session.waiting`, `session.completed`, `session.failed` | Session creation, readiness, and task completion |
8622
- | Input | `message.received` | A user message was accepted |
8851
+ | Input | `message.received`, `nudge.delivered` | A user message was accepted as a turn's prompt, or reached a running turn mid-turn. Both name the [sends they carry](#track-which-follow-up-reached-the-agent) |
8623
8852
  | Turn | `turn.queued`, `turn.started`, `turn.completed`, `turn.failed` | Queue position under a [`maxRunningTurns` cap](/docs/reference/agent-config.md#concurrency), then turn status, final result, and token usage |
8624
8853
  | Steps | `step.started`, `step.completed` | Model step boundaries and duration |
8625
8854
  | Reasoning | `reasoning.appended`, `reasoning.completed` | Streamed reasoning blocks |
@@ -8922,9 +9151,9 @@ export default defineTool({
8922
9151
  `ctx.host` carries the shared host services: `host.mcp` (authored MCP
8923
9152
  connections: `names()`, `listTools(name)`, `callTool(name, tool, args)`),
8924
9153
  `host.github` and `host.slack` (shared platform clients), `host.kv` and
8925
- `host.files` (durable storage), `host.otel` (custom
8926
- metrics and session tags; see [OpenTelemetry](/docs/guides/opentelemetry.md)),
8927
- `host.reminders` (per-session wakes, when attached).
9154
+ `host.files` (durable storage), and `host.reminders` (per-session wakes,
9155
+ when attached). Custom metrics use the
9156
+ [OpenTelemetry](/docs/guides/opentelemetry.md) API.
8928
9157
 
8929
9158
  ### Return values
8930
9159