@cursor/bdk 0.2.24 → 0.2.26
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.
- package/AGENTS.md +4 -18
- package/CHANGELOG.md +3 -0
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/bin/agent-serve.d.ts +1 -1
- package/dist/bin/agent-serve.js +71 -31
- package/dist/channels/bitbucket/api.d.ts +2 -2
- package/dist/channels/bitbucket/api.d.ts.map +1 -1
- package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +5 -4
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
- package/dist/channels/bitbucket/bitbucket-webhook.js +14 -9
- package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
- package/dist/channels/deployments/deployments-channel.js +1 -1
- package/dist/channels/github/cursor-account.d.ts +7 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +22 -5
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +10 -19
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +2 -2
- package/dist/channels/gitlab/api.d.ts.map +1 -1
- package/dist/channels/gitlab/gitlab-channel.js +1 -1
- package/dist/channels/issues/issues-channel.js +1 -1
- package/dist/channels/origin/api.d.ts +4 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +1 -1
- package/dist/channels/origin/origin-webhook.d.ts +3 -3
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/pagerduty/api.d.ts +74 -0
- package/dist/channels/pagerduty/api.d.ts.map +1 -0
- package/dist/channels/pagerduty/api.js +101 -0
- package/dist/channels/pagerduty/defaults.d.ts +42 -0
- package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
- package/dist/channels/pagerduty/defaults.js +132 -0
- package/dist/channels/pagerduty/events.d.ts +24 -0
- package/dist/channels/pagerduty/events.d.ts.map +1 -0
- package/dist/channels/pagerduty/events.js +38 -0
- package/dist/channels/pagerduty/index.d.ts +31 -0
- package/dist/channels/pagerduty/index.d.ts.map +1 -0
- package/dist/channels/pagerduty/index.js +30 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
- package/dist/channels/pagerduty/payload.d.ts +33 -0
- package/dist/channels/pagerduty/payload.d.ts.map +1 -0
- package/dist/channels/pagerduty/payload.js +150 -0
- package/dist/channels/pagerduty/replay.d.ts +35 -0
- package/dist/channels/pagerduty/replay.d.ts.map +1 -0
- package/dist/channels/pagerduty/replay.js +115 -0
- package/dist/channels/pagerduty/secrets.d.ts +16 -0
- package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
- package/dist/channels/pagerduty/secrets.js +23 -0
- package/dist/channels/pagerduty/self-user.d.ts +51 -0
- package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
- package/dist/channels/pagerduty/self-user.js +157 -0
- package/dist/channels/pagerduty/state.d.ts +31 -0
- package/dist/channels/pagerduty/state.d.ts.map +1 -0
- package/dist/channels/pagerduty/state.js +30 -0
- package/dist/channels/pagerduty/types.d.ts +217 -0
- package/dist/channels/pagerduty/types.d.ts.map +1 -0
- package/dist/channels/pagerduty/types.js +1 -0
- package/dist/channels/runs/runs-channel.js +1 -1
- package/dist/channels/slack/agentic-delivery.d.ts +2 -1
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
- package/dist/channels/slack/agentic-delivery.js +6 -10
- package/dist/channels/slack/agentic-signals.d.ts +2 -7
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -1
- package/dist/channels/slack/agentic-signals.js +4 -3
- package/dist/channels/slack/api.d.ts +1 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -0
- package/dist/channels/slack/constants.d.ts +2 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +2 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +3 -2
- package/dist/channels/slack/dispatch.d.ts +9 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +24 -20
- package/dist/channels/slack/interactive.d.ts +2 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts +3 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +9 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -1
- package/dist/channels/slack/reply-options.js +31 -1
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +7 -0
- package/dist/channels/slack/stream.d.ts +5 -1
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/types.d.ts +29 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +7 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +12 -24
- package/dist/docs/404.html +3 -3
- package/dist/docs/assets/{app.DTIg0uKK.js → app.BITbgXMP.js} +4 -4
- package/dist/docs/assets/changelog.md.sdD6ctqK.js +1 -0
- package/dist/docs/assets/changelog.md.sdD6ctqK.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.B45uCZp9.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BpJoSaxi.js → VPLocalSearchBox.3qo4-bX9.js} +2 -2
- package/dist/docs/assets/chunks/{arc.ylgNvRNq.js → arc.CTrZocKU.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.BMrNJqYk.js → architectureDiagram-Q4EWVU46.BkgIqxrv.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.BBWUEqf9.js → baseUniq.5w0JfVgo.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.DFMu-Vza.js → blockDiagram-DXYQGD6D.BVLtPjQc.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.8nkAAxWv.js → c4Diagram-AHTNJAMY.CQ7neZTW.js} +1 -1
- package/dist/docs/assets/chunks/channel.Cv2w64wj.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.sO-z2Bag.js → chunk-4BX2VUAB.D-hJ7uKM.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BMROzTMq.js → chunk-4TB4RGXK.RBYX5ywX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.X81urwg7.js → chunk-55IACEB6.Br05HoEb.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.eaZVFLZM.js → chunk-EDXVE4YY.BD_7QS60.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CmZhzstR.js → chunk-FMBD7UC4.BOPnMabX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CTezt9Lc.js → chunk-OYMX7WX6.DmGIdP8i.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.s-T8zukB.js → chunk-QZHKN3VN.CGHmolCB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DN4Nhy-D.js → chunk-YZCP3GAM.C_Uhs25v.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CtO2atCr.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CtO2atCr.js +1 -0
- package/dist/docs/assets/chunks/clone.hfsCtgP4.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.Cqyp4BUH.js → cose-bilkent-S5V4N54A.DsU6xpcZ.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.BIECOiqR.js → dagre-KV5264BT.BqQLDcoU.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.1tLyWoTg.js → diagram-5BDNPKRD.Cgv8uUNF.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BVY_6VMO.js → diagram-G4DWMVQ6.BXHPSXh_.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BSZ7xiBB.js → diagram-MMDJMWI5.CgJzo8f_.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.Bho6GmLh.js → diagram-TYMM5635.CfiN6lgT.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.A0yVIANn.js → erDiagram-SMLLAGMA.8n_hHzAd.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.ZMgbllH6.js → flowDiagram-DWJPFMVM.B2pb1Dv_.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BCCPBhXo.js → ganttDiagram-T4ZO3ILL.BFih4ucI.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.BOkL0BbA.js → gitGraphDiagram-UUTBAWPF.CqZ8PTl8.js} +1 -1
- package/dist/docs/assets/chunks/{graph.DMyZPu86.js → graph.0ufsI9gu.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CjG1IiEw.js → infoDiagram-42DDH7IO.BkPRFww4.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.UCe-kq9g.js → ishikawaDiagram-UXIWVN3A.DCRK-cVX.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.3WyOK_eY.js → journeyDiagram-VCZTEJTY.BFyAJo33.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.WoRG2qY1.js → kanban-definition-6JOO6SKY.CmA2SoGc.js} +1 -1
- package/dist/docs/assets/chunks/{layout.DV07xDd5.js → layout.CYY-CbMr.js} +1 -1
- package/dist/docs/assets/chunks/{linear.CTO8mN6o.js → linear.DeeDV4Oq.js} +1 -1
- package/dist/docs/assets/chunks/{min.SvTtcKuZ.js → min.BL3XTBN2.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.DMGgQ-HB.js → mindmap-definition-QFDTVHPH.BcbY-G6H.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.B7851apI.js → pieDiagram-DEJITSTG.dzDcQnPE.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CEqyypIX.js → quadrantDiagram-34T5L4WZ.RxR0m5iK.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.C3Mwsw-H.js → requirementDiagram-MS252O5E.DflaXb6Q.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DyYK0XxY.js → sankeyDiagram-XADWPNL6.BteLKQAe.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.SiQPH-XM.js → sequenceDiagram-FGHM5R23.BD8jM8oz.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.CTJMsP4p.js → stateDiagram-FHFEXIEX.C8SBkbPH.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.BLz7Qyo3.js +1 -0
- package/dist/docs/assets/chunks/{theme.DJo4my9R.js → theme.DiViIOLe.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CxSNRlQ6.js → timeline-definition-GMOUNBTQ.D64XF5dV.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BdoJskyD.js → vennDiagram-DHZGUBPP.CwmeYan-.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.DmAlXlpu.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.IjIbFn_F.js → wardleyDiagram-NUSXRM2D.5VJ2-5K0.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CPUxDZLH.js → xychartDiagram-5P7HB3ND.Cl6_fZVC.js} +1 -1
- package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.js → guides_hooks.md.B2XfGX50.js} +7 -3
- package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.js → guides_mcp-oauth.md.Cxq2TxBB.js} +3 -3
- package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.lean.js → guides_mcp-oauth.md.Cxq2TxBB.lean.js} +1 -1
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
- package/dist/docs/assets/{guides_slack.md.Bn-WupSE.js → guides_slack.md.ClIyi7FI.js} +8 -3
- package/dist/docs/assets/{guides_slack.md.Bn-WupSE.lean.js → guides_slack.md.ClIyi7FI.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.IplwL25I.js → reference_agent-config.md.CGSx8COP.js} +6 -2
- package/dist/docs/assets/{reference_agent-config.md.IplwL25I.lean.js → reference_agent-config.md.CGSx8COP.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.DYg0CLud.js → reference_channels.md.CNNIS6K7.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DB7Llw3T.js → reference_cli.md.1o_TqKdt.js} +7 -2
- package/dist/docs/assets/{reference_cli.md.DB7Llw3T.lean.js → reference_cli.md.1o_TqKdt.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.js → reference_hooks.md.CROr0QgC.js} +13 -7
- package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.lean.js → reference_hooks.md.CROr0QgC.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.js → reference_schedules.md.BqWnJES4.js} +3 -3
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
- package/dist/docs/assets/{reference_skills.md.C2GWh7g8.js → reference_skills.md.Ckddg6KX.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.08XR7lIl.js → reference_tools.md.Bo0UfT0a.js} +1 -1
- package/dist/docs/assets/{style.nMsabY-V.css → style.B9o0luvp.css} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/changelog.html +60 -0
- package/dist/docs/changelog.md +86 -0
- package/dist/docs/deployment.html +37 -37
- package/dist/docs/evals.html +37 -37
- package/dist/docs/guides/agent-to-agent.html +37 -37
- package/dist/docs/guides/bitbucket.html +37 -37
- package/dist/docs/guides/cloud-agents.html +37 -37
- package/dist/docs/guides/convert-automation.html +37 -37
- package/dist/docs/guides/export-grokbot.html +37 -37
- package/dist/docs/guides/github.html +37 -37
- package/dist/docs/guides/gitlab.html +37 -37
- package/dist/docs/guides/grokbot-agents.html +37 -37
- package/dist/docs/guides/hooks.html +45 -41
- package/dist/docs/guides/hooks.md +7 -3
- package/dist/docs/guides/improve.html +37 -37
- package/dist/docs/guides/jev.html +37 -37
- package/dist/docs/guides/mcp-oauth.html +39 -39
- package/dist/docs/guides/mcp-oauth.md +12 -0
- package/dist/docs/guides/migrate.html +37 -37
- package/dist/docs/guides/opentelemetry.html +62 -70
- package/dist/docs/guides/opentelemetry.md +150 -175
- package/dist/docs/guides/pagerduty.html +119 -0
- package/dist/docs/guides/pagerduty.md +336 -0
- package/dist/docs/guides/slack.html +44 -39
- package/dist/docs/guides/slack.md +41 -0
- package/dist/docs/guides/webhooks.html +37 -37
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +37 -37
- package/dist/docs/index.html +37 -37
- package/dist/docs/llms-full.txt +730 -163
- package/dist/docs/llms.txt +3 -1
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/reference/agent-config.html +42 -38
- package/dist/docs/reference/agent-config.md +21 -1
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/channels.html +38 -38
- package/dist/docs/reference/channels.md +7 -2
- package/dist/docs/reference/cli.html +43 -38
- package/dist/docs/reference/cli.md +27 -0
- package/dist/docs/reference/connections.html +37 -37
- package/dist/docs/reference/evals.html +37 -37
- package/dist/docs/reference/extensions.html +37 -37
- package/dist/docs/reference/hooks.html +49 -43
- package/dist/docs/reference/hooks.md +10 -5
- package/dist/docs/reference/http-api.html +37 -37
- package/dist/docs/reference/instructions.html +37 -37
- package/dist/docs/reference/memory.html +37 -37
- package/dist/docs/reference/playground.html +36 -36
- package/dist/docs/reference/project-layout.html +37 -37
- package/dist/docs/reference/prompt.html +37 -37
- package/dist/docs/reference/schedules.html +40 -40
- package/dist/docs/reference/sessions.html +58 -37
- package/dist/docs/reference/sessions.md +46 -1
- package/dist/docs/reference/skills.html +40 -40
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/tools.html +39 -39
- package/dist/docs/reference/tools.md +4 -3
- package/dist/docs/templates/agentic-owners.html +37 -37
- package/dist/docs/templates/grokbot-agents.html +37 -37
- package/dist/docs/templates/security-reviewer.html +37 -37
- package/dist/docs/templates/thermo-quality-review.html +37 -37
- package/dist/docs/templates/thermo-review.html +37 -37
- package/dist/docs/templates/triage.html +37 -37
- package/dist/docs/troubleshooting.html +36 -36
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +15 -15
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +1 -1
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-grokbot-agents/extension.js +7 -3
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +1 -1
- package/dist/extensions/improve/extension.js +1 -1
- package/dist/extensions/jev/extension.js +2 -2
- package/dist/extensions/jev/tools/evaluate.js +3 -3
- package/dist/extensions/slack-communication/extension.js +1 -1
- package/dist/extensions/slack-communication/tools/delete-message.js +1 -1
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -1
- package/dist/extensions/slack-communication/tools/edit-message.js +3 -6
- package/dist/extensions/slack-communication/tools/post-card.js +1 -1
- package/dist/extensions/slack-communication/tools/post-file.js +1 -1
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -1
- package/dist/extensions/slack-communication/tools/post-update.js +3 -6
- package/dist/extensions/slack-communication/tools/react.js +1 -1
- package/dist/extensions/slack-communication/tools/set-status.js +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/internal/approval-gate.d.ts +4 -2
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +2 -1
- package/dist/internal/as-of.d.ts +2 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +2 -0
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
- package/dist/internal/builtin-tools/artifacts.js +45 -12
- package/dist/internal/builtin-tools/reminders.js +1 -1
- package/dist/internal/channel-architecture.d.ts +1 -1
- package/dist/internal/channel-architecture.d.ts.map +1 -1
- package/dist/internal/channel-architecture.js +4 -2
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +39 -22
- package/dist/internal/cli-pagerduty.d.ts +32 -0
- package/dist/internal/cli-pagerduty.d.ts.map +1 -0
- package/dist/internal/cli-pagerduty.js +242 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +7 -0
- package/dist/internal/continuation-identity.d.ts +11 -3
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +83 -0
- package/dist/internal/continuation.d.ts +3 -0
- package/dist/internal/continuation.d.ts.map +1 -0
- package/dist/internal/continuation.js +1 -0
- package/dist/internal/conversation-mirror.d.ts +5 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +12 -1
- package/dist/internal/convert-automation/convert-workflow.js +1 -1
- package/dist/internal/convert-grokbot/answers.d.ts.map +1 -1
- package/dist/internal/convert-grokbot/answers.js +10 -8
- package/dist/internal/convert-grokbot/recipe.d.ts +1 -1
- package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -1
- package/dist/internal/convert-grokbot/recipe.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +2 -0
- package/dist/internal/cursor/backend-client.d.ts +8 -3
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +8 -3
- package/dist/internal/cursor/credentials.d.ts +2 -2
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +1 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts +6 -2
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +15 -6
- package/dist/internal/deferred-channel-session.d.ts +5 -4
- package/dist/internal/deferred-channel-session.d.ts.map +1 -1
- package/dist/internal/deferred-channel-session.js +6 -4
- package/dist/internal/deploy-client.d.ts +5 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -3
- package/dist/internal/deploy-manifest.d.ts +11 -4
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +19 -7
- package/dist/internal/describe-error.d.ts +2 -0
- package/dist/internal/describe-error.d.ts.map +1 -1
- package/dist/internal/describe-error.js +2 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +10 -10
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +10 -10
- package/dist/internal/discovery/channels.d.ts.map +1 -1
- package/dist/internal/discovery/channels.js +20 -16
- package/dist/internal/discovery/context.d.ts +16 -0
- package/dist/internal/discovery/context.d.ts.map +1 -1
- package/dist/internal/discovery/context.js +67 -2
- package/dist/internal/discovery/cursor-plugin.js +8 -8
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
- package/dist/internal/discovery/extension-overlay.js +2 -6
- package/dist/internal/discovery/extensions.js +15 -8
- package/dist/internal/discovery/info.d.ts +2 -2
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +9 -9
- package/dist/internal/discovery/instructions.d.ts.map +1 -1
- package/dist/internal/discovery/instructions.js +3 -6
- package/dist/internal/discovery/instrumentation.d.ts +10 -0
- package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
- package/dist/internal/discovery/instrumentation.js +29 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +7 -10
- package/dist/internal/discovery/project-public.d.ts +16 -0
- package/dist/internal/discovery/project-public.d.ts.map +1 -0
- package/dist/internal/discovery/project-public.js +54 -0
- package/dist/internal/discovery/project.d.ts +6 -0
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +40 -8
- package/dist/internal/discovery/runtime.d.ts.map +1 -1
- package/dist/internal/discovery/runtime.js +8 -8
- package/dist/internal/discovery/services.d.ts +5 -4
- package/dist/internal/discovery/services.d.ts.map +1 -1
- package/dist/internal/discovery/services.js +12 -6
- package/dist/internal/discovery.d.ts +1 -1
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +1 -1
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +1 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -1
- package/dist/internal/expected-delivery-failure.js +6 -0
- package/dist/internal/factory-resource-channel.d.ts +1 -1
- package/dist/internal/factory-resource-channel.d.ts.map +1 -1
- package/dist/internal/filesystem/nearest.d.ts +1 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -1
- package/dist/internal/filesystem/nearest.js +1 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
- package/dist/internal/filesystem/sdk-schemas.js +4 -3
- package/dist/internal/filesystem/tools.d.ts.map +1 -1
- package/dist/internal/filesystem/tools.js +1 -1
- package/dist/internal/handleAgentServeTrigger.d.ts +10 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
- package/dist/internal/handleAgentServeTrigger.js +3 -0
- package/dist/internal/hmac-secret-values.d.ts +48 -0
- package/dist/internal/hmac-secret-values.d.ts.map +1 -0
- package/dist/internal/hmac-secret-values.js +68 -0
- package/dist/internal/host-otel.d.ts +1 -1
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +5 -0
- package/dist/internal/host-platforms.d.ts.map +1 -1
- package/dist/internal/host-platforms.js +8 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +6 -2
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -0
- package/dist/internal/ids.d.ts +8 -0
- package/dist/internal/ids.d.ts.map +1 -1
- package/dist/internal/ids.js +20 -0
- package/dist/internal/init-scaffold.js +1 -1
- package/dist/internal/interview/agent-questions.d.ts +1 -1
- package/dist/internal/interview/agent-questions.d.ts.map +1 -1
- package/dist/internal/interview/agent-questions.js +1 -1
- package/dist/internal/interview/question.d.ts +2 -2
- package/dist/internal/interview/question.d.ts.map +1 -1
- package/dist/internal/interview/question.js +2 -2
- package/dist/internal/json-schema.d.ts +7 -7
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +16 -23
- package/dist/internal/mcp-endpoint.d.ts +16 -4
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +18 -6
- package/dist/internal/mcp-host.d.ts +9 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +15 -0
- package/dist/internal/otel/collector.d.ts +5 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +27 -6
- package/dist/internal/otel/config.d.ts +37 -22
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +132 -125
- package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
- package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
- package/dist/internal/otel/conversation-span-processor.js +34 -0
- package/dist/internal/otel/customer.d.ts +52 -0
- package/dist/internal/otel/customer.d.ts.map +1 -0
- package/dist/internal/otel/customer.js +727 -0
- package/dist/internal/otel/runtime.d.ts +12 -16
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +37 -218
- package/dist/internal/otel-env.d.ts +6 -0
- package/dist/internal/otel-env.d.ts.map +1 -0
- package/dist/internal/otel-env.js +5 -0
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +21 -6
- package/dist/internal/reminder-runner.d.ts +9 -4
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +12 -10
- package/dist/internal/reminder-schedule.d.ts +1 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -1
- package/dist/internal/reminder-schedule.js +1 -0
- package/dist/internal/sdk-runner.d.ts +4 -3
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +157 -17
- package/dist/internal/secret-alternatives.d.ts +11 -0
- package/dist/internal/secret-alternatives.d.ts.map +1 -0
- package/dist/internal/secret-alternatives.js +13 -0
- package/dist/internal/server.d.ts +4 -1
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +27 -26
- package/dist/internal/session-engine.d.ts +27 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +154 -25
- package/dist/internal/slack-provision-client.js +1 -1
- package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
- package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/internal/sqlite-experimental-warning.js +22 -0
- package/dist/internal/store-api-protocol.d.ts +1 -1
- package/dist/internal/store-api-protocol.d.ts.map +1 -1
- package/dist/internal/store-api-protocol.js +1 -1
- package/dist/internal/testing/conversation-identity-vectors.d.ts +6 -1
- package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -1
- package/dist/internal/testing/conversation-identity-vectors.js +34 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
- package/dist/internal/testing/hmac-secret-vectors.js +89 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -0
- package/dist/internal/update-check.d.ts +2 -2
- package/dist/internal/update-check.d.ts.map +1 -1
- package/dist/internal/update-check.js +3 -3
- package/dist/internal/zod-schema.d.ts +14 -0
- package/dist/internal/zod-schema.d.ts.map +1 -0
- package/dist/internal/zod-schema.js +22 -0
- package/dist/internal/zod3-datetime.d.ts +12 -0
- package/dist/internal/zod3-datetime.d.ts.map +1 -0
- package/dist/internal/zod3-datetime.js +17 -0
- package/dist/otel-public.d.ts +2 -3
- package/dist/otel-public.d.ts.map +1 -1
- package/dist/otel-public.js +2 -2
- package/dist/otel.d.ts +3 -102
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +61 -97
- package/dist/playground/assets/cursor-icons-16-DmHBTm1-.woff2 +0 -0
- package/dist/playground/assets/index-CyPkf2y7.css +1 -0
- package/dist/playground/assets/index-DpbzbqFY.js +62 -0
- package/dist/playground/index.html +2 -2
- package/dist/public-deprecated.d.ts +36 -0
- package/dist/public-deprecated.d.ts.map +1 -0
- package/dist/public-deprecated.js +39 -0
- package/dist/tools.d.ts +16 -13
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +4 -3
- package/dist/types.d.ts +286 -104
- package/dist/types.d.ts.map +1 -1
- package/docs/changelog.md +91 -0
- package/docs/guides/hooks.md +7 -3
- package/docs/guides/mcp-oauth.md +12 -0
- package/docs/guides/opentelemetry.md +150 -180
- package/docs/guides/pagerduty.md +341 -0
- package/docs/guides/slack.md +41 -0
- package/docs/reference/agent-config.md +21 -1
- package/docs/reference/channels.md +7 -2
- package/docs/reference/cli.md +27 -0
- package/docs/reference/hooks.md +10 -5
- package/docs/reference/sessions.md +46 -1
- package/docs/reference/tools.md +4 -3
- package/package.json +39 -8
- package/schemas/grokbot-answers.schema.json +11 -0
- package/skills/framework-map/SKILL.md +2 -1
- package/skills/migrate-v2/SKILL.md +1 -1
- package/skills/otel/SKILL.md +30 -46
- package/templates/agentic-owners/README.md +6 -1
- package/templates/agentic-owners/bot/lib/owners/decision.ts +31 -5
- package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +85 -19
- package/templates/agentic-owners/bot/lib/owners/parse.ts +133 -2
- package/templates/agentic-owners/bot/lib/owners/types.ts +23 -0
- package/templates/code-wiki/evals/wiki.eval.ts +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.3ebvCWKy.js +0 -1
- package/dist/docs/assets/chunks/channel.BOebySCN.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.C55IaN-T.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.C55IaN-T.js +0 -1
- package/dist/docs/assets/chunks/clone.D06pA7ML.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DddRVjeq.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.CVCRSuQK.js +0 -162
- package/dist/docs/assets/guides_opentelemetry.md.Ck1o2frw.js +0 -45
- package/dist/docs/assets/guides_opentelemetry.md.Ck1o2frw.lean.js +0 -1
- package/dist/docs/assets/reference_sessions.md.C8FXuGwk.js +0 -1
- package/dist/docs/assets/reference_sessions.md.C8FXuGwk.lean.js +0 -1
- package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
- package/dist/playground/assets/index-DKKdkF29.js +0 -62
- package/dist/playground/assets/index-DpKinTMs.css +0 -1
- package/templates/grokbot-agents/.gitignore +0 -4
- package/templates/security-help/.gitignore +0 -4
- /package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.lean.js → guides_hooks.md.B2XfGX50.lean.js} +0 -0
- /package/dist/docs/assets/{reference_channels.md.DYg0CLud.lean.js → reference_channels.md.CNNIS6K7.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.lean.js → reference_schedules.md.BqWnJES4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.C2GWh7g8.lean.js → reference_skills.md.Ckddg6KX.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.08XR7lIl.lean.js → reference_tools.md.Bo0UfT0a.lean.js} +0 -0
|
@@ -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
|
package/docs/guides/slack.md
CHANGED
|
@@ -99,6 +99,47 @@ export default slackChannel({
|
|
|
99
99
|
});
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
### Show steps as cards or as a checklist
|
|
103
|
+
|
|
104
|
+
The agent calls `post-card` to show one step of its work, such as
|
|
105
|
+
"Scan the repo". Each card has an `id`, a `title`, a `status`, and
|
|
106
|
+
optional `details`. When the agent calls `post-card` again with the same
|
|
107
|
+
`id`, Slack updates that card. The agent uses this to move a step from
|
|
108
|
+
`in_progress` to `complete`.
|
|
109
|
+
|
|
110
|
+
`cards` sets how Slack draws these steps:
|
|
111
|
+
|
|
112
|
+
| `cards` | What Slack shows | Use it when |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `{ display: "timeline" }` (default) | Each step is a separate card in the thread. | The turn has one or two short steps. |
|
|
115
|
+
| `{ display: "plan" }` | All steps from one turn are in one checklist. | The turn has several steps, and readers want to see progress in one place. |
|
|
116
|
+
|
|
117
|
+
This bot shows its steps as one checklist with the title "Release check":
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default slackChannel({
|
|
121
|
+
reply: {
|
|
122
|
+
mode: "agentic",
|
|
123
|
+
cards: { display: "plan", title: "Release check" },
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Know these rules for a plan:
|
|
129
|
+
|
|
130
|
+
- The `title` is optional. It can have at most 256 characters.
|
|
131
|
+
- You set the `title` in the channel configuration. The agent cannot
|
|
132
|
+
change the title.
|
|
133
|
+
- Each turn starts a new checklist with the same title.
|
|
134
|
+
- The `pending` status shows a step that has not started. Use `pending`
|
|
135
|
+
only in a plan.
|
|
136
|
+
- `slackChannel` stops at startup if `cards` is not valid. For example,
|
|
137
|
+
a `title` with `display: "timeline"` stops startup.
|
|
138
|
+
|
|
139
|
+
`display` is Slack's
|
|
140
|
+
[`task_display_mode`](https://docs.slack.dev/reference/methods/chat.startStream/),
|
|
141
|
+
and the channel sends `title` as a `plan_update` chunk.
|
|
142
|
+
|
|
102
143
|
## Wake on a channel post
|
|
103
144
|
|
|
104
145
|
This example watches `#triage-alerts`, so any substantial top-level
|
|
@@ -196,15 +196,35 @@ const handle = await serve("./my-agent", {
|
|
|
196
196
|
});
|
|
197
197
|
console.log(`listening on ${handle.url}`);
|
|
198
198
|
// handle.callTool(...), handle.dispatchSchedule("heartbeat"),
|
|
199
|
-
// handle.createReminder(...), handle.
|
|
199
|
+
// handle.createReminder(...), handle.agents, await handle.close()
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
+
`handle.agents` lists each mount as `slug`, `url`, and `info`. `handle.project` is the first agent's project. It is deprecated.
|
|
203
|
+
|
|
202
204
|
Host settings match the documented [CLI](./cli.md) `serve` flags.
|
|
203
205
|
`serve()` also accepts `discovery` (project-loading options) and
|
|
204
206
|
`mode: "single" | "multi"`. Pass `apiKey` or use the same Cursor
|
|
205
207
|
credential as the CLI: `CURSOR_API_KEY`, `CURSOR_API_KEY_FILE`,
|
|
206
208
|
`CURSOR_SERVICE_ACCOUNT_KEY`, or `bdk login`.
|
|
207
209
|
|
|
210
|
+
## Inspect a project in tests
|
|
211
|
+
|
|
212
|
+
`loadProject(dir)` reads one project and does not serve it. The result is a `Project`. The only field is `info`. That object matches the `GET /v1/info` body for the project. `bdk info --json` on a project directory prints `{ agents: [{ slug, ...info }] }`. It prints the bare object only when the single mount slug is empty.
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { loadProject } from "@cursor/bdk";
|
|
216
|
+
|
|
217
|
+
const project = await loadProject("./my-agent");
|
|
218
|
+
console.log(project.info.name);
|
|
219
|
+
console.log(project.info.tools.map((tool) => tool.name));
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
`loadProject` throws `ProjectLoadError` when discovery reports an error. Pass `{ strict: true }` to throw on a warning as well. `error.diagnostics` lists the findings. Each `path` is relative to the project directory. A path outside that directory starts with `../`. `loadProject` does not take `importModule`. `serve` still accepts `discovery.importModule` for that override.
|
|
223
|
+
|
|
224
|
+
`info.local` is `{ cwd }` when the project sets a cwd. The serve banner reads `agents[].info`.
|
|
225
|
+
|
|
226
|
+
`serve` accepts that `Project` or a directory path.
|
|
227
|
+
|
|
208
228
|
## Related
|
|
209
229
|
|
|
210
230
|
- [Instructions](./instructions.md): the required half of a minimal
|
|
@@ -117,11 +117,15 @@ Each handler receives the Fetch `Request` and a typed arguments object.
|
|
|
117
117
|
| `purpose` | Use `"eval"` to mark a new session as regression traffic |
|
|
118
118
|
| `dryRun` | Run read tools and stub write tools for a new session |
|
|
119
119
|
| `asOf` | Freeze a new session at an ISO-8601 instant with a timezone |
|
|
120
|
+
| `deliveryId` | Name this send on the session's events, at most 256 characters. Defaults to a fresh `dlv_…` ID |
|
|
120
121
|
|
|
121
122
|
`send` returns a `ChannelSession`. Its `id` identifies the session,
|
|
122
123
|
`continuationToken` contains its current channel key, and `isNew` says
|
|
123
124
|
whether this call created it. A coalesced call also returns
|
|
124
|
-
`coalesced: true`.
|
|
125
|
+
`coalesced: true`. `deliveryId` names this send on the event where the
|
|
126
|
+
message reaches the agent; see
|
|
127
|
+
[Track which follow-up reached the agent](./sessions.md#track-which-follow-up-reached-the-agent).
|
|
128
|
+
A hosted channel's `send` returns the same ID before the session exists.
|
|
125
129
|
|
|
126
130
|
## Events
|
|
127
131
|
|
|
@@ -166,7 +170,7 @@ returns `401`.
|
|
|
166
170
|
| `loopbackOnly()` | Any loopback TCP peer, including local relays that carry forwarding headers |
|
|
167
171
|
| `bearerAuth(tokenOrVerify)` | A matching bearer token, or a token accepted by the verifier |
|
|
168
172
|
| `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 |
|
|
173
|
+
| `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
174
|
| `allowAll()` | Every caller as an anonymous principal |
|
|
171
175
|
| `publicEndpoint()` | Every caller on this custom channel; managed hosting also exposes the route without an alias token |
|
|
172
176
|
|
|
@@ -193,6 +197,7 @@ author their own chain, and `--allow-anonymous` swaps it for
|
|
|
193
197
|
| `@cursor/bdk/channels/github` | `githubChannel()` | GitHub and GitHub Enterprise webhooks. See [GitHub](../guides/github.md) |
|
|
194
198
|
| `@cursor/bdk/channels/gitlab` | `gitlabChannel()` | GitLab.com and self-managed GitLab hooks. See [GitLab](../guides/gitlab.md) |
|
|
195
199
|
| `@cursor/bdk/channels/bitbucket` | `bitbucketChannel()` | Bitbucket Cloud and Data Center hooks. See [Bitbucket](../guides/bitbucket.md) |
|
|
200
|
+
| `@cursor/bdk/channels/pagerduty` | `pagerdutyChannel()` | PagerDuty v3 incident webhooks. Replies post as incident notes only with `deliverReplies: true`. See [PagerDuty](../guides/pagerduty.md) |
|
|
196
201
|
| `@cursor/bdk/channels/deployments` | `deploymentsChannel()` | Deployment events filtered by source, environment, or event name |
|
|
197
202
|
|
|
198
203
|
For other platforms like Discord or Teams, use the authored
|
package/docs/reference/cli.md
CHANGED
|
@@ -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`,
|
package/docs/reference/hooks.md
CHANGED
|
@@ -28,20 +28,26 @@ Author `bot/hooks/<name>.ts` with `defineHook` from
|
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
// bot/hooks/usage.ts
|
|
31
|
+
import { metrics } from "@opentelemetry/api";
|
|
31
32
|
import { defineHook } from "@cursor/bdk/hooks";
|
|
32
33
|
|
|
34
|
+
const meter = metrics.getMeter("acme");
|
|
35
|
+
const inputTokens = meter.createCounter("acme.tokens.input");
|
|
36
|
+
const outputTokens = meter.createCounter("acme.tokens.output");
|
|
37
|
+
const turnFailed = meter.createCounter("acme.turn.failed");
|
|
38
|
+
|
|
33
39
|
export default defineHook({
|
|
34
40
|
events: {
|
|
35
41
|
async "turn.completed"(event, ctx) {
|
|
36
42
|
if (ctx.session.purpose === "eval" || event.data.usage === undefined) {
|
|
37
43
|
return;
|
|
38
44
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
const usage = event.data.usage;
|
|
46
|
+
inputTokens.add(usage.inputTokens);
|
|
47
|
+
outputTokens.add(usage.outputTokens);
|
|
42
48
|
},
|
|
43
49
|
async "turn.failed"(_event, ctx) {
|
|
44
|
-
|
|
50
|
+
turnFailed.add(1, { channel: ctx.channel.id });
|
|
45
51
|
},
|
|
46
52
|
},
|
|
47
53
|
});
|
|
@@ -93,7 +99,6 @@ exported from `@cursor/bdk`.
|
|
|
93
99
|
| `ctx.channel` | `{ id, continuationToken }`. The token is `null` when the session can't take follow-ups |
|
|
94
100
|
| `ctx.host.kv` | Durable JSON, shared by every session of the agent. Prefix keys with `ctx.session.id` for per-session state |
|
|
95
101
|
| `ctx.host.files` | Durable files, bound to this session. Pass `{ scope: "deployment" }` for agent-wide files |
|
|
96
|
-
| `ctx.host.otel` | Counters, histograms, and tags, attributed to this session |
|
|
97
102
|
| `ctx.host.mcp`, `ctx.host.github`, `ctx.host.slack` | The same shared clients tools get |
|
|
98
103
|
| `ctx.host.reminders` | Per-session [reminders](./schedules.md#reminders), the same API tools get |
|
|
99
104
|
| `ctx.artifacts` | Session-bound [artifacts](./artifacts.md) facade: `tag` fills in `sessionId` and `turnId` |
|
|
@@ -64,6 +64,51 @@ the session is already busy depends on the channel:
|
|
|
64
64
|
Pass `admission: "coalesce"` on `send()` to opt into the Slack policy from
|
|
65
65
|
other callers. Omit it (or pass `"preempt"`) to keep interrupt semantics.
|
|
66
66
|
|
|
67
|
+
### Track which follow-up reached the agent
|
|
68
|
+
|
|
69
|
+
Every `send()` returns a `deliveryId`. Pass your own as the `deliveryId`
|
|
70
|
+
option, such as the webhook delivery ID you already hold, or omit it to
|
|
71
|
+
get a fresh `dlv_…` ID. A coalesced follow-up reaches the agent in one of
|
|
72
|
+
two ways, and the ID is on the event for that path:
|
|
73
|
+
|
|
74
|
+
| Path | Event | Field |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Steered into the running turn | `nudge.delivered` | `data.deliveryId` |
|
|
77
|
+
| Fell back to the next turn | That turn's `message.received` | `data.deliveryIds` |
|
|
78
|
+
|
|
79
|
+
`message.received` lists every send its prompt carries, in arrival order.
|
|
80
|
+
Follow-ups queued behind a busy turn drain into one turn, so the list can
|
|
81
|
+
hold several IDs. A direct send that starts a turn gets a one-item list.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// In a route or channel hook: name the steer after the webhook delivery.
|
|
85
|
+
await send(`Incident ${incident.id} was acknowledged.`, {
|
|
86
|
+
continuationToken: incident.id,
|
|
87
|
+
admission: "coalesce",
|
|
88
|
+
deliveryId: webhookId,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// In the channel's `events` map:
|
|
92
|
+
const steered = new Set<string>();
|
|
93
|
+
const prompted = new Set<string>();
|
|
94
|
+
const events: ChannelEventHandlers = {
|
|
95
|
+
"nudge.delivered": async (event) => {
|
|
96
|
+
if (event.data.deliveryId !== undefined) {
|
|
97
|
+
steered.add(event.data.deliveryId);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"message.received": async (event) => {
|
|
101
|
+
for (const id of event.data.deliveryIds ?? []) {
|
|
102
|
+
prompted.add(id);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
A local Slack session can also pick up follow-ups at a tool boundary from
|
|
109
|
+
its own thread store. That `nudge.delivered` has no `deliveryId`, which
|
|
110
|
+
tells it apart from a steered send.
|
|
111
|
+
|
|
67
112
|
`POST /v1/session/:id/stop` interrupts a turn without sending a new
|
|
68
113
|
message. The stream records `turn.failed` with `status: "cancelled"`;
|
|
69
114
|
the session stays a chat session and can take another follow-up. A
|
|
@@ -82,7 +127,7 @@ within one session. The `at` field is an ISO-8601 timestamp.
|
|
|
82
127
|
| Phase | Events | What they tell you |
|
|
83
128
|
| --- | --- | --- |
|
|
84
129
|
| Session | `session.started`, `session.waiting`, `session.completed`, `session.failed` | Session creation, readiness, and task completion |
|
|
85
|
-
| Input | `message.received` | A user message was accepted |
|
|
130
|
+
| Input | `message.received`, `nudge.delivered` | A user message was accepted as a turn's prompt, or reached a running turn mid-turn. Both name the [sends they carry](#track-which-follow-up-reached-the-agent) |
|
|
86
131
|
| Turn | `turn.queued`, `turn.started`, `turn.completed`, `turn.failed` | Queue position under a [`maxRunningTurns` cap](./agent-config.md#concurrency), then turn status, final result, and token usage |
|
|
87
132
|
| Steps | `step.started`, `step.completed` | Model step boundaries and duration |
|
|
88
133
|
| Reasoning | `reasoning.appended`, `reasoning.completed` | Streamed reasoning blocks |
|
package/docs/reference/tools.md
CHANGED
|
@@ -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) |
|
|
@@ -81,9 +82,9 @@ export default defineTool({
|
|
|
81
82
|
`ctx.host` carries the shared host services: `host.mcp` (authored MCP
|
|
82
83
|
connections: `names()`, `listTools(name)`, `callTool(name, tool, args)`),
|
|
83
84
|
`host.github` and `host.slack` (shared platform clients), `host.kv` and
|
|
84
|
-
`host.files` (durable storage), `host.
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
`host.files` (durable storage), and `host.reminders` (per-session wakes,
|
|
86
|
+
when attached). Custom metrics use the
|
|
87
|
+
[OpenTelemetry](../guides/opentelemetry.md) API.
|
|
87
88
|
|
|
88
89
|
### Return values
|
|
89
90
|
|