@cursor/bdk 0.2.24 → 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 (290) hide show
  1. package/AGENTS.md +1 -0
  2. package/dist/bin/agent-serve.d.ts +1 -1
  3. package/dist/bin/agent-serve.js +48 -12
  4. package/dist/channels/bitbucket/bitbucket-webhook.d.ts +3 -2
  5. package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
  6. package/dist/channels/bitbucket/bitbucket-webhook.js +14 -9
  7. package/dist/channels/github/github-channel.d.ts.map +1 -1
  8. package/dist/channels/github/github-channel.js +9 -18
  9. package/dist/channels/pagerduty/api.d.ts +74 -0
  10. package/dist/channels/pagerduty/api.d.ts.map +1 -0
  11. package/dist/channels/pagerduty/api.js +101 -0
  12. package/dist/channels/pagerduty/defaults.d.ts +42 -0
  13. package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
  14. package/dist/channels/pagerduty/defaults.js +132 -0
  15. package/dist/channels/pagerduty/events.d.ts +24 -0
  16. package/dist/channels/pagerduty/events.d.ts.map +1 -0
  17. package/dist/channels/pagerduty/events.js +38 -0
  18. package/dist/channels/pagerduty/index.d.ts +31 -0
  19. package/dist/channels/pagerduty/index.d.ts.map +1 -0
  20. package/dist/channels/pagerduty/index.js +30 -0
  21. package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
  22. package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
  23. package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
  24. package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
  25. package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
  26. package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
  27. package/dist/channels/pagerduty/payload.d.ts +33 -0
  28. package/dist/channels/pagerduty/payload.d.ts.map +1 -0
  29. package/dist/channels/pagerduty/payload.js +150 -0
  30. package/dist/channels/pagerduty/replay.d.ts +35 -0
  31. package/dist/channels/pagerduty/replay.d.ts.map +1 -0
  32. package/dist/channels/pagerduty/replay.js +115 -0
  33. package/dist/channels/pagerduty/secrets.d.ts +16 -0
  34. package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
  35. package/dist/channels/pagerduty/secrets.js +23 -0
  36. package/dist/channels/pagerduty/self-user.d.ts +51 -0
  37. package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
  38. package/dist/channels/pagerduty/self-user.js +157 -0
  39. package/dist/channels/pagerduty/state.d.ts +31 -0
  40. package/dist/channels/pagerduty/state.d.ts.map +1 -0
  41. package/dist/channels/pagerduty/state.js +30 -0
  42. package/dist/channels/pagerduty/types.d.ts +217 -0
  43. package/dist/channels/pagerduty/types.d.ts.map +1 -0
  44. package/dist/channels/pagerduty/types.js +1 -0
  45. package/dist/channels.d.ts +6 -0
  46. package/dist/channels.d.ts.map +1 -1
  47. package/dist/channels.js +11 -23
  48. package/dist/docs/404.html +2 -2
  49. package/dist/docs/assets/{app.DTIg0uKK.js → app.BjS1QEI4.js} +4 -4
  50. package/dist/docs/assets/chunks/@localSearchIndexroot.oGqZumnJ.js +1 -0
  51. package/dist/docs/assets/chunks/{VPLocalSearchBox.BpJoSaxi.js → VPLocalSearchBox.BOuvjb5Y.js} +1 -1
  52. package/dist/docs/assets/chunks/{arc.ylgNvRNq.js → arc.3WR6Jf-y.js} +1 -1
  53. package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.BMrNJqYk.js → architectureDiagram-Q4EWVU46.Dtb6Dqh6.js} +1 -1
  54. package/dist/docs/assets/chunks/{baseUniq.BBWUEqf9.js → baseUniq.BUyrgrZE.js} +1 -1
  55. package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.DFMu-Vza.js → blockDiagram-DXYQGD6D.BVLV_voZ.js} +1 -1
  56. package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.8nkAAxWv.js → c4Diagram-AHTNJAMY.jXJ1q70M.js} +1 -1
  57. package/dist/docs/assets/chunks/channel.Dt4aweTm.js +1 -0
  58. package/dist/docs/assets/chunks/{chunk-4BX2VUAB.sO-z2Bag.js → chunk-4BX2VUAB.zz1SMBvK.js} +1 -1
  59. package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BMROzTMq.js → chunk-4TB4RGXK.CzYKuv3I.js} +1 -1
  60. package/dist/docs/assets/chunks/{chunk-55IACEB6.X81urwg7.js → chunk-55IACEB6.C7_tcJZD.js} +1 -1
  61. package/dist/docs/assets/chunks/{chunk-EDXVE4YY.eaZVFLZM.js → chunk-EDXVE4YY.DeTwQPVO.js} +1 -1
  62. package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CmZhzstR.js → chunk-FMBD7UC4.DhMTl7ut.js} +1 -1
  63. package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CTezt9Lc.js → chunk-OYMX7WX6.Me7f5hEp.js} +1 -1
  64. package/dist/docs/assets/chunks/{chunk-QZHKN3VN.s-T8zukB.js → chunk-QZHKN3VN.D0E0Bb6g.js} +1 -1
  65. package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DN4Nhy-D.js → chunk-YZCP3GAM.CdOOBFYL.js} +1 -1
  66. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DGUHZs6j.js +1 -0
  67. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DGUHZs6j.js +1 -0
  68. package/dist/docs/assets/chunks/clone.DWf3k0Z0.js +1 -0
  69. package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.Cqyp4BUH.js → cose-bilkent-S5V4N54A.BNbGESzN.js} +1 -1
  70. package/dist/docs/assets/chunks/{dagre-KV5264BT.BIECOiqR.js → dagre-KV5264BT.zU7Lu_xJ.js} +1 -1
  71. package/dist/docs/assets/chunks/{diagram-5BDNPKRD.1tLyWoTg.js → diagram-5BDNPKRD.B9qOdE5h.js} +1 -1
  72. package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BVY_6VMO.js → diagram-G4DWMVQ6.D8X-sf77.js} +1 -1
  73. package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BSZ7xiBB.js → diagram-MMDJMWI5.CW7MvMlE.js} +1 -1
  74. package/dist/docs/assets/chunks/{diagram-TYMM5635.Bho6GmLh.js → diagram-TYMM5635.J489G0Nd.js} +1 -1
  75. package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.A0yVIANn.js → erDiagram-SMLLAGMA.BkW7tGfs.js} +1 -1
  76. package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.ZMgbllH6.js → flowDiagram-DWJPFMVM.jc9iWORD.js} +1 -1
  77. package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BCCPBhXo.js → ganttDiagram-T4ZO3ILL.B-UQfd9E.js} +1 -1
  78. package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.BOkL0BbA.js → gitGraphDiagram-UUTBAWPF.DFzrTSlJ.js} +1 -1
  79. package/dist/docs/assets/chunks/{graph.DMyZPu86.js → graph.C5IB6_e_.js} +1 -1
  80. package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CjG1IiEw.js → infoDiagram-42DDH7IO.DwF0-c8L.js} +1 -1
  81. package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.UCe-kq9g.js → ishikawaDiagram-UXIWVN3A.fBaTqzE7.js} +1 -1
  82. package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.3WyOK_eY.js → journeyDiagram-VCZTEJTY.CM8gDVJy.js} +1 -1
  83. package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.WoRG2qY1.js → kanban-definition-6JOO6SKY.YiD1p0LB.js} +1 -1
  84. package/dist/docs/assets/chunks/{layout.DV07xDd5.js → layout.6Um-DVJT.js} +1 -1
  85. package/dist/docs/assets/chunks/{linear.CTO8mN6o.js → linear.DcTeg4Hn.js} +1 -1
  86. package/dist/docs/assets/chunks/{min.SvTtcKuZ.js → min.CIxkY8Fe.js} +1 -1
  87. package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.DMGgQ-HB.js → mindmap-definition-QFDTVHPH.D4QM_voR.js} +1 -1
  88. package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.B7851apI.js → pieDiagram-DEJITSTG.nmB309G1.js} +1 -1
  89. package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CEqyypIX.js → quadrantDiagram-34T5L4WZ.D1HtZR3C.js} +1 -1
  90. package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.C3Mwsw-H.js → requirementDiagram-MS252O5E.CZgQWob-.js} +1 -1
  91. package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DyYK0XxY.js → sankeyDiagram-XADWPNL6.DtiBfU-P.js} +1 -1
  92. package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.SiQPH-XM.js → sequenceDiagram-FGHM5R23.Cld4gDSt.js} +1 -1
  93. package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.CTJMsP4p.js → stateDiagram-FHFEXIEX.DatP823_.js} +1 -1
  94. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C0571l4D.js +1 -0
  95. package/dist/docs/assets/chunks/{theme.DJo4my9R.js → theme.D5jbBys7.js} +2 -2
  96. package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CxSNRlQ6.js → timeline-definition-GMOUNBTQ.DwQLI2be.js} +1 -1
  97. package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BdoJskyD.js → vennDiagram-DHZGUBPP.a5yMfnsa.js} +1 -1
  98. package/dist/docs/assets/chunks/wardley-RL74JXVD.B-FXivgT.js +162 -0
  99. package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.IjIbFn_F.js → wardleyDiagram-NUSXRM2D.Dz--Opy3.js} +1 -1
  100. package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CPUxDZLH.js → xychartDiagram-5P7HB3ND.Dl8w8TeT.js} +1 -1
  101. package/dist/docs/assets/{guides_opentelemetry.md.Ck1o2frw.js → guides_opentelemetry.md.DBQtp7_V.js} +4 -4
  102. package/dist/docs/assets/{guides_opentelemetry.md.Ck1o2frw.lean.js → guides_opentelemetry.md.DBQtp7_V.lean.js} +1 -1
  103. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
  104. package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
  105. package/dist/docs/assets/{reference_channels.md.DYg0CLud.js → reference_channels.md.Bxaa020x.js} +1 -1
  106. package/dist/docs/assets/{reference_cli.md.DB7Llw3T.js → reference_cli.md.1o_TqKdt.js} +7 -2
  107. package/dist/docs/assets/{reference_cli.md.DB7Llw3T.lean.js → reference_cli.md.1o_TqKdt.lean.js} +1 -1
  108. package/dist/docs/assets/{reference_tools.md.08XR7lIl.js → reference_tools.md.-6pypsWt.js} +1 -1
  109. package/dist/docs/building-with-agents.html +35 -35
  110. package/dist/docs/deployment.html +35 -35
  111. package/dist/docs/evals.html +35 -35
  112. package/dist/docs/guides/agent-to-agent.html +35 -35
  113. package/dist/docs/guides/bitbucket.html +36 -36
  114. package/dist/docs/guides/cloud-agents.html +35 -35
  115. package/dist/docs/guides/convert-automation.html +35 -35
  116. package/dist/docs/guides/export-grokbot.html +35 -35
  117. package/dist/docs/guides/github.html +35 -35
  118. package/dist/docs/guides/gitlab.html +35 -35
  119. package/dist/docs/guides/grokbot-agents.html +35 -35
  120. package/dist/docs/guides/hooks.html +35 -35
  121. package/dist/docs/guides/improve.html +35 -35
  122. package/dist/docs/guides/jev.html +35 -35
  123. package/dist/docs/guides/mcp-oauth.html +35 -35
  124. package/dist/docs/guides/migrate.html +35 -35
  125. package/dist/docs/guides/opentelemetry.html +39 -39
  126. package/dist/docs/guides/opentelemetry.md +10 -5
  127. package/dist/docs/guides/pagerduty.html +119 -0
  128. package/dist/docs/guides/pagerduty.md +336 -0
  129. package/dist/docs/guides/slack.html +35 -35
  130. package/dist/docs/guides/webhooks.html +35 -35
  131. package/dist/docs/hashmap.json +1 -1
  132. package/dist/docs/hillclimbing.html +35 -35
  133. package/dist/docs/index.html +35 -35
  134. package/dist/docs/llms-full.txt +381 -6
  135. package/dist/docs/llms.txt +1 -0
  136. package/dist/docs/quickstart.html +35 -35
  137. package/dist/docs/reference/agent-config.html +35 -35
  138. package/dist/docs/reference/artifacts.html +35 -35
  139. package/dist/docs/reference/channels.html +37 -37
  140. package/dist/docs/reference/channels.md +2 -1
  141. package/dist/docs/reference/cli.html +42 -37
  142. package/dist/docs/reference/cli.md +27 -0
  143. package/dist/docs/reference/connections.html +35 -35
  144. package/dist/docs/reference/evals.html +35 -35
  145. package/dist/docs/reference/extensions.html +36 -36
  146. package/dist/docs/reference/hooks.html +35 -35
  147. package/dist/docs/reference/http-api.html +35 -35
  148. package/dist/docs/reference/instructions.html +35 -35
  149. package/dist/docs/reference/memory.html +35 -35
  150. package/dist/docs/reference/playground.html +35 -35
  151. package/dist/docs/reference/project-layout.html +35 -35
  152. package/dist/docs/reference/prompt.html +35 -35
  153. package/dist/docs/reference/schedules.html +35 -35
  154. package/dist/docs/reference/sessions.html +35 -35
  155. package/dist/docs/reference/skills.html +35 -35
  156. package/dist/docs/reference/subagents.html +35 -35
  157. package/dist/docs/reference/tools.html +37 -37
  158. package/dist/docs/reference/tools.md +1 -0
  159. package/dist/docs/templates/agentic-owners.html +35 -35
  160. package/dist/docs/templates/grokbot-agents.html +35 -35
  161. package/dist/docs/templates/security-reviewer.html +35 -35
  162. package/dist/docs/templates/thermo-quality-review.html +35 -35
  163. package/dist/docs/templates/thermo-review.html +35 -35
  164. package/dist/docs/templates/triage.html +35 -35
  165. package/dist/docs/troubleshooting.html +35 -35
  166. package/dist/internal/approval-gate.d.ts +4 -2
  167. package/dist/internal/approval-gate.d.ts.map +1 -1
  168. package/dist/internal/approval-gate.js +2 -1
  169. package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
  170. package/dist/internal/builtin-tools/artifacts.js +45 -12
  171. package/dist/internal/channel-architecture.d.ts +1 -1
  172. package/dist/internal/channel-architecture.d.ts.map +1 -1
  173. package/dist/internal/channel-architecture.js +4 -2
  174. package/dist/internal/cli-deploy.d.ts.map +1 -1
  175. package/dist/internal/cli-deploy.js +21 -12
  176. package/dist/internal/cli-pagerduty.d.ts +32 -0
  177. package/dist/internal/cli-pagerduty.d.ts.map +1 -0
  178. package/dist/internal/cli-pagerduty.js +242 -0
  179. package/dist/internal/continuation-channel.d.ts.map +1 -1
  180. package/dist/internal/continuation-channel.js +7 -0
  181. package/dist/internal/continuation-identity.d.ts +11 -3
  182. package/dist/internal/continuation-identity.d.ts.map +1 -1
  183. package/dist/internal/continuation-identity.js +83 -0
  184. package/dist/internal/deploy-manifest.d.ts +11 -4
  185. package/dist/internal/deploy-manifest.d.ts.map +1 -1
  186. package/dist/internal/deploy-manifest.js +17 -5
  187. package/dist/internal/discovery/agent-config.d.ts.map +1 -1
  188. package/dist/internal/discovery/agent-config.js +10 -10
  189. package/dist/internal/discovery/agent.d.ts.map +1 -1
  190. package/dist/internal/discovery/agent.js +10 -10
  191. package/dist/internal/discovery/channels.d.ts.map +1 -1
  192. package/dist/internal/discovery/channels.js +20 -16
  193. package/dist/internal/discovery/context.d.ts +16 -0
  194. package/dist/internal/discovery/context.d.ts.map +1 -1
  195. package/dist/internal/discovery/context.js +66 -0
  196. package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
  197. package/dist/internal/discovery/extension-overlay.js +2 -6
  198. package/dist/internal/discovery/info.d.ts.map +1 -1
  199. package/dist/internal/discovery/info.js +3 -0
  200. package/dist/internal/discovery/instructions.d.ts.map +1 -1
  201. package/dist/internal/discovery/instructions.js +3 -6
  202. package/dist/internal/discovery/modules.d.ts.map +1 -1
  203. package/dist/internal/discovery/modules.js +3 -6
  204. package/dist/internal/discovery/project.d.ts +6 -0
  205. package/dist/internal/discovery/project.d.ts.map +1 -1
  206. package/dist/internal/discovery/project.js +27 -5
  207. package/dist/internal/discovery/runtime.d.ts.map +1 -1
  208. package/dist/internal/discovery/runtime.js +8 -8
  209. package/dist/internal/discovery.d.ts +1 -1
  210. package/dist/internal/discovery.d.ts.map +1 -1
  211. package/dist/internal/discovery.js +1 -1
  212. package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
  213. package/dist/internal/expected-delivery-failure.js +6 -0
  214. package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
  215. package/dist/internal/filesystem/sdk-schemas.js +4 -3
  216. package/dist/internal/hmac-secret-values.d.ts +48 -0
  217. package/dist/internal/hmac-secret-values.d.ts.map +1 -0
  218. package/dist/internal/hmac-secret-values.js +68 -0
  219. package/dist/internal/host-platforms.d.ts.map +1 -1
  220. package/dist/internal/host-platforms.js +8 -2
  221. package/dist/internal/json-schema.d.ts +7 -7
  222. package/dist/internal/json-schema.d.ts.map +1 -1
  223. package/dist/internal/json-schema.js +13 -16
  224. package/dist/internal/otel/collector.d.ts.map +1 -1
  225. package/dist/internal/otel/collector.js +3 -1
  226. package/dist/internal/otel/config.d.ts +6 -1
  227. package/dist/internal/otel/config.d.ts.map +1 -1
  228. package/dist/internal/otel/config.js +27 -1
  229. package/dist/internal/otel/runtime.d.ts.map +1 -1
  230. package/dist/internal/otel/runtime.js +26 -3
  231. package/dist/internal/package-inline-stdio.d.ts.map +1 -1
  232. package/dist/internal/package-inline-stdio.js +21 -6
  233. package/dist/internal/sdk-runner.d.ts +2 -3
  234. package/dist/internal/sdk-runner.d.ts.map +1 -1
  235. package/dist/internal/sdk-runner.js +8 -4
  236. package/dist/internal/secret-alternatives.d.ts +11 -0
  237. package/dist/internal/secret-alternatives.d.ts.map +1 -0
  238. package/dist/internal/secret-alternatives.js +13 -0
  239. package/dist/internal/server.js +2 -2
  240. package/dist/internal/session-engine.d.ts.map +1 -1
  241. package/dist/internal/session-engine.js +5 -4
  242. package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
  243. package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
  244. package/dist/internal/sqlite-experimental-warning.js +22 -0
  245. package/dist/internal/testing/conversation-identity-vectors.d.ts +6 -1
  246. package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -1
  247. package/dist/internal/testing/conversation-identity-vectors.js +34 -0
  248. package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
  249. package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
  250. package/dist/internal/testing/hmac-secret-vectors.js +89 -0
  251. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
  252. package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
  253. package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -0
  254. package/dist/internal/zod-schema.d.ts +14 -0
  255. package/dist/internal/zod-schema.d.ts.map +1 -0
  256. package/dist/internal/zod-schema.js +22 -0
  257. package/dist/playground/assets/cursor-icons-16-DmHBTm1-.woff2 +0 -0
  258. package/dist/playground/assets/index-BdMwybMt.css +1 -0
  259. package/dist/playground/assets/{index-DKKdkF29.js → index-CHk6O92d.js} +38 -38
  260. package/dist/playground/index.html +2 -2
  261. package/dist/tools.d.ts +13 -10
  262. package/dist/tools.d.ts.map +1 -1
  263. package/dist/tools.js +3 -2
  264. package/dist/types.d.ts +67 -16
  265. package/dist/types.d.ts.map +1 -1
  266. package/docs/guides/opentelemetry.md +10 -5
  267. package/docs/guides/pagerduty.md +341 -0
  268. package/docs/reference/channels.md +2 -1
  269. package/docs/reference/cli.md +27 -0
  270. package/docs/reference/tools.md +1 -0
  271. package/package.json +10 -3
  272. package/skills/migrate-v2/SKILL.md +1 -1
  273. package/skills/otel/SKILL.md +7 -3
  274. package/templates/agentic-owners/README.md +6 -1
  275. package/templates/agentic-owners/bot/lib/owners/decision.ts +31 -5
  276. package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
  277. package/templates/agentic-owners/bot/lib/owners/match.ts +85 -19
  278. package/templates/agentic-owners/bot/lib/owners/parse.ts +133 -2
  279. package/templates/agentic-owners/bot/lib/owners/types.ts +23 -0
  280. package/dist/docs/assets/chunks/@localSearchIndexroot.3ebvCWKy.js +0 -1
  281. package/dist/docs/assets/chunks/channel.BOebySCN.js +0 -1
  282. package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.C55IaN-T.js +0 -1
  283. package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.C55IaN-T.js +0 -1
  284. package/dist/docs/assets/chunks/clone.D06pA7ML.js +0 -1
  285. package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DddRVjeq.js +0 -1
  286. package/dist/docs/assets/chunks/wardley-RL74JXVD.CVCRSuQK.js +0 -162
  287. package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
  288. package/dist/playground/assets/index-DpKinTMs.css +0 -1
  289. /package/dist/docs/assets/{reference_channels.md.DYg0CLud.lean.js → reference_channels.md.Bxaa020x.lean.js} +0 -0
  290. /package/dist/docs/assets/{reference_tools.md.08XR7lIl.lean.js → reference_tools.md.-6pypsWt.lean.js} +0 -0
