@cursor/bdk 0.2.23 → 0.2.25

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 (421) hide show
  1. package/AGENTS.md +1 -0
  2. package/dist/artifacts.d.ts +1 -1
  3. package/dist/artifacts.js +1 -1
  4. package/dist/bin/agent-serve.d.ts +1 -1
  5. package/dist/bin/agent-serve.js +48 -12
  6. package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
  7. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +3 -2
  8. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
  9. package/dist/channels/bitbucket/bitbucket-webhook.js +14 -9
  10. package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
  11. package/dist/channels/deployments/deployments-channel.js +1 -1
  12. package/dist/channels/github/github-channel.d.ts.map +1 -1
  13. package/dist/channels/github/github-channel.js +10 -19
  14. package/dist/channels/gitlab/gitlab-channel.js +1 -1
  15. package/dist/channels/issues/issues-channel.js +1 -1
  16. package/dist/channels/origin/origin-channel.js +1 -1
  17. package/dist/channels/pagerduty/api.d.ts +74 -0
  18. package/dist/channels/pagerduty/api.d.ts.map +1 -0
  19. package/dist/channels/pagerduty/api.js +101 -0
  20. package/dist/channels/pagerduty/defaults.d.ts +42 -0
  21. package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
  22. package/dist/channels/pagerduty/defaults.js +132 -0
  23. package/dist/channels/pagerduty/events.d.ts +24 -0
  24. package/dist/channels/pagerduty/events.d.ts.map +1 -0
  25. package/dist/channels/pagerduty/events.js +38 -0
  26. package/dist/channels/pagerduty/index.d.ts +31 -0
  27. package/dist/channels/pagerduty/index.d.ts.map +1 -0
  28. package/dist/channels/pagerduty/index.js +30 -0
  29. package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
  30. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
  31. package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
  32. package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
  33. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
  34. package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
  35. package/dist/channels/pagerduty/payload.d.ts +33 -0
  36. package/dist/channels/pagerduty/payload.d.ts.map +1 -0
  37. package/dist/channels/pagerduty/payload.js +150 -0
  38. package/dist/channels/pagerduty/replay.d.ts +35 -0
  39. package/dist/channels/pagerduty/replay.d.ts.map +1 -0
  40. package/dist/channels/pagerduty/replay.js +115 -0
  41. package/dist/channels/pagerduty/secrets.d.ts +16 -0
  42. package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
  43. package/dist/channels/pagerduty/secrets.js +23 -0
  44. package/dist/channels/pagerduty/self-user.d.ts +51 -0
  45. package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
  46. package/dist/channels/pagerduty/self-user.js +157 -0
  47. package/dist/channels/pagerduty/state.d.ts +31 -0
  48. package/dist/channels/pagerduty/state.d.ts.map +1 -0
  49. package/dist/channels/pagerduty/state.js +30 -0
  50. package/dist/channels/pagerduty/types.d.ts +217 -0
  51. package/dist/channels/pagerduty/types.d.ts.map +1 -0
  52. package/dist/channels/pagerduty/types.js +1 -0
  53. package/dist/channels/runs/runs-channel.js +1 -1
  54. package/dist/channels/slack/tool-approval-events.js +5 -5
  55. package/dist/channels.d.ts +14 -1
  56. package/dist/channels.d.ts.map +1 -1
  57. package/dist/channels.js +24 -9
  58. package/dist/docs/404.html +3 -3
  59. package/dist/docs/assets/{app.AXQcJZaf.js → app.BjS1QEI4.js} +4 -4
  60. package/dist/docs/assets/chunks/@localSearchIndexroot.oGqZumnJ.js +1 -0
  61. package/dist/docs/assets/chunks/{VPLocalSearchBox.hlZ2vmun.js → VPLocalSearchBox.BOuvjb5Y.js} +2 -2
  62. package/dist/docs/assets/chunks/{arc.9KNWdH-l.js → arc.3WR6Jf-y.js} +1 -1
  63. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.BfGzkBHI.js → architectureDiagram-Q4EWVU46.Dtb6Dqh6.js} +1 -1
  64. package/dist/docs/assets/chunks/{baseUniq.Btk8-2Rs.js → baseUniq.BUyrgrZE.js} +1 -1
  65. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BmHm9OH5.js → blockDiagram-DXYQGD6D.BVLV_voZ.js} +1 -1
  66. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.9POrbDHJ.js → c4Diagram-AHTNJAMY.jXJ1q70M.js} +1 -1
  67. package/dist/docs/assets/chunks/channel.Dt4aweTm.js +1 -0
  68. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.YWZVSM6S.js → chunk-4BX2VUAB.zz1SMBvK.js} +1 -1
  69. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.Cxr_SFgw.js → chunk-4TB4RGXK.CzYKuv3I.js} +1 -1
  70. package/dist/docs/assets/chunks/{chunk-55IACEB6.DtiJyPlD.js → chunk-55IACEB6.C7_tcJZD.js} +1 -1
  71. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.b5gNHJPH.js → chunk-EDXVE4YY.DeTwQPVO.js} +1 -1
  72. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DmN9yA_M.js → chunk-FMBD7UC4.DhMTl7ut.js} +1 -1
  73. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Dfm3xgV5.js → chunk-OYMX7WX6.Me7f5hEp.js} +1 -1
  74. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.sXNxDcJA.js → chunk-QZHKN3VN.D0E0Bb6g.js} +1 -1
  75. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DgBnDUV7.js → chunk-YZCP3GAM.CdOOBFYL.js} +1 -1
  76. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DGUHZs6j.js +1 -0
  77. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DGUHZs6j.js +1 -0
  78. package/dist/docs/assets/chunks/clone.DWf3k0Z0.js +1 -0
  79. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.D18MEcoN.js → cose-bilkent-S5V4N54A.BNbGESzN.js} +1 -1
  80. package/dist/docs/assets/chunks/{dagre-KV5264BT.CSf3tihh.js → dagre-KV5264BT.zU7Lu_xJ.js} +1 -1
  81. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.cbfzAfoC.js → diagram-5BDNPKRD.B9qOdE5h.js} +1 -1
  82. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.6i6P3uu9.js → diagram-G4DWMVQ6.D8X-sf77.js} +1 -1
  83. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.B9HAIfN6.js → diagram-MMDJMWI5.CW7MvMlE.js} +1 -1
  84. package/dist/docs/assets/chunks/{diagram-TYMM5635.B9baAjUv.js → diagram-TYMM5635.J489G0Nd.js} +1 -1
  85. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DaBmX_GN.js → erDiagram-SMLLAGMA.BkW7tGfs.js} +1 -1
  86. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.CJqQJjkb.js → flowDiagram-DWJPFMVM.jc9iWORD.js} +1 -1
  87. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.CIXBLQhC.js → ganttDiagram-T4ZO3ILL.B-UQfd9E.js} +1 -1
  88. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CDgentto.js → gitGraphDiagram-UUTBAWPF.DFzrTSlJ.js} +1 -1
  89. package/dist/docs/assets/chunks/{graph.BWHn6JBQ.js → graph.C5IB6_e_.js} +1 -1
  90. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.d9VU_ts_.js → infoDiagram-42DDH7IO.DwF0-c8L.js} +1 -1
  91. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BNO79Prj.js → ishikawaDiagram-UXIWVN3A.fBaTqzE7.js} +1 -1
  92. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CPgUTM1R.js → journeyDiagram-VCZTEJTY.CM8gDVJy.js} +1 -1
  93. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.idl0Eoe1.js → kanban-definition-6JOO6SKY.YiD1p0LB.js} +1 -1
  94. package/dist/docs/assets/chunks/{layout.BY7DIMr6.js → layout.6Um-DVJT.js} +1 -1
  95. package/dist/docs/assets/chunks/{linear.DYaUDrHd.js → linear.DcTeg4Hn.js} +1 -1
  96. package/dist/docs/assets/chunks/{min.V6MWb1UC.js → min.CIxkY8Fe.js} +1 -1
  97. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BRlJXuFS.js → mindmap-definition-QFDTVHPH.D4QM_voR.js} +1 -1
  98. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BIhkDLcB.js → pieDiagram-DEJITSTG.nmB309G1.js} +1 -1
  99. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.Bw-_VEL3.js → quadrantDiagram-34T5L4WZ.D1HtZR3C.js} +1 -1
  100. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DolEGwxw.js → requirementDiagram-MS252O5E.CZgQWob-.js} +1 -1
  101. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.hMM-8BhN.js → sankeyDiagram-XADWPNL6.DtiBfU-P.js} +1 -1
  102. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Bg_CRVDy.js → sequenceDiagram-FGHM5R23.Cld4gDSt.js} +1 -1
  103. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DNWdl34_.js → stateDiagram-FHFEXIEX.DatP823_.js} +1 -1
  104. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C0571l4D.js +1 -0
  105. package/dist/docs/assets/chunks/{theme.CBW1oolh.js → theme.D5jbBys7.js} +2 -2
  106. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Cr1wJ1mB.js → timeline-definition-GMOUNBTQ.DwQLI2be.js} +1 -1
  107. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BltDV9j7.js → vennDiagram-DHZGUBPP.a5yMfnsa.js} +1 -1
  108. package/dist/docs/assets/chunks/{wardley-RL74JXVD.BWPaUhOs.js → wardley-RL74JXVD.B-FXivgT.js} +1 -1
  109. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.nsADqCCo.js → wardleyDiagram-NUSXRM2D.Dz--Opy3.js} +1 -1
  110. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CCwbO3dK.js → xychartDiagram-5P7HB3ND.Dl8w8TeT.js} +1 -1
  111. package/dist/docs/assets/{deployment.md.CtSJ6sF9.js → deployment.md.3MMWuPeV.js} +5 -5
  112. package/dist/docs/assets/{deployment.md.CtSJ6sF9.lean.js → deployment.md.3MMWuPeV.lean.js} +1 -1
  113. package/dist/docs/assets/{guides_cloud-agents.md.CBK7W0-O.js → guides_cloud-agents.md.BzbzcOyj.js} +2 -2
  114. package/dist/docs/assets/{guides_cloud-agents.md.CBK7W0-O.lean.js → guides_cloud-agents.md.BzbzcOyj.lean.js} +1 -1
  115. package/dist/docs/assets/{guides_opentelemetry.md.ByW1Fs7b.js → guides_opentelemetry.md.DBQtp7_V.js} +13 -5
  116. package/dist/docs/assets/{guides_opentelemetry.md.ByW1Fs7b.lean.js → guides_opentelemetry.md.DBQtp7_V.lean.js} +1 -1
  117. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
  118. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
  119. package/dist/docs/assets/{reference_agent-config.md.DYA6ge6t.js → reference_agent-config.md.IplwL25I.js} +1 -2
  120. package/dist/docs/assets/{reference_agent-config.md.DYA6ge6t.lean.js → reference_agent-config.md.IplwL25I.lean.js} +1 -1
  121. package/dist/docs/assets/{reference_channels.md.DYg0CLud.js → reference_channels.md.Bxaa020x.js} +1 -1
  122. package/dist/docs/assets/{reference_cli.md.DB7Llw3T.js → reference_cli.md.1o_TqKdt.js} +7 -2
  123. package/dist/docs/assets/{reference_cli.md.DB7Llw3T.lean.js → reference_cli.md.1o_TqKdt.lean.js} +1 -1
  124. package/dist/docs/assets/{reference_extensions.md.OUacPetl.js → reference_extensions.md.DKxTuCIw.js} +11 -8
  125. package/dist/docs/assets/{reference_extensions.md.OUacPetl.lean.js → reference_extensions.md.DKxTuCIw.lean.js} +1 -1
  126. package/dist/docs/assets/{reference_instructions.md.DrcHZXig.js → reference_instructions.md.BYMVxAkw.js} +4 -4
  127. package/dist/docs/assets/{reference_instructions.md.DrcHZXig.lean.js → reference_instructions.md.BYMVxAkw.lean.js} +1 -1
  128. package/dist/docs/assets/{reference_schedules.md.BqWnJES4.js → reference_schedules.md.03Ryy9ca.js} +3 -3
  129. package/dist/docs/assets/{reference_tools.md.08XR7lIl.js → reference_tools.md.-6pypsWt.js} +1 -1
  130. package/dist/docs/assets/{style.Dwls12uf.css → style.nMsabY-V.css} +1 -1
  131. package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
  132. package/dist/docs/assets/{templates_agentic-owners.md.CvmABtia.lean.js → templates_agentic-owners.md.CTEnR0jp.lean.js} +1 -1
  133. package/dist/docs/building-with-agents.html +37 -37
  134. package/dist/docs/deployment.html +42 -42
  135. package/dist/docs/deployment.md +9 -4
  136. package/dist/docs/evals.html +37 -37
  137. package/dist/docs/guides/agent-to-agent.html +37 -37
  138. package/dist/docs/guides/bitbucket.html +37 -37
  139. package/dist/docs/guides/cloud-agents.html +38 -38
  140. package/dist/docs/guides/cloud-agents.md +1 -0
  141. package/dist/docs/guides/convert-automation.html +37 -37
  142. package/dist/docs/guides/export-grokbot.html +37 -37
  143. package/dist/docs/guides/github.html +37 -37
  144. package/dist/docs/guides/gitlab.html +37 -37
  145. package/dist/docs/guides/grokbot-agents.html +37 -37
  146. package/dist/docs/guides/hooks.html +37 -37
  147. package/dist/docs/guides/improve.html +37 -37
  148. package/dist/docs/guides/jev.html +37 -37
  149. package/dist/docs/guides/mcp-oauth.html +37 -37
  150. package/dist/docs/guides/migrate.html +37 -37
  151. package/dist/docs/guides/opentelemetry.html +49 -41
  152. package/dist/docs/guides/opentelemetry.md +54 -3
  153. package/dist/docs/guides/pagerduty.html +119 -0
  154. package/dist/docs/guides/pagerduty.md +336 -0
  155. package/dist/docs/guides/slack.html +37 -37
  156. package/dist/docs/guides/webhooks.html +37 -37
  157. package/dist/docs/hashmap.json +1 -1
  158. package/dist/docs/hillclimbing.html +37 -37
  159. package/dist/docs/index.html +37 -37
  160. package/dist/docs/llms-full.txt +510 -42
  161. package/dist/docs/llms.txt +1 -0
  162. package/dist/docs/quickstart.html +37 -37
  163. package/dist/docs/reference/agent-config.html +38 -39
  164. package/dist/docs/reference/agent-config.md +0 -1
  165. package/dist/docs/reference/artifacts.html +37 -37
  166. package/dist/docs/reference/channels.html +38 -38
  167. package/dist/docs/reference/channels.md +2 -1
  168. package/dist/docs/reference/cli.html +43 -38
  169. package/dist/docs/reference/cli.md +27 -0
  170. package/dist/docs/reference/connections.html +37 -37
  171. package/dist/docs/reference/evals.html +37 -37
  172. package/dist/docs/reference/extensions.html +47 -44
  173. package/dist/docs/reference/extensions.md +15 -9
  174. package/dist/docs/reference/hooks.html +37 -37
  175. package/dist/docs/reference/http-api.html +37 -37
  176. package/dist/docs/reference/instructions.html +40 -40
  177. package/dist/docs/reference/instructions.md +5 -1
  178. package/dist/docs/reference/memory.html +37 -37
  179. package/dist/docs/reference/playground.html +36 -36
  180. package/dist/docs/reference/project-layout.html +37 -37
  181. package/dist/docs/reference/prompt.html +37 -37
  182. package/dist/docs/reference/schedules.html +40 -40
  183. package/dist/docs/reference/sessions.html +36 -36
  184. package/dist/docs/reference/skills.html +37 -37
  185. package/dist/docs/reference/subagents.html +37 -37
  186. package/dist/docs/reference/tools.html +39 -39
  187. package/dist/docs/reference/tools.md +1 -0
  188. package/dist/docs/templates/agentic-owners.html +42 -43
  189. package/dist/docs/templates/agentic-owners.md +55 -23
  190. package/dist/docs/templates/grokbot-agents.html +37 -37
  191. package/dist/docs/templates/security-reviewer.html +37 -37
  192. package/dist/docs/templates/thermo-quality-review.html +37 -37
  193. package/dist/docs/templates/thermo-review.html +37 -37
  194. package/dist/docs/templates/triage.html +37 -37
  195. package/dist/docs/troubleshooting.html +36 -36
  196. package/dist/extensions/cursor-cloud-agents/extension.d.ts +2 -0
  197. package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
  198. package/dist/extensions/cursor-cloud-agents/extension.js +2 -1
  199. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +1 -0
  200. package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
  201. package/dist/extensions/cursor-cloud-agents/lib/backend.js +2 -1
  202. package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
  203. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +1 -1
  204. package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -1
  205. package/dist/extensions/cursor-cloud-agents/lib/inputs.js +1 -1
  206. package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +1 -1
  207. package/dist/extensions/cursor-cloud-agents/tools/launch.js +1 -1
  208. package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
  209. package/dist/extensions/cursor-cloud-agents/tools/reply.js +1 -1
  210. package/dist/extensions/cursor-grokbot-agents/extension.js +1 -1
  211. package/dist/extensions/cursor-grokbot-agents/lib/backend.js +1 -1
  212. package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +1 -1
  213. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +1 -1
  214. package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -1
  215. package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +1 -1
  216. package/dist/extensions/cursor-grokbot-agents/tools/ask.js +1 -1
  217. package/dist/extensions/cursor-grokbot-agents/tools/check.js +1 -1
  218. package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +1 -1
  219. package/dist/extensions/cursor-grokbot-agents/tools/list.js +1 -1
  220. package/dist/extensions/improve/extension.js +1 -1
  221. package/dist/extensions/jev/extension.js +1 -1
  222. package/dist/extensions/jev/tools/evaluate.js +1 -1
  223. package/dist/extensions/slack-communication/extension.js +1 -1
  224. package/dist/extensions/slack-communication/tools/delete-message.js +1 -1
  225. package/dist/extensions/slack-communication/tools/edit-message.js +1 -1
  226. package/dist/extensions/slack-communication/tools/post-card.js +1 -1
  227. package/dist/extensions/slack-communication/tools/post-file.js +1 -1
  228. package/dist/extensions/slack-communication/tools/post-update.js +1 -1
  229. package/dist/extensions/slack-communication/tools/react.js +1 -1
  230. package/dist/extensions/slack-communication/tools/set-status.js +1 -1
  231. package/dist/extensions.d.ts +1 -1
  232. package/dist/extensions.js +1 -1
  233. package/dist/internal/approval-gate.d.ts +4 -2
  234. package/dist/internal/approval-gate.d.ts.map +1 -1
  235. package/dist/internal/approval-gate.js +2 -1
  236. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  237. package/dist/internal/builtin-tools/artifacts.js +46 -13
  238. package/dist/internal/builtin-tools/reminders.js +1 -1
  239. package/dist/internal/channel-architecture.d.ts +1 -1
  240. package/dist/internal/channel-architecture.d.ts.map +1 -1
  241. package/dist/internal/channel-architecture.js +4 -2
  242. package/dist/internal/cli-deploy.d.ts.map +1 -1
  243. package/dist/internal/cli-deploy.js +21 -12
  244. package/dist/internal/cli-pagerduty.d.ts +32 -0
  245. package/dist/internal/cli-pagerduty.d.ts.map +1 -0
  246. package/dist/internal/cli-pagerduty.js +242 -0
  247. package/dist/internal/continuation-channel.d.ts.map +1 -1
  248. package/dist/internal/continuation-channel.js +7 -0
  249. package/dist/internal/continuation-identity.d.ts +11 -3
  250. package/dist/internal/continuation-identity.d.ts.map +1 -1
  251. package/dist/internal/continuation-identity.js +83 -0
  252. package/dist/internal/convert-automation/convert-workflow.js +1 -1
  253. package/dist/internal/convert-grokbot/answers.js +1 -1
  254. package/dist/internal/convert-grokbot/recipe.d.ts +1 -1
  255. package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -1
  256. package/dist/internal/convert-grokbot/recipe.js +1 -1
  257. package/dist/internal/cursor/backend-client.d.ts +1 -1
  258. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  259. package/dist/internal/cursor/backend-client.js +1 -1
  260. package/dist/internal/cursor/credentials.d.ts +1 -1
  261. package/dist/internal/cursor/credentials.d.ts.map +1 -1
  262. package/dist/internal/cursor/credentials.js +1 -1
  263. package/dist/internal/deploy-client.js +1 -1
  264. package/dist/internal/deploy-manifest.d.ts +11 -4
  265. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  266. package/dist/internal/deploy-manifest.js +19 -6
  267. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  268. package/dist/internal/discovery/agent-config.js +10 -10
  269. package/dist/internal/discovery/agent.d.ts.map +1 -1
  270. package/dist/internal/discovery/agent.js +10 -10
  271. package/dist/internal/discovery/channels.d.ts.map +1 -1
  272. package/dist/internal/discovery/channels.js +20 -16
  273. package/dist/internal/discovery/context.d.ts +16 -0
  274. package/dist/internal/discovery/context.d.ts.map +1 -1
  275. package/dist/internal/discovery/context.js +66 -0
  276. package/dist/internal/discovery/cursor-plugin.js +1 -1
  277. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  278. package/dist/internal/discovery/extension-overlay.js +2 -6
  279. package/dist/internal/discovery/info.d.ts.map +1 -1
  280. package/dist/internal/discovery/info.js +3 -0
  281. package/dist/internal/discovery/instructions.d.ts.map +1 -1
  282. package/dist/internal/discovery/instructions.js +3 -6
  283. package/dist/internal/discovery/modules.d.ts.map +1 -1
  284. package/dist/internal/discovery/modules.js +3 -6
  285. package/dist/internal/discovery/project.d.ts +6 -0
  286. package/dist/internal/discovery/project.d.ts.map +1 -1
  287. package/dist/internal/discovery/project.js +27 -5
  288. package/dist/internal/discovery/runtime.d.ts.map +1 -1
  289. package/dist/internal/discovery/runtime.js +8 -8
  290. package/dist/internal/discovery.d.ts +1 -1
  291. package/dist/internal/discovery.d.ts.map +1 -1
  292. package/dist/internal/discovery.js +1 -1
  293. package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
  294. package/dist/internal/expected-delivery-failure.js +6 -0
  295. package/dist/internal/factory-resource-channel.d.ts +1 -1
  296. package/dist/internal/factory-resource-channel.d.ts.map +1 -1
  297. package/dist/internal/filesystem/sdk-schemas.d.ts +1 -1
  298. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
  299. package/dist/internal/filesystem/sdk-schemas.js +5 -4
  300. package/dist/internal/filesystem/tools.js +1 -1
  301. package/dist/internal/hmac-secret-values.d.ts +48 -0
  302. package/dist/internal/hmac-secret-values.d.ts.map +1 -0
  303. package/dist/internal/hmac-secret-values.js +68 -0
  304. package/dist/internal/host-otel.d.ts +2 -1
  305. package/dist/internal/host-otel.d.ts.map +1 -1
  306. package/dist/internal/host-otel.js +20 -6
  307. package/dist/internal/host-platforms.d.ts.map +1 -1
  308. package/dist/internal/host-platforms.js +8 -2
  309. package/dist/internal/hosted-delivery-protocol.d.ts +4 -0
  310. package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
  311. package/dist/internal/hosted-delivery.d.ts +7 -0
  312. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  313. package/dist/internal/hosted-delivery.js +19 -17
  314. package/dist/internal/hosting.d.ts +6 -0
  315. package/dist/internal/hosting.d.ts.map +1 -1
  316. package/dist/internal/hosting.js +9 -0
  317. package/dist/internal/init-scaffold.js +1 -1
  318. package/dist/internal/interview/agent-questions.d.ts +1 -1
  319. package/dist/internal/interview/agent-questions.d.ts.map +1 -1
  320. package/dist/internal/interview/agent-questions.js +1 -1
  321. package/dist/internal/interview/question.d.ts +1 -1
  322. package/dist/internal/interview/question.d.ts.map +1 -1
  323. package/dist/internal/interview/question.js +1 -1
  324. package/dist/internal/json-schema.d.ts +7 -7
  325. package/dist/internal/json-schema.d.ts.map +1 -1
  326. package/dist/internal/json-schema.js +14 -17
  327. package/dist/internal/mcp-endpoint.js +1 -1
  328. package/dist/internal/otel/collector.d.ts.map +1 -1
  329. package/dist/internal/otel/collector.js +50 -19
  330. package/dist/internal/otel/config.d.ts +10 -1
  331. package/dist/internal/otel/config.d.ts.map +1 -1
  332. package/dist/internal/otel/config.js +47 -10
  333. package/dist/internal/otel/http.d.ts +1 -1
  334. package/dist/internal/otel/http.d.ts.map +1 -1
  335. package/dist/internal/otel/http.js +1 -1
  336. package/dist/internal/otel/runtime.d.ts +17 -14
  337. package/dist/internal/otel/runtime.d.ts.map +1 -1
  338. package/dist/internal/otel/runtime.js +203 -237
  339. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  340. package/dist/internal/package-inline-stdio.js +21 -5
  341. package/dist/internal/process-memory-telemetry.d.ts +1 -1
  342. package/dist/internal/process-memory-telemetry.d.ts.map +1 -1
  343. package/dist/internal/process-memory-telemetry.js +1 -1
  344. package/dist/internal/sdk-runner.d.ts +2 -3
  345. package/dist/internal/sdk-runner.d.ts.map +1 -1
  346. package/dist/internal/sdk-runner.js +30 -6
  347. package/dist/internal/secret-alternatives.d.ts +11 -0
  348. package/dist/internal/secret-alternatives.d.ts.map +1 -0
  349. package/dist/internal/secret-alternatives.js +13 -0
  350. package/dist/internal/server.d.ts.map +1 -1
  351. package/dist/internal/server.js +27 -15
  352. package/dist/internal/session-engine.d.ts +9 -1
  353. package/dist/internal/session-engine.d.ts.map +1 -1
  354. package/dist/internal/session-engine.js +30 -4
  355. package/dist/internal/slack-provision-client.js +1 -1
  356. package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
  357. package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
  358. package/dist/internal/sqlite-experimental-warning.js +22 -0
  359. package/dist/internal/store-api-protocol.d.ts +1 -1
  360. package/dist/internal/store-api-protocol.d.ts.map +1 -1
  361. package/dist/internal/store-api-protocol.js +1 -1
  362. package/dist/internal/testing/conversation-identity-vectors.d.ts +6 -1
  363. package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -1
  364. package/dist/internal/testing/conversation-identity-vectors.js +34 -0
  365. package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
  366. package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
  367. package/dist/internal/testing/hmac-secret-vectors.js +89 -0
  368. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
  369. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
  370. package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -0
  371. package/dist/internal/update-check.d.ts +1 -1
  372. package/dist/internal/update-check.d.ts.map +1 -1
  373. package/dist/internal/update-check.js +1 -1
  374. package/dist/internal/zod-schema.d.ts +14 -0
  375. package/dist/internal/zod-schema.d.ts.map +1 -0
  376. package/dist/internal/zod-schema.js +22 -0
  377. package/dist/otel.d.ts +1 -2
  378. package/dist/otel.d.ts.map +1 -1
  379. package/dist/otel.js +0 -1
  380. package/dist/playground/assets/cursor-icons-16-DmHBTm1-.woff2 +0 -0
  381. package/dist/playground/assets/index-BdMwybMt.css +1 -0
  382. package/dist/playground/assets/index-CHk6O92d.js +62 -0
  383. package/dist/playground/index.html +2 -2
  384. package/dist/tools.d.ts +14 -11
  385. package/dist/tools.d.ts.map +1 -1
  386. package/dist/tools.js +4 -3
  387. package/dist/types.d.ts +67 -16
  388. package/dist/types.d.ts.map +1 -1
  389. package/docs/deployment.md +9 -4
  390. package/docs/guides/cloud-agents.md +1 -0
  391. package/docs/guides/opentelemetry.md +54 -3
  392. package/docs/guides/pagerduty.md +341 -0
  393. package/docs/reference/agent-config.md +0 -1
  394. package/docs/reference/channels.md +2 -1
  395. package/docs/reference/cli.md +27 -0
  396. package/docs/reference/extensions.md +15 -9
  397. package/docs/reference/instructions.md +5 -1
  398. package/docs/reference/tools.md +1 -0
  399. package/docs/templates/agentic-owners.md +55 -23
  400. package/package.json +24 -19
  401. package/skills/migrate-v2/SKILL.md +1 -1
  402. package/skills/otel/SKILL.md +24 -7
  403. package/templates/agentic-owners/README.md +6 -1
  404. package/templates/agentic-owners/bot/lib/owners/decision.ts +31 -5
  405. package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
  406. package/templates/agentic-owners/bot/lib/owners/match.ts +85 -19
  407. package/templates/agentic-owners/bot/lib/owners/parse.ts +133 -2
  408. package/templates/agentic-owners/bot/lib/owners/types.ts +23 -0
  409. package/dist/docs/assets/chunks/@localSearchIndexroot.B3j7LFef.js +0 -1
  410. package/dist/docs/assets/chunks/channel.RoCpi7X1.js +0 -1
  411. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.oxdmwwqk.js +0 -1
  412. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.oxdmwwqk.js +0 -1
  413. package/dist/docs/assets/chunks/clone.BkguoIMm.js +0 -1
  414. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.7W-btjJ2.js +0 -1
  415. package/dist/docs/assets/templates_agentic-owners.md.CvmABtia.js +0 -14
  416. package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
  417. package/dist/playground/assets/index-BtsbIqV9.css +0 -1
  418. package/dist/playground/assets/index-CD8VRa25.js +0 -71
  419. /package/dist/docs/assets/{reference_channels.md.DYg0CLud.lean.js → reference_channels.md.Bxaa020x.lean.js} +0 -0
  420. /package/dist/docs/assets/{reference_schedules.md.BqWnJES4.lean.js → reference_schedules.md.03Ryy9ca.lean.js} +0 -0
  421. /package/dist/docs/assets/{reference_tools.md.08XR7lIl.lean.js → reference_tools.md.-6pypsWt.lean.js} +0 -0
