@cursor/bdk 0.2.14 → 0.2.15
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 +51 -52
- package/README.md +1 -1
- package/dist/bin/agent-sdk.js +0 -0
- package/dist/bin/agent-serve.js +0 -0
- package/dist/channels/slack/attachments.d.ts +2 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -1
- package/dist/channels/slack/attachments.js +17 -5
- package/dist/channels/slack/channel-watch.d.ts +4 -2
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +4 -2
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +4 -2
- package/dist/channels/slack/types.d.ts +6 -4
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +29 -0
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +54 -0
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.BN3sgOOo.js → app.CRMxF0qX.js} +4 -4
- package/dist/docs/assets/{building-with-agents.md.Df87rAe1.js → building-with-agents.md.Bi9CQ-bR.js} +3 -3
- package/dist/docs/assets/{building-with-agents.md.Df87rAe1.lean.js → building-with-agents.md.Bi9CQ-bR.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BZwvb2LN.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CbA00dML.js → VPLocalSearchBox.C4BiQe53.js} +1 -1
- package/dist/docs/assets/chunks/{arc.Byug8CZM.js → arc.D1TA2Mxn.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.D1_qmnQy.js → architectureDiagram-Q4EWVU46.CA-hBJCN.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.Dj-Nurf-.js → baseUniq.CzsSgiab.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BZwq3EIg.js → blockDiagram-DXYQGD6D.sxrH_f0l.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.dx75urO7.js → c4Diagram-AHTNJAMY.D_Z3mqAl.js} +1 -1
- package/dist/docs/assets/chunks/channel.D7DtboxW.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CIoddsDQ.js → chunk-4BX2VUAB.BS6_uTUf.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.O3VsVBES.js → chunk-4TB4RGXK.D-URAeTU.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.WNNWh0Pe.js → chunk-55IACEB6.b4SZc5kO.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BKVQwEME.js → chunk-EDXVE4YY.DLKEEDkN.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.Cv5iBz7A.js → chunk-FMBD7UC4.3SyQHgpY.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.wCDCToee.js → chunk-OYMX7WX6.DBKKaFeS.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.D3IGXhXA.js → chunk-QZHKN3VN.BhCYeR7H.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.CAPPh-E7.js → chunk-YZCP3GAM.Cpg0VgI7.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.irslOV8B.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.irslOV8B.js +1 -0
- package/dist/docs/assets/chunks/clone.DosLeDYL.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BQCFH3M5.js → cose-bilkent-S5V4N54A.4q0YNZN6.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.lHmdrh7L.js → dagre-KV5264BT.Bk_CcQPr.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.EtSPnHgD.js → diagram-5BDNPKRD.CgreoM_Z.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.DCyUnQT8.js → diagram-G4DWMVQ6.DlZGpm6W.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5._E0Qqblb.js → diagram-MMDJMWI5.BxtXxgIR.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.BDj4oyy_.js → diagram-TYMM5635.DSzlJp2D.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.CrvnO6a3.js → erDiagram-SMLLAGMA.BN1YUmEV.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.DIhYc-2F.js → flowDiagram-DWJPFMVM.B61NGNYu.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.hFqm_vio.js → ganttDiagram-T4ZO3ILL.DR-tto3M.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.N3GDaVDD.js → gitGraphDiagram-UUTBAWPF.CBPs2W_2.js} +1 -1
- package/dist/docs/assets/chunks/{graph.DK28rMBx.js → graph.DmlaqzCE.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DHmE6W9M.js → infoDiagram-42DDH7IO.obPv-fFg.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.ByUJuOYm.js → ishikawaDiagram-UXIWVN3A.CXHTUcM3.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BIUChFMh.js → journeyDiagram-VCZTEJTY.BoVHerYZ.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CNgFXwo-.js → kanban-definition-6JOO6SKY.CfYmPHZg.js} +1 -1
- package/dist/docs/assets/chunks/{layout.BDnwE4ET.js → layout.621UdAhB.js} +1 -1
- package/dist/docs/assets/chunks/{linear.DmrYLXFs.js → linear.Cz_zRKjr.js} +1 -1
- package/dist/docs/assets/chunks/{min.BbYcWakN.js → min.ON4GjCH7.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.C9x-klkv.js → mindmap-definition-QFDTVHPH.DLPMLJlv.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.iufpEbi0.js → pieDiagram-DEJITSTG.BFp11AYt.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DdoXbWL9.js → quadrantDiagram-34T5L4WZ.ChX7xo6B.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.XL1-_pNk.js → requirementDiagram-MS252O5E.DbKtHG_Q.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DySXofNs.js → sankeyDiagram-XADWPNL6.Spw8tv-7.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Cp0GZoOU.js → sequenceDiagram-FGHM5R23.BYso9LlE.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DvK-sXUX.js → stateDiagram-FHFEXIEX.D8l54jqW.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CAYMmzGj.js +1 -0
- package/dist/docs/assets/chunks/{theme.Clup4iIo.js → theme.m_Ethbkv.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.gHI9ZLm6.js → timeline-definition-GMOUNBTQ.BLdhhyy9.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.G2N2zXYe.js → vennDiagram-DHZGUBPP.CyGT2F_P.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.C46G0P5a.js → wardley-RL74JXVD.C5JJS3bh.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.BgUKEagd.js → wardleyDiagram-NUSXRM2D.p_Sz9p1i.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CwH7oege.js → xychartDiagram-5P7HB3ND.DtXsNUaf.js} +1 -1
- package/dist/docs/assets/deployment.md.hKKN9I4c.js +31 -0
- package/dist/docs/assets/{deployment.md.BYuEcDBv.lean.js → deployment.md.hKKN9I4c.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.C851kViu.js → evals.md.CHR34K1Y.js} +3 -7
- package/dist/docs/assets/{evals.md.C851kViu.lean.js → evals.md.CHR34K1Y.lean.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.CBK7W0-O.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.CBK7W0-O.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +15 -0
- package/dist/docs/assets/{guides_grokbot-agents.md.tD1smFhU.lean.js → guides_grokbot-agents.md.BwAykJ7U.lean.js} +1 -1
- package/dist/docs/assets/{guides_hooks.md.5Ce3NXxZ.js → guides_hooks.md.B_bKG1oA.js} +1 -1
- package/dist/docs/assets/{guides_improve.md.CRrYq22s.js → guides_improve.md.CZKVt1cT.js} +2 -3
- package/dist/docs/assets/{guides_improve.md.CRrYq22s.lean.js → guides_improve.md.CZKVt1cT.lean.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.DR3zhC9r.js → guides_mcp-oauth.md.BM_eFC0L.js} +3 -15
- package/dist/docs/assets/guides_mcp-oauth.md.BM_eFC0L.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.BBvAm_VF.js → guides_webhooks.md.Cpdc3BDX.js} +13 -12
- package/dist/docs/assets/{guides_webhooks.md.BBvAm_VF.lean.js → guides_webhooks.md.Cpdc3BDX.lean.js} +1 -1
- package/dist/docs/assets/{index.md.Dxxr7pFa.js → index.md.BIBHIQtU.js} +1 -1
- package/dist/docs/assets/{quickstart.md.BK5gjHM2.js → quickstart.md.CduLGBAB.js} +1 -1
- package/dist/docs/assets/reference_channels.md.DYg0CLud.js +22 -0
- package/dist/docs/assets/{reference_channels.md.LbNIJBwd.lean.js → reference_channels.md.DYg0CLud.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.dYCAL2lB.js → reference_cli.md.BYNIHwbi.js} +15 -12
- package/dist/docs/assets/{reference_cli.md.dYCAL2lB.lean.js → reference_cli.md.BYNIHwbi.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DLrgAd5f.js → reference_connections.md.CxbLpaaP.js} +4 -5
- package/dist/docs/assets/{reference_connections.md.DLrgAd5f.lean.js → reference_connections.md.CxbLpaaP.lean.js} +1 -1
- package/dist/docs/assets/{reference_evals.md.D5i8PuXJ.js → reference_evals.md.if--BLd0.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.B-eGa2km.js → reference_hooks.md.DbJC8mcZ.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.CrqhTv6S.js +11 -0
- package/dist/docs/assets/{reference_http-api.md.DbFNOubV.lean.js → reference_http-api.md.CrqhTv6S.lean.js} +1 -1
- package/dist/docs/assets/reference_playground.md.q4MI-0td.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.lean.js +1 -0
- package/dist/docs/assets/{reference_schedules.md.BuJ8fgMa.js → reference_schedules.md.03Ryy9ca.js} +5 -5
- package/dist/docs/assets/{reference_schedules.md.BuJ8fgMa.lean.js → reference_schedules.md.03Ryy9ca.lean.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.C_uzIWuy.js +1 -0
- package/dist/docs/assets/{reference_skills.md.ClkMoQsV.js → reference_skills.md.Ckddg6KX.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.DzIY9JzY.js → reference_tools.md.08XR7lIl.js} +3 -14
- package/dist/docs/assets/reference_tools.md.08XR7lIl.lean.js +1 -0
- package/dist/docs/assets/{templates_grokbot-agents.md.2sydjFiO.js → templates_grokbot-agents.md.DgpPEs7B.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.PCafNCb5.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.x-GBa7wN.lean.js → troubleshooting.md.PCafNCb5.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/building-with-agents.md +5 -5
- package/dist/docs/deployment.html +43 -41
- package/dist/docs/deployment.md +70 -33
- package/dist/docs/evals.html +38 -42
- package/dist/docs/evals.md +1 -16
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +38 -39
- package/dist/docs/guides/cloud-agents.md +2 -8
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +37 -38
- package/dist/docs/guides/grokbot-agents.md +9 -13
- package/dist/docs/guides/hooks.html +37 -37
- package/dist/docs/guides/hooks.md +0 -1
- package/dist/docs/guides/improve.html +37 -38
- package/dist/docs/guides/improve.md +4 -6
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +39 -51
- package/dist/docs/guides/mcp-oauth.md +17 -40
- package/dist/docs/guides/migrate.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +35 -35
- package/dist/docs/guides/webhooks.html +47 -46
- package/dist/docs/guides/webhooks.md +35 -18
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +36 -36
- package/dist/docs/index.md +1 -1
- package/dist/docs/llms-full.txt +347 -269
- package/dist/docs/llms.txt +4 -4
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/quickstart.md +2 -2
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +42 -43
- package/dist/docs/reference/channels.md +29 -13
- package/dist/docs/reference/cli.html +49 -46
- package/dist/docs/reference/cli.md +113 -40
- package/dist/docs/reference/connections.html +39 -40
- package/dist/docs/reference/connections.md +6 -5
- package/dist/docs/reference/evals.html +37 -37
- package/dist/docs/reference/evals.md +2 -4
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/hooks.md +0 -1
- package/dist/docs/reference/http-api.html +38 -38
- package/dist/docs/reference/http-api.md +7 -17
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +37 -37
- package/dist/docs/reference/playground.md +1 -4
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +39 -39
- package/dist/docs/reference/schedules.md +26 -3
- package/dist/docs/reference/sessions.html +36 -36
- package/dist/docs/reference/sessions.md +1 -2
- package/dist/docs/reference/skills.html +37 -37
- package/dist/docs/reference/skills.md +1 -1
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +39 -50
- package/dist/docs/reference/tools.md +2 -28
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/grokbot-agents.html +37 -37
- package/dist/docs/templates/grokbot-agents.md +1 -1
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +36 -36
- package/dist/docs/troubleshooting.md +12 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +5 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +5 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +14 -0
- package/dist/internal/continuation-identity.js +1 -1
- package/dist/internal/discovery/agent-config.d.ts +6 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +19 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +2 -1
- package/dist/internal/hosted-catch-protocol.d.ts +2 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-catch-protocol.js +2 -0
- package/dist/internal/hosted-catch.d.ts +2 -3
- package/dist/internal/hosted-catch.d.ts.map +1 -1
- package/dist/internal/hosted-catch.js +2 -3
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +22 -12
- package/dist/internal/hosted-execution-flush.d.ts +6 -3
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
- package/dist/internal/hosted-execution-flush.js +28 -31
- package/dist/internal/peer-connections.d.ts +6 -2
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +23 -19
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +5 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +6 -5
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +3 -0
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +26 -11
- package/dist/playground/assets/index-BVYWBxLU.css +1 -0
- package/dist/playground/assets/{index-ClxRl2Cw.js → index-DCsq6f_I.js} +37 -37
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/building-with-agents.md +5 -5
- package/docs/deployment.md +70 -33
- package/docs/evals.md +1 -16
- package/docs/guides/cloud-agents.md +3 -9
- package/docs/guides/grokbot-agents.md +10 -14
- package/docs/guides/hooks.md +0 -1
- package/docs/guides/improve.md +4 -6
- package/docs/guides/mcp-oauth.md +18 -41
- package/docs/guides/webhooks.md +35 -18
- package/docs/quickstart.md +2 -2
- package/docs/reference/channels.md +29 -13
- package/docs/reference/cli.md +113 -40
- package/docs/reference/connections.md +6 -5
- package/docs/reference/evals.md +2 -4
- package/docs/reference/hooks.md +0 -1
- package/docs/reference/http-api.md +7 -17
- package/docs/reference/playground.md +2 -5
- package/docs/reference/schedules.md +26 -3
- package/docs/reference/sessions.md +1 -2
- package/docs/reference/skills.md +1 -1
- package/docs/reference/tools.md +3 -29
- package/docs/templates/grokbot-agents.md +1 -1
- package/docs/troubleshooting.md +12 -7
- package/package.json +35 -35
- package/skills/create-agent/SKILL.md +9 -6
- package/skills/debug/SKILL.md +3 -4
- package/skills/evals/SKILL.md +2 -2
- package/skills/framework-map/SKILL.md +10 -10
- package/skills/mcp-auth/SKILL.md +10 -34
- package/skills/migrate-v2/SKILL.md +13 -9
- package/skills/setup-slack/SKILL.md +0 -13
- package/templates/agents-md/README.md +3 -3
- package/templates/agents-md/bot/channels/queue.ts +3 -8
- package/templates/agents-md/bot/instructions.md +1 -2
- package/templates/agents-md/bot/tools/apply_agents.ts +0 -1
- package/templates/agents-md/evals/agents.eval.ts +2 -2
- package/templates/demo/bot/channels/queue.ts +5 -15
- package/templates/grokbot-agents/.gitignore +4 -0
- package/templates/pr-autofixer/bot/channels/drive.ts +3 -16
- package/templates/security-help/.gitignore +4 -0
- package/templates/triage/bot/channels/queue.ts +11 -22
- package/templates/triage/bot/channels/webhook.ts +3 -6
- package/templates/triage/bot/lib/parse-queue-event.ts +0 -6
- package/dist/docs/assets/chunks/@localSearchIndexroot.CzrtdJ8s.js +0 -1
- package/dist/docs/assets/chunks/channel.6ebHhoF9.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BJ-CwKwu.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BJ-CwKwu.js +0 -1
- package/dist/docs/assets/chunks/clone.DfV2fkWH.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DNdUCJyd.js +0 -1
- package/dist/docs/assets/deployment.md.BYuEcDBv.js +0 -29
- package/dist/docs/assets/guides_cloud-agents.md.CWJjS9No.js +0 -10
- package/dist/docs/assets/guides_cloud-agents.md.CWJjS9No.lean.js +0 -1
- package/dist/docs/assets/guides_grokbot-agents.md.tD1smFhU.js +0 -16
- package/dist/docs/assets/guides_mcp-oauth.md.DR3zhC9r.lean.js +0 -1
- package/dist/docs/assets/reference_channels.md.LbNIJBwd.js +0 -23
- package/dist/docs/assets/reference_http-api.md.DbFNOubV.js +0 -11
- package/dist/docs/assets/reference_playground.md.1hx0gcIu.js +0 -1
- package/dist/docs/assets/reference_playground.md.1hx0gcIu.lean.js +0 -1
- package/dist/docs/assets/reference_sessions.md.CyM7ARz1.js +0 -1
- package/dist/docs/assets/reference_tools.md.DzIY9JzY.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.x-GBa7wN.js +0 -1
- package/dist/playground/assets/index-BKSsuEMw.css +0 -1
- /package/dist/docs/assets/{guides_hooks.md.5Ce3NXxZ.lean.js → guides_hooks.md.B_bKG1oA.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.Dxxr7pFa.lean.js → index.md.BIBHIQtU.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.BK5gjHM2.lean.js → quickstart.md.CduLGBAB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_evals.md.D5i8PuXJ.lean.js → reference_evals.md.if--BLd0.lean.js} +0 -0
- /package/dist/docs/assets/{reference_hooks.md.B-eGa2km.lean.js → reference_hooks.md.DbJC8mcZ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.CyM7ARz1.lean.js → reference_sessions.md.C_uzIWuy.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.ClkMoQsV.lean.js → reference_skills.md.Ckddg6KX.lean.js} +0 -0
- /package/dist/docs/assets/{templates_grokbot-agents.md.2sydjFiO.lean.js → templates_grokbot-agents.md.DgpPEs7B.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Evals","description":"Protect agent decisions with fixed inputs, trajectory assertions, and regression checks that run locally or in CI.","frontmatter":{"title":"Evals","description":"Protect agent decisions with fixed inputs, trajectory assertions, and regression checks that run locally or in CI."},"headers":[],"relativePath":"evals.md","filePath":"evals.md"}'),t={name:"evals.md"};function l(h,s,p,k,r,o){return e(),a("div",null,[...s[0]||(s[0]=[n("",
|
|
1
|
+
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Evals","description":"Protect agent decisions with fixed inputs, trajectory assertions, and regression checks that run locally or in CI.","frontmatter":{"title":"Evals","description":"Protect agent decisions with fixed inputs, trajectory assertions, and regression checks that run locally or in CI."},"headers":[],"relativePath":"evals.md","filePath":"evals.md"}'),t={name:"evals.md"};function l(h,s,p,k,r,o){return e(),a("div",null,[...s[0]||(s[0]=[n("",49)])])}const E=i(t,[["render",l]]);export{c as __pageData,E as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const p=JSON.parse('{"title":"Cursor cloud agents","description":"Let a BDK agent hand coding work to Cursor cloud agents and steer them: mount the extension and pick the repositories it may touch.","frontmatter":{"title":"Cursor cloud agents","description":"Let a BDK agent hand coding work to Cursor cloud agents and steer them: mount the extension and pick the repositories it may touch."},"headers":[],"relativePath":"guides/cloud-agents.md","filePath":"guides/cloud-agents.md"}'),i={name:"guides/cloud-agents.md"};function o(r,e,h,l,d,u){return s(),a("div",null,[...e[0]||(e[0]=[n(`<h1 id="cloud-agents" tabindex="-1">Cloud agents <a class="header-anchor" href="#cloud-agents" aria-label="Permalink to "Cloud agents""></a></h1><p>The <code>cursor-cloud-agents</code> extension adds repository delegation to an existing BDK conversation. Cloud agents work on repository checkouts and push branches and pull requests; your agent can hand off a task, keep talking while it runs, inspect the result, and steer or stop the same branch.</p><h2 id="mount-it" tabindex="-1">Mount it <a class="header-anchor" href="#mount-it" aria-label="Permalink to "Mount it""></a></h2><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/extensions/cloud.ts</span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cursorCloudAgents </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/extensions/cursor-cloud-agents"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
|
+
<span class="line"></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cursorCloudAgents</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cloud: {</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> repos: [{ url: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/acme/api"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, startingRef: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"main"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }],</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> autoCreatePR: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Launches run under the host's signed-in account (<code>bdk login</code>, <code>CURSOR_API_KEY</code>, or <code>CURSOR_SERVICE_ACCOUNT_KEY</code>) and spend its cloud-agent budget. Name the repositories the agent may target in <code>cloud.repos</code>.</p><h2 id="what-the-agent-can-do" tabindex="-1">What the agent can do <a class="header-anchor" href="#what-the-agent-can-do" aria-label="Permalink to "What the agent can do""></a></h2><p>With the extension mounted, the agent can hand off coding work and stay in the conversation while it happens:</p><ul><li><strong>Hand off a task.</strong> Launch a cloud agent on one of your repositories, or on a pull request, with a self-contained brief. It gets back an agent id and a URL to share.</li><li><strong>Check on it.</strong> See whether the agent is still running, what it produced, and which branches or pull requests it pushed.</li><li><strong>Read what was done.</strong> Pull the agent's full conversation into the workspace, quote its final report, or trace the exact edits before summarizing for a person.</li><li><strong>Steer or stop.</strong> Send a follow-up to an agent it launched; it queues behind the current run, or interrupts it on request. Cancel a run that went sideways.</li><li><strong>Keep track.</strong> List the agents launched in this conversation, or everything it has launched before.</li></ul><p>A skill teaches the model when to delegate, how to write a brief a cloud agent can act on alone, and how to follow up. Everything the extension launches stays bound to whoever launched it: an agent started by another user, or outside the extension, is out of reach. That separation is only as fine as your host's auth; a shared bearer token or <code>--allow-anonymous</code> makes every caller one principal, so use <a href="./../reference/channels.html#auth-policies">authored auth</a> when callers need their own.</p><h2 id="configure-it" tabindex="-1">Configure it <a class="header-anchor" href="#configure-it" aria-label="Permalink to "Configure it""></a></h2><table tabindex="0"><thead><tr><th>Option</th><th>What it controls</th></tr></thead><tbody><tr><td><code>cloud</code></td><td>Launch defaults for repositories, environment, and pull request behavior.</td></tr><tr><td><code>cloud.repos</code></td><td>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 <code>cloud.envVars</code> never reach a repository you didn't list.</td></tr><tr><td><code>model</code></td><td>The model launched agents run. Omit it to use the account default.</td></tr><tr><td><code>apiKey</code></td><td>A Cursor API key to launch with instead of the host's own.</td></tr></tbody></table><h2 id="adjust-it" tabindex="-1">Adjust it <a class="header-anchor" href="#adjust-it" aria-label="Permalink to "Adjust it""></a></h2><p>To take a capability away, such as sending follow-ups, mount as a directory and disable that tool; see <a href="./../reference/extensions.html#adjust-a-mounted-extension">overlays</a>.</p><h2 id="what-s-next" tabindex="-1">What's next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to "What's next""></a></h2><p>Continue with these pages:</p><ul><li><a href="./../reference/extensions.html">Extensions</a>: how mounts, namespaces, and overrides work</li></ul>`,16)])])}const g=t(i,[["render",o]]);export{p as __pageData,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const p=JSON.parse('{"title":"Cursor cloud agents","description":"Let a BDK agent hand coding work to Cursor cloud agents and steer them: mount the extension and pick the repositories it may touch.","frontmatter":{"title":"Cursor cloud agents","description":"Let a BDK agent hand coding work to Cursor cloud agents and steer them: mount the extension and pick the repositories it may touch."},"headers":[],"relativePath":"guides/cloud-agents.md","filePath":"guides/cloud-agents.md"}'),i={name:"guides/cloud-agents.md"};function o(r,e,h,l,d,u){return s(),a("div",null,[...e[0]||(e[0]=[n("",16)])])}const g=t(i,[["render",o]]);export{p as __pageData,g as default};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work.","frontmatter":{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work."},"headers":[],"relativePath":"guides/grokbot-agents.md","filePath":"guides/grokbot-agents.md"}'),o={name:"guides/grokbot-agents.md"};function i(r,e,l,h,c,d){return s(),a("div",null,[...e[0]||(e[0]=[n(`<h1 id="grok-bot-agents" tabindex="-1">Grok Bot agents <a class="header-anchor" href="#grok-bot-agents" aria-label="Permalink to "Grok Bot agents""></a></h1><p>The <code>cursor-grokbot-agents</code> extension lets a BDK agent consult the Grok Bot agents on its serve host's Cursor account. The bot keeps its existing conversation, memory, and tools, while your agent carries the delivered reply back into the current conversation.</p><p>Use this extension on the local runtime. It consults another Grok Bot; it does not move this agent onto a Grok Bot runtime.</p><h2 id="mount-it" tabindex="-1">Mount it <a class="header-anchor" href="#mount-it" aria-label="Permalink to "Mount it""></a></h2><p>List the bots your agent may contact. Descriptions teach the model when to choose one bot over another.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/extensions/grokbot.ts</span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cursorGrokBotAgents </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/extensions/cursor-grokbot-agents"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
|
+
<span class="line"></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cursorGrokBotAgents</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> agents: [</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Plan Keeper"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> description: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Decides whether outdoor plans should move."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Chief of Staff"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> description: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Routes work and tracks priorities."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Mounted as <code>grokbot</code>, the extension contributes <code>grokbot__ask</code>, <code>grokbot__check</code>, <code>grokbot__interrupt</code>, and <code>grokbot__list</code>, plus guidance for consulting them.</p><p>You can also scaffold the packaged example:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk init ./grokbot --template grokbot-agents</span></span></code></pre></div><h2 id="ask-a-named-bot" tabindex="-1">Ask a named bot <a class="header-anchor" href="#ask-a-named-bot" aria-label="Permalink to "Ask a named bot""></a></h2><p>When someone says, "Ask Plan Keeper whether we should move the picnic," your agent prepares one self-contained message, sends it, and waits for the bot's delivered reply. That reply appears in the current conversation as the consultation result.</p><p>The message must include who is asking, the relevant facts, and the shape of the answer. The Grok Bot does not see the current BDK conversation.</p><blockquote><p>Avery is deciding whether to move Saturday's picnic. The forecast is 70% rain from 1-4pm. Recommend keep or move, give one reason, and name the best alternate time.</p></blockquote><p>When exactly one bot is configured, the model may omit its name.</p><h2 id="keep-waiting-for-a-long-reply" tabindex="-1">Keep waiting for a long reply <a class="header-anchor" href="#keep-waiting-for-a-long-reply" aria-label="Permalink to "Keep waiting for a long reply""></a></h2><p>If the bot is still working when <code>ask</code> reaches its wait limit, the tool returns <code>status: "running"</code> and any reply received so far. Your agent calls <code>check</code> for the same bot and reports the final answer when it arrives.</p><p><code>check</code> advances this caller's read position, so it returns only replies not already consumed. Check when the answer is needed instead of polling in a tight loop.</p><p>Earlier unread replies can arrive alongside the current result. Keep their order and pass them on when they still matter.</p><h2 id="interrupt-a-bot-turn" tabindex="-1">Interrupt a bot turn <a class="header-anchor" href="#interrupt-a-bot-turn" aria-label="Permalink to "Interrupt a bot turn""></a></h2><p>Use <code>interrupt</code> when the bot is pursuing the wrong task or the person changes direction. The active turn stops, but the host account's conversation with that bot remains, so a later <code>ask</code> continues with its existing memory.</p><blockquote><p>Stop Plan Keeper's current turn. Then ask it to compare indoor venues instead of changing the time.</p></blockquote><p><code>check</code> and <code>interrupt</code> act on the bot conversation directly, so expose this extension only to callers who may read or stop those conversations.</p><h2 id="configure-it" tabindex="-1">Configure it <a class="header-anchor" href="#configure-it" aria-label="Permalink to "Configure it""></a></h2><p><code>agents</code> is a name allowlist, not an existence check. A name outside the list is refused, but a misspelled configured name may create a new empty bot on first use. If a result says <code>created: true</code>, tell the person and check the name before sending more work.</p><p>With no <code>agents</code> list, any name is allowed. Prefer an explicit list for a shared agent. <code>list</code> returns configured bots and bots this caller already contacted; it does not enumerate the whole account.</p><p>Calls use the serve host credential: <code>CURSOR_API_KEY</code>, <code>CURSOR_API_KEY_FILE</code>, <code>CURSOR_SERVICE_ACCOUNT_KEY</code>, or <code>bdk login</code>. Use <code>apiKey</code> only when the extension should run under a different account.</p><p><code>pollIntervalMs</code> changes how often a waiting tool reads for new bot output. Keep the default unless the service needs a different balance between response latency and request volume.</p><h2 id="account-and-caller-boundaries" tabindex="-1">Account and caller boundaries <a class="header-anchor" href="#account-and-caller-boundaries" aria-label="Permalink to "Account and caller boundaries""></a></h2><p>Every tool reaches the serve host account's existing Grok Bot conversation. Authenticated BDK callers have separate contact lists and read positions, but they do not get separate Grok Bot accounts or isolated bot memory.</p><p>A shared bearer token or anonymous host also collapses callers into one BDK principal. Use per-caller auth when contact history and read positions must remain separate.</p><p>If <code>ask</code> finds the bot busy with an earlier message, it sends nothing. For a bot this caller already contacted, use <code>check</code> or <code>interrupt</code>. On first contact, wait for the existing turn in the Grok Bot app to finish, then ask again.</p><h2 id="adjust-it" tabindex="-1">Adjust it <a class="header-anchor" href="#adjust-it" aria-label="Permalink to "Adjust it""></a></h2><p>To remove a capability such as <code>interrupt</code>, mount the extension as a directory and disable that tool. See <a href="./../reference/extensions.html#adjust-a-mounted-extension">Adjust a mounted extension</a>.</p><h2 id="what-s-next" tabindex="-1">What's next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to "What's next""></a></h2><ul><li><a href="./../reference/extensions.html">Extensions</a>: namespaces, trust, and overlays</li></ul>`,35)])])}const k=t(o,[["render",i]]);export{u as __pageData,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work.","frontmatter":{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work."},"headers":[],"relativePath":"guides/grokbot-agents.md","filePath":"guides/grokbot-agents.md"}'),o={name:"guides/grokbot-agents.md"};function i(r,e,l,h,
|
|
1
|
+
import{_ as t,c as a,o as s,a3 as n}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work.","frontmatter":{"title":"Cursor Grok Bot agents","description":"Mount an extension that lets your agent consult named Grok Bot agents, wait for long replies, and interrupt work."},"headers":[],"relativePath":"guides/grokbot-agents.md","filePath":"guides/grokbot-agents.md"}'),o={name:"guides/grokbot-agents.md"};function i(r,e,l,h,c,d){return s(),a("div",null,[...e[0]||(e[0]=[n("",35)])])}const k=t(o,[["render",i]]);export{u as __pageData,k as default};
|
|
@@ -47,4 +47,4 @@ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const E
|
|
|
47
47
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
48
48
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
49
49
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
50
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="events-when-hooks-run" tabindex="-1">Events / when hooks run <a class="header-anchor" href="#events-when-hooks-run" aria-label="Permalink to "Events / when hooks run""></a></h2><p>Use event names from the <a href="./../reference/sessions.html#stream-events">session event vocabulary</a>. A hook receives each matching event after it is recorded, and the model does not wait for the handler.</p><p>Within one session, handlers run one at a time. A slow handler delays later handlers for that session, but it does not delay the model or handlers for other sessions. Hooks also fire for evals, so check <code>ctx.session.purpose === "eval"</code> before metering or paging. A restart does not replay recorded events into hooks.</p><h2 id="when-not-to-use-a-hook" tabindex="-1">When not to use a hook <a class="header-anchor" href="#when-not-to-use-a-hook" aria-label="Permalink to "When not to use a hook""></a></h2><table tabindex="0"><thead><tr><th>Want</th><th>Use instead</th></tr></thead><tbody><tr><td>Add context before the model</td><td><code>instructions.md</code>, skills, or <code>workspaceFiles</code></td></tr><tr><td>Deliver to Slack or a PR</td><td>Channel <a href="./../reference/channels.html#events"><code>events</code></a> or packs</td></tr><tr><td>
|
|
50
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="events-when-hooks-run" tabindex="-1">Events / when hooks run <a class="header-anchor" href="#events-when-hooks-run" aria-label="Permalink to "Events / when hooks run""></a></h2><p>Use event names from the <a href="./../reference/sessions.html#stream-events">session event vocabulary</a>. A hook receives each matching event after it is recorded, and the model does not wait for the handler.</p><p>Within one session, handlers run one at a time. A slow handler delays later handlers for that session, but it does not delay the model or handlers for other sessions. Hooks also fire for evals, so check <code>ctx.session.purpose === "eval"</code> before metering or paging. A restart does not replay recorded events into hooks.</p><h2 id="when-not-to-use-a-hook" tabindex="-1">When not to use a hook <a class="header-anchor" href="#when-not-to-use-a-hook" aria-label="Permalink to "When not to use a hook""></a></h2><table tabindex="0"><thead><tr><th>Want</th><th>Use instead</th></tr></thead><tbody><tr><td>Add context before the model</td><td><code>instructions.md</code>, skills, or <code>workspaceFiles</code></td></tr><tr><td>Deliver to Slack or a PR</td><td>Channel <a href="./../reference/channels.html#events"><code>events</code></a> or packs</td></tr><tr><td>Gate final assistant text</td><td><code>defineResult</code></td></tr><tr><td>Gate behavior</td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><p><a href="https://cursor.com/docs/agent/hooks" target="_blank" rel="noreferrer">Cursor Agent hooks</a> in <code>.cursor/hooks.json</code> are a different product. They can observe, block, or modify the local agent loop.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/hooks.html">Hooks reference</a>: payloads, context, and discovery</li><li><a href="./../reference/sessions.html#stream-events">Sessions: stream events</a>: event vocabulary and payload sequence</li><li><a href="./opentelemetry.html">OpenTelemetry</a>: export traces and custom metrics</li><li><a href="./../reference/channels.html#events">Channels: events</a>: deliver replies back to Slack, source control, or another surface</li></ul>`,16)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const
|
|
1
|
+
import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Self-improvement","description":"Let an agent propose a change to its own source through a branch and pull request, with review and deployment kept separate.","frontmatter":{"title":"Self-improvement","description":"Let an agent propose a change to its own source through a branch and pull request, with review and deployment kept separate."},"headers":[],"relativePath":"guides/improve.md","filePath":"guides/improve.md"}'),n={name:"guides/improve.md"};function o(r,e,l,h,p,d){return i(),a("div",null,[...e[0]||(e[0]=[t(`<h1 id="self-improvement" tabindex="-1">Self-improvement <a class="header-anchor" href="#self-improvement" aria-label="Permalink to "Self-improvement""></a></h1><p>The <code>improve</code> extension teaches an agent how to turn "change how you work" into a source change. The agent prepares a brief, a Cursor cloud agent edits a checkout and opens a pull request, and the running agent reports the verified PR for human review.</p><p>Durable behavior does not change until that source is merged and deployed.</p><h2 id="mount-it" tabindex="-1">Mount it <a class="header-anchor" href="#mount-it" aria-label="Permalink to "Mount it""></a></h2><p>Mount Cloud agents with the agent's own repository allowlisted, then mount <code>improve</code> with the source directory.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/extensions/cloud.ts</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> cursorCloudAgents </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/extensions/cursor-cloud-agents"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
3
|
<span class="line"></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> cursorCloudAgents</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -11,7 +11,6 @@ import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const k
|
|
|
11
11
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
12
12
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> autoCreatePR: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
13
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
14
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> needsApproval: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
15
14
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/extensions/improve.ts</span></span>
|
|
16
15
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> improve </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/extensions/improve"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
17
16
|
<span class="line"></span>
|
|
@@ -19,4 +18,4 @@ import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const k
|
|
|
19
18
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> repo: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"https://github.com/acme/agents"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
20
19
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> path: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"agents/concierge"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
21
20
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ref: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"main"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
22
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Mounted as <code>improve</code>, the extension contributes the <code>improve__yourself</code> skill. It does not contribute a tool that can bypass the normal repository workflow.</p><h2 id="ask-for-one-behavioral-change" tabindex="-1">Ask for one behavioral change <a class="header-anchor" href="#ask-for-one-behavioral-change" aria-label="Permalink to "Ask for one behavioral change""></a></h2><p>State the change, how to tell it worked, and what behavior must stay fixed. The agent maps the request to instructions, a skill, a tool, channel configuration, or the model setting before preparing the coding brief.</p><blockquote><p>Improve yourself: stop opening incident replies with a summary. Start with the decision, keep the existing evidence bullets, and preserve every current eval.</p></blockquote><p>The success criterion and freeze line keep the cloud agent from turning a narrow behavior request into an unrelated refactor.</p><h2 id="follow-the-source-change" tabindex="-1">Follow the source change <a class="header-anchor" href="#follow-the-source-change" aria-label="Permalink to "Follow the source change""></a></h2><p>The agent
|
|
21
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Mounted as <code>improve</code>, the extension contributes the <code>improve__yourself</code> skill. It does not contribute a tool that can bypass the normal repository workflow.</p><h2 id="ask-for-one-behavioral-change" tabindex="-1">Ask for one behavioral change <a class="header-anchor" href="#ask-for-one-behavioral-change" aria-label="Permalink to "Ask for one behavioral change""></a></h2><p>State the change, how to tell it worked, and what behavior must stay fixed. The agent maps the request to instructions, a skill, a tool, channel configuration, or the model setting before preparing the coding brief.</p><blockquote><p>Improve yourself: stop opening incident replies with a summary. Start with the decision, keep the existing evidence bullets, and preserve every current eval.</p></blockquote><p>The success criterion and freeze line keep the cloud agent from turning a narrow behavior request into an unrelated refactor.</p><h2 id="follow-the-source-change" tabindex="-1">Follow the source change <a class="header-anchor" href="#follow-the-source-change" aria-label="Permalink to "Follow the source change""></a></h2><p>The agent launches one cloud agent on the configured repository and ref. It reports the complete cloud-agent ID and URL immediately, then checks the same run instead of launching another agent for follow-up work.</p><p>When the cloud agent opens a pull request, the running agent reads the result and the PR before reporting what changed and which checks passed. The pull request, not the delegation transcript, is the durable deliverable.</p><p>Use the <a href="./cloud-agents.html">Cloud agents guide</a> for launch, status, transcript, steering, and cancellation behavior.</p><h2 id="review-merge-then-deploy" tabindex="-1">Review, merge, then deploy <a class="header-anchor" href="#review-merge-then-deploy" aria-label="Permalink to "Review, merge, then deploy""></a></h2><p>The workflow stops at a pull request. A human reviews the diff and decides whether to merge it; a separate deployment action decides when the new behavior becomes live.</p><p>This separation gives each boundary a real control:</p><ul><li>Repository permissions limit who can push the branch.</li><li>Branch protection and review policy govern the merge.</li><li>Deployment authorization governs the running agent.</li></ul><p>After deployment, repeat the original request or regression eval to confirm the behavior changed without crossing the freeze line.</p><h2 id="configure-it" tabindex="-1">Configure it <a class="header-anchor" href="#configure-it" aria-label="Permalink to "Configure it""></a></h2><ul><li><code>repo</code> is the source repository URL.</li><li><code>path</code> is the agent's repository-relative directory.</li><li><code>ref</code> is the deployed branch or ref that new branches and pull requests target; it defaults to <code>main</code>.</li><li><code>notes</code> adds tree-specific guidance to every coding brief, such as a required test command or PR convention.</li><li><code>deploy</code> tells the skill who deploys a merged change and when it becomes live.</li></ul><p><code>notes</code> and <code>deploy</code> insert prose into the contributed skill. They do not run checks, merge a branch, or trigger a deployment.</p><p>Validation checks the URL and path shape. It does not prove the source exists, matches the current deployment, or appears in the Cloud agents repository allowlist, so keep those values aligned yourself.</p><h2 id="what-the-extension-enforces" tabindex="-1">What the extension enforces <a class="header-anchor" href="#what-the-extension-enforces" aria-label="Permalink to "What the extension enforces""></a></h2><p><code>improve__yourself</code> is model guidance for locating the change, writing a brief, following repository rules, opening a PR, and reporting it. Rules such as "never merge" are instructions, not framework-enforced permissions.</p><p>Use repository and deployment controls for hard enforcement. The extension provides a repeatable path through those controls; it does not replace them.</p><h2 id="what-s-next" tabindex="-1">What's next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to "What's next""></a></h2><ul><li><a href="./cloud-agents.html">Cloud agents</a>: delegation and steering</li><li><a href="./../building-with-agents.html">Build with a coding agent</a>: have an external coding agent edit the project directly</li><li><a href="./../reference/extensions.html">Extensions</a>: namespaces and overlays</li><li><a href="./../deployment.html">Deployment</a>: make a merged source change live</li><li><a href="./../evals.html">Evals</a>: protect the requested behavior before and after the change</li></ul>`,30)])])}const k=s(n,[["render",o]]);export{u as __pageData,k as default};
|
package/dist/docs/assets/{guides_improve.md.CRrYq22s.lean.js → guides_improve.md.CZKVt1cT.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const
|
|
1
|
+
import{_ as s,c as a,o as i,a3 as t}from"./chunks/framework.BNw1pucY.js";const u=JSON.parse('{"title":"Self-improvement","description":"Let an agent propose a change to its own source through a branch and pull request, with review and deployment kept separate.","frontmatter":{"title":"Self-improvement","description":"Let an agent propose a change to its own source through a branch and pull request, with review and deployment kept separate."},"headers":[],"relativePath":"guides/improve.md","filePath":"guides/improve.md"}'),n={name:"guides/improve.md"};function o(r,e,l,h,p,d){return i(),a("div",null,[...e[0]||(e[0]=[t("",30)])])}const k=s(n,[["render",o]]);export{u as __pageData,k as default};
|
package/dist/docs/assets/{guides_mcp-oauth.md.DR3zhC9r.js → guides_mcp-oauth.md.BM_eFC0L.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Host MCP OAuth","description":"Authorize a private MCP server locally, constrain its tools, and
|
|
1
|
+
import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Host MCP OAuth","description":"Authorize a private MCP server locally, constrain its tools, and choose where its credentials live.","frontmatter":{"title":"Host MCP OAuth","description":"Authorize a private MCP server locally, constrain its tools, and choose where its credentials live."},"headers":[],"relativePath":"guides/mcp-oauth.md","filePath":"guides/mcp-oauth.md"}'),n={name:"guides/mcp-oauth.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="connect-a-private-mcp-server-with-oauth" tabindex="-1">Connect a private MCP server with OAuth <a class="header-anchor" href="#connect-a-private-mcp-server-with-oauth" aria-label="Permalink to "Connect a private MCP server with OAuth""></a></h1><p>Host MCP OAuth lets a BDK process authorize a remote MCP server without putting tokens in the agent's source or workspace. Use it when the server speaks OAuth and its credentials should belong to the serve host instead of a person's Cursor account.</p><h2 id="use-a-private-mcp-tool-locally" tabindex="-1">Use a private MCP tool locally <a class="header-anchor" href="#use-a-private-mcp-tool-locally" aria-label="Permalink to "Use a private MCP tool locally""></a></h2><p>Declare the remote server, authorize it once in the browser, and start the agent. The next local turn can call the server's named tools with the credentials stored on that host.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/mcp-connections/inventory.ts</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineConnection } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/connections"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
3
|
<span class="line"></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineConnection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -7,7 +7,7 @@ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
|
|
|
7
7
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> advertiseTools: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
8
8
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk mcp oauth inventory</span></span>
|
|
9
9
|
<span class="line"><span>bdk run --dir . \\</span></span>
|
|
10
|
-
<span class="line"><span> --message "Which east-coast warehouse has SKU-142 in stock?"</span></span></code></pre></div><p>The filename is the connection name used by the CLI and <code>ctx.host.mcp</code>. Changing the server URL invalidates its saved authorization, so run <code>mcp oauth</code> again after moving the endpoint.</p><h2 id="connect-on-first-use" tabindex="-1">Connect on first use <a class="header-anchor" href="#connect-on-first-use" aria-label="Permalink to "Connect on first use""></a></h2><p>You can also let the first unauthenticated call ask for authorization. The turn parks and the playground shows <strong>Connect</strong>. Finish the browser flow, return to the playground, and confirm <strong>Connected</strong>; the same call retries and the turn continues without restarting the agent.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk serve --dir . --dev</span></span></code></pre></div><p>Connect authorizes the process that is running now
|
|
10
|
+
<span class="line"><span> --message "Which east-coast warehouse has SKU-142 in stock?"</span></span></code></pre></div><p>The filename is the connection name used by the CLI and <code>ctx.host.mcp</code>. Changing the server URL invalidates its saved authorization, so run <code>mcp oauth</code> again after moving the endpoint.</p><h2 id="connect-on-first-use" tabindex="-1">Connect on first use <a class="header-anchor" href="#connect-on-first-use" aria-label="Permalink to "Connect on first use""></a></h2><p>You can also let the first unauthenticated call ask for authorization. The turn parks and the playground shows <strong>Connect</strong>. Finish the browser flow, return to the playground, and confirm <strong>Connected</strong>; the same call retries and the turn continues without restarting the agent.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk serve --dir . --dev</span></span></code></pre></div><p>Connect authorizes the process that is running now.</p><h2 id="keep-privileged-tools-behind-a-wrapper" tabindex="-1">Keep privileged tools behind a wrapper <a class="header-anchor" href="#keep-privileged-tools-behind-a-wrapper" aria-label="Permalink to "Keep privileged tools behind a wrapper""></a></h2><p>Put a connection under <code>bot/host-connections/</code> when the model should not receive the MCP server's tools directly. A server tool can expose one constrained operation while <code>ctx.host.mcp</code> keeps the broader server on the host.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/host-connections/inventory.ts</span></span>
|
|
11
11
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineConnection } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/connections"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
12
12
|
<span class="line"></span>
|
|
13
13
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineConnection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -35,16 +35,4 @@ import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c
|
|
|
35
35
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> stock: result.structuredContent </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">??</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
36
36
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> };</span></span>
|
|
37
37
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
38
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>The model sees <code>get_stock</code>, not the unrestricted inventory server. Use this shape when code should own an allowlist
|
|
39
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
40
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> hosting: {</span></span>
|
|
41
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> egressDomains: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"mcp.example.com"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
42
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> secretNames: [</span></span>
|
|
43
|
-
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "MCP_OAUTH_INVENTORY_ACCESS_TOKEN"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
44
|
-
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "MCP_OAUTH_INVENTORY_REFRESH_TOKEN"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
45
|
-
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "MCP_OAUTH_INVENTORY_CLIENT_ID"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
46
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
47
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
48
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk mcp oauth inventory --store</span></span>
|
|
49
|
-
<span class="line"><span>bdk secrets list my-agent</span></span>
|
|
50
|
-
<span class="line"><span>bdk deploy</span></span></code></pre></div><p><code>--store</code> writes deployment secrets; it does not restart the current process. Follow the CLI or dashboard prompt to redeploy, then exercise the hosted agent.</p><p>These credentials belong to the deployment, not to the person who clicked Connect. Anyone able to use that agent can reach the MCP capabilities you expose, so keep privileged servers host-only or narrow their tool list.</p><h2 id="choose-where-credentials-live" tabindex="-1">Choose where credentials live <a class="header-anchor" href="#choose-where-credentials-live" aria-label="Permalink to "Choose where credentials live""></a></h2><p>Use the credential shape that matches who should own access:</p><ul><li><p>Choose <code>cursorAccount: true</code> for connectors already authorized under MCP in the Cursor dashboard. Their tokens stay on the Cursor backend.</p></li><li><p>Choose <code>url</code> with <code>oauth: true</code> when the serve host or hosted deployment should hold OAuth credentials.</p></li><li><p>Choose <code>url</code> with static <code>headers</code> when the server uses an API key or bearer token instead of OAuth.</p></li></ul><p>Host OAuth and per-session <code>auth</code> are different identity models and cannot be combined on one connection. Use per-session auth when each caller needs a different downstream identity.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../../skills/mcp-auth/SKILL.html"><code>skills/mcp-auth/SKILL.md</code></a>: the companion setup procedure for coding agents</li><li><a href="./../reference/connections.html">MCP connections</a>: transports, account connectors, per-session auth, and tool filtering</li><li><a href="./../reference/cli.html#mcp-oauth">CLI reference</a>: OAuth command flags and browser callback behavior</li><li><a href="./../deployment.html">Deployment</a>: hosted secrets and egress</li><li><a href="./../troubleshooting.html">Troubleshooting</a>: authorization symptoms and remedies</li></ul>`,28)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
|
|
38
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>The model sees <code>get_stock</code>, not the unrestricted inventory server. Use this shape when code should own an allowlist or another side-effect gate.</p><h2 id="use-an-oauth-server-from-a-hosted-agent" tabindex="-1">Use an OAuth server from a hosted agent <a class="header-anchor" href="#use-an-oauth-server-from-a-hosted-agent" aria-label="Permalink to "Use an OAuth server from a hosted agent""></a></h2><p>Tokens from <code>mcp oauth</code> stay in the CLI config directory of the machine that authorized them, so a hosted deployment doesn't receive them. For a Cursor-managed agent, add the server under MCP in the Cursor dashboard, reach it through a <a href="./../reference/connections.html#cursor-account-mcp-connection"><code>cursorAccount: true</code> connection</a>, and connect it from <strong>Deployed Agents</strong> in the <a href="https://cursor.com/dashboard" target="_blank" rel="noreferrer">dashboard</a>.</p><p>Anyone able to use that agent can reach the MCP capabilities you expose, so narrow the connection's <code>servers</code> list and keep privileged operations behind a host-side wrapper.</p><h2 id="choose-where-credentials-live" tabindex="-1">Choose where credentials live <a class="header-anchor" href="#choose-where-credentials-live" aria-label="Permalink to "Choose where credentials live""></a></h2><p>Use the credential shape that matches who should own access:</p><ul><li><p>Choose <code>cursorAccount: true</code> for connectors already authorized under MCP in the Cursor dashboard. Their tokens stay on the Cursor backend.</p></li><li><p>Choose <code>url</code> with <code>oauth: true</code> when the machine running <code>bdk serve</code> should hold OAuth credentials.</p></li><li><p>Choose <code>url</code> with static <code>headers</code> when the server uses an API key or bearer token instead of OAuth.</p></li></ul><p>Host OAuth and per-session <code>auth</code> are different identity models and cannot be combined on one connection. Use per-session auth when each caller needs a different downstream identity.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../../skills/mcp-auth/SKILL.html"><code>skills/mcp-auth/SKILL.md</code></a>: the companion setup procedure for coding agents</li><li><a href="./../reference/connections.html">MCP connections</a>: transports, account connectors, per-session auth, and tool filtering</li><li><a href="./../reference/cli.html#mcp-oauth">CLI reference</a>: OAuth command flags and browser callback behavior</li><li><a href="./../deployment.html">Deployment</a>: hosted egress and secrets</li><li><a href="./../troubleshooting.html">Troubleshooting</a>: authorization symptoms and remedies</li></ul>`,25)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as a,o as e,a3 as t}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Host MCP OAuth","description":"Authorize a private MCP server locally, constrain its tools, and choose where its credentials live.","frontmatter":{"title":"Host MCP OAuth","description":"Authorize a private MCP server locally, constrain its tools, and choose where its credentials live."},"headers":[],"relativePath":"guides/mcp-oauth.md","filePath":"guides/mcp-oauth.md"}'),n={name:"guides/mcp-oauth.md"};function h(l,s,o,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[t("",25)])])}const E=i(n,[["render",h]]);export{c as __pageData,E as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const
|
|
1
|
+
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out.","frontmatter":{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out."},"headers":[],"relativePath":"guides/webhooks.md","filePath":"guides/webhooks.md"}'),t={name:"guides/webhooks.md"};function h(l,s,p,k,r,d){return e(),a("div",null,[...s[0]||(s[0]=[n(`<h1 id="webhook-agents" tabindex="-1">Webhook agents <a class="header-anchor" href="#webhook-agents" aria-label="Permalink to "Webhook agents""></a></h1><p>A custom channel turns an event from another system into an agent conversation, then sends the result back to the system that started it. Use one when the built-in <a href="./../reference/http-api.html">HTTP API</a> does not match the provider's payload, conversation key, or reply path.</p><p>Author <code>bot/channels/<id>.ts</code>. Its routes mount under <code>/<slug>/v1/channels/<id></code>.</p><h2 id="receive-a-webhook-and-send-the-answer-back" tabindex="-1">Receive a webhook and send the answer back <a class="header-anchor" href="#receive-a-webhook-and-send-the-answer-back" aria-label="Permalink to "Receive a webhook and send the answer back""></a></h2><p>When a ticket system sends a new message, this endpoint responds with <code>202 Accepted</code> and an empty body right away. The agent keeps working after the HTTP request ends, and its completed answer appears as a comment on the ticket.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// bot/channels/tickets.ts</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineChannel, POST } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/channels"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "zod"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { postTicketComment } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "../lib/tickets.js"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
@@ -23,7 +23,7 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
23
23
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> title: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Ticket \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">body</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ticketId</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
24
24
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
|
25
25
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> );</span></span>
|
|
26
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#
|
|
26
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
27
27
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
28
28
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }),</span></span>
|
|
29
29
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
@@ -35,7 +35,7 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
35
35
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> postTicketComment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(channel.state.ticketId, event.data.text);</span></span>
|
|
36
36
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
37
37
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
38
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>postTicketComment</code> is a small wrapper around the ticket provider's SDK. Keeping that write in the event handler means the webhook request does not stay open while the model works.</p><h2 id="keep-one-conversation-per-ticket" tabindex="-1">Keep one conversation per ticket <a class="header-anchor" href="#keep-one-conversation-per-ticket" aria-label="Permalink to "Keep one conversation per ticket""></a></h2><p>Without a conversation key, every delivery creates a new session. Add the ticket ID as the <code>continuationToken</code> so the opening message and all later comments resume the same conversation, while a different ticket starts its own.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">waitUntil</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
38
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>postTicketComment</code> is a small wrapper around the ticket provider's SDK. Keeping that write in the event handler means the webhook request does not stay open while the model works.</p><p>The caller only ever receives that empty <code>202</code>. On Cursor-managed hosting, the deployment sends it before your handler runs and discards whatever the handler returns, so deliver every result, including failures, back through the provider's API. See <a href="./../reference/channels.html#route-responses">Route responses</a>.</p><h2 id="keep-one-conversation-per-ticket" tabindex="-1">Keep one conversation per ticket <a class="header-anchor" href="#keep-one-conversation-per-ticket" aria-label="Permalink to "Keep one conversation per ticket""></a></h2><p>Without a conversation key, every delivery creates a new session. Add the ticket ID as the <code>continuationToken</code> so the opening message and all later comments resume the same conversation, while a different ticket starts its own.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">waitUntil</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
39
39
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> send</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(body.message, {</span></span>
|
|
40
40
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> continuationToken: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`ticket:\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">body</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ticketId</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
41
41
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> state: { ticketId: body.ticketId },</span></span>
|
|
@@ -46,10 +46,11 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
46
46
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ticketId: body.ticketId,</span></span>
|
|
47
47
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
48
48
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (prepared.isError) {</span></span>
|
|
49
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">
|
|
50
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">
|
|
51
|
-
<span class="line"><span style="--shiki-light:#
|
|
49
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> postTicketComment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
50
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> body.ticketId,</span></span>
|
|
51
|
+
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "I couldn't load this ticket, so I didn't draft a reply."</span></span>
|
|
52
52
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> );</span></span>
|
|
53
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
53
54
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
54
55
|
<span class="line"></span>
|
|
55
56
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> waitUntil</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
@@ -61,8 +62,8 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
61
62
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
62
63
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> })</span></span>
|
|
63
64
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> );</span></span>
|
|
64
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#
|
|
65
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>The same <code>message.completed</code> handler from the first example delivers the answer back to the ticket.</p><h2 id="routes-receive-events-deliver" tabindex="-1">Routes receive, events deliver <a class="header-anchor" href="#routes-receive-events-deliver" aria-label="Permalink to "Routes receive, events deliver""></a></h2><p>Routes own inbound HTTP. A route validates the request, decides whether to start or resume a turn, and
|
|
65
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
66
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>The same <code>message.completed</code> handler from the first example delivers the answer back to the ticket. When preparation fails, the handler reports that on the ticket instead.</p><h2 id="routes-receive-events-deliver" tabindex="-1">Routes receive, events deliver <a class="header-anchor" href="#routes-receive-events-deliver" aria-label="Permalink to "Routes receive, events deliver""></a></h2><p>Routes own inbound HTTP. A route validates the request, decides whether to start or resume a turn, and acknowledges the caller with <code>202</code>. The channel's <code>events</code> handlers receive session events later, which is where you deliver the model's answer or report a failure to the originating system.</p><h2 id="validate-payloads-with-zod" tabindex="-1">Validate payloads with Zod <a class="header-anchor" href="#validate-payloads-with-zod" aria-label="Permalink to "Validate payloads with Zod""></a></h2><p><code>POST</code>, <code>PUT</code>, and <code>PATCH</code> routes require a Zod <code>bodySchema</code>; <code>GET</code> requires a <code>querySchema</code>. Validation runs before the handler, and the parsed value arrives as typed <code>body</code> or <code>query</code>. Use <code>z.unknown()</code> when the provider controls a variable payload and your own parser will narrow it.</p><p>The route description and schema also appear in <code>GET /v1/info</code>. The playground uses them to add a <strong>Try</strong> action and a matching slash command, so you can exercise the same handler without building a separate test UI.</p><h2 id="use-handler-context" tabindex="-1">Use handler context <a class="header-anchor" href="#use-handler-context" aria-label="Permalink to "Use handler context""></a></h2><p>The handler context keeps deterministic setup and model work in one route:</p><ul><li><p><code>send</code> starts or resumes the agent conversation.</p></li><li><p><code>callTool</code> runs an authored server tool without starting a model turn.</p></li><li><p><code>waitUntil</code> keeps background work alive after the handler returns. Await <code>send</code> when later handler code needs the session handle, such as calling <code>session.waitForCompletion()</code> before reporting the turn outcome to the provider.</p></li><li><p><code>host</code> provides authenticated services for API calls made by channel code.</p></li></ul><p>The full handler API lives in the <a href="./../reference/channels.html#handler-arguments">Channels reference</a>.</p><h2 id="protect-public-webhooks" tabindex="-1">Protect public webhooks <a class="header-anchor" href="#protect-public-webhooks" aria-label="Permalink to "Protect public webhooks""></a></h2><p>Custom routes accept direct loopback requests by default. They reject forwarded requests, so a tunnel or reverse proxy does not silently turn a local development endpoint into a public one.</p><p>Before accepting remote traffic, choose an explicit boundary. <code>bearerAuth()</code> works when the sender can attach an authorization header. On managed hosting, webhook providers often cannot attach the agent alias token, so <code>publicEndpoint()</code> lets that custom channel bypass it. That opens the route to every caller; verify the provider signature before starting a turn or calling a tool.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineChannel, POST, publicEndpoint } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/bdk/channels"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
66
67
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "zod"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
67
68
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { verifyProviderSignature } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "../lib/tickets.js"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
68
69
|
<span class="line"></span>
|
|
@@ -76,17 +77,17 @@ import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
76
77
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> rawBody</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> request.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">text</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>
|
|
77
78
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> signature</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> request.headers.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">get</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"x-provider-signature"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
|
|
78
79
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">verifyProviderSignature</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(rawBody, signature)) {</span></span>
|
|
79
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#
|
|
80
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
80
81
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
81
82
|
<span class="line"></span>
|
|
82
83
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Parse and dispatch only after the signature passes.</span></span>
|
|
83
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#
|
|
84
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">202</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
84
85
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
85
86
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }),</span></span>
|
|
86
87
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
87
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>publicEndpoint()</code> only opens this channel's routes. The built-in session and tool APIs stay private. See <a href="./../reference/channels.html#auth-policies">Auth policies</a> for bearer tokens and the complete policy reference.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to "Test locally""></a></h2><p>Run the agent in development mode, then replay the same payload the provider will send. The
|
|
88
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Because a hosted handler runs after the <code>202</code>, a delivery with a bad signature is dropped silently rather than rejected. When the provider sends a shared secret header or signs the raw body with HMAC-SHA256, use <code>sharedSecretAuth()</code> or <code>hmacSignatureAuth()</code> instead. Hosting checks those policies before the handler runs and answers a bad delivery with <code>401</code>.</p><p><code>publicEndpoint()</code> only opens this channel's routes. The built-in session and tool APIs stay private. See <a href="./../reference/channels.html#auth-policies">Auth policies</a> for bearer tokens and the complete policy reference.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to "Test locally""></a></h2><p>Run the agent in development mode, then replay the same payload the provider will send. The route should answer <code>202</code> with an empty body right away, and the resulting session should appear in the playground while the reply is delivered.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk serve --dir . --dev</span></span>
|
|
88
89
|
<span class="line"><span></span></span>
|
|
89
90
|
<span class="line"><span>curl -sS -X POST \\</span></span>
|
|
90
91
|
<span class="line"><span> http://127.0.0.1:3000/<slug>/v1/channels/tickets/ticket \\</span></span>
|
|
91
92
|
<span class="line"><span> -H 'content-type: application/json' \\</span></span>
|
|
92
|
-
<span class="line"><span> -d '{"ticketId":"ENG-142","message":"CSV export returns 500"}'</span></span></code></pre></div><p>Keep representative payloads under <code>fixtures/</code> and pass them with <code>--data-binary @fixtures/<event>.json</code>. You can also open the route's <strong>Try</strong> action in the playground for manual probes.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/channels.html">Channels reference</a>: route methods, handler arguments, events, state, and auth policies</li><li><a href="./../templates/triage.html">Triage Linear or Jira issues</a>: a complete signed tracker webhook with reply delivery</li><li><a href="./../reference/http-api.html">HTTP API</a>: built-in session, follow-up, stream, and tool routes</li><li><a href="./../deployment.html#use-the-hosted-agent">Deployment</a>: stable hosted URLs and alias-token behavior</li><li><a href="./../evals.html">Evals</a>: turn saved payloads into regression fixtures</li></ul>`,
|
|
93
|
+
<span class="line"><span> -d '{"ticketId":"ENG-142","message":"CSV export returns 500"}'</span></span></code></pre></div><p>Keep representative payloads under <code>fixtures/</code> and pass them with <code>--data-binary @fixtures/<event>.json</code>. You can also open the route's <strong>Try</strong> action in the playground for manual probes.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/channels.html">Channels reference</a>: route methods, handler arguments, events, state, and auth policies</li><li><a href="./../templates/triage.html">Triage Linear or Jira issues</a>: a complete signed tracker webhook with reply delivery</li><li><a href="./../reference/http-api.html">HTTP API</a>: built-in session, follow-up, stream, and tool routes</li><li><a href="./../deployment.html#use-the-hosted-agent">Deployment</a>: stable hosted URLs and alias-token behavior</li><li><a href="./../evals.html">Evals</a>: turn saved payloads into regression fixtures</li></ul>`,37)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
|
package/dist/docs/assets/{guides_webhooks.md.BBvAm_VF.lean.js → guides_webhooks.md.Cpdc3BDX.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const
|
|
1
|
+
import{_ as i,c as a,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out.","frontmatter":{"title":"Webhooks & custom channels","description":"Receive provider events, keep one conversation per domain object, and deliver agent replies back out."},"headers":[],"relativePath":"guides/webhooks.md","filePath":"guides/webhooks.md"}'),t={name:"guides/webhooks.md"};function h(l,s,p,k,r,d){return e(),a("div",null,[...s[0]||(s[0]=[n("",37)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t,c as s,o as a,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",g=JSON.parse(`{"title":"Grok Bot Development Kit (BDK)","description":"Build, test, and deploy BDK bots and agents as code on Cursor's agent harness.","frontmatter":{"title":"Grok Bot Development Kit (BDK)","description":"Build, test, and deploy BDK bots and agents as code on Cursor's agent harness."},"headers":[],"relativePath":"index.md","filePath":"README.md"}`),r={name:"index.md"};function i(p,e,l,d,c,h){return a(),s("div",null,[...e[0]||(e[0]=[n('<h1 id="grok-bot-development-kit-bdk" tabindex="-1">Grok Bot Development Kit (BDK) <a class="header-anchor" href="#grok-bot-development-kit-bdk" aria-label="Permalink to "Grok Bot Development Kit (BDK)""></a></h1><p>The Grok Bot Development Kit (BDK) lets you define, test, and deploy agents as code. It uses the Cursor SDK harness that powers Bugbot, Security Review,
|
|
1
|
+
import{_ as t,c as s,o as a,a3 as n}from"./chunks/framework.BNw1pucY.js";const o="/docs/architecture.svg",g=JSON.parse(`{"title":"Grok Bot Development Kit (BDK)","description":"Build, test, and deploy BDK bots and agents as code on Cursor's agent harness.","frontmatter":{"title":"Grok Bot Development Kit (BDK)","description":"Build, test, and deploy BDK bots and agents as code on Cursor's agent harness."},"headers":[],"relativePath":"index.md","filePath":"README.md"}`),r={name:"index.md"};function i(p,e,l,d,c,h){return a(),s("div",null,[...e[0]||(e[0]=[n('<h1 id="grok-bot-development-kit-bdk" tabindex="-1">Grok Bot Development Kit (BDK) <a class="header-anchor" href="#grok-bot-development-kit-bdk" aria-label="Permalink to "Grok Bot Development Kit (BDK)""></a></h1><p>The Grok Bot Development Kit (BDK) lets you define, test, and deploy agents as code. It uses the Cursor SDK harness that powers Bugbot, Security Review, Approval Bot, and Rollouts.</p><p>A BDK project is a folder of Markdown and TypeScript. Combine deterministic code with model judgment, then make the bot or agent available in source control, Slack, issue trackers, and Cursor.</p><h2 id="why-use-it" tabindex="-1">Why use it <a class="header-anchor" href="#why-use-it" aria-label="Permalink to "Why use it""></a></h2><ul><li><p><strong>Bots and agents live in your repo.</strong> Instructions, tools, and evals are files you review, version, and ship like the rest of your code.</p></li><li><p><strong>Cursor runs the loop.</strong> You write the instructions and tools. Your agent gets Cursor's models, tool calling, skills, MCP, and subagents. Each turn runs on your host.</p></li><li><p><strong>Use it where you work.</strong> Trigger a project from source-control events, Slack threads, custom webhooks, or schedules.</p></li><li><p><strong>Test normal TypeScript.</strong> Add evals and unit tests without a separate configuration language.</p></li><li><p><strong>Choose where it runs.</strong> Deploy to Cursor-managed hosting or run the process on your infrastructure.</p></li></ul><h2 id="when-to-use-bdk" tabindex="-1">When to use BDK <a class="header-anchor" href="#when-to-use-bdk" aria-label="Permalink to "When to use BDK""></a></h2><table tabindex="0"><thead><tr><th></th><th>Cursor Automations</th><th>Grok Bot</th><th>BDK</th></tr></thead><tbody><tr><td><strong>Use for</strong></td><td>Repeatable jobs driven by a prompt and a trigger</td><td>Interactive agents that work with you in Cursor</td><td>Agents that need custom code, integrations, tests, or deployment choices</td></tr><tr><td><strong>You define</strong></td><td>A prompt, model, and trigger in the dashboard</td><td>Instructions, skills, and connected tools in the app</td><td>A versioned Markdown and TypeScript project</td></tr><tr><td><strong>Where it runs</strong></td><td>Cursor-managed</td><td>Cursor-managed</td><td>Cursor-managed hosting or your infrastructure</td></tr><tr><td><strong>Choose it when</strong></td><td>The job fits a schedule or event trigger</td><td>You want an agent you can configure and talk to without creating a software project</td><td>You want deterministic code around model judgment and a project your team can review and test</td></tr></tbody></table><h2 id="architecture" tabindex="-1">Architecture <a class="header-anchor" href="#architecture" aria-label="Permalink to "Architecture""></a></h2><p>Define the project in source control. Run execution, inference, and sandboxing on Cursor infrastructure or on your own host.</p><p><img src="'+o+`" alt="BDK architecture: you bring the agent as code, and the platform provides triggers, runtime, integrations, and operations"></p><h2 id="get-started" tabindex="-1">Get started <a class="header-anchor" href="#get-started" aria-label="Permalink to "Get started""></a></h2><p>Install <code>@cursor/bdk</code>, then start with <code>bdk init</code> and <code>bdk dev</code>.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>npm install --global @cursor/bdk</span></span>
|
|
2
2
|
<span class="line"><span>bdk init ./my-bot</span></span>
|
|
3
3
|
<span class="line"><span>cd my-bot</span></span>
|
|
4
4
|
<span class="line"><span>bdk dev</span></span></code></pre></div><p>Open the project in Cursor. BDK projects use <code>bot/</code>.</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>my-bot/</span></span>
|
|
@@ -167,4 +167,4 @@ import{_ as i,c as a,o as n,a3 as t}from"./chunks/framework.BNw1pucY.js";const g
|
|
|
167
167
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
168
168
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Channel-turn <code>context</code> is a <code>readonly string[]</code>, so wrap each context block in an array. The <code>context</code> label under <code>progress.commitStatus</code> is a separate string option.</p><p>Keep <code>bdk dev</code> running. In a second terminal, replay an open pull request. Pull access is enough; repo admin isn't required:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bdk github replay https://github.com/acme/checkout/pull/42 \\</span></span>
|
|
169
169
|
<span class="line"><span> --dir . --action opened</span></span></code></pre></div><p>Open the playground and confirm <code>Review acme/checkout#42</code> contains the trigger, both tool calls, and the verdict.</p><h2 id="run-options" tabindex="-1">Run options <a class="header-anchor" href="#run-options" aria-label="Permalink to "Run options""></a></h2><ol><li><strong>CLI message</strong></li></ol><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span> bdk run --dir . --message "Review https://github.com/acme/checkout/pull/42"</span></span></code></pre></div><ol start="2"><li><strong>Local replay</strong></li></ol><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span> bdk github replay https://github.com/acme/checkout/pull/42 \\</span></span>
|
|
170
|
-
<span class="line"><span> --dir . --action opened</span></span></code></pre></div><h2 id="where-to-go-next" tabindex="-1">Where to go next <a class="header-anchor" href="#where-to-go-next" aria-label="Permalink to "Where to go next""></a></h2><ul><li><a href="./evals.html">Evals</a>: freeze these two PRs as regression checks so prompt changes can't flip a verdict</li><li><a href="./reference/tools.html">Tools</a>: more on typed tools,
|
|
170
|
+
<span class="line"><span> --dir . --action opened</span></span></code></pre></div><h2 id="where-to-go-next" tabindex="-1">Where to go next <a class="header-anchor" href="#where-to-go-next" aria-label="Permalink to "Where to go next""></a></h2><ul><li><a href="./evals.html">Evals</a>: freeze these two PRs as regression checks so prompt changes can't flip a verdict</li><li><a href="./reference/tools.html">Tools</a>: more on typed tools, dry-run effects, and direct calls</li><li><a href="./guides/github.html">GitHub</a>: fixtures, forwarding, and pulling events from Cursor</li><li><a href="./building-with-agents.html">Building agents with agents</a>: have a coding agent extend the project for you</li></ul>`,48)])])}const o=i(h,[["render",l]]);export{g as __pageData,o as default};
|