@cursor/bdk 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -18
- package/CHANGELOG.md +3 -0
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/bin/agent-serve.js +25 -21
- package/dist/channels/bitbucket/api.d.ts +2 -2
- package/dist/channels/bitbucket/api.d.ts.map +1 -1
- package/dist/channels/bitbucket/bitbucket-channel.js +1 -1
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +2 -2
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -1
- package/dist/channels/change-monitors/change-monitors-channel.js +1 -1
- package/dist/channels/deployments/deployments-channel.js +1 -1
- package/dist/channels/github/cursor-account.d.ts +7 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +22 -5
- package/dist/channels/github/github-channel.js +1 -1
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +2 -2
- package/dist/channels/gitlab/api.d.ts.map +1 -1
- package/dist/channels/gitlab/gitlab-channel.js +1 -1
- package/dist/channels/issues/issues-channel.js +1 -1
- package/dist/channels/origin/api.d.ts +4 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +1 -1
- package/dist/channels/origin/origin-webhook.d.ts +3 -3
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts +2 -2
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -1
- package/dist/channels/runs/runs-channel.js +1 -1
- package/dist/channels/slack/agentic-delivery.d.ts +2 -1
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
- package/dist/channels/slack/agentic-delivery.js +6 -10
- package/dist/channels/slack/agentic-signals.d.ts +2 -7
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -1
- package/dist/channels/slack/agentic-signals.js +4 -3
- package/dist/channels/slack/api.d.ts +1 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -0
- package/dist/channels/slack/constants.d.ts +2 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +2 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +3 -2
- package/dist/channels/slack/dispatch.d.ts +9 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +24 -20
- package/dist/channels/slack/interactive.d.ts +2 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts +3 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +9 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -1
- package/dist/channels/slack/reply-options.js +31 -1
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +7 -0
- package/dist/channels/slack/stream.d.ts +5 -1
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/types.d.ts +29 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +1 -1
- package/dist/channels.js +1 -1
- package/dist/docs/404.html +3 -3
- package/dist/docs/assets/{app.BjS1QEI4.js → app.BITbgXMP.js} +4 -4
- package/dist/docs/assets/changelog.md.sdD6ctqK.js +1 -0
- package/dist/docs/assets/changelog.md.sdD6ctqK.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.B45uCZp9.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BOuvjb5Y.js → VPLocalSearchBox.3qo4-bX9.js} +2 -2
- package/dist/docs/assets/chunks/{arc.3WR6Jf-y.js → arc.CTrZocKU.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.Dtb6Dqh6.js → architectureDiagram-Q4EWVU46.BkgIqxrv.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.BUyrgrZE.js → baseUniq.5w0JfVgo.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.BVLV_voZ.js → blockDiagram-DXYQGD6D.BVLtPjQc.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.jXJ1q70M.js → c4Diagram-AHTNJAMY.CQ7neZTW.js} +1 -1
- package/dist/docs/assets/chunks/channel.Cv2w64wj.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.zz1SMBvK.js → chunk-4BX2VUAB.D-hJ7uKM.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.CzYKuv3I.js → chunk-4TB4RGXK.RBYX5ywX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.C7_tcJZD.js → chunk-55IACEB6.Br05HoEb.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DeTwQPVO.js → chunk-EDXVE4YY.BD_7QS60.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DhMTl7ut.js → chunk-FMBD7UC4.BOPnMabX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Me7f5hEp.js → chunk-OYMX7WX6.DmGIdP8i.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.D0E0Bb6g.js → chunk-QZHKN3VN.CGHmolCB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.CdOOBFYL.js → chunk-YZCP3GAM.C_Uhs25v.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CtO2atCr.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CtO2atCr.js +1 -0
- package/dist/docs/assets/chunks/clone.hfsCtgP4.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BNbGESzN.js → cose-bilkent-S5V4N54A.DsU6xpcZ.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.zU7Lu_xJ.js → dagre-KV5264BT.BqQLDcoU.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.B9qOdE5h.js → diagram-5BDNPKRD.Cgv8uUNF.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.D8X-sf77.js → diagram-G4DWMVQ6.BXHPSXh_.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.CW7MvMlE.js → diagram-MMDJMWI5.CgJzo8f_.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.J489G0Nd.js → diagram-TYMM5635.CfiN6lgT.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.BkW7tGfs.js → erDiagram-SMLLAGMA.8n_hHzAd.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.jc9iWORD.js → flowDiagram-DWJPFMVM.B2pb1Dv_.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.B-UQfd9E.js → ganttDiagram-T4ZO3ILL.BFih4ucI.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.DFzrTSlJ.js → gitGraphDiagram-UUTBAWPF.CqZ8PTl8.js} +1 -1
- package/dist/docs/assets/chunks/{graph.C5IB6_e_.js → graph.0ufsI9gu.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DwF0-c8L.js → infoDiagram-42DDH7IO.BkPRFww4.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.fBaTqzE7.js → ishikawaDiagram-UXIWVN3A.DCRK-cVX.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CM8gDVJy.js → journeyDiagram-VCZTEJTY.BFyAJo33.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.YiD1p0LB.js → kanban-definition-6JOO6SKY.CmA2SoGc.js} +1 -1
- package/dist/docs/assets/chunks/{layout.6Um-DVJT.js → layout.CYY-CbMr.js} +1 -1
- package/dist/docs/assets/chunks/{linear.DcTeg4Hn.js → linear.DeeDV4Oq.js} +1 -1
- package/dist/docs/assets/chunks/{min.CIxkY8Fe.js → min.BL3XTBN2.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.D4QM_voR.js → mindmap-definition-QFDTVHPH.BcbY-G6H.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.nmB309G1.js → pieDiagram-DEJITSTG.dzDcQnPE.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D1HtZR3C.js → quadrantDiagram-34T5L4WZ.RxR0m5iK.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CZgQWob-.js → requirementDiagram-MS252O5E.DflaXb6Q.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.DtiBfU-P.js → sankeyDiagram-XADWPNL6.BteLKQAe.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.Cld4gDSt.js → sequenceDiagram-FGHM5R23.BD8jM8oz.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DatP823_.js → stateDiagram-FHFEXIEX.C8SBkbPH.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.BLz7Qyo3.js +1 -0
- package/dist/docs/assets/chunks/{theme.D5jbBys7.js → theme.DiViIOLe.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.DwQLI2be.js → timeline-definition-GMOUNBTQ.D64XF5dV.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.a5yMfnsa.js → vennDiagram-DHZGUBPP.CwmeYan-.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.B-FXivgT.js → wardley-RL74JXVD.DmAlXlpu.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.Dz--Opy3.js → wardleyDiagram-NUSXRM2D.5VJ2-5K0.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.Dl8w8TeT.js → xychartDiagram-5P7HB3ND.Cl6_fZVC.js} +1 -1
- package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.js → guides_hooks.md.B2XfGX50.js} +7 -3
- package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.js → guides_mcp-oauth.md.Cxq2TxBB.js} +3 -3
- package/dist/docs/assets/{guides_mcp-oauth.md.BM_eFC0L.lean.js → guides_mcp-oauth.md.Cxq2TxBB.lean.js} +1 -1
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
- package/dist/docs/assets/{guides_slack.md.Bn-WupSE.js → guides_slack.md.ClIyi7FI.js} +8 -3
- package/dist/docs/assets/{guides_slack.md.Bn-WupSE.lean.js → guides_slack.md.ClIyi7FI.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.IplwL25I.js → reference_agent-config.md.CGSx8COP.js} +6 -2
- package/dist/docs/assets/{reference_agent-config.md.IplwL25I.lean.js → reference_agent-config.md.CGSx8COP.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.Bxaa020x.js → reference_channels.md.CNNIS6K7.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.js → reference_hooks.md.CROr0QgC.js} +13 -7
- package/dist/docs/assets/{reference_hooks.md.B1jq3oGl.lean.js → reference_hooks.md.CROr0QgC.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.js → reference_schedules.md.BqWnJES4.js} +3 -3
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
- package/dist/docs/assets/{reference_skills.md.C2GWh7g8.js → reference_skills.md.Ckddg6KX.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.-6pypsWt.js → reference_tools.md.Bo0UfT0a.js} +1 -1
- package/dist/docs/assets/{style.nMsabY-V.css → style.B9o0luvp.css} +1 -1
- package/dist/docs/building-with-agents.html +37 -37
- package/dist/docs/changelog.html +60 -0
- package/dist/docs/changelog.md +86 -0
- package/dist/docs/deployment.html +37 -37
- package/dist/docs/evals.html +37 -37
- package/dist/docs/guides/agent-to-agent.html +37 -37
- package/dist/docs/guides/bitbucket.html +37 -37
- package/dist/docs/guides/cloud-agents.html +37 -37
- package/dist/docs/guides/convert-automation.html +37 -37
- package/dist/docs/guides/export-grokbot.html +37 -37
- package/dist/docs/guides/github.html +37 -37
- package/dist/docs/guides/gitlab.html +37 -37
- package/dist/docs/guides/grokbot-agents.html +37 -37
- package/dist/docs/guides/hooks.html +45 -41
- package/dist/docs/guides/hooks.md +7 -3
- package/dist/docs/guides/improve.html +37 -37
- package/dist/docs/guides/jev.html +37 -37
- package/dist/docs/guides/mcp-oauth.html +39 -39
- package/dist/docs/guides/mcp-oauth.md +12 -0
- package/dist/docs/guides/migrate.html +37 -37
- package/dist/docs/guides/opentelemetry.html +62 -70
- package/dist/docs/guides/opentelemetry.md +149 -179
- package/dist/docs/guides/pagerduty.html +37 -37
- package/dist/docs/guides/slack.html +44 -39
- package/dist/docs/guides/slack.md +41 -0
- package/dist/docs/guides/webhooks.html +37 -37
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +37 -37
- package/dist/docs/index.html +37 -37
- package/dist/docs/llms-full.txt +385 -193
- package/dist/docs/llms.txt +2 -1
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/reference/agent-config.html +42 -38
- package/dist/docs/reference/agent-config.md +21 -1
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/channels.html +38 -38
- package/dist/docs/reference/channels.md +5 -1
- package/dist/docs/reference/cli.html +37 -37
- package/dist/docs/reference/connections.html +37 -37
- package/dist/docs/reference/evals.html +37 -37
- package/dist/docs/reference/extensions.html +37 -37
- package/dist/docs/reference/hooks.html +49 -43
- package/dist/docs/reference/hooks.md +10 -5
- package/dist/docs/reference/http-api.html +37 -37
- package/dist/docs/reference/instructions.html +37 -37
- package/dist/docs/reference/memory.html +37 -37
- package/dist/docs/reference/playground.html +36 -36
- package/dist/docs/reference/project-layout.html +37 -37
- package/dist/docs/reference/prompt.html +37 -37
- package/dist/docs/reference/schedules.html +40 -40
- package/dist/docs/reference/sessions.html +58 -37
- package/dist/docs/reference/sessions.md +46 -1
- package/dist/docs/reference/skills.html +40 -40
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/tools.html +39 -39
- package/dist/docs/reference/tools.md +3 -3
- package/dist/docs/templates/agentic-owners.html +37 -37
- package/dist/docs/templates/grokbot-agents.html +37 -37
- package/dist/docs/templates/security-reviewer.html +37 -37
- package/dist/docs/templates/thermo-quality-review.html +37 -37
- package/dist/docs/templates/thermo-review.html +37 -37
- package/dist/docs/templates/triage.html +37 -37
- package/dist/docs/troubleshooting.html +36 -36
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +15 -15
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +1 -1
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-grokbot-agents/extension.js +7 -3
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -1
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +1 -1
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +1 -1
- package/dist/extensions/improve/extension.js +1 -1
- package/dist/extensions/jev/extension.js +2 -2
- package/dist/extensions/jev/tools/evaluate.js +3 -3
- package/dist/extensions/slack-communication/extension.js +1 -1
- package/dist/extensions/slack-communication/tools/delete-message.js +1 -1
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -1
- package/dist/extensions/slack-communication/tools/edit-message.js +3 -6
- package/dist/extensions/slack-communication/tools/post-card.js +1 -1
- package/dist/extensions/slack-communication/tools/post-file.js +1 -1
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -1
- package/dist/extensions/slack-communication/tools/post-update.js +3 -6
- package/dist/extensions/slack-communication/tools/react.js +1 -1
- package/dist/extensions/slack-communication/tools/set-status.js +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/index.d.ts +14 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -4
- package/dist/internal/as-of.d.ts +2 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +2 -0
- package/dist/internal/builtin-tools/reminders.js +1 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +18 -10
- package/dist/internal/continuation.d.ts +3 -0
- package/dist/internal/continuation.d.ts.map +1 -0
- package/dist/internal/continuation.js +1 -0
- package/dist/internal/conversation-mirror.d.ts +5 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +12 -1
- package/dist/internal/convert-automation/convert-workflow.js +1 -1
- package/dist/internal/convert-grokbot/answers.d.ts.map +1 -1
- package/dist/internal/convert-grokbot/answers.js +10 -8
- package/dist/internal/convert-grokbot/recipe.d.ts +1 -1
- package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -1
- package/dist/internal/convert-grokbot/recipe.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +2 -0
- package/dist/internal/cursor/backend-client.d.ts +8 -3
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +8 -3
- package/dist/internal/cursor/credentials.d.ts +2 -2
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +1 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts +6 -2
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +15 -6
- package/dist/internal/deferred-channel-session.d.ts +5 -4
- package/dist/internal/deferred-channel-session.d.ts.map +1 -1
- package/dist/internal/deferred-channel-session.js +6 -4
- package/dist/internal/deploy-client.d.ts +5 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -3
- package/dist/internal/deploy-manifest.js +2 -2
- package/dist/internal/describe-error.d.ts +2 -0
- package/dist/internal/describe-error.d.ts.map +1 -1
- package/dist/internal/describe-error.js +2 -0
- package/dist/internal/discovery/context.d.ts.map +1 -1
- package/dist/internal/discovery/context.js +1 -2
- package/dist/internal/discovery/cursor-plugin.js +8 -8
- package/dist/internal/discovery/extensions.js +15 -8
- package/dist/internal/discovery/info.d.ts +2 -2
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +6 -9
- package/dist/internal/discovery/instrumentation.d.ts +10 -0
- package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
- package/dist/internal/discovery/instrumentation.js +29 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +4 -4
- package/dist/internal/discovery/project-public.d.ts +16 -0
- package/dist/internal/discovery/project-public.d.ts.map +1 -0
- package/dist/internal/discovery/project-public.js +54 -0
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +13 -3
- package/dist/internal/discovery/services.d.ts +5 -4
- package/dist/internal/discovery/services.d.ts.map +1 -1
- package/dist/internal/discovery/services.js +12 -6
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +1 -0
- package/dist/internal/factory-resource-channel.d.ts +1 -1
- package/dist/internal/factory-resource-channel.d.ts.map +1 -1
- package/dist/internal/filesystem/nearest.d.ts +1 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -1
- package/dist/internal/filesystem/nearest.js +1 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -1
- package/dist/internal/filesystem/tools.js +1 -1
- package/dist/internal/handleAgentServeTrigger.d.ts +10 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
- package/dist/internal/handleAgentServeTrigger.js +3 -0
- package/dist/internal/hmac-secret-values.d.ts +1 -1
- package/dist/internal/hmac-secret-values.d.ts.map +1 -1
- package/dist/internal/host-otel.d.ts +1 -1
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +5 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +6 -2
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -0
- package/dist/internal/ids.d.ts +8 -0
- package/dist/internal/ids.d.ts.map +1 -1
- package/dist/internal/ids.js +20 -0
- package/dist/internal/init-scaffold.js +1 -1
- package/dist/internal/interview/agent-questions.d.ts +1 -1
- package/dist/internal/interview/agent-questions.d.ts.map +1 -1
- package/dist/internal/interview/agent-questions.js +1 -1
- package/dist/internal/interview/question.d.ts +2 -2
- package/dist/internal/interview/question.d.ts.map +1 -1
- package/dist/internal/interview/question.js +2 -2
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +3 -7
- package/dist/internal/mcp-endpoint.d.ts +16 -4
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +18 -6
- package/dist/internal/mcp-host.d.ts +9 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +15 -0
- package/dist/internal/otel/collector.d.ts +5 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +24 -5
- package/dist/internal/otel/config.d.ts +31 -21
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +121 -140
- package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
- package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
- package/dist/internal/otel/conversation-span-processor.js +34 -0
- package/dist/internal/otel/customer.d.ts +52 -0
- package/dist/internal/otel/customer.d.ts.map +1 -0
- package/dist/internal/otel/customer.js +727 -0
- package/dist/internal/otel/runtime.d.ts +12 -16
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +30 -234
- package/dist/internal/otel-env.d.ts +6 -0
- package/dist/internal/otel-env.d.ts.map +1 -0
- package/dist/internal/otel-env.js +5 -0
- package/dist/internal/reminder-runner.d.ts +9 -4
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +12 -10
- package/dist/internal/reminder-schedule.d.ts +1 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -1
- package/dist/internal/reminder-schedule.js +1 -0
- package/dist/internal/sdk-runner.d.ts +2 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +149 -13
- package/dist/internal/server.d.ts +4 -1
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +25 -24
- package/dist/internal/session-engine.d.ts +27 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +149 -21
- package/dist/internal/slack-provision-client.js +1 -1
- package/dist/internal/store-api-protocol.d.ts +1 -1
- package/dist/internal/store-api-protocol.d.ts.map +1 -1
- package/dist/internal/store-api-protocol.js +1 -1
- package/dist/internal/update-check.d.ts +2 -2
- package/dist/internal/update-check.d.ts.map +1 -1
- package/dist/internal/update-check.js +3 -3
- package/dist/internal/zod3-datetime.d.ts +12 -0
- package/dist/internal/zod3-datetime.d.ts.map +1 -0
- package/dist/internal/zod3-datetime.js +17 -0
- package/dist/otel-public.d.ts +2 -3
- package/dist/otel-public.d.ts.map +1 -1
- package/dist/otel-public.js +2 -2
- package/dist/otel.d.ts +3 -102
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +61 -97
- package/dist/playground/assets/index-CyPkf2y7.css +1 -0
- package/dist/playground/assets/{index-CHk6O92d.js → index-DpbzbqFY.js} +38 -38
- package/dist/playground/index.html +2 -2
- package/dist/public-deprecated.d.ts +36 -0
- package/dist/public-deprecated.d.ts.map +1 -0
- package/dist/public-deprecated.js +39 -0
- package/dist/tools.d.ts +3 -3
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +1 -1
- package/dist/types.d.ts +221 -90
- package/dist/types.d.ts.map +1 -1
- package/docs/changelog.md +91 -0
- package/docs/guides/hooks.md +7 -3
- package/docs/guides/mcp-oauth.md +12 -0
- package/docs/guides/opentelemetry.md +149 -184
- package/docs/guides/slack.md +41 -0
- package/docs/reference/agent-config.md +21 -1
- package/docs/reference/channels.md +5 -1
- package/docs/reference/hooks.md +10 -5
- package/docs/reference/sessions.md +46 -1
- package/docs/reference/tools.md +3 -3
- package/package.json +31 -7
- package/schemas/grokbot-answers.schema.json +11 -0
- package/skills/framework-map/SKILL.md +2 -1
- package/skills/otel/SKILL.md +28 -48
- package/templates/code-wiki/evals/wiki.eval.ts +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.oGqZumnJ.js +0 -1
- package/dist/docs/assets/chunks/channel.Dt4aweTm.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DGUHZs6j.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DGUHZs6j.js +0 -1
- package/dist/docs/assets/chunks/clone.DWf3k0Z0.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C0571l4D.js +0 -1
- package/dist/docs/assets/guides_opentelemetry.md.DBQtp7_V.js +0 -45
- package/dist/docs/assets/guides_opentelemetry.md.DBQtp7_V.lean.js +0 -1
- package/dist/docs/assets/reference_sessions.md.C8FXuGwk.js +0 -1
- package/dist/docs/assets/reference_sessions.md.C8FXuGwk.lean.js +0 -1
- package/dist/playground/assets/index-BdMwybMt.css +0 -1
- package/templates/grokbot-agents/.gitignore +0 -4
- package/templates/security-help/.gitignore +0 -4
- /package/dist/docs/assets/{guides_hooks.md.Bfj0pK91.lean.js → guides_hooks.md.B2XfGX50.lean.js} +0 -0
- /package/dist/docs/assets/{reference_channels.md.Bxaa020x.lean.js → reference_channels.md.CNNIS6K7.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.lean.js → reference_schedules.md.BqWnJES4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.C2GWh7g8.lean.js → reference_skills.md.Ckddg6KX.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.-6pypsWt.lean.js → reference_tools.md.Bo0UfT0a.lean.js} +0 -0
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
title: "OpenTelemetry"
|
|
3
|
-
description: "Send agent traces and metrics to an OTLP collector, follow one conversation, and add domain telemetry."
|
|
4
|
-
---
|
|
1
|
+
# OpenTelemetry
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Export is opt-in. Nothing leaves the process until you configure a
|
|
14
|
-
destination.
|
|
15
|
-
|
|
16
|
-
## Connect an OTLP collector
|
|
17
|
-
|
|
18
|
-
Set the collector endpoint, start the agent, and send it a message. You
|
|
19
|
-
should see an `agent_sdk.http` request span and an `agent_sdk.turn`
|
|
20
|
-
trace, with any tool or subagent work nested under the turn.
|
|
3
|
+
BDK exports traces, metrics, and logs to an OTLP collector. You
|
|
4
|
+
configure that with standard `OTEL_*` environment variables. There is
|
|
5
|
+
no `defineOtel` or `register()` hook. `ctx.host.otel` is deprecated.
|
|
6
|
+
It still runs for this release and logs one warning per process. Set
|
|
7
|
+
`OTEL_*` variables and record with `metrics.getMeter` and
|
|
8
|
+
`trace.getTracer` from `@opentelemetry/api`.
|
|
21
9
|
|
|
22
10
|
```bash
|
|
23
11
|
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.example.com
|
|
@@ -27,214 +15,191 @@ export OTEL_SERVICE_NAME=incident-agent
|
|
|
27
15
|
bdk serve --dir . --dev
|
|
28
16
|
```
|
|
29
17
|
|
|
30
|
-
|
|
18
|
+
The default protocol is OTLP/HTTP protobuf. Set
|
|
19
|
+
`OTEL_EXPORTER_OTLP_PROTOCOL=http/json` when the collector only accepts
|
|
20
|
+
JSON. `grpc` is not supported. BDK logs a warning and uses
|
|
21
|
+
`http/protobuf`.
|
|
22
|
+
|
|
23
|
+
Metrics use delta temporality by default. BDK logs that default when
|
|
24
|
+
export starts. For Grafana Cloud or Prometheus, set
|
|
31
25
|
`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` to `cumulative`.
|
|
32
26
|
Grafana Cloud rejects delta metrics.
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
28
|
+
BDK installs trace, metric, and log providers before it imports
|
|
29
|
+
`bot/agent.ts`. A meter, tracer, or logger created at module scope
|
|
30
|
+
binds to those providers. Exporters attach when the process has the
|
|
31
|
+
`OTEL_*` variables. On a hosted agent that is the first request, after
|
|
32
|
+
secrets are in the environment.
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
With no OTLP endpoint, BDK adds no exporters. Outbound `fetch` does
|
|
35
|
+
not gain a `traceparent` header. The session collector stays disabled.
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
otel: {
|
|
43
|
-
serviceName: "incident-agent",
|
|
44
|
-
exporters: [
|
|
45
|
-
{
|
|
46
|
-
url: "https://otel.example.com",
|
|
47
|
-
headers: {
|
|
48
|
-
Authorization: `Bearer ${process.env.OTEL_TOKEN ?? ""}`,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Use environment variables when you start the agent with
|
|
57
|
-
`bdk serve`. Use `serve({ otel })` when your TypeScript
|
|
58
|
-
application starts the server itself. When that application
|
|
59
|
-
already uses OpenTelemetry, BDK sends its traces, metrics, and
|
|
60
|
-
logs to the collector configured here.
|
|
37
|
+
## Variables
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
39
|
+
| Variable | Effect |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Base URL. BDK appends `/v1/traces`, `/v1/metrics`, and `/v1/logs`. |
|
|
42
|
+
| `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Traces URL, used as written. It wins over the base URL. |
|
|
43
|
+
| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Metrics URL, used as written. It wins over the base URL. |
|
|
44
|
+
| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Logs URL, used as written. It wins over the base URL. |
|
|
45
|
+
| `OTEL_EXPORTER_OTLP_HEADERS` | Headers on every export. Values are URL-encoded. Read again on each export. |
|
|
46
|
+
| `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` (default) or `http/json`. gRPC is not supported. |
|
|
47
|
+
| `OTEL_SERVICE_NAME` | `service.name`. Default is the agent name, then `unknown_service:node`. |
|
|
48
|
+
| `OTEL_RESOURCE_ATTRIBUTES` | Resource attributes, including `service.namespace`, `service.version`, and `deployment.environment.name`. |
|
|
49
|
+
| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | `delta` (default), `cumulative`, or `lowmemory`. Use `cumulative` for Grafana Cloud. |
|
|
50
|
+
| `OTEL_LOGS_EXPORTER` | `otlp` turns logs on. Unset, `none`, and `console` leave OTLP logs off. |
|
|
51
|
+
| `OTEL_SDK_DISABLED` | `true` turns export off. |
|
|
52
|
+
| `OTEL_TRACES_EXPORTER` | `none` turns traces off. |
|
|
53
|
+
| `OTEL_METRICS_EXPORTER` | `none` turns metrics off. |
|
|
54
|
+
| `OTEL_LOG_USER_PROMPTS` | `1` puts prompt text on log records. |
|
|
55
|
+
| `OTEL_LOG_TOOL_CONTENT` | `1` puts tool payloads on log records. |
|
|
56
|
+
|
|
57
|
+
## Hosted agents
|
|
58
|
+
|
|
59
|
+
Set the endpoint, headers, and service name as secrets. Add the
|
|
65
60
|
collector host to `hosting.egressDomains`. The host is a hostname
|
|
66
|
-
with no scheme and no path.
|
|
67
|
-
and export starts with those headers.
|
|
61
|
+
with no scheme and no path.
|
|
68
62
|
|
|
69
63
|
```ts
|
|
70
|
-
// bot/agent.ts
|
|
71
|
-
import { defineAgent } from "@cursor/bdk";
|
|
72
|
-
|
|
73
64
|
export default defineAgent({
|
|
74
65
|
hosting: {
|
|
75
66
|
egressDomains: ["otlp-gateway-prod-us-east-0.grafana.net"],
|
|
76
|
-
secretNames: [
|
|
67
|
+
secretNames: [
|
|
68
|
+
"OTEL_EXPORTER_OTLP_ENDPOINT",
|
|
69
|
+
"OTEL_EXPORTER_OTLP_HEADERS",
|
|
70
|
+
"OTEL_SERVICE_NAME",
|
|
71
|
+
],
|
|
77
72
|
},
|
|
78
73
|
});
|
|
79
74
|
```
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
Secrets arrive with the first request that has an endpoint. That
|
|
77
|
+
request's export uses those headers and `service.name`. A later
|
|
78
|
+
`bdk secrets set` updates headers on the next export, including a
|
|
79
|
+
rotated key. BDK also replaces the exporter when the URL, protocol,
|
|
80
|
+
or signal list changes. `service.name` is fixed on the first export
|
|
81
|
+
that attaches. Redeploy to change the service name.
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
`name=value` pairs. Each value is URL-encoded, so a space is
|
|
87
|
-
`%20` (`Authorization=Basic%20...`).
|
|
83
|
+
## What you can record
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
You do not redeploy to rotate a token. The URL, service name,
|
|
91
|
-
resource attributes, signals, sample ratio, metric export interval,
|
|
92
|
-
and metrics temporality stay as they were on the first export.
|
|
93
|
-
Redeploy to change one of those. BDK logs a warning when one of them
|
|
94
|
-
changes on a running agent.
|
|
85
|
+
Create the tracer, meter, and logger at module scope.
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
```ts
|
|
88
|
+
import { metrics, trace } from "@opentelemetry/api";
|
|
89
|
+
import { logs } from "@opentelemetry/api-logs";
|
|
98
90
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
const tracer = trace.getTracer("incident-agent");
|
|
92
|
+
const lookups = metrics.getMeter("incident-agent").createCounter("incident.lookups");
|
|
93
|
+
const logger = logs.getLogger("incident-agent");
|
|
94
|
+
```
|
|
102
95
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
Record during a request, after secrets have loaded. A span or a log
|
|
97
|
+
record that ends before the exporters attach is still exported. BDK
|
|
98
|
+
holds up to 2048 spans and 2048 log records until the exporters
|
|
99
|
+
attach, then sends them. BDK drops each record past that limit. A
|
|
100
|
+
metric recorded before the first collect is included in that collect.
|
|
107
101
|
|
|
108
|
-
|
|
102
|
+
BDK also records HTTP spans, token counts, and tool calls on the
|
|
103
|
+
session. Those spans carry `cursor.conversation.id`. A span you start
|
|
104
|
+
with `trace.getTracer` during a turn or a tool call gets the same
|
|
105
|
+
attribute from the active context. A value you set on the span stays.
|
|
106
|
+
BDK does not overwrite it. The id stays in this process. It is not
|
|
107
|
+
propagated.
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`cursor.conversation.id`. Every turn in that conversation carries the
|
|
113
|
-
same value, including follow-ups and tool work.
|
|
109
|
+
A metric does not get `cursor.conversation.id`. Read the id and set
|
|
110
|
+
the attribute yourself.
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
```ts
|
|
113
|
+
import { metrics } from "@opentelemetry/api";
|
|
114
|
+
import { currentConversationId } from "@cursor/bdk/otel";
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
request: agent_sdk.http
|
|
116
|
+
const lookups = metrics.getMeter("incident-agent").createCounter("incident.lookups");
|
|
119
117
|
|
|
120
|
-
|
|
121
|
-
|- agent_sdk.tool
|
|
122
|
-
`- agent_sdk.subagent
|
|
123
|
-
`- agent_sdk.tool
|
|
118
|
+
lookups.add(1, { "cursor.conversation.id": currentConversationId() });
|
|
124
119
|
```
|
|
125
120
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
### Subagents
|
|
121
|
+
Prompt text and tool payloads stay off log records unless logs are on
|
|
122
|
+
(`OTEL_LOGS_EXPORTER=otlp`) and you set `OTEL_LOG_USER_PROMPTS` or
|
|
123
|
+
`OTEL_LOG_TOOL_CONTENT`.
|
|
130
124
|
|
|
131
|
-
|
|
132
|
-
`agent_sdk.subagent` span. Its `reasoning.completed` and
|
|
133
|
-
`message.completed` events sit on that span too, so the subagent span
|
|
134
|
-
shows where its time went. Time between two tool spans is the model
|
|
135
|
-
choosing the next step. A subagent that fails or is cancelled ends its
|
|
136
|
-
span with ERROR status when it stops.
|
|
125
|
+
## Limits
|
|
137
126
|
|
|
138
|
-
|
|
127
|
+
These are not supported yet.
|
|
139
128
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
- Custom span processors, samplers, and views.
|
|
130
|
+
- Bringing your own OpenTelemetry SDK.
|
|
131
|
+
- Library auto-instrumentation.
|
|
132
|
+
- A `register()` hook. There is no ticket for it yet.
|
|
133
|
+
- `OTEL_TRACES_SAMPLER` and `OTEL_METRIC_EXPORT_INTERVAL` that arrive
|
|
134
|
+
only with hosted secrets. BDK reads them when it builds the provider,
|
|
135
|
+
which is before that secret load. Set them on the process, then
|
|
136
|
+
restart. BDK logs a warning when a later value differs.
|
|
144
137
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
| `agent_sdk.computer.settle_ms` | Part of that time spent waiting for the screen to settle |
|
|
138
|
+
Do not import your own SDK providers next to BDK's. BDK logs a warning
|
|
139
|
+
when a module replaces a provider BDK registered. The global API then
|
|
140
|
+
uses that module's provider. BDK shuts down a provider it created
|
|
141
|
+
only when that provider is not the one it registered.
|
|
150
142
|
|
|
151
|
-
|
|
143
|
+
## Migrating from serve({ otel })
|
|
152
144
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
`serve({ otel })` is removed. Delete the option. Set the same
|
|
146
|
+
values with `OTEL_*` variables. Delete `bot/otel.ts`,
|
|
147
|
+
`agent/otel.ts`, and `bot/instrumentation.ts`. Do not call
|
|
148
|
+
`defineOtel`.
|
|
157
149
|
|
|
158
|
-
|
|
150
|
+
BDK sends each signal to one URL. A second exporter for the same
|
|
151
|
+
signal has no variable.
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
| Old option | Set this instead |
|
|
154
|
+
| --- | --- |
|
|
155
|
+
| `serviceName` | `OTEL_SERVICE_NAME` |
|
|
156
|
+
| `serviceVersion` | `service.version` in `OTEL_RESOURCE_ATTRIBUTES` |
|
|
157
|
+
| `resourceAttributes` | `OTEL_RESOURCE_ATTRIBUTES`. Separate pairs with commas. URL-encode each value. |
|
|
158
|
+
| `exporters[].url` | `OTEL_EXPORTER_OTLP_ENDPOINT`. BDK appends `/v1/traces`, `/v1/metrics`, and `/v1/logs`. |
|
|
159
|
+
| `exporters[].url` with `signals` | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`, or `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`. BDK uses that URL as written. |
|
|
160
|
+
| `exporters[].headers` | `OTEL_EXPORTER_OTLP_HEADERS`. Separate pairs with commas. URL-encode each value. |
|
|
161
|
+
| `exporters[].protocol` | `OTEL_EXPORTER_OTLP_PROTOCOL`. Use `http/protobuf` or `http/json`. For one signal, use `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`, `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`, or `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`. |
|
|
162
|
+
| `exporters[].signals` | Set the signal URL above. Set `OTEL_TRACES_EXPORTER`, `OTEL_METRICS_EXPORTER`, or `OTEL_LOGS_EXPORTER` to `none` to stop that signal. |
|
|
163
|
+
| `traces: false` | `OTEL_TRACES_EXPORTER=none` |
|
|
164
|
+
| `traces: true` | Leave `OTEL_TRACES_EXPORTER` unset. Traces start when an endpoint is set. |
|
|
165
|
+
| `traces.sampleRatio` | `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG` set to the ratio. Set both before the process starts. |
|
|
166
|
+
| `metrics: false` | `OTEL_METRICS_EXPORTER=none` |
|
|
167
|
+
| `metrics: true` | Leave `OTEL_METRICS_EXPORTER` unset. Metrics start when a metrics URL is set. |
|
|
168
|
+
| `metrics.exportIntervalMillis` | `OTEL_METRIC_EXPORT_INTERVAL`, in milliseconds. Set it before the process starts. |
|
|
169
|
+
| `logs: false` | Leave `OTEL_LOGS_EXPORTER` unset, or set it to `none`. |
|
|
170
|
+
| `logs: true` | `OTEL_LOGS_EXPORTER=otlp` |
|
|
171
|
+
| `logs.userPrompts` | `OTEL_LOGS_EXPORTER=otlp` and `OTEL_LOG_USER_PROMPTS=1` |
|
|
172
|
+
| `logs.toolContent` | `OTEL_LOGS_EXPORTER=otlp` and `OTEL_LOG_TOOL_CONTENT=1` |
|
|
173
|
+
| `otel: false` | Set no endpoint, or set `OTEL_SDK_DISABLED=true`. |
|
|
174
|
+
|
|
175
|
+
Before:
|
|
165
176
|
|
|
166
177
|
```ts
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
outcome: "approved",
|
|
178
|
+
await serve(".", {
|
|
179
|
+
otel: {
|
|
180
|
+
serviceName: "incident-agent",
|
|
181
|
+
exporters: [
|
|
182
|
+
{
|
|
183
|
+
url: "https://otel.example.com",
|
|
184
|
+
headers: { Authorization: `Bearer ${process.env.OTEL_TOKEN ?? ""}` },
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
178
188
|
});
|
|
179
189
|
```
|
|
180
190
|
|
|
181
|
-
|
|
182
|
-
session-bound context adds `cursor.conversation.id` and
|
|
183
|
-
`agent_sdk.agent` automatically, so custom measurements join the
|
|
184
|
-
first-party telemetry without extra plumbing.
|
|
185
|
-
|
|
186
|
-
Prefix custom names with your team or agent. First-party metric names
|
|
187
|
-
and join keys are reserved, and this surface does not create custom
|
|
188
|
-
spans.
|
|
189
|
-
|
|
190
|
-
## Choose signals
|
|
191
|
-
|
|
192
|
-
Once export has a destination, traces and metrics are on by default;
|
|
193
|
-
logs remain off until you opt in.
|
|
194
|
-
|
|
195
|
-
| Signal | What appears |
|
|
196
|
-
| --- | --- |
|
|
197
|
-
| Traces | HTTP requests, turns, tools, and subagents |
|
|
198
|
-
| Metrics | Token usage, tool calls, cost, and BDK session or turn counts |
|
|
199
|
-
| Logs | Session events, after you enable log export |
|
|
200
|
-
|
|
201
|
-
The first metrics to look for are `cursor.token.usage`,
|
|
202
|
-
`cursor.tool.calls`, and `cursor.cost.usage`. Configure
|
|
203
|
-
`traces: false`, `metrics: false`, or `logs: true` under
|
|
204
|
-
`serve({ otel })` when you need a different signal mix.
|
|
205
|
-
|
|
206
|
-
## Control what leaves the process
|
|
207
|
-
|
|
208
|
-
Traces include structure, tool names, usage metrics, and span
|
|
209
|
-
status. A failed tool's span status and its `action.result` log
|
|
210
|
-
include a short failure reason.
|
|
211
|
-
A tool or subagent that is still open when the turn ends gets
|
|
212
|
-
ERROR status with the reason `no result`. User prompts, tool
|
|
213
|
-
arguments, and full tool results stay off the wire until you opt in.
|
|
214
|
-
|
|
215
|
-
Turn on logs first, then opt into prompt or tool content separately:
|
|
191
|
+
After:
|
|
216
192
|
|
|
217
193
|
```bash
|
|
218
|
-
export
|
|
219
|
-
export
|
|
220
|
-
export
|
|
194
|
+
export OTEL_SERVICE_NAME=incident-agent
|
|
195
|
+
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.example.com
|
|
196
|
+
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20$OTEL_TOKEN"
|
|
197
|
+
bdk serve --dir . --dev
|
|
221
198
|
```
|
|
222
199
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
when the collector's access and retention policies are appropriate for
|
|
226
|
-
that data.
|
|
227
|
-
|
|
228
|
-
The same controls are available as
|
|
229
|
-
`logs: { userPrompts, toolContent }` under `serve({ otel })`.
|
|
200
|
+
On a hosted agent, put the same names in `hosting.secretNames`. Add
|
|
201
|
+
the collector host to `hosting.egressDomains`. Then run:
|
|
230
202
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
configuration and custom-metric reference for coding agents
|
|
235
|
-
- [Hooks](../reference/hooks.md): emit domain telemetry from session
|
|
236
|
-
events
|
|
237
|
-
- [Deployment](../deployment.md): declare `hosting.egressDomains`
|
|
238
|
-
and set collector secrets on a hosted agent
|
|
239
|
-
- [Cursor enterprise OpenTelemetry Export](https://cursor.com/docs/enterprise/opentelemetry-export):
|
|
240
|
-
send organization-wide Cursor telemetry to the same collector
|
|
203
|
+
```bash
|
|
204
|
+
bdk secrets set my-agent OTEL_SERVICE_NAME OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_HEADERS
|
|
205
|
+
```
|
package/docs/guides/slack.md
CHANGED
|
@@ -99,6 +99,47 @@ export default slackChannel({
|
|
|
99
99
|
});
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
### Show steps as cards or as a checklist
|
|
103
|
+
|
|
104
|
+
The agent calls `post-card` to show one step of its work, such as
|
|
105
|
+
"Scan the repo". Each card has an `id`, a `title`, a `status`, and
|
|
106
|
+
optional `details`. When the agent calls `post-card` again with the same
|
|
107
|
+
`id`, Slack updates that card. The agent uses this to move a step from
|
|
108
|
+
`in_progress` to `complete`.
|
|
109
|
+
|
|
110
|
+
`cards` sets how Slack draws these steps:
|
|
111
|
+
|
|
112
|
+
| `cards` | What Slack shows | Use it when |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `{ display: "timeline" }` (default) | Each step is a separate card in the thread. | The turn has one or two short steps. |
|
|
115
|
+
| `{ display: "plan" }` | All steps from one turn are in one checklist. | The turn has several steps, and readers want to see progress in one place. |
|
|
116
|
+
|
|
117
|
+
This bot shows its steps as one checklist with the title "Release check":
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default slackChannel({
|
|
121
|
+
reply: {
|
|
122
|
+
mode: "agentic",
|
|
123
|
+
cards: { display: "plan", title: "Release check" },
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Know these rules for a plan:
|
|
129
|
+
|
|
130
|
+
- The `title` is optional. It can have at most 256 characters.
|
|
131
|
+
- You set the `title` in the channel configuration. The agent cannot
|
|
132
|
+
change the title.
|
|
133
|
+
- Each turn starts a new checklist with the same title.
|
|
134
|
+
- The `pending` status shows a step that has not started. Use `pending`
|
|
135
|
+
only in a plan.
|
|
136
|
+
- `slackChannel` stops at startup if `cards` is not valid. For example,
|
|
137
|
+
a `title` with `display: "timeline"` stops startup.
|
|
138
|
+
|
|
139
|
+
`display` is Slack's
|
|
140
|
+
[`task_display_mode`](https://docs.slack.dev/reference/methods/chat.startStream/),
|
|
141
|
+
and the channel sends `title` as a `plan_update` chunk.
|
|
142
|
+
|
|
102
143
|
## Wake on a channel post
|
|
103
144
|
|
|
104
145
|
This example watches `#triage-alerts`, so any substantial top-level
|
|
@@ -196,15 +196,35 @@ const handle = await serve("./my-agent", {
|
|
|
196
196
|
});
|
|
197
197
|
console.log(`listening on ${handle.url}`);
|
|
198
198
|
// handle.callTool(...), handle.dispatchSchedule("heartbeat"),
|
|
199
|
-
// handle.createReminder(...), handle.
|
|
199
|
+
// handle.createReminder(...), handle.agents, await handle.close()
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
+
`handle.agents` lists each mount as `slug`, `url`, and `info`. `handle.project` is the first agent's project. It is deprecated.
|
|
203
|
+
|
|
202
204
|
Host settings match the documented [CLI](./cli.md) `serve` flags.
|
|
203
205
|
`serve()` also accepts `discovery` (project-loading options) and
|
|
204
206
|
`mode: "single" | "multi"`. Pass `apiKey` or use the same Cursor
|
|
205
207
|
credential as the CLI: `CURSOR_API_KEY`, `CURSOR_API_KEY_FILE`,
|
|
206
208
|
`CURSOR_SERVICE_ACCOUNT_KEY`, or `bdk login`.
|
|
207
209
|
|
|
210
|
+
## Inspect a project in tests
|
|
211
|
+
|
|
212
|
+
`loadProject(dir)` reads one project and does not serve it. The result is a `Project`. The only field is `info`. That object matches the `GET /v1/info` body for the project. `bdk info --json` on a project directory prints `{ agents: [{ slug, ...info }] }`. It prints the bare object only when the single mount slug is empty.
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { loadProject } from "@cursor/bdk";
|
|
216
|
+
|
|
217
|
+
const project = await loadProject("./my-agent");
|
|
218
|
+
console.log(project.info.name);
|
|
219
|
+
console.log(project.info.tools.map((tool) => tool.name));
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
`loadProject` throws `ProjectLoadError` when discovery reports an error. Pass `{ strict: true }` to throw on a warning as well. `error.diagnostics` lists the findings. Each `path` is relative to the project directory. A path outside that directory starts with `../`. `loadProject` does not take `importModule`. `serve` still accepts `discovery.importModule` for that override.
|
|
223
|
+
|
|
224
|
+
`info.local` is `{ cwd }` when the project sets a cwd. The serve banner reads `agents[].info`.
|
|
225
|
+
|
|
226
|
+
`serve` accepts that `Project` or a directory path.
|
|
227
|
+
|
|
208
228
|
## Related
|
|
209
229
|
|
|
210
230
|
- [Instructions](./instructions.md): the required half of a minimal
|
|
@@ -117,11 +117,15 @@ Each handler receives the Fetch `Request` and a typed arguments object.
|
|
|
117
117
|
| `purpose` | Use `"eval"` to mark a new session as regression traffic |
|
|
118
118
|
| `dryRun` | Run read tools and stub write tools for a new session |
|
|
119
119
|
| `asOf` | Freeze a new session at an ISO-8601 instant with a timezone |
|
|
120
|
+
| `deliveryId` | Name this send on the session's events, at most 256 characters. Defaults to a fresh `dlv_…` ID |
|
|
120
121
|
|
|
121
122
|
`send` returns a `ChannelSession`. Its `id` identifies the session,
|
|
122
123
|
`continuationToken` contains its current channel key, and `isNew` says
|
|
123
124
|
whether this call created it. A coalesced call also returns
|
|
124
|
-
`coalesced: true`.
|
|
125
|
+
`coalesced: true`. `deliveryId` names this send on the event where the
|
|
126
|
+
message reaches the agent; see
|
|
127
|
+
[Track which follow-up reached the agent](./sessions.md#track-which-follow-up-reached-the-agent).
|
|
128
|
+
A hosted channel's `send` returns the same ID before the session exists.
|
|
125
129
|
|
|
126
130
|
## Events
|
|
127
131
|
|
package/docs/reference/hooks.md
CHANGED
|
@@ -28,20 +28,26 @@ Author `bot/hooks/<name>.ts` with `defineHook` from
|
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
// bot/hooks/usage.ts
|
|
31
|
+
import { metrics } from "@opentelemetry/api";
|
|
31
32
|
import { defineHook } from "@cursor/bdk/hooks";
|
|
32
33
|
|
|
34
|
+
const meter = metrics.getMeter("acme");
|
|
35
|
+
const inputTokens = meter.createCounter("acme.tokens.input");
|
|
36
|
+
const outputTokens = meter.createCounter("acme.tokens.output");
|
|
37
|
+
const turnFailed = meter.createCounter("acme.turn.failed");
|
|
38
|
+
|
|
33
39
|
export default defineHook({
|
|
34
40
|
events: {
|
|
35
41
|
async "turn.completed"(event, ctx) {
|
|
36
42
|
if (ctx.session.purpose === "eval" || event.data.usage === undefined) {
|
|
37
43
|
return;
|
|
38
44
|
}
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
const usage = event.data.usage;
|
|
46
|
+
inputTokens.add(usage.inputTokens);
|
|
47
|
+
outputTokens.add(usage.outputTokens);
|
|
42
48
|
},
|
|
43
49
|
async "turn.failed"(_event, ctx) {
|
|
44
|
-
|
|
50
|
+
turnFailed.add(1, { channel: ctx.channel.id });
|
|
45
51
|
},
|
|
46
52
|
},
|
|
47
53
|
});
|
|
@@ -93,7 +99,6 @@ exported from `@cursor/bdk`.
|
|
|
93
99
|
| `ctx.channel` | `{ id, continuationToken }`. The token is `null` when the session can't take follow-ups |
|
|
94
100
|
| `ctx.host.kv` | Durable JSON, shared by every session of the agent. Prefix keys with `ctx.session.id` for per-session state |
|
|
95
101
|
| `ctx.host.files` | Durable files, bound to this session. Pass `{ scope: "deployment" }` for agent-wide files |
|
|
96
|
-
| `ctx.host.otel` | Counters, histograms, and tags, attributed to this session |
|
|
97
102
|
| `ctx.host.mcp`, `ctx.host.github`, `ctx.host.slack` | The same shared clients tools get |
|
|
98
103
|
| `ctx.host.reminders` | Per-session [reminders](./schedules.md#reminders), the same API tools get |
|
|
99
104
|
| `ctx.artifacts` | Session-bound [artifacts](./artifacts.md) facade: `tag` fills in `sessionId` and `turnId` |
|
|
@@ -64,6 +64,51 @@ the session is already busy depends on the channel:
|
|
|
64
64
|
Pass `admission: "coalesce"` on `send()` to opt into the Slack policy from
|
|
65
65
|
other callers. Omit it (or pass `"preempt"`) to keep interrupt semantics.
|
|
66
66
|
|
|
67
|
+
### Track which follow-up reached the agent
|
|
68
|
+
|
|
69
|
+
Every `send()` returns a `deliveryId`. Pass your own as the `deliveryId`
|
|
70
|
+
option, such as the webhook delivery ID you already hold, or omit it to
|
|
71
|
+
get a fresh `dlv_…` ID. A coalesced follow-up reaches the agent in one of
|
|
72
|
+
two ways, and the ID is on the event for that path:
|
|
73
|
+
|
|
74
|
+
| Path | Event | Field |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| Steered into the running turn | `nudge.delivered` | `data.deliveryId` |
|
|
77
|
+
| Fell back to the next turn | That turn's `message.received` | `data.deliveryIds` |
|
|
78
|
+
|
|
79
|
+
`message.received` lists every send its prompt carries, in arrival order.
|
|
80
|
+
Follow-ups queued behind a busy turn drain into one turn, so the list can
|
|
81
|
+
hold several IDs. A direct send that starts a turn gets a one-item list.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// In a route or channel hook: name the steer after the webhook delivery.
|
|
85
|
+
await send(`Incident ${incident.id} was acknowledged.`, {
|
|
86
|
+
continuationToken: incident.id,
|
|
87
|
+
admission: "coalesce",
|
|
88
|
+
deliveryId: webhookId,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// In the channel's `events` map:
|
|
92
|
+
const steered = new Set<string>();
|
|
93
|
+
const prompted = new Set<string>();
|
|
94
|
+
const events: ChannelEventHandlers = {
|
|
95
|
+
"nudge.delivered": async (event) => {
|
|
96
|
+
if (event.data.deliveryId !== undefined) {
|
|
97
|
+
steered.add(event.data.deliveryId);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"message.received": async (event) => {
|
|
101
|
+
for (const id of event.data.deliveryIds ?? []) {
|
|
102
|
+
prompted.add(id);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
A local Slack session can also pick up follow-ups at a tool boundary from
|
|
109
|
+
its own thread store. That `nudge.delivered` has no `deliveryId`, which
|
|
110
|
+
tells it apart from a steered send.
|
|
111
|
+
|
|
67
112
|
`POST /v1/session/:id/stop` interrupts a turn without sending a new
|
|
68
113
|
message. The stream records `turn.failed` with `status: "cancelled"`;
|
|
69
114
|
the session stays a chat session and can take another follow-up. A
|
|
@@ -82,7 +127,7 @@ within one session. The `at` field is an ISO-8601 timestamp.
|
|
|
82
127
|
| Phase | Events | What they tell you |
|
|
83
128
|
| --- | --- | --- |
|
|
84
129
|
| Session | `session.started`, `session.waiting`, `session.completed`, `session.failed` | Session creation, readiness, and task completion |
|
|
85
|
-
| Input | `message.received` | A user message was accepted |
|
|
130
|
+
| Input | `message.received`, `nudge.delivered` | A user message was accepted as a turn's prompt, or reached a running turn mid-turn. Both name the [sends they carry](#track-which-follow-up-reached-the-agent) |
|
|
86
131
|
| Turn | `turn.queued`, `turn.started`, `turn.completed`, `turn.failed` | Queue position under a [`maxRunningTurns` cap](./agent-config.md#concurrency), then turn status, final result, and token usage |
|
|
87
132
|
| Steps | `step.started`, `step.completed` | Model step boundaries and duration |
|
|
88
133
|
| Reasoning | `reasoning.appended`, `reasoning.completed` | Streamed reasoning blocks |
|
package/docs/reference/tools.md
CHANGED
|
@@ -82,9 +82,9 @@ export default defineTool({
|
|
|
82
82
|
`ctx.host` carries the shared host services: `host.mcp` (authored MCP
|
|
83
83
|
connections: `names()`, `listTools(name)`, `callTool(name, tool, args)`),
|
|
84
84
|
`host.github` and `host.slack` (shared platform clients), `host.kv` and
|
|
85
|
-
`host.files` (durable storage), `host.
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
`host.files` (durable storage), and `host.reminders` (per-session wakes,
|
|
86
|
+
when attached). Custom metrics use the
|
|
87
|
+
[OpenTelemetry](../guides/opentelemetry.md) API.
|
|
88
88
|
|
|
89
89
|
### Return values
|
|
90
90
|
|