@@ -65,6 +65,7 @@ their own.
65
65
  | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
66
  | `cloud` | Launch defaults for repositories, environment, and pull request behavior. |
67
67
  | `cloud.repos` | The repositories the agent may hand work to, with a default branch or pull request for each. Without it, launches run with no repository and the model can't name one, so secrets in `cloud.envVars` never reach a repository you didn't list. |
68
+ | `cloud.teamMcpServers` | The team MCP servers, by name, that launched agents may use (up to 50 names, matched case-insensitively; every team server with a listed name is kept). Every other team server is left out. Personal servers and `cloud.mcpServers` aren't filtered. Omit it to give agents every team server the launching account can use. |
68
69
  | `model` | The model launched agents run. Omit it to use the account default. |
69
70
  | `apiKey` | A Cursor API key to launch with instead of the host's own. |
70
71
 
@@ -27,6 +27,10 @@ export OTEL_SERVICE_NAME=incident-agent
27
27
  bdk serve --dir . --dev
28
28
  ```
29
29
 
30
+ Metrics use delta temporality by default. For Grafana Cloud, set
31
+ `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` to `cumulative`.
32
+ Grafana Cloud rejects delta metrics.
33
+
30
34
  The default protocol is OTLP/HTTP protobuf. If you already call
31
35
  `serve()` from TypeScript, you can configure the same destination in
32
36
  code:
@@ -55,6 +59,52 @@ application starts the server itself. When that application
55
59
  already uses OpenTelemetry, BDK sends its traces, metrics, and
56
60
  logs to the collector configured here.
57
61
 
62
+ ## Export from a hosted agent
63
+
64
+ Set the collector endpoint and headers as secrets, and add the
65
+ collector host to `hosting.egressDomains`. The host is a hostname
66
+ with no scheme and no path. The first request loads the secrets,
67
+ and export starts with those headers.
68
+
69
+ ```ts
70
+ // bot/agent.ts
71
+ import { defineAgent } from "@cursor/bdk";
72
+
73
+ export default defineAgent({
74
+ hosting: {
75
+ egressDomains: ["otlp-gateway-prod-us-east-0.grafana.net"],
76
+ secretNames: ["OTEL_EXPORTER_OTLP_ENDPOINT", "OTEL_EXPORTER_OTLP_HEADERS"],
77
+ },
78
+ });
79
+ ```
80
+
81
+ ```bash
82
+ bdk secrets set my-agent OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_HEADERS
83
+ ```
84
+
85
+ `OTEL_EXPORTER_OTLP_HEADERS` is a comma-separated list of
86
+ `name=value` pairs. Each value is URL-encoded, so a space is
87
+ `%20` (`Authorization=Basic%20...`).
88
+
89
+ A later `bdk secrets set` changes the headers on the next export.
90
+ You do not redeploy to rotate a token. The URL, service name,
91
+ resource attributes, signals, sample ratio, metric export interval,
92
+ and metrics temporality stay as they were on the first export.
93
+ Redeploy to change one of those. BDK logs a warning when one of them
94
+ changes on a running agent.
95
+
96
+ When an exporter host is missing from `hosting.egressDomains`, BDK
97
+ logs an error that names the host. Add the host and redeploy.
98
+
99
+ Spans and metrics from before the first request are not exported,
100
+ including spans from channel `onStart`. If the OpenTelemetry config
101
+ fails, BDK logs the error and the request still completes.
102
+
103
+ Logs stay off until `serve({ otel })` sets `logs`, or until
104
+ `OTEL_LOGS_EXPORTER` is `otlp`. Prompt text and tool payloads stay
105
+ off until you set `OTEL_LOG_USER_PROMPTS` or
106
+ `OTEL_LOG_TOOL_CONTENT`.
107
+
58
108
  ## Follow one conversation
59
109
 
60
110
  Copy the complete session ID from the playground or session API, then
@@ -156,7 +206,8 @@ The first metrics to look for are `cursor.token.usage`,
156
206
  ## Control what leaves the process
157
207
 
158
208
  Traces include structure, tool names, usage metrics, and span
159
- status. A failed tool's status includes a short failure reason.
209
+ status. A failed tool's span status and its `action.result` log
210
+ include a short failure reason.
160
211
  A tool or subagent that is still open when the turn ends gets
161
212
  ERROR status with the reason `no result`. User prompts, tool
162
213
  arguments, and full tool results stay off the wire until you opt in.
@@ -183,7 +234,7 @@ The same controls are available as
183
234
  configuration and custom-metric reference for coding agents
184
235
  - [Hooks](../reference/hooks.md): emit domain telemetry from session
185
236
  events
186
- - [Deployment](../deployment.md): set collector endpoints and secrets
187
- on hosted or self-hosted agents
237
+ - [Deployment](../deployment.md): declare `hosting.egressDomains`
238
+ and set collector secrets on a hosted agent
188
239
  - [Cursor enterprise OpenTelemetry Export](https://cursor.com/docs/enterprise/opentelemetry-export):
189
240
  send organization-wide Cursor telemetry to the same collector
@@ -0,0 +1,341 @@
1
+ ---
2
+ title: "PagerDuty"
3
+ description: "Respond to PagerDuty incidents: investigate a page, follow it through acknowledgement and resolution, and ignore your own actions."
4
+ ---
5
+
6
+ # PagerDuty agents
7
+
8
+ A PagerDuty agent wakes when an incident triggers, investigates it, and
9
+ writes what it found back to the incident. `pagerdutyChannel()` receives
10
+ PagerDuty's v3 webhooks, verifies them, and keeps every later event for
11
+ the same incident in one session, so the agent sees an acknowledgement,
12
+ a note, or a responder's reply in the context of the investigation it
13
+ already started. Every setting has a default read from a well-known secret, so
14
+ the channel needs no configuration beyond its hooks; see
15
+ [Connect](#connect) for the variables.
16
+
17
+ ## Investigate a new incident
18
+
19
+ When an incident triggers, the agent starts a turn with the incident's
20
+ title, service, urgency, and link. It reads whatever the investigation
21
+ needs, and with `deliverReplies: true` its reply is posted as a note on
22
+ the incident, where the person on call already looks.
23
+
24
+ ```ts
25
+ // bot/channels/pagerduty.ts
26
+ import { defaultPagerDutyAuth, pagerdutyChannel } from "@cursor/bdk/channels/pagerduty";
27
+
28
+ export default pagerdutyChannel({
29
+ deliverReplies: true,
30
+ onIncident: (ctx, event) => {
31
+ if (event.eventType !== "incident.triggered") {
32
+ return null;
33
+ }
34
+ return {
35
+ // `auth` starts a model turn running as the event's PagerDuty actor.
36
+ auth: defaultPagerDutyAuth(ctx),
37
+ message: `Investigate PagerDuty incident #${event.incident.number}: ${event.incident.title}`,
38
+ context: [`Service: ${event.incident.service?.summary ?? "unknown"}`],
39
+ };
40
+ },
41
+ });
42
+ ```
43
+
44
+ Reply notes are off unless you set `deliverReplies: true`, so the channel
45
+ writes nothing to PagerDuty on its own. An agent that writes to PagerDuty
46
+ through its own path, such as a service that audits each write, leaves it
47
+ off and posts only what it chooses, from `events` or `ctx.pagerduty`.
48
+
49
+ With `deliverReplies: true`, the channel posts each completed reply as a
50
+ note on the session's incident, and a short note if a turn fails, using
51
+ the `PAGERDUTY_TOKEN` secret. The note goes to the incident in the
52
+ verified event's state, so the model never chooses which incident it
53
+ writes to. Eval runs and agents without a token post nothing. Nothing is
54
+ posted until the channel knows the agent's own PagerDuty user (see
55
+ [Ignore your own actions](#ignore-your-own-actions)), because each note
56
+ comes back as a webhook event that only the echo skip keeps from starting
57
+ another turn. Handlers you write in `events` replace the built-in ones.
58
+
59
+ Hooks also get `ctx.pagerduty`, a REST client with the channel's
60
+ credentials, for reads and writes of their own:
61
+
62
+ ```ts
63
+ onIncident: async (ctx, event) => {
64
+ const incident = await ctx.pagerduty.getIncident(event.incident.id);
65
+ // …
66
+ },
67
+ ```
68
+
69
+ Hosted, the agent also declares PagerDuty's API host and the token:
70
+
71
+ ```ts
72
+ // bot/agent.ts
73
+ import { defineAgent } from "@cursor/bdk";
74
+
75
+ export default defineAgent({
76
+ architecture: "v2",
77
+ hosting: {
78
+ egressDomains: ["api.pagerduty.com"],
79
+ secretNames: ["PAGERDUTY_TOKEN"],
80
+ },
81
+ });
82
+ ```
83
+
84
+ ## Follow the incident in one session
85
+
86
+ People act on an incident while the agent investigates: someone
87
+ acknowledges it, adds a note, pulls in a responder, or resolves it.
88
+ Return a dispatch for those events too, and each one arrives in the
89
+ session that is already working on the incident, with the earlier
90
+ findings in context.
91
+
92
+ ```ts
93
+ onIncident: (ctx, event) => {
94
+ const followUps = ["incident.acknowledged", "incident.reassigned", "incident.resolved"];
95
+ if (event.eventType !== "incident.triggered" && !followUps.includes(event.eventType)) {
96
+ return null;
97
+ }
98
+ return {
99
+ auth: defaultPagerDutyAuth(ctx),
100
+ message: `${event.eventType} by ${ctx.agent?.summary ?? "PagerDuty"}`,
101
+ };
102
+ },
103
+ onNote: (ctx, note) => {
104
+ return {
105
+ auth: defaultPagerDutyAuth(ctx),
106
+ message: `Note on the incident: ${note.content}`,
107
+ };
108
+ },
109
+ ```
110
+
111
+ Add these to the same `pagerdutyChannel()` declaration as the
112
+ investigation handler.
113
+
114
+ ## Ignore your own actions
115
+
116
+ PagerDuty sends the agent's own changes back as webhook events: the
117
+ note it posted, or an acknowledgement or resolve made through its
118
+ PagerDuty user. The channel acknowledges those events without running a
119
+ hook or starting a turn. The same action by a person is still delivered.
120
+
121
+ The channel finds the agent's user in this order, on each delivery:
122
+
123
+ 1. The `selfUserIds` option, when you pass one. Nothing below is used.
124
+ 2. The `PAGERDUTY_USER_ID` secret: one PagerDuty user id.
125
+ 3. The user `PAGERDUTY_TOKEN` acts as, which PagerDuty reports at
126
+ `GET /users/me`.
127
+
128
+ When none of these names a user, echo skip is off. `bdk deploy` warns
129
+ while neither `PAGERDUTY_USER_ID` nor `PAGERDUTY_TOKEN` is set, and the
130
+ agent logs a warning when its token names no single user.
131
+
132
+ Inference depends on the kind of token:
133
+
134
+ | `PAGERDUTY_TOKEN` | Inferred user |
135
+ | --- | --- |
136
+ | User token REST API key | The key's own user |
137
+ | OAuth user token (Classic User OAuth or Scoped OAuth), written as `Bearer <token>` | The user who authorized the app |
138
+ | General access (account-level) REST API key | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
139
+ | Scoped OAuth app token (client credentials) | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
140
+
141
+ PagerDuty serves
142
+ [`GET /users/me`](https://developer.pagerduty.com/api-reference/0b6f8b0c3e8d1-get-the-current-user)
143
+ only to a user-level API key or a token from an OAuth flow, not to an
144
+ account-level key. An app token
145
+ [acts as the app](https://docs.pagerduty.com/developer/private-apps),
146
+ not as a user. With either, the channel looks up `PAGERDUTY_FROM_EMAIL`,
147
+ the `From` user the token writes as, through `GET /users?query=` and uses
148
+ the one user whose email matches exactly. The inferred id is kept in the
149
+ agent's memory for an hour per token, never in agent storage, and an
150
+ unresolved answer is retried after five minutes. Hosted, the lookup needs
151
+ `api.pagerduty.com` (or your `PAGERDUTY_API_BASE_URL` host) in
152
+ `hosting.egressDomains`, the same entry write-backs need.
153
+
154
+ A read-only agent with no token sets the id directly:
155
+
156
+ ```bash
157
+ bdk secrets set incident-responder PAGERDUTY_USER_ID
158
+ ```
159
+
160
+ `PAGERDUTY_USER_ID` holds one id because a deployment has one token
161
+ and so acts as one PagerDuty user. To skip several users, or to keep the
162
+ id in code, pass `selfUserIds`:
163
+
164
+ ```ts
165
+ export default pagerdutyChannel({
166
+ selfUserIds: ["PBOT001"],
167
+ onIncident: (ctx) => ({ auth: defaultPagerDutyAuth(ctx) }),
168
+ });
169
+ ```
170
+
171
+ `selfUserIds: { secretName: "OTHER_NAME" }` reads one id from another
172
+ secret and never falls back to inference.
173
+
174
+ ## Events
175
+
176
+ Each hook receives one family of v3 events:
177
+
178
+ | Hook | Events |
179
+ | --- | --- |
180
+ | `onIncident` | `incident.triggered`, `.acknowledged`, `.unacknowledged`, `.escalated`, `.reassigned`, `.delegated`, `.resolved`, `.reopened`, `.priority_updated`, `.incident_type.changed` |
181
+ | `onNote` | `incident.annotated` |
182
+ | `onResponder` | `incident.responder.added`, `incident.responder.replied` |
183
+ | `onEvent` | Everything else, such as status updates and workflow events |
184
+
185
+ Without `onIncident`, a triggered or reopened incident starts a turn and
186
+ other lifecycle events are acknowledged. Notes, responder events, and
187
+ the rest are acknowledged until you add their hook. Each hook returns
188
+ one of three decisions:
189
+
190
+ | Return | What happens |
191
+ | --- | --- |
192
+ | `{ auth }` | Start or continue a model turn as the event's actor |
193
+ | `{ task }` | Acknowledge the webhook, then run host code that may also call `send` |
194
+ | `null` | Skip the event |
195
+
196
+ ## Incident affinity
197
+
198
+ Every event for one incident joins one session, keyed on the incident
199
+ id. Lifecycle events carry the incident, and notes and responder events
200
+ name it by reference, so all of them reach the same session.
201
+
202
+ A re-trigger after a resolve is a new PagerDuty incident, so it starts a
203
+ new session. `ctx.incidentKey` carries the dedup key of the alert that
204
+ opened an incident (its `incident_key`, set per alert by a Datadog
205
+ monitor, a Sentry issue, or a Grafana rule), for an agent that wants to
206
+ recall what it found the last time the same alert fired.
207
+
208
+ ## Connect
209
+
210
+ Create a v3 webhook subscription in PagerDuty for the services that
211
+ should wake the agent, and point it at
212
+ `https://<your-host>/<slug>/v1/channels/pagerduty`. Then set the
213
+ channel's secrets on the deployment. Locally the same names are
214
+ environment variables.
215
+
216
+ | Variable | Used for | Override |
217
+ | --- | --- | --- |
218
+ | `PAGERDUTY_WEBHOOK_SECRET` | Verifying `X-PagerDuty-Signature`. Hosted, the platform checks it before any compute starts and answers a bad delivery with `401` | `webhookSecret: { secretName }` |
219
+ | `PAGERDUTY_USER_ID` | Skipping the agent's own actions: its PagerDuty user id. Optional when `PAGERDUTY_TOKEN` names a user | `selfUserIds: [ids]` or `{ secretName }` |
220
+ | `PAGERDUTY_TOKEN` | Reply notes (with `deliverReplies: true`), `ctx.pagerduty`, and inferring the agent's user: a REST API key, or an OAuth token as `Bearer <token>` | `token: { secretName }` |
221
+ | `PAGERDUTY_FROM_EMAIL` | The `From` user PagerDuty requires for writes made with an account-level key or app token, and the user inferred for those tokens | `from: { secretName }` |
222
+ | `PAGERDUTY_API_BASE_URL` | The REST host, such as `https://api.eu.pagerduty.com`. Defaults to `https://api.pagerduty.com` | `apiBaseUrl` |
223
+
224
+ Set `token`, `from`, and `apiBaseUrl` on `pagerdutyChannel()`; they cover
225
+ reply notes, `ctx.pagerduty`, and inference. `createPagerDutyClient()`
226
+ takes the same options for code outside the channel.
227
+
228
+ ```bash
229
+ bdk deploy --dir . --slug incident-responder
230
+ bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET PAGERDUTY_TOKEN
231
+ bdk secrets list incident-responder
232
+ ```
233
+
234
+ `bdk deploy` warns until `PAGERDUTY_WEBHOOK_SECRET` is set, and until
235
+ either `PAGERDUTY_USER_ID` or `PAGERDUTY_TOKEN` is. The next delivery
236
+ uses a new value without another deploy.
237
+
238
+ ### Several subscriptions
239
+
240
+ PagerDuty gives each webhook subscription its own signing secret, so an
241
+ agent fed by several subscriptions (one per service, say) needs all of
242
+ them. Put them in `PAGERDUTY_WEBHOOK_SECRET`, one per line:
243
+
244
+ ```text
245
+ <signing secret of subscription 1>
246
+ <signing secret of subscription 2>
247
+ ```
248
+
249
+ A delivery is admitted when any `v1=` signature in its
250
+ `X-PagerDuty-Signature` header matches any line. Each line is trimmed,
251
+ blank lines are ignored, and a value without a line break is one secret,
252
+ used as-is. The value holds at most 32 secrets. Past that, every delivery
253
+ is rejected rather than checked against only some of them.
254
+
255
+ Keep the list in a file, since `bdk secrets list` never shows values,
256
+ and set it from stdin, which keeps the line breaks:
257
+
258
+ ```bash
259
+ bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET < pagerduty-webhook-secrets.txt
260
+ ```
261
+
262
+ Rotate by adding before removing. Add the new secret as a line before
263
+ PagerDuty starts signing with it, for example before creating the
264
+ replacement subscription. Remove the old line only once nothing signs
265
+ with the old secret, for example after deleting the subscription it
266
+ replaced. While both are live, a delivery signed with either secret
267
+ verifies, including one whose header carries both signatures. Removing
268
+ the old line first rejects those deliveries until the new one is added.
269
+
270
+ The same format works for every `hmacSignatureAuth()` secret, including
271
+ `GITHUB_WEBHOOK_SECRET` and `BITBUCKET_WEBHOOK_SECRET`. It needs
272
+ `@cursor/bdk` 0.2.25 or later. Earlier versions check the signature again
273
+ in the agent with the whole value as one secret, so they reject every
274
+ delivery once the value has a second line.
275
+
276
+ Only signature checks read the value as a list. Everywhere else it is
277
+ used whole: a `sharedSecretAuth()` header compares the entire value, and
278
+ a `${NAME}` template in an MCP connection's `headers` would put the line
279
+ breaks into the header. Keep a list secret for webhook signing only.
280
+
281
+ Until `PAGERDUTY_WEBHOOK_SECRET` is set, the route accepts only local
282
+ traffic: loopback deliveries under `bdk dev`, nothing in production.
283
+
284
+ ## Test locally
285
+
286
+ `bdk pagerduty replay` posts synthesized v3 deliveries for one incident
287
+ to the running agent, in order. With `PAGERDUTY_WEBHOOK_SECRET` unset,
288
+ `bdk dev` admits them unsigned from loopback; with it set, replay signs
289
+ them the way PagerDuty does:
290
+
291
+ ```bash
292
+ bdk dev &
293
+ bdk pagerduty replay --events triggered,acknowledged,annotated,resolved \
294
+ --comment "Rolled back the 09:30 deploy."
295
+ ```
296
+
297
+ The trigger comes from PagerDuty itself, and the later events come from a
298
+ person, so each one joins the session the trigger started. Pass an
299
+ incident id to start another session, `--dry-run` to print the bodies,
300
+ or `--out fixtures/pagerduty` to save them as fixtures for
301
+ [evals](../evals.md). `bdk pagerduty events` lists the channels and the
302
+ events each accepts.
303
+
304
+ To post a real delivery saved from the webhook's delivery log, sign it
305
+ with the secret:
306
+
307
+ ```bash
308
+ export PAGERDUTY_WEBHOOK_SECRET=local-test-secret
309
+ bdk dev &
310
+
311
+ body=fixtures/pagerduty/incident-triggered.json
312
+ signature=$(openssl dgst -sha256 -hmac "$PAGERDUTY_WEBHOOK_SECRET" -hex < "$body" | awk '{print $NF}')
313
+ curl -X POST http://127.0.0.1:3000/v1/channels/pagerduty \
314
+ -H 'content-type: application/json' \
315
+ -H "x-pagerduty-signature: v1=$signature" \
316
+ --data-binary @"$body"
317
+ ```
318
+
319
+ Set `event.agent.id` in a saved body to the agent's own user id to see
320
+ the delivery skipped as an echo.
321
+
322
+ ## Practices
323
+
324
+ - Write back from host code with the incident in channel state or
325
+ `ctx`, never from an incident id the model produced.
326
+
327
+ - Make sure the agent knows its own user before it acts on incidents, so
328
+ its own notes and resolves do not wake it again: a user-level token, a
329
+ `PAGERDUTY_FROM_EMAIL` with an account-level key, or `PAGERDUTY_USER_ID`.
330
+
331
+ - Scope the webhook subscription to the services the agent responds to;
332
+ every delivery it sends reaches the channel.
333
+
334
+ ## Related
335
+
336
+ - [Channels reference](../reference/channels.md): channel hooks,
337
+ dispatch decisions, and session behavior
338
+ - [Webhooks and custom channels](./webhooks.md): direct webhook auth
339
+ and reply delivery
340
+ - [Evals](../evals.md): turn saved PagerDuty payloads into regression
341
+ fixtures
@@ -193,7 +193,6 @@ import { serve } from "@cursor/bdk";
193
193
 
