@cursor/bdk 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/README.md +1 -6
- package/dist/artifacts.d.ts +5 -2
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +5 -2
- package/dist/bin/agent-serve.js +23 -7
- package/dist/channels/github/auth.d.ts.map +1 -1
- package/dist/channels/github/auth.js +36 -5
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +3 -2
- package/dist/channels/slack/types.d.ts +6 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.JVQvbRO-.js → app.BOIHhrKi.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.D5L-b34G.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BkhY63uW.js → VPLocalSearchBox.D49zVZqM.js} +1 -1
- package/dist/docs/assets/chunks/{arc.Cc1unYd3.js → arc.hmjb-sc4.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CAY_TPVz.js → architectureDiagram-Q4EWVU46.CxEI1KqM.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.my2VD3Xm.js → baseUniq.DHHvBWoV.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.CQXAOmqd.js → blockDiagram-DXYQGD6D.DnXW-3bu.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.D0AsQFSX.js → c4Diagram-AHTNJAMY.e-47O2jM.js} +1 -1
- package/dist/docs/assets/chunks/channel.BbOGaJQP.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.DZjhgNls.js → chunk-4BX2VUAB.3ry4pYXB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.qdcp_qbo.js → chunk-4TB4RGXK.DGIZFRx6.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BHXoZhJ-.js → chunk-55IACEB6.DKBnqg9U.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.Cds_Vwj3.js → chunk-EDXVE4YY.BIU8Ue5k.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CSl0HknT.js → chunk-FMBD7UC4.DP-TFhjI.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.DJMvAt5N.js → chunk-OYMX7WX6.Ux0OYj5v.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BYQzBK9D.js → chunk-QZHKN3VN.BzHMwYox.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BAvw7N4o.js → chunk-YZCP3GAM.D4OGAsSP.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.Db58HCb1.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.Db58HCb1.js +1 -0
- package/dist/docs/assets/chunks/clone.Co4MBflG.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.Buf3seya.js → cose-bilkent-S5V4N54A.Jq_7BUNx.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.DMGGa3uA.js → dagre-KV5264BT.Di-skR2x.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DDjnwRmY.js → diagram-5BDNPKRD.DeREHIdH.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.RwyrIr8Q.js → diagram-G4DWMVQ6.C7Kcqxro.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.DRvQV16Z.js → diagram-MMDJMWI5.BK3eohyo.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.Dw8W9BTk.js → diagram-TYMM5635.C6TyymXT.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DQT1Hnwf.js → erDiagram-SMLLAGMA.DYGG-gGx.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.6_Aky-ut.js → flowDiagram-DWJPFMVM.C9nBcSV4.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.DHIwqnqN.js → ganttDiagram-T4ZO3ILL.wAg_ymsp.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CGd_eJbn.js → gitGraphDiagram-UUTBAWPF.B87j9Oeg.js} +1 -1
- package/dist/docs/assets/chunks/{graph.ChMEylkh.js → graph.CuFMj31w.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Cd4gMyAz.js → infoDiagram-42DDH7IO.P_mLGumP.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.D1uw7MXq.js → ishikawaDiagram-UXIWVN3A.DyuL_MsT.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.AWLXtelc.js → journeyDiagram-VCZTEJTY.CtP09IoJ.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CagPhAn5.js → kanban-definition-6JOO6SKY.BoeSYPZo.js} +1 -1
- package/dist/docs/assets/chunks/{layout.ClTBBkE_.js → layout.B0lMMtNo.js} +1 -1
- package/dist/docs/assets/chunks/{linear.SwS2rOLA.js → linear.HxRBiAFX.js} +1 -1
- package/dist/docs/assets/chunks/{min.By_x-Btb.js → min.BGlFFHwS.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.By_RAMaP.js → mindmap-definition-QFDTVHPH.JyLBD9M8.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.DfAl9sy4.js → pieDiagram-DEJITSTG.DnSmNZF8.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CNuqFRBj.js → quadrantDiagram-34T5L4WZ.CUCnbfCa.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DJ5CmTCl.js → requirementDiagram-MS252O5E.py0IVUn5.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.D-T_AKJj.js → sankeyDiagram-XADWPNL6.Bkc-HWYp.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BRn9WcrR.js → sequenceDiagram-FGHM5R23.Dqn8Mlv2.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.F12urmm7.js → stateDiagram-FHFEXIEX.JikkoQUU.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CMsKhrW0.js +1 -0
- package/dist/docs/assets/chunks/{theme.zK3OJa_C.js → theme.b6HQ6zG_.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.B7GiQBeC.js → timeline-definition-GMOUNBTQ.BvpSXiBj.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.D0niwuY_.js → vennDiagram-DHZGUBPP.CU7MVnZx.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.1zhHNRsx.js → wardley-RL74JXVD.BKwC4ctG.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DKaqpT7K.js → wardleyDiagram-NUSXRM2D.BfaF6Uhe.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.e8BPicch.js → xychartDiagram-5P7HB3ND.Bg5dcpj4.js} +1 -1
- package/dist/docs/assets/{deployment.md.nGo1yIsa.js → deployment.md.BJ8i7Q6p.js} +5 -8
- package/dist/docs/assets/{deployment.md.nGo1yIsa.lean.js → deployment.md.BJ8i7Q6p.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.js → guides_github.md.Bq9kQU9B.js} +9 -3
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.lean.js → guides_github.md.Bq9kQU9B.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.js → guides_slack.md.diqqXTTm.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.lean.js → guides_slack.md.diqqXTTm.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.wG4shE1f.js → quickstart.md.CHpHPBUN.js} +5 -3
- package/dist/docs/assets/{quickstart.md.wG4shE1f.lean.js → quickstart.md.CHpHPBUN.lean.js} +1 -1
- package/dist/docs/assets/{reference_artifacts.md.IFFC5Zln.js → reference_artifacts.md.CQfKq8F2.js} +1 -1
- package/dist/docs/assets/reference_cli.md.DgeLTO18.js +91 -0
- package/dist/docs/assets/reference_cli.md.DgeLTO18.lean.js +1 -0
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.js → reference_connections.md.COq--gAm.js} +7 -3
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.lean.js → reference_connections.md.COq--gAm.lean.js} +1 -1
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.js → reference_evals.md.CJm3uCUm.js} +4 -4
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.lean.js → reference_evals.md.CJm3uCUm.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.Dg3dEugd.js → reference_hooks.md.DbthhtIR.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.BtpTjZmh.js → reference_sessions.md.DeRUItHD.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Cw5PKa3t.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.BzZSu1Gz.lean.js → troubleshooting.md.Cw5PKa3t.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +40 -43
- package/dist/docs/deployment.md +45 -15
- package/dist/docs/evals.html +35 -35
- 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 +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +43 -37
- package/dist/docs/guides/github.md +34 -0
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +5 -0
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +205 -97
- package/dist/docs/quickstart.html +40 -38
- package/dist/docs/quickstart.md +7 -1
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/artifacts.md +1 -1
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +55 -61
- package/dist/docs/reference/cli.md +65 -63
- package/dist/docs/reference/connections.html +42 -38
- package/dist/docs/reference/connections.md +28 -2
- package/dist/docs/reference/evals.html +39 -39
- package/dist/docs/reference/evals.md +6 -7
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/hooks.md +3 -2
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +36 -36
- package/dist/docs/reference/sessions.md +4 -3
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- 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 +7 -3
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +16 -4
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +7 -3
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +7 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +4 -2
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +21 -12
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +2 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +3 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +2 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +63 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +158 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +59 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +206 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +25 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +37 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +32 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +34 -0
- package/dist/files-backends/cursor-hosted.js +4 -4
- package/dist/internal/artifacts-store.d.ts +12 -2
- package/dist/internal/artifacts-store.d.ts.map +1 -1
- package/dist/internal/artifacts-store.js +8 -4
- package/dist/internal/cli-ax.d.ts +1 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +43 -10
- package/dist/internal/cli-deploy.d.ts +5 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +22 -4
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +2 -1
- package/dist/internal/cli-skills.d.ts +1 -1
- package/dist/internal/cli-skills.d.ts.map +1 -1
- package/dist/internal/cli-skills.js +5 -5
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +84 -0
- package/dist/internal/cursor/backend-client.js +5 -0
- package/dist/internal/deploy-client.d.ts +30 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +45 -9
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +11 -0
- package/dist/internal/event-mapper.d.ts +46 -4
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +316 -25
- package/dist/internal/hosted-delivery-protocol.d.ts +36 -11
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +31 -8
- package/dist/internal/hosted-delivery.d.ts +2 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +229 -49
- package/dist/internal/hosting.d.ts +2 -2
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +9 -3
- package/dist/internal/install-cursor-skills.d.ts +20 -24
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +50 -48
- package/dist/internal/legacy-command-guard.d.ts +2 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -1
- package/dist/internal/legacy-command-guard.js +10 -1
- package/dist/internal/mcp-host.d.ts +6 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +35 -16
- 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 +10 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -1
- package/dist/internal/session-engine.d.ts +1 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +33 -8
- package/dist/playground/assets/index-6BbTPnaT.css +1 -0
- package/dist/playground/assets/{index-FFdUqTt_.js → index-CI7FAmOP.js} +43 -43
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +50 -4
- package/dist/types.d.ts.map +1 -1
- package/docs/deployment.md +45 -15
- package/docs/guides/github.md +34 -0
- package/docs/guides/slack.md +5 -0
- package/docs/quickstart.md +7 -1
- package/docs/reference/artifacts.md +1 -1
- package/docs/reference/cli.md +65 -63
- package/docs/reference/connections.md +28 -2
- package/docs/reference/evals.md +6 -7
- package/docs/reference/hooks.md +3 -2
- package/docs/reference/sessions.md +4 -3
- package/docs/troubleshooting.md +7 -3
- package/package.json +2 -4
- package/scripts/install-cursor-skills.mjs +1 -1
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/deploy/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +1 -1
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/artifacts.ts +5 -2
- package/src/bin/agent-serve.ts +27 -6
- package/src/channels/github/auth.ts +44 -5
- package/src/channels/slack/manifest.ts +2 -1
- package/src/channels/slack/types.ts +6 -1
- package/src/connections.ts +1 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +23 -6
- package/src/extensions/cursor-cloud-agents/lib/channels.ts +11 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +19 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +2 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +3 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +2 -0
- package/src/extensions/cursor-grokbot-agents/extension.ts +132 -0
- package/src/extensions/cursor-grokbot-agents/lib/agents.ts +42 -0
- package/src/extensions/cursor-grokbot-agents/lib/backend.ts +208 -0
- package/src/extensions/cursor-grokbot-agents/lib/contacts.ts +74 -0
- package/src/extensions/cursor-grokbot-agents/lib/conversation.ts +260 -0
- package/src/extensions/cursor-grokbot-agents/lib/inputs.ts +21 -0
- package/src/extensions/cursor-grokbot-agents/lib/lock.ts +26 -0
- package/src/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/src/extensions/cursor-grokbot-agents/tools/ask.ts +32 -0
- package/src/extensions/cursor-grokbot-agents/tools/check.ts +25 -0
- package/src/extensions/cursor-grokbot-agents/tools/interrupt.ts +17 -0
- package/src/extensions/cursor-grokbot-agents/tools/list.ts +26 -0
- package/src/files-backends/cursor-hosted.ts +4 -4
- package/src/internal/artifacts-store.ts +14 -3
- package/src/internal/cli-ax.ts +52 -7
- package/src/internal/cli-deploy.ts +39 -6
- package/src/internal/cli-mcp-oauth.ts +2 -1
- package/src/internal/cli-skills.ts +4 -5
- package/src/internal/connection-env.ts +106 -0
- package/src/internal/cursor/backend-client.ts +6 -0
- package/src/internal/deploy-client.ts +79 -9
- package/src/internal/discovery/connections.ts +11 -0
- package/src/internal/event-mapper.ts +367 -36
- package/src/internal/hosted-delivery-protocol.ts +57 -20
- package/src/internal/hosted-delivery.ts +487 -229
- package/src/internal/hosting.ts +10 -3
- package/src/internal/install-cursor-skills.ts +56 -53
- package/src/internal/legacy-command-guard.ts +13 -1
- package/src/internal/mcp-host.ts +45 -17
- package/src/internal/sdk-runner.ts +11 -0
- package/src/internal/server.ts +13 -1
- package/src/internal/session-engine.ts +33 -13
- package/src/types.ts +56 -5
- package/templates/agents-md/bot/lib/collect.ts +1 -4
- package/templates/code-wiki/bot/channels/github.ts +2 -2
- package/templates/demo/bot/channels/github.ts +5 -1
- package/templates/pr-autofixer/bot/lib/start-drive.ts +4 -4
- package/templates/triage/bot/lib/types.ts +6 -6
- package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +0 -1
- package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +0 -1
- package/dist/docs/assets/chunks/clone.zl2qolPE.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +0 -1
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +0 -97
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +0 -1
- package/dist/playground/assets/index-BMV_IcEE.css +0 -1
- /package/dist/docs/assets/{reference_artifacts.md.IFFC5Zln.lean.js → reference_artifacts.md.CQfKq8F2.lean.js} +0 -0
- /package/dist/docs/assets/{reference_hooks.md.Dg3dEugd.lean.js → reference_hooks.md.DbthhtIR.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.BtpTjZmh.lean.js → reference_sessions.md.DeRUItHD.lean.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import { interrupt as interruptAgent } from "../lib/conversation.js";
|
|
5
|
+
import { agentName } from "../lib/inputs.js";
|
|
6
|
+
|
|
7
|
+
const interrupt: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"Stop what a Grok Bot agent you asked is doing right now. It keeps its conversation; ask it again to continue.",
|
|
10
|
+
effect: "write",
|
|
11
|
+
inputSchema: z.object({ agent: agentName }),
|
|
12
|
+
async execute(input, ctx) {
|
|
13
|
+
return interruptAgent(ctx, { agent: input.agent });
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default interrupt;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import extension from "../extension.js";
|
|
5
|
+
import { listContacts } from "../lib/contacts.js";
|
|
6
|
+
|
|
7
|
+
const list: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"List the Grok Bot agents you can talk to: the ones configured for this agent, with what each is for, and the ones you have already asked, most recent first.",
|
|
10
|
+
effect: "read",
|
|
11
|
+
inputSchema: z.object({}),
|
|
12
|
+
async execute(_input, ctx) {
|
|
13
|
+
const contacts = await listContacts(ctx);
|
|
14
|
+
return {
|
|
15
|
+
configured: extension.config.agents ?? [],
|
|
16
|
+
contacted: contacts.map(contact => ({
|
|
17
|
+
name: contact.name,
|
|
18
|
+
sessionId: contact.sessionId,
|
|
19
|
+
firstContactAt: contact.firstContactAt,
|
|
20
|
+
lastContactAt: contact.lastContactAt,
|
|
21
|
+
})),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export default list;
|
|
@@ -925,10 +925,10 @@ export function cursorHostedFiles(options: CursorHostedFilesOptions = {}): Hoste
|
|
|
925
925
|
if (files.wire !== "flush") {
|
|
926
926
|
return false;
|
|
927
927
|
}
|
|
928
|
-
//
|
|
929
|
-
//
|
|
930
|
-
// the
|
|
931
|
-
//
|
|
928
|
+
// With an observed etag the flush delete is If-Match on that version.
|
|
929
|
+
// Without one, the server tombstones whatever live object occupies
|
|
930
|
+
// the key (no directory walk here) and an absent key settles as
|
|
931
|
+
// `already_deleted`.
|
|
932
932
|
const cached = observedEtags.get(key);
|
|
933
933
|
const response = await flushPost<FlushWireResponse>(options, "/flush", {
|
|
934
934
|
store: files.store,
|
|
@@ -107,6 +107,12 @@ export interface CreateArtifactsStoreOptions {
|
|
|
107
107
|
config?: ArtifactsConfig;
|
|
108
108
|
/** Explicit sink override (tests). Omitted → hosted store or local disk. */
|
|
109
109
|
sink?: FileSink;
|
|
110
|
+
/**
|
|
111
|
+
* Whether `tag` enforces {@link ArtifactsConfig.max} by listing and
|
|
112
|
+
* deleting. Default true. Hosted architecture v2 passes false: the
|
|
113
|
+
* installation store is allowed to grow, and a tag must not list the prefix.
|
|
114
|
+
*/
|
|
115
|
+
enforceCap?: () => boolean;
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
/** Kind used by freeform tags when no kinds are declared. */
|
|
@@ -114,8 +120,11 @@ export const ARTIFACT_DEFAULT_KIND = "artifact";
|
|
|
114
120
|
|
|
115
121
|
/**
|
|
116
122
|
* Upsert + list semantics over one {@link ArtifactRowStore}: kind/schema
|
|
117
|
-
* validation, deterministic ids for keyed tags, and `max` eviction.
|
|
118
|
-
*
|
|
123
|
+
* validation, deterministic ids for keyed tags, and `max` eviction.
|
|
124
|
+
* Architecture v1 and self-hosted v2 evict. Hosted architecture v2 sets
|
|
125
|
+
* {@link CreateArtifactsStoreOptions.enforceCap} false and does not list
|
|
126
|
+
* or delete on tag. The engine wraps this into the per-context
|
|
127
|
+
* {@link ArtifactsApi} facades and
|
|
119
128
|
* owns the `artifact.tagged` event append.
|
|
120
129
|
*/
|
|
121
130
|
export class ArtifactsStore {
|
|
@@ -123,6 +132,7 @@ export class ArtifactsStore {
|
|
|
123
132
|
private readonly content: ArtifactContentStore;
|
|
124
133
|
private readonly config: ArtifactsConfig | undefined;
|
|
125
134
|
private readonly max: number;
|
|
135
|
+
private readonly enforceCap: () => boolean;
|
|
126
136
|
/** Serializes tags so read-modify-write upserts and eviction don't race. */
|
|
127
137
|
private tagChain: Promise<unknown> = Promise.resolve();
|
|
128
138
|
|
|
@@ -137,6 +147,7 @@ export class ArtifactsStore {
|
|
|
137
147
|
}
|
|
138
148
|
this.config = options.config;
|
|
139
149
|
this.max = resolveArtifactsMax(options.config);
|
|
150
|
+
this.enforceCap = options.enforceCap ?? (() => true);
|
|
140
151
|
}
|
|
141
152
|
|
|
142
153
|
tag(input: ArtifactTagInput): Promise<ArtifactRecord> {
|
|
@@ -181,7 +192,7 @@ export class ArtifactsStore {
|
|
|
181
192
|
}
|
|
182
193
|
}
|
|
183
194
|
await this.rows.put(record);
|
|
184
|
-
if (existing === undefined) {
|
|
195
|
+
if (existing === undefined && this.enforceCap()) {
|
|
185
196
|
await this.evictPastCap();
|
|
186
197
|
}
|
|
187
198
|
return record;
|
package/src/internal/cli-ax.ts
CHANGED
|
@@ -17,7 +17,11 @@ import { lookupSessionContinuation, runChat } from "./chat-client.js";
|
|
|
17
17
|
import { ensureCursorLogin } from "./cli-cursor.js";
|
|
18
18
|
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
19
19
|
import { resolveApiKey } from "./cursor/credentials.js";
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
type AgentkitSessionEventPoll,
|
|
22
|
+
type AgentkitSessionRuns,
|
|
23
|
+
DeployApiError,
|
|
24
|
+
} from "./deploy-client.js";
|
|
21
25
|
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "./distribution.js";
|
|
22
26
|
import {
|
|
23
27
|
discoverEvals,
|
|
@@ -48,7 +52,7 @@ import {
|
|
|
48
52
|
resolveTemplate,
|
|
49
53
|
} from "./init-project.js";
|
|
50
54
|
import { offerInstallCursorSkills } from "./install-cursor-skills.js";
|
|
51
|
-
import { rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
|
|
55
|
+
import { rejectV2ForLegacyCommand, v2HostedVerifyHint } from "./legacy-command-guard.js";
|
|
52
56
|
import { runLogsTail, sanitizeCustomerError } from "./logs-client.js";
|
|
53
57
|
import { mapPool } from "./map-pool.js";
|
|
54
58
|
import { openBrowser } from "./open-browser.js";
|
|
@@ -750,6 +754,9 @@ async function cmdHostedSession(options: AxCliOptions): Promise<number | "fallba
|
|
|
750
754
|
componentKey: trimNonEmpty(options.componentKey),
|
|
751
755
|
});
|
|
752
756
|
console.log(JSON.stringify(accepted, null, 2));
|
|
757
|
+
if (accepted.sessionId === undefined) {
|
|
758
|
+
process.stderr.write(`${v2HostedVerifyHint(slug)}\n`);
|
|
759
|
+
}
|
|
753
760
|
return 0;
|
|
754
761
|
} catch (error) {
|
|
755
762
|
if (error instanceof DeployApiError && error.status === 404) {
|
|
@@ -811,7 +818,15 @@ export async function cmdCall(options: AxCliOptions): Promise<number> {
|
|
|
811
818
|
}
|
|
812
819
|
}
|
|
813
820
|
|
|
814
|
-
|
|
821
|
+
let target: ResolvedAgentTarget;
|
|
822
|
+
try {
|
|
823
|
+
target = await resolveTarget(options);
|
|
824
|
+
} catch (error) {
|
|
825
|
+
process.stderr.write(
|
|
826
|
+
`${sanitizeCustomerError(error instanceof Error ? error.message : String(error))}\n`,
|
|
827
|
+
);
|
|
828
|
+
return 1;
|
|
829
|
+
}
|
|
815
830
|
try {
|
|
816
831
|
const body: { input: unknown; sessionId?: string } = { input };
|
|
817
832
|
if (options.sessionId !== undefined) {
|
|
@@ -1906,7 +1921,13 @@ export async function cmdSessions(options: AxCliOptions): Promise<number> {
|
|
|
1906
1921
|
}
|
|
1907
1922
|
}
|
|
1908
1923
|
|
|
1909
|
-
|
|
1924
|
+
export const HOSTED_RUNS_LAG_NOTE = "Turn running; runs may lag behind events.";
|
|
1925
|
+
|
|
1926
|
+
function formatHostedSessionRuns(
|
|
1927
|
+
sessionId: string,
|
|
1928
|
+
runs: AgentkitSessionRuns,
|
|
1929
|
+
events?: AgentkitSessionEventPoll,
|
|
1930
|
+
): string {
|
|
1910
1931
|
const lines = [`Session ${sessionId}`, `Hosted executions: ${runs.executions.length}`];
|
|
1911
1932
|
for (const run of runs.executions) {
|
|
1912
1933
|
const failure = run.error?.message ?? run.message ?? "";
|
|
@@ -1916,6 +1937,17 @@ function formatHostedSessionRuns(sessionId: string, runs: AgentkitSessionRuns):
|
|
|
1916
1937
|
...run.logs.map(log => ` ${log.line}`),
|
|
1917
1938
|
);
|
|
1918
1939
|
}
|
|
1940
|
+
const latestType = events?.events.at(-1)?.type;
|
|
1941
|
+
if (events !== undefined && events.events.length > 0) {
|
|
1942
|
+
const latest = latestType === undefined ? "" : ` (latest ${latestType})`;
|
|
1943
|
+
lines.push("", `Events: ${events.events.length}${latest}`);
|
|
1944
|
+
}
|
|
1945
|
+
const turnRunning =
|
|
1946
|
+
runs.executions.at(-1)?.turnStatus === "running" ||
|
|
1947
|
+
(runs.executions.length === 0 && events?.execution?.turnStatus === "running");
|
|
1948
|
+
if (turnRunning && (events?.events.length ?? 0) > 0) {
|
|
1949
|
+
lines.push(HOSTED_RUNS_LAG_NOTE);
|
|
1950
|
+
}
|
|
1919
1951
|
return `${lines.join("\n")}\n`;
|
|
1920
1952
|
}
|
|
1921
1953
|
|
|
@@ -1933,19 +1965,32 @@ async function readHostedSessionRuns(
|
|
|
1933
1965
|
return auth;
|
|
1934
1966
|
}
|
|
1935
1967
|
try {
|
|
1968
|
+
const slug = resolveProdSlug(options);
|
|
1936
1969
|
const runs = await auth.client.getAgentkitSessionRuns({
|
|
1937
1970
|
teamId: auth.teamId,
|
|
1938
|
-
slug
|
|
1971
|
+
slug,
|
|
1939
1972
|
sessionId,
|
|
1940
1973
|
});
|
|
1941
1974
|
if (options.rawEvents === true || trimNonEmpty(options.out) !== undefined) {
|
|
1942
1975
|
process.stderr.write("--events and --out need an engine trajectory.\n");
|
|
1943
1976
|
return 2;
|
|
1944
1977
|
}
|
|
1978
|
+
const latest = runs.executions.at(-1);
|
|
1979
|
+
const events =
|
|
1980
|
+
runs.executions.length === 0 || latest?.turnStatus === "running"
|
|
1981
|
+
? await auth.client
|
|
1982
|
+
.getAgentkitSessionEvents({
|
|
1983
|
+
teamId: auth.teamId,
|
|
1984
|
+
slug,
|
|
1985
|
+
sessionId,
|
|
1986
|
+
afterEventIndex: -1,
|
|
1987
|
+
})
|
|
1988
|
+
.catch(() => undefined)
|
|
1989
|
+
: undefined;
|
|
1945
1990
|
process.stdout.write(
|
|
1946
1991
|
options.json === true
|
|
1947
1992
|
? `${JSON.stringify({ sessionId, ...runs }, null, 2)}\n`
|
|
1948
|
-
: formatHostedSessionRuns(sessionId, runs),
|
|
1993
|
+
: formatHostedSessionRuns(sessionId, runs, events),
|
|
1949
1994
|
);
|
|
1950
1995
|
return 0;
|
|
1951
1996
|
} catch (error) {
|
|
@@ -1988,7 +2033,7 @@ export async function cmdSession(
|
|
|
1988
2033
|
}
|
|
1989
2034
|
if (sessionId === undefined || sessionId.trim() === "") {
|
|
1990
2035
|
process.stderr.write(
|
|
1991
|
-
`Usage: ${CLI_COMMAND_NAME} session <
|
|
2036
|
+
`Usage: ${CLI_COMMAND_NAME} session <ses_> [--url | --prod] [--slug <slug>] [--json | --text | --events] [--out <file.ndjson>]\n` +
|
|
1992
2037
|
` or: ${CLI_COMMAND_NAME} session --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]\n`,
|
|
1993
2038
|
);
|
|
1994
2039
|
return 2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `agent-sdk deploy | deployments | deployment | stop | delete | rotate-token |
|
|
2
|
+
* `agent-sdk deploy | deployments | deployment | stop | rollback | delete | rotate-token |
|
|
3
3
|
* secrets set|list|unset` — Heroku-style deploys
|
|
4
4
|
* onto Cursor's managed agent-serve hosting.
|
|
5
5
|
*
|
|
@@ -1787,12 +1787,45 @@ const RELEASE_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]
|
|
|
1787
1787
|
export async function cmdUpgrade(
|
|
1788
1788
|
args: { slug: string | undefined; release: string | undefined },
|
|
1789
1789
|
options: DeployCliOptions,
|
|
1790
|
+
): Promise<number> {
|
|
1791
|
+
return cmdPinRelease(args, options, {
|
|
1792
|
+
usage: `Usage: ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
|
|
1793
|
+
pin: (client, request) => client.upgradeAgentkitInstall(request),
|
|
1794
|
+
success: (slug, releaseId) => `${slug} now runs release ${releaseId}.\n`,
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
export async function cmdRollback(
|
|
1799
|
+
args: { slug: string | undefined; release: string | undefined },
|
|
1800
|
+
options: DeployCliOptions,
|
|
1801
|
+
): Promise<number> {
|
|
1802
|
+
return cmdPinRelease(args, options, {
|
|
1803
|
+
usage: `Usage: ${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]\n`,
|
|
1804
|
+
pin: (client, request) => client.rollbackAgentkitInstall(request),
|
|
1805
|
+
success: (slug, releaseId) => `${slug} rolled back to release ${releaseId}.\n`,
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
async function cmdPinRelease(
|
|
1810
|
+
args: { slug: string | undefined; release: string | undefined },
|
|
1811
|
+
options: DeployCliOptions,
|
|
1812
|
+
pin: {
|
|
1813
|
+
usage: string;
|
|
1814
|
+
pin: (
|
|
1815
|
+
client: AgentServeDeployClient,
|
|
1816
|
+
request: {
|
|
1817
|
+
teamId: number;
|
|
1818
|
+
slug: string;
|
|
1819
|
+
releaseId?: string;
|
|
1820
|
+
version?: string;
|
|
1821
|
+
},
|
|
1822
|
+
) => Promise<string>;
|
|
1823
|
+
success: (slug: string, releaseId: string) => string;
|
|
1824
|
+
},
|
|
1790
1825
|
): Promise<number> {
|
|
1791
1826
|
const { slug, release } = args;
|
|
1792
1827
|
if (slug === undefined || slug === "") {
|
|
1793
|
-
(options.err ?? ((text: string) => void process.stderr.write(text)))(
|
|
1794
|
-
`Usage: ${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]\n`,
|
|
1795
|
-
);
|
|
1828
|
+
(options.err ?? ((text: string) => void process.stderr.write(text)))(pin.usage);
|
|
1796
1829
|
return 1;
|
|
1797
1830
|
}
|
|
1798
1831
|
const ctx = await prepare(options);
|
|
@@ -1802,7 +1835,7 @@ export async function cmdUpgrade(
|
|
|
1802
1835
|
const selector = release?.trim() ?? "";
|
|
1803
1836
|
let releaseId: string;
|
|
1804
1837
|
try {
|
|
1805
|
-
releaseId = await ctx.client
|
|
1838
|
+
releaseId = await pin.pin(ctx.client, {
|
|
1806
1839
|
teamId: ctx.teamId,
|
|
1807
1840
|
slug,
|
|
1808
1841
|
...(selector === ""
|
|
@@ -1817,7 +1850,7 @@ export async function cmdUpgrade(
|
|
|
1817
1850
|
if (ctx.json) {
|
|
1818
1851
|
ctx.out(`${JSON.stringify({ releaseId }, null, 2)}\n`);
|
|
1819
1852
|
} else {
|
|
1820
|
-
ctx.out(
|
|
1853
|
+
ctx.out(pin.success(slug, releaseId));
|
|
1821
1854
|
}
|
|
1822
1855
|
return 0;
|
|
1823
1856
|
}
|
|
@@ -15,6 +15,7 @@ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/
|
|
|
15
15
|
import type { OAuthTokens } from "@modelcontextprotocol/sdk/shared/auth.js";
|
|
16
16
|
import { isCursorAccountTransport } from "../types.js";
|
|
17
17
|
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
18
|
+
import { resolveConnectionEnvTemplates } from "./connection-env.js";
|
|
18
19
|
import { CursorBackendClient } from "./cursor/backend-client.js";
|
|
19
20
|
import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
|
|
20
21
|
import { deploymentServiceAccountId } from "./deploy-client.js";
|
|
@@ -76,7 +77,7 @@ export async function cmdMcpOauth(options: McpOauthCliOptions): Promise<number>
|
|
|
76
77
|
return 1;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
const transport = connection.transport;
|
|
80
|
+
const transport = resolveConnectionEnvTemplates(connection.transport);
|
|
80
81
|
if (isCursorAccountTransport(transport)) {
|
|
81
82
|
return cmdMcpOauthCursorAccount(options, {
|
|
82
83
|
servers: transport.servers,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `install-skills` — install the package's coding-agent skills into
|
|
3
|
-
* `~/.cursor/skills/
|
|
3
|
+
* `~/.cursor/skills/bdk/` without running `init`.
|
|
4
4
|
*
|
|
5
5
|
* Never prompts: running the command is the confirmation. The interactive
|
|
6
6
|
* offer lives in `init`. Consumer `npm install` / `npx` copies the same
|
|
@@ -12,7 +12,6 @@ import { CLI_COMMAND_NAME } from "./distribution.js";
|
|
|
12
12
|
import {
|
|
13
13
|
formatSkillInstall,
|
|
14
14
|
installCursorSkills,
|
|
15
|
-
LEGACY_CURSOR_SKILLS_NAMESPACE,
|
|
16
15
|
planSkillInstall,
|
|
17
16
|
type SkillInstallPlan,
|
|
18
17
|
} from "./install-cursor-skills.js";
|
|
@@ -61,7 +60,7 @@ export async function cmdInstallSkills(options: InstallSkillsCliOptions = {}): P
|
|
|
61
60
|
return 0;
|
|
62
61
|
}
|
|
63
62
|
const action = plan.firstInstall ? "install" : "update";
|
|
64
|
-
out(`Would ${action} ${plan.leaves.length}
|
|
63
|
+
out(`Would ${action} ${plan.leaves.length} BDK ${noun}\n`);
|
|
65
64
|
out(previewBlock(plan));
|
|
66
65
|
return 0;
|
|
67
66
|
}
|
|
@@ -91,8 +90,8 @@ function previewBlock(plan: SkillInstallPlan): string {
|
|
|
91
90
|
if (plan.orphans.length > 0) {
|
|
92
91
|
lines.push(` removes: ${plan.orphans.join(", ")}`);
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
lines.push(` removes: ${
|
|
93
|
+
for (const dir of plan.legacyDirs) {
|
|
94
|
+
lines.push(` removes: ${dir}`);
|
|
96
95
|
}
|
|
97
96
|
lines.push(` location: ${plan.directory}`);
|
|
98
97
|
return `${lines.join("\n")}\n`;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `${NAME}` expansion for MCP connection credentials, applied when a
|
|
3
|
+
* transport is built instead of when its module is imported.
|
|
4
|
+
*
|
|
5
|
+
* Discovery imports `mcp-connections/*.ts` once, at startup. A hosted
|
|
6
|
+
* deployment has none of its secrets in the environment at that point: the
|
|
7
|
+
* control plane binds them per request and `consumeHostedBoundSecrets` copies
|
|
8
|
+
* them into `process.env` at the top of the turn. A `process.env.TOKEN` read
|
|
9
|
+
* inside `defineConnection` therefore captures an empty value for the life of
|
|
10
|
+
* the process, while a `"Bearer ${TOKEN}"` template stays verbatim on the
|
|
11
|
+
* transport and resolves here, each time a client opens.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
import type { ConnectionTransport } from "../types.js";
|
|
16
|
+
|
|
17
|
+
/** `${NAME}`, plus the `mcp.json` spelling `${env:NAME}`. */
|
|
18
|
+
const ENV_TEMPLATE = /\$\{(?:env:)?([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
19
|
+
|
|
20
|
+
type Env = Record<string, string | undefined>;
|
|
21
|
+
|
|
22
|
+
/** Credential-bearing values of a transport: HTTP headers or stdio env. */
|
|
23
|
+
function credentials(transport: ConnectionTransport): Record<string, string> | undefined {
|
|
24
|
+
if ("url" in transport) {
|
|
25
|
+
return transport.headers;
|
|
26
|
+
}
|
|
27
|
+
if ("command" in transport) {
|
|
28
|
+
return transport.env;
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function expand(value: string, env: Env): string {
|
|
34
|
+
return value.replace(ENV_TEMPLATE, (_match, name: string) => env[name] ?? "");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The same object back when nothing templates, so callers can compare by identity. */
|
|
38
|
+
function expandRecord(
|
|
39
|
+
values: Record<string, string> | undefined,
|
|
40
|
+
env: Env,
|
|
41
|
+
): Record<string, string> | undefined {
|
|
42
|
+
if (values === undefined) {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
const expanded: Record<string, string> = {};
|
|
46
|
+
let changed = false;
|
|
47
|
+
for (const [key, value] of Object.entries(values)) {
|
|
48
|
+
expanded[key] = expand(value, env);
|
|
49
|
+
changed ||= expanded[key] !== value;
|
|
50
|
+
}
|
|
51
|
+
return changed ? expanded : values;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Substitute `${NAME}` in the transport's headers (http/sse) or env (stdio)
|
|
56
|
+
* from the environment as it stands now. An unset variable resolves to an
|
|
57
|
+
* empty string, as reading it in the module would have.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveConnectionEnvTemplates<T extends ConnectionTransport>(
|
|
60
|
+
transport: T,
|
|
61
|
+
env: Env = process.env,
|
|
62
|
+
): T {
|
|
63
|
+
if ("url" in transport) {
|
|
64
|
+
const headers = expandRecord(transport.headers, env);
|
|
65
|
+
return headers === transport.headers ? transport : ({ ...transport, headers } as T);
|
|
66
|
+
}
|
|
67
|
+
if ("command" in transport) {
|
|
68
|
+
const spawnEnv = expandRecord(transport.env, env);
|
|
69
|
+
return spawnEnv === transport.env ? transport : ({ ...transport, env: spawnEnv } as T);
|
|
70
|
+
}
|
|
71
|
+
return transport;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Variables a transport templates that the environment does not define, in first-seen order. */
|
|
75
|
+
export function unresolvedConnectionEnvNames(
|
|
76
|
+
transport: ConnectionTransport,
|
|
77
|
+
env: Env = process.env,
|
|
78
|
+
): string[] {
|
|
79
|
+
const missing = new Set<string>();
|
|
80
|
+
for (const value of Object.values(credentials(transport) ?? {})) {
|
|
81
|
+
for (const match of value.matchAll(ENV_TEMPLATE)) {
|
|
82
|
+
const name = match[1];
|
|
83
|
+
if (name !== undefined && env[name] === undefined) {
|
|
84
|
+
missing.add(name);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return [...missing];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Identifies the credentials a client would open with right now, so a cached
|
|
93
|
+
* client is recognizable as stale once the environment changes underneath it.
|
|
94
|
+
* Hashed rather than stored, so the cache key is not a second copy of the
|
|
95
|
+
* secret.
|
|
96
|
+
*/
|
|
97
|
+
export function connectionCredentialsFingerprint(
|
|
98
|
+
transport: ConnectionTransport,
|
|
99
|
+
env: Env = process.env,
|
|
100
|
+
): string {
|
|
101
|
+
const resolved = credentials(resolveConnectionEnvTemplates(transport, env));
|
|
102
|
+
if (resolved === undefined) {
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
return createHash("sha256").update(JSON.stringify(resolved)).digest("hex");
|
|
106
|
+
}
|
|
@@ -938,6 +938,12 @@ function describeGithubTokenHttpFailure(
|
|
|
938
938
|
detail === undefined ? "" : `: ${detail}`
|
|
939
939
|
}. Run \`${CLI} login\` again or update CURSOR_API_KEY.`;
|
|
940
940
|
}
|
|
941
|
+
if (status === 429) {
|
|
942
|
+
const cleaned =
|
|
943
|
+
detail === undefined ? undefined : detail.replace(/\[?resource_exhausted\]?/gi, "").trim();
|
|
944
|
+
const suffix = cleaned === undefined || cleaned === "" ? "" : `: ${cleaned}`;
|
|
945
|
+
return `${label} API rate limit (429)${suffix}. Retry after the rate-limit window.`;
|
|
946
|
+
}
|
|
941
947
|
if (detail !== undefined) {
|
|
942
948
|
return detail;
|
|
943
949
|
}
|
|
@@ -372,6 +372,21 @@ export interface AgentkitSessionRuns {
|
|
|
372
372
|
startLog: string | null;
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
+
/** One event from the hosted session event poll. */
|
|
376
|
+
export interface AgentkitSessionEvent {
|
|
377
|
+
index?: number;
|
|
378
|
+
type?: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* `GET .../sessions/:sessionId/events?afterEventIndex=` body.
|
|
383
|
+
* Events land before the run log on a long turn.
|
|
384
|
+
*/
|
|
385
|
+
export interface AgentkitSessionEventPoll {
|
|
386
|
+
events: AgentkitSessionEvent[];
|
|
387
|
+
execution: { executionId: string; turnStatus: string } | null;
|
|
388
|
+
}
|
|
389
|
+
|
|
375
390
|
/** One secret's metadata from the list endpoint — names only, never values. */
|
|
376
391
|
export interface SecretInfo {
|
|
377
392
|
name: string;
|
|
@@ -556,6 +571,25 @@ const agentkitSessionRunsSchema = z
|
|
|
556
571
|
})
|
|
557
572
|
.passthrough();
|
|
558
573
|
|
|
574
|
+
const agentkitSessionEventPollSchema = z
|
|
575
|
+
.object({
|
|
576
|
+
events: z.array(
|
|
577
|
+
z
|
|
578
|
+
.object({
|
|
579
|
+
index: z.number().optional(),
|
|
580
|
+
type: z.string().optional(),
|
|
581
|
+
})
|
|
582
|
+
.passthrough(),
|
|
583
|
+
),
|
|
584
|
+
execution: z
|
|
585
|
+
.object({
|
|
586
|
+
executionId: z.string(),
|
|
587
|
+
turnStatus: z.string(),
|
|
588
|
+
})
|
|
589
|
+
.nullable(),
|
|
590
|
+
})
|
|
591
|
+
.passthrough();
|
|
592
|
+
|
|
559
593
|
const deploymentSchema = z.object({
|
|
560
594
|
id: z.number(),
|
|
561
595
|
slug: z.string(),
|
|
@@ -983,26 +1017,44 @@ export class AgentServeDeployClient {
|
|
|
983
1017
|
return agentkitEventRepositoriesSchema.parse(raw).repositories;
|
|
984
1018
|
}
|
|
985
1019
|
|
|
986
|
-
/**
|
|
987
|
-
* Pin a v2 install onto a release
|
|
988
|
-
* (`PUT /internal/agentsdk/deployments/:slug/release`), newest ready one
|
|
989
|
-
* when neither selector is given. A multi-tenant deploy leaves tenants
|
|
990
|
-
* on the release they were installed on.
|
|
991
|
-
*/
|
|
992
1020
|
async upgradeAgentkitInstall(args: {
|
|
993
1021
|
teamId: number;
|
|
994
1022
|
slug: string;
|
|
995
1023
|
releaseId?: string;
|
|
996
1024
|
version?: string;
|
|
997
1025
|
}): Promise<string> {
|
|
1026
|
+
return this.pinAgentkitInstall("upgrade", args);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
async rollbackAgentkitInstall(args: {
|
|
1030
|
+
teamId: number;
|
|
1031
|
+
slug: string;
|
|
1032
|
+
releaseId?: string;
|
|
1033
|
+
version?: string;
|
|
1034
|
+
}): Promise<string> {
|
|
1035
|
+
return this.pinAgentkitInstall("rollback", args);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
private async pinAgentkitInstall(
|
|
1039
|
+
direction: "upgrade" | "rollback",
|
|
1040
|
+
args: {
|
|
1041
|
+
teamId: number;
|
|
1042
|
+
slug: string;
|
|
1043
|
+
releaseId?: string;
|
|
1044
|
+
version?: string;
|
|
1045
|
+
},
|
|
1046
|
+
): Promise<string> {
|
|
998
1047
|
const raw = await this.request({
|
|
999
|
-
method: "PUT",
|
|
1000
|
-
path: `/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}
|
|
1048
|
+
method: direction === "upgrade" ? "PUT" : "POST",
|
|
1049
|
+
path: `/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}/${direction === "upgrade" ? "release" : "rollback"}?teamId=${args.teamId}`,
|
|
1001
1050
|
body: {
|
|
1002
1051
|
...(args.releaseId === undefined ? {} : { releaseId: args.releaseId }),
|
|
1003
1052
|
...(args.version === undefined ? {} : { version: args.version }),
|
|
1004
1053
|
},
|
|
1005
|
-
context: {
|
|
1054
|
+
context: {
|
|
1055
|
+
verb: direction === "upgrade" ? "upgrade" : "roll back",
|
|
1056
|
+
slug: args.slug,
|
|
1057
|
+
},
|
|
1006
1058
|
});
|
|
1007
1059
|
return agentkitInstallReleaseSchema.parse(raw).releaseId;
|
|
1008
1060
|
}
|
|
@@ -1064,6 +1116,24 @@ export class AgentServeDeployClient {
|
|
|
1064
1116
|
return agentkitSessionRunsSchema.parse(raw);
|
|
1065
1117
|
}
|
|
1066
1118
|
|
|
1119
|
+
/** Events written so far. Pass `afterEventIndex: -1` to read from the start. */
|
|
1120
|
+
async getAgentkitSessionEvents(args: {
|
|
1121
|
+
teamId: number;
|
|
1122
|
+
slug: string;
|
|
1123
|
+
sessionId: string;
|
|
1124
|
+
afterEventIndex: number;
|
|
1125
|
+
}): Promise<AgentkitSessionEventPoll> {
|
|
1126
|
+
const raw = await this.request({
|
|
1127
|
+
method: "GET",
|
|
1128
|
+
path:
|
|
1129
|
+
`/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}` +
|
|
1130
|
+
`/sessions/${encodeURIComponent(args.sessionId)}/events` +
|
|
1131
|
+
`?teamId=${args.teamId}&afterEventIndex=${args.afterEventIndex}`,
|
|
1132
|
+
context: { verb: "get session events", slug: args.slug },
|
|
1133
|
+
});
|
|
1134
|
+
return agentkitSessionEventPollSchema.parse(raw);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1067
1137
|
async listDeployments(args: { teamId: number }): Promise<Deployment[]> {
|
|
1068
1138
|
const raw = await this.request({
|
|
1069
1139
|
method: "GET",
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
normalizeCursorAccountServers,
|
|
17
17
|
type ToolEffect,
|
|
18
18
|
} from "../../types.js";
|
|
19
|
+
import { unresolvedConnectionEnvNames } from "../connection-env.js";
|
|
19
20
|
import { packageInlineStdioConnection } from "../package-inline-stdio.js";
|
|
20
21
|
import { type DiscoveryContext, displayPath, errorMessage, isBlank } from "./context.js";
|
|
21
22
|
import { importDefault, moduleEntries } from "./modules.js";
|
|
@@ -424,6 +425,16 @@ export async function compileConnection(
|
|
|
424
425
|
});
|
|
425
426
|
return undefined;
|
|
426
427
|
}
|
|
428
|
+
// A warning, never an error: templates resolve when the connection opens,
|
|
429
|
+
// and a hosted deployment binds its secrets after discovery has run.
|
|
430
|
+
const unresolved = unresolvedConnectionEnvNames(transport);
|
|
431
|
+
if (unresolved.length > 0) {
|
|
432
|
+
ctx.diagnostics.push({
|
|
433
|
+
severity: "warning",
|
|
434
|
+
path: displayPath(ctx, entryPath),
|
|
435
|
+
message: `MCP connection "${name}" templates ${unresolved.map(variable => `\${${variable}}`).join(", ")}, which the environment does not set. The value resolves when the connection opens, so hosted deployments are fine; locally, set it before the turn or the credential is empty.`,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
427
438
|
return {
|
|
428
439
|
name,
|
|
429
440
|
transport,
|