@@ -0,0 +1,336 @@
1
+ # PagerDuty agents
2
+
3
+ A PagerDuty agent wakes when an incident triggers, investigates it, and
4
+ writes what it found back to the incident. `pagerdutyChannel()` receives
5
+ PagerDuty's v3 webhooks, verifies them, and keeps every later event for
6
+ the same incident in one session, so the agent sees an acknowledgement,
7
+ a note, or a responder's reply in the context of the investigation it
8
+ already started. Every setting has a default read from a well-known secret, so
9
+ the channel needs no configuration beyond its hooks; see
10
+ [Connect](#connect) for the variables.
11
+
12
+ ## Investigate a new incident
13
+
14
+ When an incident triggers, the agent starts a turn with the incident's
15
+ title, service, urgency, and link. It reads whatever the investigation
16
+ needs, and with `deliverReplies: true` its reply is posted as a note on
17
+ the incident, where the person on call already looks.
18
+
19
+ ```ts
20
+ // bot/channels/pagerduty.ts
21
+ import { defaultPagerDutyAuth, pagerdutyChannel } from "@cursor/bdk/channels/pagerduty";
22
+
23
+ export default pagerdutyChannel({
24
+ deliverReplies: true,
25
+ onIncident: (ctx, event) => {
26
+ if (event.eventType !== "incident.triggered") {
27
+ return null;
28
+ }
29
+ return {
30
+ // `auth` starts a model turn running as the event's PagerDuty actor.
31
+ auth: defaultPagerDutyAuth(ctx),
32
+ message: `Investigate PagerDuty incident #${event.incident.number}: ${event.incident.title}`,
33
+ context: [`Service: ${event.incident.service?.summary ?? "unknown"}`],
34
+ };
35
+ },
36
+ });
37
+ ```
38
+
39
+ Reply notes are off unless you set `deliverReplies: true`, so the channel
40
+ writes nothing to PagerDuty on its own. An agent that writes to PagerDuty
41
+ through its own path, such as a service that audits each write, leaves it
42
+ off and posts only what it chooses, from `events` or `ctx.pagerduty`.
43
+
44
+ With `deliverReplies: true`, the channel posts each completed reply as a
45
+ note on the session's incident, and a short note if a turn fails, using
46
+ the `PAGERDUTY_TOKEN` secret. The note goes to the incident in the
47
+ verified event's state, so the model never chooses which incident it
48
+ writes to. Eval runs and agents without a token post nothing. Nothing is
49
+ posted until the channel knows the agent's own PagerDuty user (see
50
+ [Ignore your own actions](#ignore-your-own-actions)), because each note
51
+ comes back as a webhook event that only the echo skip keeps from starting
52
+ another turn. Handlers you write in `events` replace the built-in ones.
53
+
54
+ Hooks also get `ctx.pagerduty`, a REST client with the channel's
55
+ credentials, for reads and writes of their own:
56
+
57
+ ```ts
58
+ onIncident: async (ctx, event) => {
59
+ const incident = await ctx.pagerduty.getIncident(event.incident.id);
60
+ // …
61
+ },
62
+ ```
63
+
64
+ Hosted, the agent also declares PagerDuty's API host and the token:
65
+
66
+ ```ts
67
+ // bot/agent.ts
68
+ import { defineAgent } from "@cursor/bdk";
69
+
70
+ export default defineAgent({
71
+ architecture: "v2",
72
+ hosting: {
73
+ egressDomains: ["api.pagerduty.com"],
74
+ secretNames: ["PAGERDUTY_TOKEN"],
75
+ },
76
+ });
77
+ ```
78
+
79
+ ## Follow the incident in one session
80
+
81
+ People act on an incident while the agent investigates: someone
82
+ acknowledges it, adds a note, pulls in a responder, or resolves it.
83
+ Return a dispatch for those events too, and each one arrives in the
84
+ session that is already working on the incident, with the earlier
85
+ findings in context.
86
+
87
+ ```ts
88
+ onIncident: (ctx, event) => {
89
+ const followUps = ["incident.acknowledged", "incident.reassigned", "incident.resolved"];
90
+ if (event.eventType !== "incident.triggered" && !followUps.includes(event.eventType)) {
91
+ return null;
92
+ }
93
+ return {
94
+ auth: defaultPagerDutyAuth(ctx),
95
+ message: `${event.eventType} by ${ctx.agent?.summary ?? "PagerDuty"}`,
96
+ };
97
+ },
98
+ onNote: (ctx, note) => {
99
+ return {
100
+ auth: defaultPagerDutyAuth(ctx),
101
+ message: `Note on the incident: ${note.content}`,
102
+ };
103
+ },
104
+ ```
105
+
106
+ Add these to the same `pagerdutyChannel()` declaration as the
107
+ investigation handler.
108
+
109
+ ## Ignore your own actions
110
+
111
+ PagerDuty sends the agent's own changes back as webhook events: the
112
+ note it posted, or an acknowledgement or resolve made through its
113
+ PagerDuty user. The channel acknowledges those events without running a
114
+ hook or starting a turn. The same action by a person is still delivered.
115
+
116
+ The channel finds the agent's user in this order, on each delivery:
117
+
118
+ 1. The `selfUserIds` option, when you pass one. Nothing below is used.
119
+ 2. The `PAGERDUTY_USER_ID` secret: one PagerDuty user id.
120
+ 3. The user `PAGERDUTY_TOKEN` acts as, which PagerDuty reports at
121
+ `GET /users/me`.
122
+
123
+ When none of these names a user, echo skip is off. `bdk deploy` warns
124
+ while neither `PAGERDUTY_USER_ID` nor `PAGERDUTY_TOKEN` is set, and the
125
+ agent logs a warning when its token names no single user.
126
+
127
+ Inference depends on the kind of token:
128
+
129
+ | `PAGERDUTY_TOKEN` | Inferred user |
130
+ | --- | --- |
131
+ | User token REST API key | The key's own user |
132
+ | OAuth user token (Classic User OAuth or Scoped OAuth), written as `Bearer <token>` | The user who authorized the app |
133
+ | General access (account-level) REST API key | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
134
+ | Scoped OAuth app token (client credentials) | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
135
+
136
+ PagerDuty serves
137
+ [`GET /users/me`](https://developer.pagerduty.com/api-reference/0b6f8b0c3e8d1-get-the-current-user)
138
+ only to a user-level API key or a token from an OAuth flow, not to an
139
+ account-level key. An app token
140
+ [acts as the app](https://docs.pagerduty.com/developer/private-apps),
141
+ not as a user. With either, the channel looks up `PAGERDUTY_FROM_EMAIL`,
142
+ the `From` user the token writes as, through `GET /users?query=` and uses
143
+ the one user whose email matches exactly. The inferred id is kept in the
144
+ agent's memory for an hour per token, never in agent storage, and an
145
+ unresolved answer is retried after five minutes. Hosted, the lookup needs
146
+ `api.pagerduty.com` (or your `PAGERDUTY_API_BASE_URL` host) in
147
+ `hosting.egressDomains`, the same entry write-backs need.
148
+
149
+ A read-only agent with no token sets the id directly:
150
+
151
+ ```bash
152
+ bdk secrets set incident-responder PAGERDUTY_USER_ID
153
+ ```
154
+
155
+ `PAGERDUTY_USER_ID` holds one id because a deployment has one token
156
+ and so acts as one PagerDuty user. To skip several users, or to keep the
157
+ id in code, pass `selfUserIds`:
158
+
159
+ ```ts
160
+ export default pagerdutyChannel({
161
+ selfUserIds: ["PBOT001"],
162
+ onIncident: (ctx) => ({ auth: defaultPagerDutyAuth(ctx) }),
163
+ });
164
+ ```
165
+
166
+ `selfUserIds: { secretName: "OTHER_NAME" }` reads one id from another
167
+ secret and never falls back to inference.
168
+
169
+ ## Events
170
+
171
+ Each hook receives one family of v3 events:
172
+
173
+ | Hook | Events |
174
+ | --- | --- |
175
+ | `onIncident` | `incident.triggered`, `.acknowledged`, `.unacknowledged`, `.escalated`, `.reassigned`, `.delegated`, `.resolved`, `.reopened`, `.priority_updated`, `.incident_type.changed` |
176
+ | `onNote` | `incident.annotated` |
177
+ | `onResponder` | `incident.responder.added`, `incident.responder.replied` |
178
+ | `onEvent` | Everything else, such as status updates and workflow events |
179
+
180
+ Without `onIncident`, a triggered or reopened incident starts a turn and
181
+ other lifecycle events are acknowledged. Notes, responder events, and
182
+ the rest are acknowledged until you add their hook. Each hook returns
183
+ one of three decisions:
184
+
185
+ | Return | What happens |
186
+ | --- | --- |
187
+ | `{ auth }` | Start or continue a model turn as the event's actor |
188
+ | `{ task }` | Acknowledge the webhook, then run host code that may also call `send` |
189
+ | `null` | Skip the event |
190
+
191
+ ## Incident affinity
192
+
193
+ Every event for one incident joins one session, keyed on the incident
194
+ id. Lifecycle events carry the incident, and notes and responder events
195
+ name it by reference, so all of them reach the same session.
196
+
197
+ A re-trigger after a resolve is a new PagerDuty incident, so it starts a
198
+ new session. `ctx.incidentKey` carries the dedup key of the alert that
199
+ opened an incident (its `incident_key`, set per alert by a Datadog
200
+ monitor, a Sentry issue, or a Grafana rule), for an agent that wants to
201
+ recall what it found the last time the same alert fired.
202
+
203
+ ## Connect
204
+
205
+ Create a v3 webhook subscription in PagerDuty for the services that
206
+ should wake the agent, and point it at
207
+ `https://<your-host>/<slug>/v1/channels/pagerduty`. Then set the
208
+ channel's secrets on the deployment. Locally the same names are
209
+ environment variables.
210
+
211
+ | Variable | Used for | Override |
212
+ | --- | --- | --- |
213
+ | `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 }` |
214
+ | `PAGERDUTY_USER_ID` | Skipping the agent's own actions: its PagerDuty user id. Optional when `PAGERDUTY_TOKEN` names a user | `selfUserIds: [ids]` or `{ secretName }` |
215
+ | `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 }` |
216
+ | `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 }` |
217
+ | `PAGERDUTY_API_BASE_URL` | The REST host, such as `https://api.eu.pagerduty.com`. Defaults to `https://api.pagerduty.com` | `apiBaseUrl` |
218
+
219
+ Set `token`, `from`, and `apiBaseUrl` on `pagerdutyChannel()`; they cover
220
+ reply notes, `ctx.pagerduty`, and inference. `createPagerDutyClient()`
221
+ takes the same options for code outside the channel.
222
+
223
+ ```bash
224
+ bdk deploy --dir . --slug incident-responder
225
+ bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET PAGERDUTY_TOKEN
226
+ bdk secrets list incident-responder
227
+ ```
228
+
229
+ `bdk deploy` warns until `PAGERDUTY_WEBHOOK_SECRET` is set, and until
230
+ either `PAGERDUTY_USER_ID` or `PAGERDUTY_TOKEN` is. The next delivery
231
+ uses a new value without another deploy.
232
+
233
+ ### Several subscriptions
234
+
235
+ PagerDuty gives each webhook subscription its own signing secret, so an
236
+ agent fed by several subscriptions (one per service, say) needs all of
237
+ them. Put them in `PAGERDUTY_WEBHOOK_SECRET`, one per line:
238
+
239
+ ```text
240
+ <signing secret of subscription 1>
241
+ <signing secret of subscription 2>
242
+ ```
243
+
244
+ A delivery is admitted when any `v1=` signature in its
245
+ `X-PagerDuty-Signature` header matches any line. Each line is trimmed,
246
+ blank lines are ignored, and a value without a line break is one secret,
247
+ used as-is. The value holds at most 32 secrets. Past that, every delivery
248
+ is rejected rather than checked against only some of them.
249
+
250
+ Keep the list in a file, since `bdk secrets list` never shows values,
251
+ and set it from stdin, which keeps the line breaks:
252
+
253
+ ```bash
254
+ bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET < pagerduty-webhook-secrets.txt
255
+ ```
256
+
257
+ Rotate by adding before removing. Add the new secret as a line before
258
+ PagerDuty starts signing with it, for example before creating the
259
+ replacement subscription. Remove the old line only once nothing signs
260
+ with the old secret, for example after deleting the subscription it
261
+ replaced. While both are live, a delivery signed with either secret
262
+ verifies, including one whose header carries both signatures. Removing
263
+ the old line first rejects those deliveries until the new one is added.
264
+
265
+ The same format works for every `hmacSignatureAuth()` secret, including
266
+ `GITHUB_WEBHOOK_SECRET` and `BITBUCKET_WEBHOOK_SECRET`. It needs
267
+ `@cursor/bdk` 0.2.25 or later. Earlier versions check the signature again
268
+ in the agent with the whole value as one secret, so they reject every
269
+ delivery once the value has a second line.
270
+
271
+ Only signature checks read the value as a list. Everywhere else it is
272
+ used whole: a `sharedSecretAuth()` header compares the entire value, and
273
+ a `${NAME}` template in an MCP connection's `headers` would put the line
274
+ breaks into the header. Keep a list secret for webhook signing only.
275
+
276
+ Until `PAGERDUTY_WEBHOOK_SECRET` is set, the route accepts only local
277
+ traffic: loopback deliveries under `bdk dev`, nothing in production.
278
+
279
+ ## Test locally
280
+
281
+ `bdk pagerduty replay` posts synthesized v3 deliveries for one incident
282
+ to the running agent, in order. With `PAGERDUTY_WEBHOOK_SECRET` unset,
283
+ `bdk dev` admits them unsigned from loopback; with it set, replay signs
284
+ them the way PagerDuty does:
285
+
286
+ ```bash
287
+ bdk dev &
288
+ bdk pagerduty replay --events triggered,acknowledged,annotated,resolved \
289
+ --comment "Rolled back the 09:30 deploy."
290
+ ```
291
+
292
+ The trigger comes from PagerDuty itself, and the later events come from a
293
+ person, so each one joins the session the trigger started. Pass an
294
+ incident id to start another session, `--dry-run` to print the bodies,
295
+ or `--out fixtures/pagerduty` to save them as fixtures for
296
+ [evals](/docs/evals.md). `bdk pagerduty events` lists the channels and the
297
+ events each accepts.
298
+
299
+ To post a real delivery saved from the webhook's delivery log, sign it
300
+ with the secret:
301
+
302
+ ```bash
303
+ export PAGERDUTY_WEBHOOK_SECRET=local-test-secret
304
+ bdk dev &
305
+
306
+ body=fixtures/pagerduty/incident-triggered.json
307
+ signature=$(openssl dgst -sha256 -hmac "$PAGERDUTY_WEBHOOK_SECRET" -hex < "$body" | awk '{print $NF}')
308
+ curl -X POST http://127.0.0.1:3000/v1/channels/pagerduty \
309
+ -H 'content-type: application/json' \
310
+ -H "x-pagerduty-signature: v1=$signature" \
311
+ --data-binary @"$body"
312
+ ```
313
+
314
+ Set `event.agent.id` in a saved body to the agent's own user id to see
315
+ the delivery skipped as an echo.
316
+
317
+ ## Practices
318
+
319
+ - Write back from host code with the incident in channel state or
320
+ `ctx`, never from an incident id the model produced.
321
+
322
+ - Make sure the agent knows its own user before it acts on incidents, so
323
+ its own notes and resolves do not wake it again: a user-level token, a
324
+ `PAGERDUTY_FROM_EMAIL` with an account-level key, or `PAGERDUTY_USER_ID`.
325
+
326
+ - Scope the webhook subscription to the services the agent responds to;
327
+ every delivery it sends reaches the channel.
328
+
329
+ ## Related
330
+
331
+ - [Channels reference](/docs/reference/channels.md): channel hooks,
332
+ dispatch decisions, and session behavior
333
+ - [Webhooks and custom channels](/docs/guides/webhooks.md): direct webhook auth
334
+ and reply delivery
335
+ - [Evals](/docs/evals.md): turn saved PagerDuty payloads into regression
336
+ fixtures