194
194
  const handle = await serve("./my-agent", {
195
195
  port: 3000,
196
- apiKey: process.env.CURSOR_API_KEY,
197
196
  });
198
197
  console.log(`listening on ${handle.url}`);
199
198
  // handle.callTool(...), handle.dispatchSchedule("heartbeat"),
@@ -166,7 +166,7 @@ returns `401`.
166
166
  | `loopbackOnly()` | Any loopback TCP peer, including local relays that carry forwarding headers |
167
167
  | `bearerAuth(tokenOrVerify)` | A matching bearer token, or a token accepted by the verifier |
168
168
  | `sharedSecretAuth({ header, secret })` | A header matching the named environment or deployment secret |
169
- | `hmacSignatureAuth({ header, secret, prefix? })` | A hex HMAC-SHA256 signature over the raw body using the named secret |
169
+ | `hmacSignatureAuth({ header, secret, prefix?, separator? })` | A hex HMAC-SHA256 signature over the raw body using the named secret. With `separator`, any of several signatures in the header. A secret holding one value per line verifies under any of them (at most 32, `@cursor/bdk` 0.2.25 or later) |
170
170
  | `allowAll()` | Every caller as an anonymous principal |
171
171
  | `publicEndpoint()` | Every caller on this custom channel; managed hosting also exposes the route without an alias token |
