@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
package/src/bin/agent-serve.ts
CHANGED
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
cmdDeployments,
|
|
49
49
|
cmdEventRepos,
|
|
50
50
|
cmdKill,
|
|
51
|
+
cmdRollback,
|
|
51
52
|
cmdRotateToken,
|
|
52
53
|
cmdSecretsList,
|
|
53
54
|
cmdSecretsSet,
|
|
@@ -66,6 +67,7 @@ import {
|
|
|
66
67
|
PACKAGE_NAME,
|
|
67
68
|
packageVersion,
|
|
68
69
|
} from "../internal/distribution.js";
|
|
70
|
+
import { v2HostedVerifyHint } from "../internal/legacy-command-guard.js";
|
|
69
71
|
import { loadAgentLocalEnv } from "../internal/local-env.js";
|
|
70
72
|
import {
|
|
71
73
|
ENTER_RESTART_EXIT_CODE,
|
|
@@ -97,6 +99,7 @@ Usage:
|
|
|
97
99
|
[--slug <slug>] [--team <id>] [--dir <path>]
|
|
98
100
|
${CLI} sessions [--url <baseUrl> | --prod] [--json]
|
|
99
101
|
[--slug <slug>] [--team <id>] [--dir <path>]
|
|
102
|
+
v2: unsupported. ${v2HostedVerifyHint()}
|
|
100
103
|
${CLI} session <sessionId> [--url <baseUrl> | --prod]
|
|
101
104
|
[--json | --text | --events] [--out <file.ndjson>]
|
|
102
105
|
[--slug <slug>] [--team <id>] [--dir <path>]
|
|
@@ -114,6 +117,7 @@ Usage:
|
|
|
114
117
|
${CLI} trajectory --events <file.ndjson> [--text]
|
|
115
118
|
${CLI} call <tool> [--input <json>] [--dir <path> | --url <baseUrl> | --prod]
|
|
116
119
|
[--session <id>] [--slug <slug>] [--team <id>]
|
|
120
|
+
v2: unsupported. ${v2HostedVerifyHint()}
|
|
117
121
|
${CLI} skill <name> [--dir <path> | --url <baseUrl> | --prod]
|
|
118
122
|
[--slug <slug>] [--team <id>] [--text]
|
|
119
123
|
${CLI} init [dir] [--template <name>] [--var id=value]... [--json]
|
|
@@ -157,6 +161,7 @@ Usage:
|
|
|
157
161
|
${CLI} cancel-runs <slug> [--team <id>] [--json]
|
|
158
162
|
${CLI} event-repos <slug> [--repo <owner/name>]... [--team <id>] [--json]
|
|
159
163
|
${CLI} upgrade <slug> [--release <id|version>] [--team <id>] [--json]
|
|
164
|
+
${CLI} rollback <slug> [--release <id|version>] [--team <id>] [--json]
|
|
160
165
|
${CLI} delete <slug> [--team <id>] [--json] [--no-wait]
|
|
161
166
|
${CLI} rotate-token <slug> [--team <id>]
|
|
162
167
|
${CLI} secrets set <slug> NAME... | list <slug> | unset <slug> NAME
|
|
@@ -189,8 +194,10 @@ Commands:
|
|
|
189
194
|
the current buffer. --prod shows deploy progress until the
|
|
190
195
|
hosted deployment is running, then tails runtime logs. Without
|
|
191
196
|
--prod, tails the local server (or --url).
|
|
192
|
-
sessions List sessions on a running agent
|
|
193
|
-
|
|
197
|
+
sessions List sessions on a running agent or a v1 --prod deployment.
|
|
198
|
+
Unsupported on architecture v2. ${v2HostedVerifyHint()}
|
|
199
|
+
session Show one session. On v2: \`${CLI} session <ses_> --prod --slug <slug>\`.
|
|
200
|
+
Default: text trajectory. --json for trajectory
|
|
194
201
|
JSON; --events for the raw event list. To continue interactively,
|
|
195
202
|
use \`${CLI} resume [id]\`.
|
|
196
203
|
cost Pull cost metrics. With a session id: per-turn token usage and
|
|
@@ -208,13 +215,14 @@ Commands:
|
|
|
208
215
|
Streams tool calls and reply text to stderr when stderr is a TTY.
|
|
209
216
|
Pass --prod to hit the hosted deployment instead of a local server.
|
|
210
217
|
On an AgentSDK v2 slug, --prod starts a hosted session through
|
|
211
|
-
the control plane (Temporal, no resident engine)
|
|
212
|
-
ses_… resumes that exact session. A 404 falls back to the v1
|
|
218
|
+
the control plane (Temporal, no resident engine). ${v2HostedVerifyHint()}
|
|
219
|
+
--session ses_… resumes that exact session. A 404 falls back to the v1
|
|
213
220
|
engine alias.
|
|
214
221
|
trajectory Summarize an events.ndjson file into a trajectory.
|
|
215
222
|
call Call an authored server tool deterministically (no model turn)
|
|
216
223
|
via POST /v1/tools/:toolName. --session runs it inside an
|
|
217
224
|
existing session and records it on that session's event stream.
|
|
225
|
+
Unsupported on architecture v2. ${v2HostedVerifyHint()}
|
|
218
226
|
skill Read an authored skill deterministically (no model turn)
|
|
219
227
|
via GET /v1/skills/:skillName. --text prints SKILL.md.
|
|
220
228
|
init Scaffold a project (skipping existing files), npm install,
|
|
@@ -234,8 +242,8 @@ Commands:
|
|
|
234
242
|
-> MCP). Review the project, then run \`validate\` / \`dev\`.
|
|
235
243
|
Warnings never fail the command.
|
|
236
244
|
install-skills
|
|
237
|
-
Refresh the
|
|
238
|
-
~/.cursor/skills/
|
|
245
|
+
Refresh the BDK skills for coding agents in
|
|
246
|
+
~/.cursor/skills/bdk and print where they landed.
|
|
239
247
|
Installed copies set alwaysApply so Cursor injects them
|
|
240
248
|
into context. \`npm install\` / \`npx\` already copies them
|
|
241
249
|
(postinstall); this command overwrites with the package
|
|
@@ -306,6 +314,9 @@ Commands:
|
|
|
306
314
|
upgrade Move this team's install onto a release, the newest ready one
|
|
307
315
|
by default. Deploying a multi-tenant application publishes a
|
|
308
316
|
release without moving any tenant onto it.
|
|
317
|
+
rollback Move this team's install onto an earlier ready release, the
|
|
318
|
+
nearest one by default. Does not publish a release. Pass
|
|
319
|
+
--release to choose an older id or version.
|
|
309
320
|
delete Delete a deployment (teardown + purge the record) and wait
|
|
310
321
|
until GET 404s. The slug is then free to redeploy.
|
|
311
322
|
rotate-token Mint a new alias token for a deployment (shown once); the old
|
|
@@ -392,7 +403,10 @@ Options:
|
|
|
392
403
|
--dir basename. Mutually exclusive with --url. Requires
|
|
393
404
|
\`${CLI} login\`. For eval, this is how you opt into the
|
|
394
405
|
persisted server-side batch (default is local).
|
|
406
|
+
v2: ${v2HostedVerifyHint()} call --prod and
|
|
407
|
+
sessions --prod stay on v1.
|
|
395
408
|
--dry-run run/session --prod: mark the hosted v2 turn non-mutating.
|
|
409
|
+
${v2HostedVerifyHint()}
|
|
396
410
|
--component run/session --prod: wake this v2 component key,
|
|
397
411
|
not the application default.
|
|
398
412
|
--as-of run/session --prod: freeze the session clock at this
|
|
@@ -893,6 +907,13 @@ async function main(argv: string[]): Promise<number> {
|
|
|
893
907
|
);
|
|
894
908
|
}
|
|
895
909
|
|
|
910
|
+
case "rollback": {
|
|
911
|
+
return cmdRollback(
|
|
912
|
+
{ slug: positionals[0], release: values.release },
|
|
913
|
+
deployOptionsFromValues(values),
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
|
|
896
917
|
case "delete": {
|
|
897
918
|
return cmdDelete(positionals[0], deployOptionsFromValues(values));
|
|
898
919
|
}
|
|
@@ -215,11 +215,50 @@ export async function createGitHubInstallationToken(input: {
|
|
|
215
215
|
privateKey,
|
|
216
216
|
...(input.api?.apiBaseUrl === undefined ? {} : { baseUrl: input.api.apiBaseUrl }),
|
|
217
217
|
});
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
try {
|
|
219
|
+
const result = await auth({
|
|
220
|
+
type: "installation",
|
|
221
|
+
installationId: input.installationId,
|
|
222
|
+
});
|
|
223
|
+
return result.token;
|
|
224
|
+
} catch (error) {
|
|
225
|
+
throw installationTokenMintError(error, {
|
|
226
|
+
appId,
|
|
227
|
+
installationId: input.installationId,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Octokit's bare mint failure ("Not Found - <docs url>") names neither the
|
|
234
|
+
* app nor the installation, which makes a revoked installation or an
|
|
235
|
+
* app/installation credential mismatch undiagnosable from production logs.
|
|
236
|
+
* Rewrap with both ids and, for 404, the two causes that produce it.
|
|
237
|
+
*/
|
|
238
|
+
function installationTokenMintError(
|
|
239
|
+
error: unknown,
|
|
240
|
+
context: { appId: string; installationId: number },
|
|
241
|
+
): Error {
|
|
242
|
+
const status =
|
|
243
|
+
typeof error === "object" &&
|
|
244
|
+
error !== null &&
|
|
245
|
+
"status" in error &&
|
|
246
|
+
typeof (error as { status: unknown }).status === "number"
|
|
247
|
+
? (error as { status: number }).status
|
|
248
|
+
: undefined;
|
|
249
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
250
|
+
const hint =
|
|
251
|
+
status === 404
|
|
252
|
+
? " — the installation does not exist for this app: it was uninstalled or suspended, or the configured app credentials belong to a different GitHub App than the one this installation id refers to"
|
|
253
|
+
: "";
|
|
254
|
+
const wrapped = new Error(
|
|
255
|
+
`githubChannel: failed to mint an installation access token (app ${context.appId}, installation ${context.installationId}): ${detail}${hint}`,
|
|
256
|
+
error instanceof Error ? { cause: error } : undefined,
|
|
257
|
+
);
|
|
258
|
+
if (status !== undefined) {
|
|
259
|
+
(wrapped as Error & { status?: number }).status = status;
|
|
260
|
+
}
|
|
261
|
+
return wrapped;
|
|
223
262
|
}
|
|
224
263
|
|
|
225
264
|
/**
|
|
@@ -133,6 +133,7 @@ export function buildSlackManifest(options: SlackManifestOptions): SlackAppManif
|
|
|
133
133
|
const displayName = benny ? "benny-dev" : env === "dev" ? `${options.name} (dev)` : options.name;
|
|
134
134
|
const botName = options.botDisplayName ?? toBotDisplayName(options.name, env);
|
|
135
135
|
const description = options.description ?? defaultDescription(options.name);
|
|
136
|
+
const agentDescription = options.agentDescription ?? description;
|
|
136
137
|
const includeAgentView = options.assistant !== false;
|
|
137
138
|
|
|
138
139
|
const botScopes = includeAgentView
|
|
@@ -163,7 +164,7 @@ export function buildSlackManifest(options: SlackManifestOptions): SlackAppManif
|
|
|
163
164
|
},
|
|
164
165
|
agent_view: includeAgentView
|
|
165
166
|
? {
|
|
166
|
-
agent_description:
|
|
167
|
+
agent_description: agentDescription,
|
|
167
168
|
suggested_prompts: suggested,
|
|
168
169
|
}
|
|
169
170
|
: undefined,
|
|
@@ -752,8 +752,13 @@ export interface SlackManifestOptions {
|
|
|
752
752
|
botDisplayName?: string;
|
|
753
753
|
/** Env profile. Affects display name suffix. */
|
|
754
754
|
env: "dev" | "prod";
|
|
755
|
-
/** Optional short description shown in the Slack app. */
|
|
755
|
+
/** Optional short description shown in the Slack app directory. Slack caps this at 140 characters. */
|
|
756
756
|
description?: string;
|
|
757
|
+
/**
|
|
758
|
+
* Slack agent profile (`features.agent_view.agent_description`).
|
|
759
|
+
* Defaults to `description`. Separate from the 140-character marketplace line.
|
|
760
|
+
*/
|
|
761
|
+
agentDescription?: string;
|
|
757
762
|
/** Include `agent_view` + `assistant:write` for typing status. */
|
|
758
763
|
assistant?: boolean;
|
|
759
764
|
/**
|
package/src/connections.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* export default defineConnection({
|
|
20
20
|
* url: "https://mcp.linear.app/mcp",
|
|
21
|
-
* headers: { authorization:
|
|
21
|
+
* headers: { authorization: "Bearer ${LINEAR_TOKEN}" },
|
|
22
22
|
* });
|
|
23
23
|
*
|
|
24
24
|
* // TypeScript tools, packaged as stdio MCP for the agent environment:
|
|
@@ -18,14 +18,22 @@
|
|
|
18
18
|
* Agents API, everything else through the BackgroundComposerService RPCs,
|
|
19
19
|
* all under the serve host's Cursor API key (`CURSOR_API_KEY`, key file, or
|
|
20
20
|
* `login`). Each launched agent stays bound to the principal that launched
|
|
21
|
-
* it, and launches go to the configured repositories.
|
|
22
|
-
*
|
|
21
|
+
* it, and launches go to the configured repositories. `channels` limits
|
|
22
|
+
* launch, reply, and cancel to sessions on those channel ids, so a channel
|
|
23
|
+
* whose input is untrusted (an alert webhook) cannot start or steer an agent.
|
|
24
|
+
* The tools run on the serve host, so they need the local runtime.
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
import { z } from "zod";
|
|
26
28
|
import { defineExtension } from "../../extensions.js";
|
|
27
29
|
import type { AgentCloudOptions, Extension, ModelSetting } from "../../types.js";
|
|
28
30
|
|
|
31
|
+
type CloudRepo = NonNullable<AgentCloudOptions["repos"]>[number];
|
|
32
|
+
|
|
33
|
+
export type CursorCloudAgentsCloudOptions = Omit<AgentCloudOptions, "repos"> & {
|
|
34
|
+
repos?: CloudRepo[] | (() => CloudRepo[]);
|
|
35
|
+
};
|
|
36
|
+
|
|
29
37
|
/** Mount options; every field is optional. */
|
|
30
38
|
export interface CursorCloudAgentsOptions {
|
|
31
39
|
/**
|
|
@@ -34,8 +42,12 @@ export interface CursorCloudAgentsOptions {
|
|
|
34
42
|
* allowlist for a launch's own `repo` / `prUrl`; model-chosen targets are
|
|
35
43
|
* refused when no allowlist is configured. With none configured,
|
|
36
44
|
* `needsApproval` defaults to true so prompt-only launches park first.
|
|
45
|
+
* `repos` may be a function, called on every launch, for an allowlist that
|
|
46
|
+
* is only known at request time (a multi-tenant deployment's per-install
|
|
47
|
+
* secrets). A launch against a function allowlist always targets exactly
|
|
48
|
+
* one of its repositories, never the whole list and never none.
|
|
37
49
|
*/
|
|
38
|
-
cloud?:
|
|
50
|
+
cloud?: CursorCloudAgentsCloudOptions;
|
|
39
51
|
/** Model for launched agents. The account default when omitted. */
|
|
40
52
|
model?: ModelSetting;
|
|
41
53
|
/**
|
|
@@ -46,15 +58,17 @@ export interface CursorCloudAgentsOptions {
|
|
|
46
58
|
* require the allowlist regardless of this flag.
|
|
47
59
|
*/
|
|
48
60
|
needsApproval?: boolean;
|
|
61
|
+
channels?: string[];
|
|
49
62
|
/** Cursor API key. Defaults to the serve host's own key. */
|
|
50
63
|
apiKey?: string;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
/** {@link CursorCloudAgentsOptions} with defaults applied. */
|
|
54
67
|
export interface CursorCloudAgentsConfig {
|
|
55
|
-
cloud:
|
|
68
|
+
cloud: CursorCloudAgentsCloudOptions;
|
|
56
69
|
model?: ModelSetting;
|
|
57
70
|
needsApproval: boolean;
|
|
71
|
+
channels?: string[];
|
|
58
72
|
apiKey?: string;
|
|
59
73
|
}
|
|
60
74
|
|
|
@@ -64,7 +78,9 @@ const repo = z.object({
|
|
|
64
78
|
prUrl: z.string().url().optional(),
|
|
65
79
|
});
|
|
66
80
|
|
|
67
|
-
const
|
|
81
|
+
const repos = z.array(repo);
|
|
82
|
+
|
|
83
|
+
const cloud: z.ZodType<CursorCloudAgentsCloudOptions> = z.object({
|
|
68
84
|
env: z
|
|
69
85
|
.discriminatedUnion("type", [
|
|
70
86
|
z.object({ type: z.literal("cloud"), name: z.string().optional() }),
|
|
@@ -72,7 +88,7 @@ const cloud: z.ZodType<AgentCloudOptions> = z.object({
|
|
|
72
88
|
z.object({ type: z.literal("machine"), name: z.string().optional() }),
|
|
73
89
|
])
|
|
74
90
|
.optional(),
|
|
75
|
-
repos: z.
|
|
91
|
+
repos: z.union([repos, z.function().args().returns(repos)]).optional(),
|
|
76
92
|
workOnCurrentBranch: z.boolean().optional(),
|
|
77
93
|
autoCreatePR: z.boolean().optional(),
|
|
78
94
|
skipReviewerRequest: z.boolean().optional(),
|
|
@@ -96,6 +112,7 @@ const config: z.ZodType<
|
|
|
96
112
|
cloud: cloud.default({}),
|
|
97
113
|
model: model.optional(),
|
|
98
114
|
needsApproval: z.boolean().optional(),
|
|
115
|
+
channels: z.array(z.string().min(1)).optional(),
|
|
99
116
|
apiKey: z.string().optional(),
|
|
100
117
|
})
|
|
101
118
|
.default({})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolContext } from "../../../types.js";
|
|
2
|
+
import extension from "../extension.js";
|
|
3
|
+
|
|
4
|
+
export function assertWriteChannel(ctx: ToolContext): void {
|
|
5
|
+
const { channels } = extension.config;
|
|
6
|
+
if (channels !== undefined && !channels.includes(ctx.session.channelId)) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`Cloud agents cannot be launched or steered from the "${ctx.session.channelId}" channel.`,
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* `prUrl` per call, but the author's `cloud.repos` are the allowlist.
|
|
4
4
|
* Model-chosen targets always require that allowlist: an unbound mount
|
|
5
5
|
* (no `cloud.repos`) must not accept an arbitrary URL under the host API
|
|
6
|
-
* key, with or without `envVars`.
|
|
6
|
+
* key, with or without `envVars`. A function allowlist is resolved on every
|
|
7
|
+
* call and always narrows the launch to one of its repositories.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
import { parsePrUrl } from "../../../internal/scm/pr-url.js";
|
|
10
11
|
import type { AgentCloudOptions } from "../../../types.js";
|
|
12
|
+
import type { CursorCloudAgentsCloudOptions } from "../extension.js";
|
|
11
13
|
|
|
12
14
|
export interface LaunchTarget {
|
|
13
15
|
repo?: string;
|
|
@@ -17,10 +19,20 @@ export interface LaunchTarget {
|
|
|
17
19
|
|
|
18
20
|
export function launchRepos(
|
|
19
21
|
target: LaunchTarget,
|
|
20
|
-
cloud:
|
|
22
|
+
cloud: CursorCloudAgentsCloudOptions,
|
|
21
23
|
): AgentCloudOptions["repos"] {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
const resolved = typeof cloud.repos === "function";
|
|
25
|
+
const allowlist = typeof cloud.repos === "function" ? cloud.repos() : cloud.repos;
|
|
26
|
+
if (resolved && allowlist?.length === 0) {
|
|
27
|
+
throw new Error("No repositories are available to cloud agents for this deployment.");
|
|
28
|
+
}
|
|
29
|
+
if (
|
|
30
|
+
!resolved &&
|
|
31
|
+
target.repo === undefined &&
|
|
32
|
+
target.ref === undefined &&
|
|
33
|
+
target.prUrl === undefined
|
|
34
|
+
) {
|
|
35
|
+
return allowlist;
|
|
24
36
|
}
|
|
25
37
|
const pr = target.prUrl === undefined ? undefined : parsePrUrl(target.prUrl);
|
|
26
38
|
if (target.prUrl !== undefined && pr?.provider !== "github") {
|
|
@@ -28,7 +40,7 @@ export function launchRepos(
|
|
|
28
40
|
}
|
|
29
41
|
const prRepo = pr === undefined ? undefined : `https://github.com/${pr.owner}/${pr.repo}`;
|
|
30
42
|
// A lone `ref` needs exactly one configured repository to apply to.
|
|
31
|
-
const configured =
|
|
43
|
+
const configured = allowlist ?? [];
|
|
32
44
|
const url = target.repo ?? prRepo ?? (configured.length === 1 ? configured[0]?.url : undefined);
|
|
33
45
|
if (url === undefined) {
|
|
34
46
|
throw new Error(
|
|
@@ -40,10 +52,10 @@ export function launchRepos(
|
|
|
40
52
|
if (prRepo !== undefined && repoKey(prRepo) !== repoKey(url)) {
|
|
41
53
|
throw new Error(`prUrl ${target.prUrl} is not a pull request of ${url}.`);
|
|
42
54
|
}
|
|
43
|
-
const allowlisted =
|
|
55
|
+
const allowlisted = allowlist?.some(configured => repoKey(configured.url) === repoKey(url));
|
|
44
56
|
if (allowlisted !== true) {
|
|
45
57
|
throw new Error(
|
|
46
|
-
|
|
58
|
+
allowlist === undefined
|
|
47
59
|
? `Configure cloud.repos before launching against a model-chosen repository (${url}).`
|
|
48
60
|
: `${url} is not one of this extension's configured repositories.`,
|
|
49
61
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineTool } from "../../../tools.js";
|
|
2
2
|
import type { ToolDefinition } from "../../../types.js";
|
|
3
3
|
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
4
|
+
import { assertWriteChannel } from "../lib/channels.js";
|
|
4
5
|
import { assertOwned } from "../lib/fleet.js";
|
|
5
6
|
import { agentRef } from "../lib/inputs.js";
|
|
6
7
|
|
|
@@ -10,6 +11,7 @@ const cancel: ToolDefinition = defineTool({
|
|
|
10
11
|
effect: "write",
|
|
11
12
|
inputSchema: agentRef,
|
|
12
13
|
async execute(input, ctx) {
|
|
14
|
+
assertWriteChannel(ctx);
|
|
13
15
|
await assertOwned(ctx, input.agent_id);
|
|
14
16
|
await cloudAgentsBackend().pause(input.agent_id);
|
|
15
17
|
return { agentId: input.agent_id, cancelled: true };
|
|
@@ -3,6 +3,7 @@ import { defineTool } from "../../../tools.js";
|
|
|
3
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
4
4
|
import extension from "../extension.js";
|
|
5
5
|
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { assertWriteChannel } from "../lib/channels.js";
|
|
6
7
|
import { recordLaunch } from "../lib/fleet.js";
|
|
7
8
|
import { launchRepos } from "../lib/repos.js";
|
|
8
9
|
|
|
@@ -21,7 +22,7 @@ const launch: ToolDefinition = defineTool({
|
|
|
21
22
|
.url()
|
|
22
23
|
.optional()
|
|
23
24
|
.describe(
|
|
24
|
-
"GitHub
|
|
25
|
+
"Repository clone URL (GitHub or Origin), one of the configured repositories. Defaults to the configured repository when there is exactly one.",
|
|
25
26
|
),
|
|
26
27
|
starting_ref: z
|
|
27
28
|
.string()
|
|
@@ -39,6 +40,7 @@ const launch: ToolDefinition = defineTool({
|
|
|
39
40
|
.describe("Display name; derived from the prompt when omitted."),
|
|
40
41
|
}),
|
|
41
42
|
async execute(input, ctx) {
|
|
43
|
+
assertWriteChannel(ctx);
|
|
42
44
|
const { cloud, model } = extension.config;
|
|
43
45
|
const launched = await cloudAgentsBackend().launch({
|
|
44
46
|
prompt: input.prompt,
|
|
@@ -3,6 +3,7 @@ import { defineTool } from "../../../tools.js";
|
|
|
3
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
4
4
|
import extension from "../extension.js";
|
|
5
5
|
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { assertWriteChannel } from "../lib/channels.js";
|
|
6
7
|
import { assertOwned } from "../lib/fleet.js";
|
|
7
8
|
import { agentRef } from "../lib/inputs.js";
|
|
8
9
|
|
|
@@ -21,6 +22,7 @@ const reply: ToolDefinition = defineTool({
|
|
|
21
22
|
),
|
|
22
23
|
}),
|
|
23
24
|
async execute(input, ctx) {
|
|
25
|
+
assertWriteChannel(ctx);
|
|
24
26
|
await assertOwned(ctx, input.agent_id);
|
|
25
27
|
const { runId } = await cloudAgentsBackend().followUp(
|
|
26
28
|
input.agent_id,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Your Grok Bot agents as an extension. Mount it and the agent can talk to
|
|
3
|
+
* the Grok Bot agents of the host's account: send a message, read the
|
|
4
|
+
* reply, keep waiting on a long turn, interrupt one.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* // agent/extensions/grokbot.ts
|
|
8
|
+
* import cursorGrokBotAgents from "@cursor/bdk/extensions/cursor-grokbot-agents";
|
|
9
|
+
*
|
|
10
|
+
* export default cursorGrokBotAgents({
|
|
11
|
+
* agents: [
|
|
12
|
+
* { name: "Plan Keeper", description: "Keeps or moves outdoor plans." },
|
|
13
|
+
* ],
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* Contributes `grokbot__ask`, `grokbot__check`, `grokbot__interrupt`,
|
|
18
|
+
* `grokbot__list` and the `grokbot__consult` skill (the namespace is the
|
|
19
|
+
* mount filename), over the same public `/v0/grokbot` session API the
|
|
20
|
+
* grokbot runtime uses, under the serve host's Cursor API key
|
|
21
|
+
* (`CURSOR_API_KEY`, key file, or `login`). Agents are addressed by name and
|
|
22
|
+
* resolved on the account the key belongs to; a message lands in that
|
|
23
|
+
* account's own conversation with the agent, and the reply is what the agent
|
|
24
|
+
* sends back during that turn. The tools run on the serve host, so they
|
|
25
|
+
* need the local runtime.
|
|
26
|
+
*
|
|
27
|
+
* This is the other direction from `defineAgent({ runtime: "grokbot" })`:
|
|
28
|
+
* the runtime runs *this* agent's turns on the hosted Grok Bot harness; the
|
|
29
|
+
* extension keeps the agent where it is and lets it talk to *other* Grok
|
|
30
|
+
* Bot agents.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { z } from "zod";
|
|
34
|
+
import { defineExtension } from "../../extensions.js";
|
|
35
|
+
import type { Extension } from "../../types.js";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A Grok Bot agent the model may address, by the name shown in the app.
|
|
39
|
+
* Type alias, not an interface: `list` returns these.
|
|
40
|
+
*/
|
|
41
|
+
export type ConfiguredGrokBotAgent = {
|
|
42
|
+
name: string;
|
|
43
|
+
/** What the agent is for; shown to the model by `list`. */
|
|
44
|
+
description?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** Mount options; every field is optional. */
|
|
48
|
+
export interface CursorGrokBotAgentsOptions {
|
|
49
|
+
/**
|
|
50
|
+
* The Grok Bot agents the model may talk to, by name. This is the
|
|
51
|
+
* allowlist for a call's own `agent`: names outside it are refused, and a
|
|
52
|
+
* lone configured agent is the default when a call names none. Without
|
|
53
|
+
* it, any name goes through and `needsApproval` defaults to true, since
|
|
54
|
+
* an unknown name creates an agent of that name on the account.
|
|
55
|
+
*/
|
|
56
|
+
agents?: Array<string | ConfiguredGrokBotAgent>;
|
|
57
|
+
/**
|
|
58
|
+
* Park messages for a human approval. Defaults to `true` when no `agents`
|
|
59
|
+
* are configured; `false` once they are. Pass an explicit boolean to
|
|
60
|
+
* override. Configured names still bound the model's choice regardless.
|
|
61
|
+
*/
|
|
62
|
+
needsApproval?: boolean;
|
|
63
|
+
/** Cursor API key. Defaults to the serve host's own key. */
|
|
64
|
+
apiKey?: string;
|
|
65
|
+
/**
|
|
66
|
+
* How often to read the agent's transcript while waiting for a reply, in
|
|
67
|
+
* milliseconds. Defaults to 750.
|
|
68
|
+
*/
|
|
69
|
+
pollIntervalMs?: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** {@link CursorGrokBotAgentsOptions} with defaults applied. */
|
|
73
|
+
export interface CursorGrokBotAgentsConfig {
|
|
74
|
+
agents?: ConfiguredGrokBotAgent[];
|
|
75
|
+
needsApproval: boolean;
|
|
76
|
+
apiKey?: string;
|
|
77
|
+
pollIntervalMs: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The backend's session name limit. */
|
|
81
|
+
export const AGENT_NAME_MAX_LENGTH = 255;
|
|
82
|
+
const DEFAULT_POLL_INTERVAL_MS = 750;
|
|
83
|
+
|
|
84
|
+
const agentName = z
|
|
85
|
+
.string()
|
|
86
|
+
.trim()
|
|
87
|
+
.min(1, "Grok Bot agent names must not be empty.")
|
|
88
|
+
.max(AGENT_NAME_MAX_LENGTH);
|
|
89
|
+
|
|
90
|
+
const configuredAgent: z.ZodType<
|
|
91
|
+
ConfiguredGrokBotAgent,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
string | ConfiguredGrokBotAgent
|
|
94
|
+
> = z
|
|
95
|
+
.union([agentName, z.object({ name: agentName, description: z.string().optional() })])
|
|
96
|
+
.transform(agent => (typeof agent === "string" ? { name: agent } : agent));
|
|
97
|
+
|
|
98
|
+
const agents = z
|
|
99
|
+
.array(configuredAgent)
|
|
100
|
+
.min(1, "agents must name at least one Grok Bot agent; omit it to allow any.")
|
|
101
|
+
.refine(
|
|
102
|
+
list => new Set(list.map(agent => agent.name.toLowerCase())).size === list.length,
|
|
103
|
+
"agents must not repeat a name (names match case-insensitively).",
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const config: z.ZodType<
|
|
107
|
+
CursorGrokBotAgentsConfig,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
CursorGrokBotAgentsOptions | undefined
|
|
110
|
+
> = z
|
|
111
|
+
.object({
|
|
112
|
+
agents: agents.optional(),
|
|
113
|
+
needsApproval: z.boolean().optional(),
|
|
114
|
+
apiKey: z.string().optional(),
|
|
115
|
+
pollIntervalMs: z.number().int().min(1).default(DEFAULT_POLL_INTERVAL_MS),
|
|
116
|
+
})
|
|
117
|
+
.default({})
|
|
118
|
+
.transform(options => ({
|
|
119
|
+
...options,
|
|
120
|
+
needsApproval: options.needsApproval ?? options.agents === undefined,
|
|
121
|
+
}));
|
|
122
|
+
|
|
123
|
+
const cursorGrokBotAgents: Extension<
|
|
124
|
+
CursorGrokBotAgentsConfig,
|
|
125
|
+
CursorGrokBotAgentsOptions | undefined
|
|
126
|
+
> = defineExtension({
|
|
127
|
+
root: import.meta.dirname,
|
|
128
|
+
description: "Talk to your Grok Bot agents and read their replies.",
|
|
129
|
+
config,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export default cursorGrokBotAgents;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which Grok Bot agent a call addresses. The model names one per call, but
|
|
3
|
+
* the author's `agents` are the allowlist: with them configured, a name
|
|
4
|
+
* outside the list is refused (the backend would create an agent of that
|
|
5
|
+
* name), and a lone configured agent stands in when the call names none.
|
|
6
|
+
* Matching is case-insensitive and resolves to the configured spelling,
|
|
7
|
+
* since the backend looks names up exactly.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { ConfiguredGrokBotAgent } from "../extension.js";
|
|
11
|
+
|
|
12
|
+
export function resolveAgentName(
|
|
13
|
+
requested: string | undefined,
|
|
14
|
+
configured: ConfiguredGrokBotAgent[] | undefined,
|
|
15
|
+
): string {
|
|
16
|
+
const name = requested?.trim();
|
|
17
|
+
if (configured === undefined) {
|
|
18
|
+
if (name === undefined || name === "") {
|
|
19
|
+
throw new Error("`agent` is required: this extension has no configured Grok Bot agents.");
|
|
20
|
+
}
|
|
21
|
+
return name;
|
|
22
|
+
}
|
|
23
|
+
const names = configured.map(agent => `"${agent.name}"`).join(", ");
|
|
24
|
+
if (name === undefined || name === "") {
|
|
25
|
+
const only = configured.length === 1 ? configured[0] : undefined;
|
|
26
|
+
if (only === undefined) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`\`agent\` is required: this extension configures several Grok Bot agents (${names}).`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return only.name;
|
|
32
|
+
}
|
|
33
|
+
const match =
|
|
34
|
+
configured.find(agent => agent.name === name) ??
|
|
35
|
+
configured.find(agent => agent.name.toLowerCase() === name.toLowerCase());
|
|
36
|
+
if (match === undefined) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`"${name}" is not one of this extension's configured Grok Bot agents (${names}).`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return match.name;
|
|
42
|
+
}
|