@cursor/bdk 0.2.23 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -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 +48 -12
- package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +3 -2
- 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/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +10 -19
- package/dist/channels/gitlab/gitlab-channel.js +1 -1
- package/dist/channels/issues/issues-channel.js +1 -1
- package/dist/channels/origin/origin-channel.js +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/tool-approval-events.js +5 -5
- package/dist/channels.d.ts +14 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +24 -9
- package/dist/docs/404.html +3 -3
- package/dist/docs/assets/{app.AXQcJZaf.js → app.BjS1QEI4.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.oGqZumnJ.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.hlZ2vmun.js → VPLocalSearchBox.BOuvjb5Y.js} +2 -2
- package/dist/docs/assets/chunks/{arc.9KNWdH-l.js → arc.3WR6Jf-y.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.BfGzkBHI.js → architectureDiagram-Q4EWVU46.Dtb6Dqh6.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.Btk8-2Rs.js → baseUniq.BUyrgrZE.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BmHm9OH5.js → blockDiagram-DXYQGD6D.BVLV_voZ.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.9POrbDHJ.js → c4Diagram-AHTNJAMY.jXJ1q70M.js} +1 -1
- package/dist/docs/assets/chunks/channel.Dt4aweTm.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.YWZVSM6S.js → chunk-4BX2VUAB.zz1SMBvK.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.Cxr_SFgw.js → chunk-4TB4RGXK.CzYKuv3I.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.DtiJyPlD.js → chunk-55IACEB6.C7_tcJZD.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.b5gNHJPH.js → chunk-EDXVE4YY.DeTwQPVO.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DmN9yA_M.js → chunk-FMBD7UC4.DhMTl7ut.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Dfm3xgV5.js → chunk-OYMX7WX6.Me7f5hEp.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.sXNxDcJA.js → chunk-QZHKN3VN.D0E0Bb6g.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DgBnDUV7.js → chunk-YZCP3GAM.CdOOBFYL.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DGUHZs6j.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DGUHZs6j.js +1 -0
- package/dist/docs/assets/chunks/clone.DWf3k0Z0.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.D18MEcoN.js → cose-bilkent-S5V4N54A.BNbGESzN.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CSf3tihh.js → dagre-KV5264BT.zU7Lu_xJ.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.cbfzAfoC.js → diagram-5BDNPKRD.B9qOdE5h.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.6i6P3uu9.js → diagram-G4DWMVQ6.D8X-sf77.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.B9HAIfN6.js → diagram-MMDJMWI5.CW7MvMlE.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.B9baAjUv.js → diagram-TYMM5635.J489G0Nd.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DaBmX_GN.js → erDiagram-SMLLAGMA.BkW7tGfs.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.CJqQJjkb.js → flowDiagram-DWJPFMVM.jc9iWORD.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.CIXBLQhC.js → ganttDiagram-T4ZO3ILL.B-UQfd9E.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CDgentto.js → gitGraphDiagram-UUTBAWPF.DFzrTSlJ.js} +1 -1
- package/dist/docs/assets/chunks/{graph.BWHn6JBQ.js → graph.C5IB6_e_.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.d9VU_ts_.js → infoDiagram-42DDH7IO.DwF0-c8L.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BNO79Prj.js → ishikawaDiagram-UXIWVN3A.fBaTqzE7.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CPgUTM1R.js → journeyDiagram-VCZTEJTY.CM8gDVJy.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.idl0Eoe1.js → kanban-definition-6JOO6SKY.YiD1p0LB.js} +1 -1
- package/dist/docs/assets/chunks/{layout.BY7DIMr6.js → layout.6Um-DVJT.js} +1 -1
- package/dist/docs/assets/chunks/{linear.DYaUDrHd.js → linear.DcTeg4Hn.js} +1 -1
- package/dist/docs/assets/chunks/{min.V6MWb1UC.js → min.CIxkY8Fe.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BRlJXuFS.js → mindmap-definition-QFDTVHPH.D4QM_voR.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BIhkDLcB.js → pieDiagram-DEJITSTG.nmB309G1.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.Bw-_VEL3.js → quadrantDiagram-34T5L4WZ.D1HtZR3C.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DolEGwxw.js → requirementDiagram-MS252O5E.CZgQWob-.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.hMM-8BhN.js → sankeyDiagram-XADWPNL6.DtiBfU-P.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Bg_CRVDy.js → sequenceDiagram-FGHM5R23.Cld4gDSt.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DNWdl34_.js → stateDiagram-FHFEXIEX.DatP823_.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C0571l4D.js +1 -0
- package/dist/docs/assets/chunks/{theme.CBW1oolh.js → theme.D5jbBys7.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Cr1wJ1mB.js → timeline-definition-GMOUNBTQ.DwQLI2be.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BltDV9j7.js → vennDiagram-DHZGUBPP.a5yMfnsa.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.BWPaUhOs.js → wardley-RL74JXVD.B-FXivgT.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.nsADqCCo.js → wardleyDiagram-NUSXRM2D.Dz--Opy3.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CCwbO3dK.js → xychartDiagram-5P7HB3ND.Dl8w8TeT.js} +1 -1
- package/dist/docs/assets/{deployment.md.CtSJ6sF9.js → deployment.md.3MMWuPeV.js} +5 -5
- package/dist/docs/assets/{deployment.md.CtSJ6sF9.lean.js → deployment.md.3MMWuPeV.lean.js} +1 -1
- package/dist/docs/assets/{guides_cloud-agents.md.CBK7W0-O.js → guides_cloud-agents.md.BzbzcOyj.js} +2 -2
- package/dist/docs/assets/{guides_cloud-agents.md.CBK7W0-O.lean.js → guides_cloud-agents.md.BzbzcOyj.lean.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.ByW1Fs7b.js → guides_opentelemetry.md.DBQtp7_V.js} +13 -5
- package/dist/docs/assets/{guides_opentelemetry.md.ByW1Fs7b.lean.js → guides_opentelemetry.md.DBQtp7_V.lean.js} +1 -1
- 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/{reference_agent-config.md.DYA6ge6t.js → reference_agent-config.md.IplwL25I.js} +1 -2
- package/dist/docs/assets/{reference_agent-config.md.DYA6ge6t.lean.js → reference_agent-config.md.IplwL25I.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.DYg0CLud.js → reference_channels.md.Bxaa020x.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_extensions.md.OUacPetl.js → reference_extensions.md.DKxTuCIw.js} +11 -8
- package/dist/docs/assets/{reference_extensions.md.OUacPetl.lean.js → reference_extensions.md.DKxTuCIw.lean.js} +1 -1
- package/dist/docs/assets/{reference_instructions.md.DrcHZXig.js → reference_instructions.md.BYMVxAkw.js} +4 -4
- package/dist/docs/assets/{reference_instructions.md.DrcHZXig.lean.js → reference_instructions.md.BYMVxAkw.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.BqWnJES4.js → reference_schedules.md.03Ryy9ca.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.08XR7lIl.js → reference_tools.md.-6pypsWt.js} +1 -1
- package/dist/docs/assets/{style.Dwls12uf.css → style.nMsabY-V.css} +1 -1
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
- package/dist/docs/assets/{templates_agentic-owners.md.CvmABtia.lean.js → templates_agentic-owners.md.CTEnR0jp.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/deployment.html +42 -42
- package/dist/docs/deployment.md +9 -4
- 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 +38 -38
- package/dist/docs/guides/cloud-agents.md +1 -0
- 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 +37 -37
- package/dist/docs/guides/improve.html +37 -37
- package/dist/docs/guides/jev.html +37 -37
- package/dist/docs/guides/mcp-oauth.html +37 -37
- package/dist/docs/guides/migrate.html +37 -37
- package/dist/docs/guides/opentelemetry.html +49 -41
- package/dist/docs/guides/opentelemetry.md +54 -3
- package/dist/docs/guides/pagerduty.html +119 -0
- package/dist/docs/guides/pagerduty.md +336 -0
- package/dist/docs/guides/slack.html +37 -37
- 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 +510 -42
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/reference/agent-config.html +38 -39
- package/dist/docs/reference/agent-config.md +0 -1
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/channels.html +38 -38
- package/dist/docs/reference/channels.md +2 -1
- 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 +47 -44
- package/dist/docs/reference/extensions.md +15 -9
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/http-api.html +37 -37
- package/dist/docs/reference/instructions.html +40 -40
- package/dist/docs/reference/instructions.md +5 -1
- 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 +36 -36
- package/dist/docs/reference/skills.html +37 -37
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/tools.html +39 -39
- package/dist/docs/reference/tools.md +1 -0
- package/dist/docs/templates/agentic-owners.html +42 -43
- package/dist/docs/templates/agentic-owners.md +55 -23
- 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 +2 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +2 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +2 -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.js +1 -1
- 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 +1 -1
- package/dist/extensions/jev/tools/evaluate.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- 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/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/builtin-tools/artifacts.d.ts.map +1 -1
- package/dist/internal/builtin-tools/artifacts.js +46 -13
- 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 +21 -12
- 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/convert-automation/convert-workflow.js +1 -1
- package/dist/internal/convert-grokbot/answers.js +1 -1
- 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/backend-client.d.ts +1 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +1 -1
- package/dist/internal/cursor/credentials.d.ts +1 -1
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +1 -1
- package/dist/internal/deploy-client.js +1 -1
- 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 -6
- 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 +66 -0
- package/dist/internal/discovery/cursor-plugin.js +1 -1
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
- package/dist/internal/discovery/extension-overlay.js +2 -6
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +3 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -1
- package/dist/internal/discovery/instructions.js +3 -6
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +3 -6
- 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 +27 -5
- package/dist/internal/discovery/runtime.d.ts.map +1 -1
- package/dist/internal/discovery/runtime.js +8 -8
- 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/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/sdk-schemas.d.ts +1 -1
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -1
- package/dist/internal/filesystem/sdk-schemas.js +5 -4
- package/dist/internal/filesystem/tools.js +1 -1
- 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 +2 -1
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +20 -6
- package/dist/internal/host-platforms.d.ts.map +1 -1
- package/dist/internal/host-platforms.js +8 -2
- package/dist/internal/hosted-delivery-protocol.d.ts +4 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.d.ts +7 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +19 -17
- package/dist/internal/hosting.d.ts +6 -0
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +9 -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 +1 -1
- package/dist/internal/interview/question.d.ts.map +1 -1
- package/dist/internal/interview/question.js +1 -1
- 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 +14 -17
- package/dist/internal/mcp-endpoint.js +1 -1
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +50 -19
- package/dist/internal/otel/config.d.ts +10 -1
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +47 -10
- package/dist/internal/otel/http.d.ts +1 -1
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +1 -1
- package/dist/internal/otel/runtime.d.ts +17 -14
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +203 -237
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +21 -5
- package/dist/internal/process-memory-telemetry.d.ts +1 -1
- package/dist/internal/process-memory-telemetry.d.ts.map +1 -1
- package/dist/internal/process-memory-telemetry.js +1 -1
- package/dist/internal/sdk-runner.d.ts +2 -3
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +30 -6
- 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.map +1 -1
- package/dist/internal/server.js +27 -15
- package/dist/internal/session-engine.d.ts +9 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +30 -4
- 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 +1 -1
- package/dist/internal/update-check.d.ts.map +1 -1
- package/dist/internal/update-check.js +1 -1
- 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/otel.d.ts +1 -2
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +0 -1
- package/dist/playground/assets/cursor-icons-16-DmHBTm1-.woff2 +0 -0
- package/dist/playground/assets/index-BdMwybMt.css +1 -0
- package/dist/playground/assets/index-CHk6O92d.js +62 -0
- package/dist/playground/index.html +2 -2
- package/dist/tools.d.ts +14 -11
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +4 -3
- package/dist/types.d.ts +67 -16
- package/dist/types.d.ts.map +1 -1
- package/docs/deployment.md +9 -4
- package/docs/guides/cloud-agents.md +1 -0
- package/docs/guides/opentelemetry.md +54 -3
- package/docs/guides/pagerduty.md +341 -0
- package/docs/reference/agent-config.md +0 -1
- package/docs/reference/channels.md +2 -1
- package/docs/reference/cli.md +27 -0
- package/docs/reference/extensions.md +15 -9
- package/docs/reference/instructions.md +5 -1
- package/docs/reference/tools.md +1 -0
- package/docs/templates/agentic-owners.md +55 -23
- package/package.json +24 -19
- package/skills/migrate-v2/SKILL.md +1 -1
- package/skills/otel/SKILL.md +24 -7
- 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/dist/docs/assets/chunks/@localSearchIndexroot.B3j7LFef.js +0 -1
- package/dist/docs/assets/chunks/channel.RoCpi7X1.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.oxdmwwqk.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.oxdmwwqk.js +0 -1
- package/dist/docs/assets/chunks/clone.BkguoIMm.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.7W-btjJ2.js +0 -1
- package/dist/docs/assets/templates_agentic-owners.md.CvmABtia.js +0 -14
- package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
- package/dist/playground/assets/index-BtsbIqV9.css +0 -1
- package/dist/playground/assets/index-CD8VRa25.js +0 -71
- /package/dist/docs/assets/{reference_channels.md.DYg0CLud.lean.js → reference_channels.md.Bxaa020x.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.BqWnJES4.lean.js → reference_schedules.md.03Ryy9ca.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.08XR7lIl.lean.js → reference_tools.md.-6pypsWt.lean.js} +0 -0
package/dist/docs/llms-full.txt
CHANGED
|
@@ -235,9 +235,9 @@ agent and doesn't train on it.
|
|
|
235
235
|
Declare the external hosts and secret names the agent needs. Mounted
|
|
236
236
|
extensions add the ones they declare, so list only what your own code
|
|
237
237
|
calls; `bdk info --dir .` shows the combined list and what each mount
|
|
238
|
-
adds.
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
adds. Deploy the agent, then set each value at the hidden prompt.
|
|
239
|
+
The next task uses the new value. You do not deploy again to apply
|
|
240
|
+
that value.
|
|
241
241
|
|
|
242
242
|
```ts
|
|
243
243
|
// bot/agent.ts
|
|
@@ -252,9 +252,9 @@ export default defineAgent({
|
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
```text
|
|
255
|
+
bdk deploy --dir . --slug weather-agent
|
|
255
256
|
bdk secrets set weather-agent WEATHER_API_KEY
|
|
256
257
|
bdk secrets list weather-agent
|
|
257
|
-
bdk deploy --dir . --slug weather-agent
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
Commit secret names, never values. `secrets set` accepts names and reads
|
|
@@ -268,6 +268,11 @@ loading sees nothing. Read a secret inside the handler, tool, or callback
|
|
|
268
268
|
that needs it, and give an MCP connection its credential as a `${NAME}`
|
|
269
269
|
template, which resolves when the connection opens. See
|
|
270
270
|
[credentials in headers and env](/docs/reference/connections.md#credentials-in-headers-and-env).
|
|
271
|
+
|
|
272
|
+
`bdk deploy` runs the top-level code in your files one time to build
|
|
273
|
+
the snapshot. No secrets exist at that time. The snapshot keeps those
|
|
274
|
+
values.
|
|
275
|
+
|
|
271
276
|
SCM webhook channels go one step further and name their secrets in the
|
|
272
277
|
channel definition, as `{ secretName: "GITHUB_WEBHOOK_SECRET" }`, so the
|
|
273
278
|
platform can verify each delivery's signature before any compute starts.
|
|
@@ -1225,6 +1230,7 @@ their own.
|
|
|
1225
1230
|
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1226
1231
|
| `cloud` | Launch defaults for repositories, environment, and pull request behavior. |
|
|
1227
1232
|
| `cloud.repos` | The repositories the agent may hand work to, with a default branch or pull request for each. Without it, launches run with no repository and the model can't name one, so secrets in `cloud.envVars` never reach a repository you didn't list. |
|
|
1233
|
+
| `cloud.teamMcpServers` | The team MCP servers, by name, that launched agents may use (up to 50 names, matched case-insensitively; every team server with a listed name is kept). Every other team server is left out. Personal servers and `cloud.mcpServers` aren't filtered. Omit it to give agents every team server the launching account can use. |
|
|
1228
1234
|
| `model` | The model launched agents run. Omit it to use the account default. |
|
|
1229
1235
|
| `apiKey` | A Cursor API key to launch with instead of the host's own. |
|
|
1230
1236
|
|
|
@@ -3387,6 +3393,10 @@ export OTEL_SERVICE_NAME=incident-agent
|
|
|
3387
3393
|
bdk serve --dir . --dev
|
|
3388
3394
|
```
|
|
3389
3395
|
|
|
3396
|
+
Metrics use delta temporality by default. For Grafana Cloud, set
|
|
3397
|
+
`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` to `cumulative`.
|
|
3398
|
+
Grafana Cloud rejects delta metrics.
|
|
3399
|
+
|
|
3390
3400
|
The default protocol is OTLP/HTTP protobuf. If you already call
|
|
3391
3401
|
`serve()` from TypeScript, you can configure the same destination in
|
|
3392
3402
|
code:
|
|
@@ -3415,6 +3425,52 @@ application starts the server itself. When that application
|
|
|
3415
3425
|
already uses OpenTelemetry, BDK sends its traces, metrics, and
|
|
3416
3426
|
logs to the collector configured here.
|
|
3417
3427
|
|
|
3428
|
+
## Export from a hosted agent
|
|
3429
|
+
|
|
3430
|
+
Set the collector endpoint and headers as secrets, and add the
|
|
3431
|
+
collector host to `hosting.egressDomains`. The host is a hostname
|
|
3432
|
+
with no scheme and no path. The first request loads the secrets,
|
|
3433
|
+
and export starts with those headers.
|
|
3434
|
+
|
|
3435
|
+
```ts
|
|
3436
|
+
// bot/agent.ts
|
|
3437
|
+
import { defineAgent } from "@cursor/bdk";
|
|
3438
|
+
|
|
3439
|
+
export default defineAgent({
|
|
3440
|
+
hosting: {
|
|
3441
|
+
egressDomains: ["otlp-gateway-prod-us-east-0.grafana.net"],
|
|
3442
|
+
secretNames: ["OTEL_EXPORTER_OTLP_ENDPOINT", "OTEL_EXPORTER_OTLP_HEADERS"],
|
|
3443
|
+
},
|
|
3444
|
+
});
|
|
3445
|
+
```
|
|
3446
|
+
|
|
3447
|
+
```bash
|
|
3448
|
+
bdk secrets set my-agent OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_HEADERS
|
|
3449
|
+
```
|
|
3450
|
+
|
|
3451
|
+
`OTEL_EXPORTER_OTLP_HEADERS` is a comma-separated list of
|
|
3452
|
+
`name=value` pairs. Each value is URL-encoded, so a space is
|
|
3453
|
+
`%20` (`Authorization=Basic%20...`).
|
|
3454
|
+
|
|
3455
|
+
A later `bdk secrets set` changes the headers on the next export.
|
|
3456
|
+
You do not redeploy to rotate a token. The URL, service name,
|
|
3457
|
+
resource attributes, signals, sample ratio, metric export interval,
|
|
3458
|
+
and metrics temporality stay as they were on the first export.
|
|
3459
|
+
Redeploy to change one of those. BDK logs a warning when one of them
|
|
3460
|
+
changes on a running agent.
|
|
3461
|
+
|
|
3462
|
+
When an exporter host is missing from `hosting.egressDomains`, BDK
|
|
3463
|
+
logs an error that names the host. Add the host and redeploy.
|
|
3464
|
+
|
|
3465
|
+
Spans and metrics from before the first request are not exported,
|
|
3466
|
+
including spans from channel `onStart`. If the OpenTelemetry config
|
|
3467
|
+
fails, BDK logs the error and the request still completes.
|
|
3468
|
+
|
|
3469
|
+
Logs stay off until `serve({ otel })` sets `logs`, or until
|
|
3470
|
+
`OTEL_LOGS_EXPORTER` is `otlp`. Prompt text and tool payloads stay
|
|
3471
|
+
off until you set `OTEL_LOG_USER_PROMPTS` or
|
|
3472
|
+
`OTEL_LOG_TOOL_CONTENT`.
|
|
3473
|
+
|
|
3418
3474
|
## Follow one conversation
|
|
3419
3475
|
|
|
3420
3476
|
Copy the complete session ID from the playground or session API, then
|
|
@@ -3516,7 +3572,8 @@ The first metrics to look for are `cursor.token.usage`,
|
|
|
3516
3572
|
## Control what leaves the process
|
|
3517
3573
|
|
|
3518
3574
|
Traces include structure, tool names, usage metrics, and span
|
|
3519
|
-
status. A failed tool's status
|
|
3575
|
+
status. A failed tool's span status and its `action.result` log
|
|
3576
|
+
include a short failure reason.
|
|
3520
3577
|
A tool or subagent that is still open when the turn ends gets
|
|
3521
3578
|
ERROR status with the reason `no result`. User prompts, tool
|
|
3522
3579
|
arguments, and full tool results stay off the wire until you opt in.
|
|
@@ -3543,13 +3600,354 @@ The same controls are available as
|
|
|
3543
3600
|
configuration and custom-metric reference for coding agents
|
|
3544
3601
|
- [Hooks](/docs/reference/hooks.md): emit domain telemetry from session
|
|
3545
3602
|
events
|
|
3546
|
-
- [Deployment](/docs/deployment.md):
|
|
3547
|
-
on
|
|
3603
|
+
- [Deployment](/docs/deployment.md): declare `hosting.egressDomains`
|
|
3604
|
+
and set collector secrets on a hosted agent
|
|
3548
3605
|
- [Cursor enterprise OpenTelemetry Export](https://cursor.com/docs/enterprise/opentelemetry-export):
|
|
3549
3606
|
send organization-wide Cursor telemetry to the same collector
|
|
3550
3607
|
|
|
3551
3608
|
---
|
|
3552
3609
|
|
|
3610
|
+
Source: /docs/guides/pagerduty.md
|
|
3611
|
+
|
|
3612
|
+
# PagerDuty agents
|
|
3613
|
+
|
|
3614
|
+
A PagerDuty agent wakes when an incident triggers, investigates it, and
|
|
3615
|
+
writes what it found back to the incident. `pagerdutyChannel()` receives
|
|
3616
|
+
PagerDuty's v3 webhooks, verifies them, and keeps every later event for
|
|
3617
|
+
the same incident in one session, so the agent sees an acknowledgement,
|
|
3618
|
+
a note, or a responder's reply in the context of the investigation it
|
|
3619
|
+
already started. Every setting has a default read from a well-known secret, so
|
|
3620
|
+
the channel needs no configuration beyond its hooks; see
|
|
3621
|
+
[Connect](#connect) for the variables.
|
|
3622
|
+
|
|
3623
|
+
## Investigate a new incident
|
|
3624
|
+
|
|
3625
|
+
When an incident triggers, the agent starts a turn with the incident's
|
|
3626
|
+
title, service, urgency, and link. It reads whatever the investigation
|
|
3627
|
+
needs, and with `deliverReplies: true` its reply is posted as a note on
|
|
3628
|
+
the incident, where the person on call already looks.
|
|
3629
|
+
|
|
3630
|
+
```ts
|
|
3631
|
+
// bot/channels/pagerduty.ts
|
|
3632
|
+
import { defaultPagerDutyAuth, pagerdutyChannel } from "@cursor/bdk/channels/pagerduty";
|
|
3633
|
+
|
|
3634
|
+
export default pagerdutyChannel({
|
|
3635
|
+
deliverReplies: true,
|
|
3636
|
+
onIncident: (ctx, event) => {
|
|
3637
|
+
if (event.eventType !== "incident.triggered") {
|
|
3638
|
+
return null;
|
|
3639
|
+
}
|
|
3640
|
+
return {
|
|
3641
|
+
// `auth` starts a model turn running as the event's PagerDuty actor.
|
|
3642
|
+
auth: defaultPagerDutyAuth(ctx),
|
|
3643
|
+
message: `Investigate PagerDuty incident #${event.incident.number}: ${event.incident.title}`,
|
|
3644
|
+
context: [`Service: ${event.incident.service?.summary ?? "unknown"}`],
|
|
3645
|
+
};
|
|
3646
|
+
},
|
|
3647
|
+
});
|
|
3648
|
+
```
|
|
3649
|
+
|
|
3650
|
+
Reply notes are off unless you set `deliverReplies: true`, so the channel
|
|
3651
|
+
writes nothing to PagerDuty on its own. An agent that writes to PagerDuty
|
|
3652
|
+
through its own path, such as a service that audits each write, leaves it
|
|
3653
|
+
off and posts only what it chooses, from `events` or `ctx.pagerduty`.
|
|
3654
|
+
|
|
3655
|
+
With `deliverReplies: true`, the channel posts each completed reply as a
|
|
3656
|
+
note on the session's incident, and a short note if a turn fails, using
|
|
3657
|
+
the `PAGERDUTY_TOKEN` secret. The note goes to the incident in the
|
|
3658
|
+
verified event's state, so the model never chooses which incident it
|
|
3659
|
+
writes to. Eval runs and agents without a token post nothing. Nothing is
|
|
3660
|
+
posted until the channel knows the agent's own PagerDuty user (see
|
|
3661
|
+
[Ignore your own actions](#ignore-your-own-actions)), because each note
|
|
3662
|
+
comes back as a webhook event that only the echo skip keeps from starting
|
|
3663
|
+
another turn. Handlers you write in `events` replace the built-in ones.
|
|
3664
|
+
|
|
3665
|
+
Hooks also get `ctx.pagerduty`, a REST client with the channel's
|
|
3666
|
+
credentials, for reads and writes of their own:
|
|
3667
|
+
|
|
3668
|
+
```ts
|
|
3669
|
+
onIncident: async (ctx, event) => {
|
|
3670
|
+
const incident = await ctx.pagerduty.getIncident(event.incident.id);
|
|
3671
|
+
// …
|
|
3672
|
+
},
|
|
3673
|
+
```
|
|
3674
|
+
|
|
3675
|
+
Hosted, the agent also declares PagerDuty's API host and the token:
|
|
3676
|
+
|
|
3677
|
+
```ts
|
|
3678
|
+
// bot/agent.ts
|
|
3679
|
+
import { defineAgent } from "@cursor/bdk";
|
|
3680
|
+
|
|
3681
|
+
export default defineAgent({
|
|
3682
|
+
architecture: "v2",
|
|
3683
|
+
hosting: {
|
|
3684
|
+
egressDomains: ["api.pagerduty.com"],
|
|
3685
|
+
secretNames: ["PAGERDUTY_TOKEN"],
|
|
3686
|
+
},
|
|
3687
|
+
});
|
|
3688
|
+
```
|
|
3689
|
+
|
|
3690
|
+
## Follow the incident in one session
|
|
3691
|
+
|
|
3692
|
+
People act on an incident while the agent investigates: someone
|
|
3693
|
+
acknowledges it, adds a note, pulls in a responder, or resolves it.
|
|
3694
|
+
Return a dispatch for those events too, and each one arrives in the
|
|
3695
|
+
session that is already working on the incident, with the earlier
|
|
3696
|
+
findings in context.
|
|
3697
|
+
|
|
3698
|
+
```ts
|
|
3699
|
+
onIncident: (ctx, event) => {
|
|
3700
|
+
const followUps = ["incident.acknowledged", "incident.reassigned", "incident.resolved"];
|
|
3701
|
+
if (event.eventType !== "incident.triggered" && !followUps.includes(event.eventType)) {
|
|
3702
|
+
return null;
|
|
3703
|
+
}
|
|
3704
|
+
return {
|
|
3705
|
+
auth: defaultPagerDutyAuth(ctx),
|
|
3706
|
+
message: `${event.eventType} by ${ctx.agent?.summary ?? "PagerDuty"}`,
|
|
3707
|
+
};
|
|
3708
|
+
},
|
|
3709
|
+
onNote: (ctx, note) => {
|
|
3710
|
+
return {
|
|
3711
|
+
auth: defaultPagerDutyAuth(ctx),
|
|
3712
|
+
message: `Note on the incident: ${note.content}`,
|
|
3713
|
+
};
|
|
3714
|
+
},
|
|
3715
|
+
```
|
|
3716
|
+
|
|
3717
|
+
Add these to the same `pagerdutyChannel()` declaration as the
|
|
3718
|
+
investigation handler.
|
|
3719
|
+
|
|
3720
|
+
## Ignore your own actions
|
|
3721
|
+
|
|
3722
|
+
PagerDuty sends the agent's own changes back as webhook events: the
|
|
3723
|
+
note it posted, or an acknowledgement or resolve made through its
|
|
3724
|
+
PagerDuty user. The channel acknowledges those events without running a
|
|
3725
|
+
hook or starting a turn. The same action by a person is still delivered.
|
|
3726
|
+
|
|
3727
|
+
The channel finds the agent's user in this order, on each delivery:
|
|
3728
|
+
|
|
3729
|
+
1. The `selfUserIds` option, when you pass one. Nothing below is used.
|
|
3730
|
+
2. The `PAGERDUTY_USER_ID` secret: one PagerDuty user id.
|
|
3731
|
+
3. The user `PAGERDUTY_TOKEN` acts as, which PagerDuty reports at
|
|
3732
|
+
`GET /users/me`.
|
|
3733
|
+
|
|
3734
|
+
When none of these names a user, echo skip is off. `bdk deploy` warns
|
|
3735
|
+
while neither `PAGERDUTY_USER_ID` nor `PAGERDUTY_TOKEN` is set, and the
|
|
3736
|
+
agent logs a warning when its token names no single user.
|
|
3737
|
+
|
|
3738
|
+
Inference depends on the kind of token:
|
|
3739
|
+
|
|
3740
|
+
| `PAGERDUTY_TOKEN` | Inferred user |
|
|
3741
|
+
| --- | --- |
|
|
3742
|
+
| User token REST API key | The key's own user |
|
|
3743
|
+
| OAuth user token (Classic User OAuth or Scoped OAuth), written as `Bearer <token>` | The user who authorized the app |
|
|
3744
|
+
| General access (account-level) REST API key | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
|
|
3745
|
+
| Scoped OAuth app token (client credentials) | The user whose email is exactly `PAGERDUTY_FROM_EMAIL`, if set |
|
|
3746
|
+
|
|
3747
|
+
PagerDuty serves
|
|
3748
|
+
[`GET /users/me`](https://developer.pagerduty.com/api-reference/0b6f8b0c3e8d1-get-the-current-user)
|
|
3749
|
+
only to a user-level API key or a token from an OAuth flow, not to an
|
|
3750
|
+
account-level key. An app token
|
|
3751
|
+
[acts as the app](https://docs.pagerduty.com/developer/private-apps),
|
|
3752
|
+
not as a user. With either, the channel looks up `PAGERDUTY_FROM_EMAIL`,
|
|
3753
|
+
the `From` user the token writes as, through `GET /users?query=` and uses
|
|
3754
|
+
the one user whose email matches exactly. The inferred id is kept in the
|
|
3755
|
+
agent's memory for an hour per token, never in agent storage, and an
|
|
3756
|
+
unresolved answer is retried after five minutes. Hosted, the lookup needs
|
|
3757
|
+
`api.pagerduty.com` (or your `PAGERDUTY_API_BASE_URL` host) in
|
|
3758
|
+
`hosting.egressDomains`, the same entry write-backs need.
|
|
3759
|
+
|
|
3760
|
+
A read-only agent with no token sets the id directly:
|
|
3761
|
+
|
|
3762
|
+
```bash
|
|
3763
|
+
bdk secrets set incident-responder PAGERDUTY_USER_ID
|
|
3764
|
+
```
|
|
3765
|
+
|
|
3766
|
+
`PAGERDUTY_USER_ID` holds one id because a deployment has one token
|
|
3767
|
+
and so acts as one PagerDuty user. To skip several users, or to keep the
|
|
3768
|
+
id in code, pass `selfUserIds`:
|
|
3769
|
+
|
|
3770
|
+
```ts
|
|
3771
|
+
export default pagerdutyChannel({
|
|
3772
|
+
selfUserIds: ["PBOT001"],
|
|
3773
|
+
onIncident: (ctx) => ({ auth: defaultPagerDutyAuth(ctx) }),
|
|
3774
|
+
});
|
|
3775
|
+
```
|
|
3776
|
+
|
|
3777
|
+
`selfUserIds: { secretName: "OTHER_NAME" }` reads one id from another
|
|
3778
|
+
secret and never falls back to inference.
|
|
3779
|
+
|
|
3780
|
+
## Events
|
|
3781
|
+
|
|
3782
|
+
Each hook receives one family of v3 events:
|
|
3783
|
+
|
|
3784
|
+
| Hook | Events |
|
|
3785
|
+
| --- | --- |
|
|
3786
|
+
| `onIncident` | `incident.triggered`, `.acknowledged`, `.unacknowledged`, `.escalated`, `.reassigned`, `.delegated`, `.resolved`, `.reopened`, `.priority_updated`, `.incident_type.changed` |
|
|
3787
|
+
| `onNote` | `incident.annotated` |
|
|
3788
|
+
| `onResponder` | `incident.responder.added`, `incident.responder.replied` |
|
|
3789
|
+
| `onEvent` | Everything else, such as status updates and workflow events |
|
|
3790
|
+
|
|
3791
|
+
Without `onIncident`, a triggered or reopened incident starts a turn and
|
|
3792
|
+
other lifecycle events are acknowledged. Notes, responder events, and
|
|
3793
|
+
the rest are acknowledged until you add their hook. Each hook returns
|
|
3794
|
+
one of three decisions:
|
|
3795
|
+
|
|
3796
|
+
| Return | What happens |
|
|
3797
|
+
| --- | --- |
|
|
3798
|
+
| `{ auth }` | Start or continue a model turn as the event's actor |
|
|
3799
|
+
| `{ task }` | Acknowledge the webhook, then run host code that may also call `send` |
|
|
3800
|
+
| `null` | Skip the event |
|
|
3801
|
+
|
|
3802
|
+
## Incident affinity
|
|
3803
|
+
|
|
3804
|
+
Every event for one incident joins one session, keyed on the incident
|
|
3805
|
+
id. Lifecycle events carry the incident, and notes and responder events
|
|
3806
|
+
name it by reference, so all of them reach the same session.
|
|
3807
|
+
|
|
3808
|
+
A re-trigger after a resolve is a new PagerDuty incident, so it starts a
|
|
3809
|
+
new session. `ctx.incidentKey` carries the dedup key of the alert that
|
|
3810
|
+
opened an incident (its `incident_key`, set per alert by a Datadog
|
|
3811
|
+
monitor, a Sentry issue, or a Grafana rule), for an agent that wants to
|
|
3812
|
+
recall what it found the last time the same alert fired.
|
|
3813
|
+
|
|
3814
|
+
## Connect
|
|
3815
|
+
|
|
3816
|
+
Create a v3 webhook subscription in PagerDuty for the services that
|
|
3817
|
+
should wake the agent, and point it at
|
|
3818
|
+
`https://<your-host>/<slug>/v1/channels/pagerduty`. Then set the
|
|
3819
|
+
channel's secrets on the deployment. Locally the same names are
|
|
3820
|
+
environment variables.
|
|
3821
|
+
|
|
3822
|
+
| Variable | Used for | Override |
|
|
3823
|
+
| --- | --- | --- |
|
|
3824
|
+
| `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 }` |
|
|
3825
|
+
| `PAGERDUTY_USER_ID` | Skipping the agent's own actions: its PagerDuty user id. Optional when `PAGERDUTY_TOKEN` names a user | `selfUserIds: [ids]` or `{ secretName }` |
|
|
3826
|
+
| `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 }` |
|
|
3827
|
+
| `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 }` |
|
|
3828
|
+
| `PAGERDUTY_API_BASE_URL` | The REST host, such as `https://api.eu.pagerduty.com`. Defaults to `https://api.pagerduty.com` | `apiBaseUrl` |
|
|
3829
|
+
|
|
3830
|
+
Set `token`, `from`, and `apiBaseUrl` on `pagerdutyChannel()`; they cover
|
|
3831
|
+
reply notes, `ctx.pagerduty`, and inference. `createPagerDutyClient()`
|
|
3832
|
+
takes the same options for code outside the channel.
|
|
3833
|
+
|
|
3834
|
+
```bash
|
|
3835
|
+
bdk deploy --dir . --slug incident-responder
|
|
3836
|
+
bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET PAGERDUTY_TOKEN
|
|
3837
|
+
bdk secrets list incident-responder
|
|
3838
|
+
```
|
|
3839
|
+
|
|
3840
|
+
`bdk deploy` warns until `PAGERDUTY_WEBHOOK_SECRET` is set, and until
|
|
3841
|
+
either `PAGERDUTY_USER_ID` or `PAGERDUTY_TOKEN` is. The next delivery
|
|
3842
|
+
uses a new value without another deploy.
|
|
3843
|
+
|
|
3844
|
+
### Several subscriptions
|
|
3845
|
+
|
|
3846
|
+
PagerDuty gives each webhook subscription its own signing secret, so an
|
|
3847
|
+
agent fed by several subscriptions (one per service, say) needs all of
|
|
3848
|
+
them. Put them in `PAGERDUTY_WEBHOOK_SECRET`, one per line:
|
|
3849
|
+
|
|
3850
|
+
```text
|
|
3851
|
+
<signing secret of subscription 1>
|
|
3852
|
+
<signing secret of subscription 2>
|
|
3853
|
+
```
|
|
3854
|
+
|
|
3855
|
+
A delivery is admitted when any `v1=` signature in its
|
|
3856
|
+
`X-PagerDuty-Signature` header matches any line. Each line is trimmed,
|
|
3857
|
+
blank lines are ignored, and a value without a line break is one secret,
|
|
3858
|
+
used as-is. The value holds at most 32 secrets. Past that, every delivery
|
|
3859
|
+
is rejected rather than checked against only some of them.
|
|
3860
|
+
|
|
3861
|
+
Keep the list in a file, since `bdk secrets list` never shows values,
|
|
3862
|
+
and set it from stdin, which keeps the line breaks:
|
|
3863
|
+
|
|
3864
|
+
```bash
|
|
3865
|
+
bdk secrets set incident-responder PAGERDUTY_WEBHOOK_SECRET < pagerduty-webhook-secrets.txt
|
|
3866
|
+
```
|
|
3867
|
+
|
|
3868
|
+
Rotate by adding before removing. Add the new secret as a line before
|
|
3869
|
+
PagerDuty starts signing with it, for example before creating the
|
|
3870
|
+
replacement subscription. Remove the old line only once nothing signs
|
|
3871
|
+
with the old secret, for example after deleting the subscription it
|
|
3872
|
+
replaced. While both are live, a delivery signed with either secret
|
|
3873
|
+
verifies, including one whose header carries both signatures. Removing
|
|
3874
|
+
the old line first rejects those deliveries until the new one is added.
|
|
3875
|
+
|
|
3876
|
+
The same format works for every `hmacSignatureAuth()` secret, including
|
|
3877
|
+
`GITHUB_WEBHOOK_SECRET` and `BITBUCKET_WEBHOOK_SECRET`. It needs
|
|
3878
|
+
`@cursor/bdk` 0.2.25 or later. Earlier versions check the signature again
|
|
3879
|
+
in the agent with the whole value as one secret, so they reject every
|
|
3880
|
+
delivery once the value has a second line.
|
|
3881
|
+
|
|
3882
|
+
Only signature checks read the value as a list. Everywhere else it is
|
|
3883
|
+
used whole: a `sharedSecretAuth()` header compares the entire value, and
|
|
3884
|
+
a `${NAME}` template in an MCP connection's `headers` would put the line
|
|
3885
|
+
breaks into the header. Keep a list secret for webhook signing only.
|
|
3886
|
+
|
|
3887
|
+
Until `PAGERDUTY_WEBHOOK_SECRET` is set, the route accepts only local
|
|
3888
|
+
traffic: loopback deliveries under `bdk dev`, nothing in production.
|
|
3889
|
+
|
|
3890
|
+
## Test locally
|
|
3891
|
+
|
|
3892
|
+
`bdk pagerduty replay` posts synthesized v3 deliveries for one incident
|
|
3893
|
+
to the running agent, in order. With `PAGERDUTY_WEBHOOK_SECRET` unset,
|
|
3894
|
+
`bdk dev` admits them unsigned from loopback; with it set, replay signs
|
|
3895
|
+
them the way PagerDuty does:
|
|
3896
|
+
|
|
3897
|
+
```bash
|
|
3898
|
+
bdk dev &
|
|
3899
|
+
bdk pagerduty replay --events triggered,acknowledged,annotated,resolved \
|
|
3900
|
+
--comment "Rolled back the 09:30 deploy."
|
|
3901
|
+
```
|
|
3902
|
+
|
|
3903
|
+
The trigger comes from PagerDuty itself, and the later events come from a
|
|
3904
|
+
person, so each one joins the session the trigger started. Pass an
|
|
3905
|
+
incident id to start another session, `--dry-run` to print the bodies,
|
|
3906
|
+
or `--out fixtures/pagerduty` to save them as fixtures for
|
|
3907
|
+
[evals](/docs/evals.md). `bdk pagerduty events` lists the channels and the
|
|
3908
|
+
events each accepts.
|
|
3909
|
+
|
|
3910
|
+
To post a real delivery saved from the webhook's delivery log, sign it
|
|
3911
|
+
with the secret:
|
|
3912
|
+
|
|
3913
|
+
```bash
|
|
3914
|
+
export PAGERDUTY_WEBHOOK_SECRET=local-test-secret
|
|
3915
|
+
bdk dev &
|
|
3916
|
+
|
|
3917
|
+
body=fixtures/pagerduty/incident-triggered.json
|
|
3918
|
+
signature=$(openssl dgst -sha256 -hmac "$PAGERDUTY_WEBHOOK_SECRET" -hex < "$body" | awk '{print $NF}')
|
|
3919
|
+
curl -X POST http://127.0.0.1:3000/v1/channels/pagerduty \
|
|
3920
|
+
-H 'content-type: application/json' \
|
|
3921
|
+
-H "x-pagerduty-signature: v1=$signature" \
|
|
3922
|
+
--data-binary @"$body"
|
|
3923
|
+
```
|
|
3924
|
+
|
|
3925
|
+
Set `event.agent.id` in a saved body to the agent's own user id to see
|
|
3926
|
+
the delivery skipped as an echo.
|
|
3927
|
+
|
|
3928
|
+
## Practices
|
|
3929
|
+
|
|
3930
|
+
- Write back from host code with the incident in channel state or
|
|
3931
|
+
`ctx`, never from an incident id the model produced.
|
|
3932
|
+
|
|
3933
|
+
- Make sure the agent knows its own user before it acts on incidents, so
|
|
3934
|
+
its own notes and resolves do not wake it again: a user-level token, a
|
|
3935
|
+
`PAGERDUTY_FROM_EMAIL` with an account-level key, or `PAGERDUTY_USER_ID`.
|
|
3936
|
+
|
|
3937
|
+
- Scope the webhook subscription to the services the agent responds to;
|
|
3938
|
+
every delivery it sends reaches the channel.
|
|
3939
|
+
|
|
3940
|
+
## Related
|
|
3941
|
+
|
|
3942
|
+
- [Channels reference](/docs/reference/channels.md): channel hooks,
|
|
3943
|
+
dispatch decisions, and session behavior
|
|
3944
|
+
- [Webhooks and custom channels](/docs/guides/webhooks.md): direct webhook auth
|
|
3945
|
+
and reply delivery
|
|
3946
|
+
- [Evals](/docs/evals.md): turn saved PagerDuty payloads into regression
|
|
3947
|
+
fixtures
|
|
3948
|
+
|
|
3949
|
+
---
|
|
3950
|
+
|
|
3553
3951
|
Source: /docs/guides/slack.md
|
|
3554
3952
|
|
|
3555
3953
|
# Slack agents
|
|
@@ -4836,7 +5234,6 @@ import { serve } from "@cursor/bdk";
|
|
|
4836
5234
|
|
|
4837
5235
|
const handle = await serve("./my-agent", {
|
|
4838
5236
|
port: 3000,
|
|
4839
|
-
apiKey: process.env.CURSOR_API_KEY,
|
|
4840
5237
|
});
|
|
4841
5238
|
console.log(`listening on ${handle.url}`);
|
|
4842
5239
|
// handle.callTool(...), handle.dispatchSchedule("heartbeat"),
|
|
@@ -5142,7 +5539,7 @@ returns `401`.
|
|
|
5142
5539
|
| `loopbackOnly()` | Any loopback TCP peer, including local relays that carry forwarding headers |
|
|
5143
5540
|
| `bearerAuth(tokenOrVerify)` | A matching bearer token, or a token accepted by the verifier |
|
|
5144
5541
|
| `sharedSecretAuth({ header, secret })` | A header matching the named environment or deployment secret |
|
|
5145
|
-
| `hmacSignatureAuth({ header, secret, prefix? })` | A hex HMAC-SHA256 signature over the raw body using the named secret |
|
|
5542
|
+
| `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) |
|
|
5146
5543
|
| `allowAll()` | Every caller as an anonymous principal |
|
|
5147
5544
|
| `publicEndpoint()` | Every caller on this custom channel; managed hosting also exposes the route without an alias token |
|
|
5148
5545
|
|
|
@@ -5169,6 +5566,7 @@ author their own chain, and `--allow-anonymous` swaps it for
|
|
|
5169
5566
|
| `@cursor/bdk/channels/github` | `githubChannel()` | GitHub and GitHub Enterprise webhooks. See [GitHub](/docs/guides/github.md) |
|
|
5170
5567
|
| `@cursor/bdk/channels/gitlab` | `gitlabChannel()` | GitLab.com and self-managed GitLab hooks. See [GitLab](/docs/guides/gitlab.md) |
|
|
5171
5568
|
| `@cursor/bdk/channels/bitbucket` | `bitbucketChannel()` | Bitbucket Cloud and Data Center hooks. See [Bitbucket](/docs/guides/bitbucket.md) |
|
|
5569
|
+
| `@cursor/bdk/channels/pagerduty` | `pagerdutyChannel()` | PagerDuty v3 incident webhooks. Replies post as incident notes only with `deliverReplies: true`. See [PagerDuty](/docs/guides/pagerduty.md) |
|
|
5172
5570
|
| `@cursor/bdk/channels/deployments` | `deploymentsChannel()` | Deployment events filtered by source, environment, or event name |
|
|
5173
5571
|
|
|
5174
5572
|
For other platforms like Discord or Teams, use the authored
|
|
@@ -6214,6 +6612,33 @@ follow the GitHub replay contract.
|
|
|
6214
6612
|
|
|
6215
6613
|
See [Bitbucket](/docs/guides/bitbucket.md) for Cloud and Data Center setup.
|
|
6216
6614
|
|
|
6615
|
+
### Test PagerDuty webhooks {#pagerduty}
|
|
6616
|
+
|
|
6617
|
+
```text
|
|
6618
|
+
bdk pagerduty replay [incident-id]
|
|
6619
|
+
[--events a,b,c | '*'] [--comment <body>]
|
|
6620
|
+
[--dir <path>] [--slug <slug>] [--channel <id>]
|
|
6621
|
+
[--url <url>] [--host <host>] [--port <n>]
|
|
6622
|
+
[--secret <secret>] [--dry-run] [--out <dir>] [--json]
|
|
6623
|
+
bdk pagerduty events [--dir <path>] [--host <host>] [--port <n>] [--json]
|
|
6624
|
+
```
|
|
6625
|
+
|
|
6626
|
+
| Subcommand | Contract |
|
|
6627
|
+
| --- | --- |
|
|
6628
|
+
| `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. |
|
|
6629
|
+
| `events` | List discovered PagerDuty channel URLs and event types. |
|
|
6630
|
+
|
|
6631
|
+
Replay supports `incident.triggered`, `.acknowledged`, `.annotated`,
|
|
6632
|
+
`.escalated`, `.resolved`, and `.reopened`, by full name or by action alone
|
|
6633
|
+
(`resolved`). It needs no PagerDuty account. The incident id defaults to
|
|
6634
|
+
`PREPLAY1`, and `--comment` is the note body for `annotated`. `--secret`
|
|
6635
|
+
defaults to `PAGERDUTY_WEBHOOK_SECRET`, signing with its first line when it
|
|
6636
|
+
lists several; without either the deliveries are unsigned, which `bdk dev`
|
|
6637
|
+
admits from loopback. `--dry-run` and `--out`
|
|
6638
|
+
follow the GitHub replay contract.
|
|
6639
|
+
|
|
6640
|
+
See [PagerDuty](/docs/guides/pagerduty.md) for channel setup.
|
|
6641
|
+
|
|
6217
6642
|
## Environment variables
|
|
6218
6643
|
|
|
6219
6644
|
Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
|
|
@@ -6904,10 +7329,13 @@ import ci from "@acme/ci-triage";
|
|
|
6904
7329
|
|
|
6905
7330
|
export default ci({
|
|
6906
7331
|
org: "acme",
|
|
6907
|
-
token: process.env.BUILDKITE_TOKEN,
|
|
7332
|
+
token: () => process.env.BUILDKITE_TOKEN ?? "",
|
|
6908
7333
|
});
|
|
6909
7334
|
```
|
|
6910
7335
|
|
|
7336
|
+
Pass `token` as a function so a tool can call it. The function reads
|
|
7337
|
+
`BUILDKITE_TOKEN` when the tool calls it.
|
|
7338
|
+
|
|
6911
7339
|
The extension validates its configuration while the project loads.
|
|
6912
7340
|
Missing or mistyped settings fail `bdk validate` before a turn
|
|
6913
7341
|
can call the contributed code.
|
|
@@ -6992,14 +7420,15 @@ import { cursorPlugin } from "@cursor/bdk/extensions";
|
|
|
6992
7420
|
export default cursorPlugin({
|
|
6993
7421
|
path: "plugins/notion-workspace",
|
|
6994
7422
|
variables: {
|
|
6995
|
-
NOTION_TOKEN:
|
|
7423
|
+
NOTION_TOKEN: "${NOTION_TOKEN}",
|
|
6996
7424
|
},
|
|
6997
7425
|
});
|
|
6998
7426
|
```
|
|
6999
7427
|
|
|
7000
7428
|
`path` is relative to the project root. `variables` fills placeholders
|
|
7001
|
-
declared by the plugin's MCP configuration
|
|
7002
|
-
|
|
7429
|
+
declared by the plugin's MCP configuration. Pass a `${NAME}` template.
|
|
7430
|
+
The connection reads `NAME` when it opens. An unresolved placeholder
|
|
7431
|
+
fails validation instead of mounting a partial server.
|
|
7003
7432
|
|
|
7004
7433
|
Plugin rules and hooks are not mounted. Overlay a generated
|
|
7005
7434
|
`mcp-connections/<server>.ts` file to replace or disable one plugin
|
|
@@ -7049,10 +7478,13 @@ export default defineExtension({
|
|
|
7049
7478
|
description: "Investigate failing Buildkite jobs.",
|
|
7050
7479
|
config: z.object({
|
|
7051
7480
|
org: z.string(),
|
|
7052
|
-
token: z.string(),
|
|
7481
|
+
token: z.function().args().returns(z.string()),
|
|
7053
7482
|
logTailLines: z.number().int().positive().default(200),
|
|
7054
7483
|
}),
|
|
7055
|
-
hosting: () => ({
|
|
7484
|
+
hosting: () => ({
|
|
7485
|
+
egressDomains: ["api.buildkite.com"],
|
|
7486
|
+
secretNames: ["BUILDKITE_TOKEN"],
|
|
7487
|
+
}),
|
|
7056
7488
|
});
|
|
7057
7489
|
```
|
|
7058
7490
|
|
|
@@ -7065,9 +7497,8 @@ prose assets beside it.
|
|
|
7065
7497
|
from the environment. It receives the validated settings, and the
|
|
7066
7498
|
mounting agent's `hosting.egressDomains` and `hosting.secretNames` gain
|
|
7067
7499
|
whatever it returns, so a hosted deploy reaches Buildkite without the
|
|
7068
|
-
consumer listing `api.buildkite.com`.
|
|
7069
|
-
|
|
7070
|
-
value comes from.
|
|
7500
|
+
consumer listing `api.buildkite.com`. List `BUILDKITE_TOKEN` in
|
|
7501
|
+
`secretNames`. Call `extension.config.token()` inside a tool.
|
|
7071
7502
|
|
|
7072
7503
|
The [Project layout](/docs/reference/project-layout.md) owns each contribution's
|
|
7073
7504
|
authoring contract. Keep extension instructions and tool descriptions
|
|
@@ -7530,10 +7961,14 @@ on every turn. A root agent requires them; a subagent may inline
|
|
|
7530
7961
|
import { defineInstructions } from "@cursor/bdk";
|
|
7531
7962
|
|
|
7532
7963
|
export default defineInstructions({
|
|
7533
|
-
markdown:
|
|
7964
|
+
markdown: "You are the on-call assistant for the payments team.",
|
|
7534
7965
|
});
|
|
7535
7966
|
```
|
|
7536
7967
|
|
|
7968
|
+
The `markdown` string is fixed when this file loads. Read a secret in
|
|
7969
|
+
a handler, a tool, or a callback. See
|
|
7970
|
+
[Add egress and secrets](/docs/deployment.md#add-egress-and-secrets).
|
|
7971
|
+
|
|
7537
7972
|
## Delivery
|
|
7538
7973
|
|
|
7539
7974
|
Instructions land in the session workspace as `AGENTS.md`, and the
|
|
@@ -8476,6 +8911,7 @@ export default defineTool({
|
|
|
8476
8911
|
| --- | --- |
|
|
8477
8912
|
| `ctx.toolCallId` | The call id, matching the `actions.requested` / `action.result` stream events |
|
|
8478
8913
|
| `ctx.session` | Read-only session info: id, channel, mode, auth |
|
|
8914
|
+
| `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 |
|
|
8479
8915
|
| `ctx.workspaceDir` | The session's workspace directory |
|
|
8480
8916
|
| `ctx.stateRoot` | The agent's durable state root, shared across every session |
|
|
8481
8917
|
| `ctx.host` | Shared host services (see below) |
|
|
@@ -8723,13 +9159,13 @@ Source: /docs/templates/agentic-owners.md
|
|
|
8723
9159
|
This agent reviews every pull request in your repository. It risk-tiers
|
|
8724
9160
|
the diff, requests the owning team or user as reviewers, and approves
|
|
8725
9161
|
what your policy allows. Ownership rules live in
|
|
8726
|
-
`.agentic-owners/policy.yml` files committed at any depth of the repo
|
|
8727
|
-
|
|
8728
|
-
from the PR's base ref so a PR cannot exempt itself.
|
|
9162
|
+
`.agentic-owners/policy.yml` files committed at any depth of the repo.
|
|
9163
|
+
The closest policy to a changed file wins, and policies are always read
|
|
9164
|
+
from the PR's base ref, so a PR cannot exempt itself.
|
|
8729
9165
|
|
|
8730
9166
|
## Scaffold
|
|
8731
9167
|
|
|
8732
|
-
```
|
|
9168
|
+
```bash
|
|
8733
9169
|
bdk init ./owners-agent --template agentic-owners
|
|
8734
9170
|
```
|
|
8735
9171
|
|
|
@@ -8738,21 +9174,23 @@ on PATH.
|
|
|
8738
9174
|
|
|
8739
9175
|
## Log in and run
|
|
8740
9176
|
|
|
8741
|
-
Set your repositories in `bot/lib/config.ts` (`repos: ["
|
|
9177
|
+
Set your repositories in `bot/lib/config.ts` (`repos: ["acme/api"]`),
|
|
8742
9178
|
then:
|
|
8743
9179
|
|
|
8744
|
-
```
|
|
9180
|
+
```bash
|
|
8745
9181
|
cd owners-agent
|
|
8746
9182
|
bdk login
|
|
8747
9183
|
bdk dev
|
|
8748
9184
|
```
|
|
8749
9185
|
|
|
8750
9186
|
PR events stream through your Cursor account. No webhook or GitHub App
|
|
8751
|
-
setup.
|
|
9187
|
+
setup. The agent reviews a PR when it is opened, reopened, pushed to,
|
|
9188
|
+
marked ready for review, or retargeted to another base. Draft PRs wait
|
|
9189
|
+
until they are ready. Open a PR, or replay a real one (this also works
|
|
8752
9190
|
with `repos` empty):
|
|
8753
9191
|
|
|
8754
|
-
```
|
|
8755
|
-
bdk github replay https://github.com/
|
|
9192
|
+
```bash
|
|
9193
|
+
bdk github replay https://github.com/acme/api/pull/123 --dir .
|
|
8756
9194
|
```
|
|
8757
9195
|
|
|
8758
9196
|
Deploy with `bdk deploy`.
|
|
@@ -8764,37 +9202,67 @@ low risk approve, medium and above hold with a comment. Route reviews by
|
|
|
8764
9202
|
committing policies:
|
|
8765
9203
|
|
|
8766
9204
|
```yaml
|
|
8767
|
-
# .agentic-owners/policy.yml
|
|
8768
|
-
# paths are repo-root-relative globs, wherever the policy file lives.
|
|
9205
|
+
# .agentic-owners/policy.yml at any depth; the closest policy wins.
|
|
8769
9206
|
version: 1
|
|
8770
9207
|
policies:
|
|
8771
9208
|
- paths: ["docs/**"]
|
|
8772
9209
|
always_approve: true
|
|
8773
9210
|
- paths: ["src/api/**"]
|
|
8774
|
-
team:
|
|
9211
|
+
team: platform # bare slug in the repo's org; or acme/platform, or user: alice
|
|
8775
9212
|
prompt: api-review.md # optional extra rubric, same directory
|
|
8776
9213
|
- paths: ["src/billing/**"]
|
|
8777
|
-
|
|
8778
|
-
|
|
9214
|
+
users: [alice, bob]
|
|
9215
|
+
mode: hard # the agent never approves; a person must
|
|
8779
9216
|
```
|
|
8780
9217
|
|
|
8781
|
-
`
|
|
8782
|
-
|
|
9218
|
+
`paths` are globs relative to the directory that holds the
|
|
9219
|
+
`.agentic-owners/` folder, so a root policy sees repo-relative paths and
|
|
9220
|
+
`src/.agentic-owners/policy.yml` matches `api/**` against
|
|
9221
|
+
`src/api/**`. Leading `../` segments reach a sibling tree. A path cannot
|
|
9222
|
+
escape the repo.
|
|
9223
|
+
|
|
9224
|
+
| Key | Meaning |
|
|
9225
|
+
| --- | --- |
|
|
9226
|
+
| `paths` | Globs relative to the policy's directory. Required. |
|
|
9227
|
+
| `team` / `teams` | Owner teams. A bare slug resolves in the repo's org. An `org/team` handle names a team directly. |
|
|
9228
|
+
| `user` / `users` | Owner GitHub logins, without `@`. |
|
|
9229
|
+
| `prompt` | Markdown filename in the same directory, added to the rubric for matching PRs. |
|
|
9230
|
+
| `mode` | `advisory` (default): low risk approves. `hard`: a person must approve. `notify`: the rule never blocks and its owners are not requested. |
|
|
9231
|
+
| `human_review_required` | `true` is the older spelling of `mode: hard`. |
|
|
9232
|
+
| `self_review` | A listed `user:` owner's own PRs clear this rule. |
|
|
9233
|
+
| `always_approve` | Satisfied at every risk tier. Cannot combine with owners, `prompt`, `mode`, `self_review`, or `human_review_required`. |
|
|
9234
|
+
|
|
9235
|
+
A rule without owners must set `always_approve: true`.
|
|
9236
|
+
`global_exclusions` in the root policy opts paths out entirely. The
|
|
9237
|
+
agent rejects `delegated_automations`: nothing in this template consumes
|
|
9238
|
+
automation approvals.
|
|
8783
9239
|
|
|
8784
9240
|
## What one review does
|
|
8785
9241
|
|
|
8786
9242
|
One model turn per PR head assesses the host-fetched diff against the
|
|
8787
|
-
base rubric plus any matched rule prompts, then records a
|
|
9243
|
+
base rubric plus any matched rule prompts, then records a risk tier of
|
|
9244
|
+
`very_low`, `low`, `medium`, `medium_high`, or `high` with
|
|
8788
9245
|
`record_review`. The host recomputes the policy from trusted state and
|
|
8789
9246
|
applies the deterministic decision:
|
|
8790
9247
|
|
|
8791
|
-
- **Approve** when
|
|
8792
|
-
|
|
9248
|
+
- **Approve** when every matched rule is `always_approve` or `notify`,
|
|
9249
|
+
or when the tier is very low or low and every matched `hard` rule is
|
|
9250
|
+
cleared by an owner-author with `self_review`. At medium and above,
|
|
9251
|
+
the agent approves only when the author's `self_review` covers every
|
|
9252
|
+
rule that can require review.
|
|
8793
9253
|
- **Request reviewers** otherwise: the policy owners (max 2, never the
|
|
8794
9254
|
author), plus one status comment the agent keeps updated in place.
|
|
8795
9255
|
|
|
9256
|
+
An approval binds to the head SHA, and a later hold dismisses the
|
|
9257
|
+
agent's earlier approvals. The agent also holds when the PR edits
|
|
9258
|
+
`.agentic-owners/` or `CODEOWNERS`, when the diff is empty or truncated,
|
|
9259
|
+
or when GitHub capped the changed-file list. `self_review` never clears
|
|
9260
|
+
a governance edit.
|
|
9261
|
+
|
|
8796
9262
|
The model never writes to GitHub. A broken policy file fails closed with
|
|
8797
|
-
a comment listing the validation issues.
|
|
9263
|
+
a comment listing the validation issues. Team membership is not
|
|
9264
|
+
resolved, because repo-scoped credentials cannot read org teams, so
|
|
9265
|
+
`self_review` applies to `user:` owners only.
|
|
8798
9266
|
|
|
8799
9267
|
## Rubric
|
|
8800
9268
|
|
|
@@ -8806,12 +9274,12 @@ next to the policy that names them. The next review reads both.
|
|
|
8806
9274
|
|
|
8807
9275
|
Use the three smoke reviews as a local exercise:
|
|
8808
9276
|
|
|
8809
|
-
```
|
|
9277
|
+
```bash
|
|
8810
9278
|
bdk eval
|
|
8811
9279
|
```
|
|
8812
9280
|
|
|
8813
|
-
|
|
8814
|
-
sessions skip GitHub writes.
|
|
9281
|
+
The cases are a docs-only change, an auth deletion, and a prompt
|
|
9282
|
+
injection. Eval sessions skip GitHub writes.
|
|
8815
9283
|
|
|
8816
9284
|
---
|
|
8817
9285
|
|