172
172
 
@@ -193,6 +193,7 @@ author their own chain, and `--allow-anonymous` swaps it for
193
193
  | `@cursor/bdk/channels/github` | `githubChannel()` | GitHub and GitHub Enterprise webhooks. See [GitHub](../guides/github.md) |
194
194
  | `@cursor/bdk/channels/gitlab` | `gitlabChannel()` | GitLab.com and self-managed GitLab hooks. See [GitLab](../guides/gitlab.md) |
195
195
  | `@cursor/bdk/channels/bitbucket` | `bitbucketChannel()` | Bitbucket Cloud and Data Center hooks. See [Bitbucket](../guides/bitbucket.md) |
196
+ | `@cursor/bdk/channels/pagerduty` | `pagerdutyChannel()` | PagerDuty v3 incident webhooks. Replies post as incident notes only with `deliverReplies: true`. See [PagerDuty](../guides/pagerduty.md) |
196
197
  | `@cursor/bdk/channels/deployments` | `deploymentsChannel()` | Deployment events filtered by source, environment, or event name |
197
198
 
198
199
  For other platforms like Discord or Teams, use the authored
@@ -1024,6 +1024,33 @@ follow the GitHub replay contract.
1024
1024
 
1025
1025
  See [Bitbucket](../guides/bitbucket.md) for Cloud and Data Center setup.
1026
1026
 
1027
+ ### Test PagerDuty webhooks {#pagerduty}
1028
+
1029
+ ```text
1030
+ bdk pagerduty replay [incident-id]
1031
+ [--events a,b,c | '*'] [--comment <body>]
1032
+ [--dir <path>] [--slug <slug>] [--channel <id>]
1033
+ [--url <url>] [--host <host>] [--port <n>]
1034
+ [--secret <secret>] [--dry-run] [--out <dir>] [--json]
1035
+ bdk pagerduty events [--dir <path>] [--host <host>] [--port <n>] [--json]
1036
+ ```
1037
+
1038
+ | Subcommand | Contract |
1039
+ | --- | --- |
1040
+ | `replay` | Synthesize v3 webhook bodies for one incident and post them, in order, to matching channels. The default event is `incident.triggered`; `'*'` selects every declared event replay supports. |
1041
+ | `events` | List discovered PagerDuty channel URLs and event types. |
1042
+
1043
+ Replay supports `incident.triggered`, `.acknowledged`, `.annotated`,
1044
+ `.escalated`, `.resolved`, and `.reopened`, by full name or by action alone
1045
+ (`resolved`). It needs no PagerDuty account. The incident id defaults to
1046
+ `PREPLAY1`, and `--comment` is the note body for `annotated`. `--secret`
1047
+ defaults to `PAGERDUTY_WEBHOOK_SECRET`, signing with its first line when it
1048
+ lists several; without either the deliveries are unsigned, which `bdk dev`
1049
+ admits from loopback. `--dry-run` and `--out`
1050
+ follow the GitHub replay contract.
1051
+
1052
+ See [PagerDuty](../guides/pagerduty.md) for channel setup.
1053
+
1027
1054
  ## Environment variables
1028
1055
 
1029
1056
  Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
@@ -27,10 +27,13 @@ import ci from "@acme/ci-triage";
27
27
 
28
28
  export default ci({
29
29
  org: "acme",
30
- token: process.env.BUILDKITE_TOKEN,
30
+ token: () => process.env.BUILDKITE_TOKEN ?? "",
31
31
  });
32
32
  ```
33
33
 
34
+ Pass `token` as a function so a tool can call it. The function reads
35
+ `BUILDKITE_TOKEN` when the tool calls it.
36
+
34
37
  The extension validates its configuration while the project loads.
35
38
  Missing or mistyped settings fail `bdk validate` before a turn
36
39
  can call the contributed code.
@@ -115,14 +118,15 @@ import { cursorPlugin } from "@cursor/bdk/extensions";
115
118
  export default cursorPlugin({
116
119
  path: "plugins/notion-workspace",
117
120
  variables: {
118
- NOTION_TOKEN: process.env.NOTION_TOKEN,
121
+ NOTION_TOKEN: "${NOTION_TOKEN}",
119
122
  },
120
123
  });
121
124
  ```
122
125
 
123
126
  `path` is relative to the project root. `variables` fills placeholders
124
- declared by the plugin's MCP configuration; unresolved placeholders
125
- fail validation instead of mounting a partial server.
127
+ declared by the plugin's MCP configuration. Pass a `${NAME}` template.
128
+ The connection reads `NAME` when it opens. An unresolved placeholder
129
+ fails validation instead of mounting a partial server.
126
130
 
127
131
  Plugin rules and hooks are not mounted. Overlay a generated
128
132
  `mcp-connections/<server>.ts` file to replace or disable one plugin
@@ -172,10 +176,13 @@ export default defineExtension({
172
176
  description: "Investigate failing Buildkite jobs.",
173
177
  config: z.object({
174
178
  org: z.string(),
175
- token: z.string(),
179
+ token: z.function().args().returns(z.string()),
176
180
  logTailLines: z.number().int().positive().default(200),
177
181
  }),
178
- hosting: () => ({ egressDomains: ["api.buildkite.com"] }),
182
+ hosting: () => ({
183
+ egressDomains: ["api.buildkite.com"],
184
+ secretNames: ["BUILDKITE_TOKEN"],
185
+ }),
179
186
  });
180
187
  ```
181
188
 
@@ -188,9 +195,8 @@ prose assets beside it.
188
195
  from the environment. It receives the validated settings, and the
189
196
  mounting agent's `hosting.egressDomains` and `hosting.secretNames` gain
190
197
  whatever it returns, so a hosted deploy reaches Buildkite without the
191
- consumer listing `api.buildkite.com`. Leave out secrets that arrive
192
- through settings, such as `token` here; the consumer decides where that
193
- value comes from.
198
+ consumer listing `api.buildkite.com`. List `BUILDKITE_TOKEN` in
199
+ `secretNames`. Call `extension.config.token()` inside a tool.
194
200
 
195
201
  The [Project layout](./project-layout.md) owns each contribution's
196
202
  authoring contract. Keep extension instructions and tool descriptions
@@ -22,10 +22,14 @@ on every turn. A root agent requires them; a subagent may inline
22
22
  import { defineInstructions } from "@cursor/bdk";
23
23
 
24
24
  export default defineInstructions({
25
- markdown: `You are the on-call assistant for ${process.env.TEAM_NAME}.`,
25
+ markdown: "You are the on-call assistant for the payments team.",
26
26
  });
27
27
  ```
28
28
 
29
+ The `markdown` string is fixed when this file loads. Read a secret in
30
+ a handler, a tool, or a callback. See
31
+ [Add egress and secrets](../deployment.md#add-egress-and-secrets).
32
+
29
33
  ## Delivery
30
34
 
31
35
  Instructions land in the session workspace as `AGENTS.md`, and the
@@ -71,6 +71,7 @@ export default defineTool({
71
71
  | --- | --- |
72
72
  | `ctx.toolCallId` | The call id, matching the `actions.requested` / `action.result` stream events |
73
73
  | `ctx.session` | Read-only session info: id, channel, mode, auth |
74
+ | `ctx.approvedBy` | For a `needsApproval` tool, the auth of whoever approved this call, in the same shape as `ctx.session.auth`. On Slack, `attributes.user_id` is the person who clicked Approve, who can differ from the person who started the thread. Unset when the call needed no approval |
74
75
  | `ctx.workspaceDir` | The session's workspace directory |
75
76
  | `ctx.stateRoot` | The agent's durable state root, shared across every session |
76
77
  | `ctx.host` | Shared host services (see below) |