@cursor/july 0.1.101 → 0.1.103
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 +34 -32
- package/README.md +28 -3
- package/dist/ab.d.ts +1 -1
- package/dist/ab.js +1 -1
- package/dist/bin/agent-serve.d.ts +12 -12
- package/dist/bin/agent-serve.js +114 -36
- package/dist/channels/bitbucket/api.d.ts +176 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +419 -0
- package/dist/channels/bitbucket/binding.d.ts +71 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +269 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +73 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +64 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +304 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +229 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/deployments/deployments-channel.d.ts +22 -14
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +25 -27
- package/dist/channels/deployments/types.d.ts +12 -6
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/binding.d.ts +6 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +3 -3
- package/dist/channels/github/cursor-account.d.ts +7 -3
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +10 -6
- package/dist/channels/github/events.d.ts +1 -1
- package/dist/channels/github/events.js +1 -1
- package/dist/channels/github/forward.d.ts +1 -1
- package/dist/channels/github/forward.d.ts.map +1 -1
- package/dist/channels/github/forward.js +3 -2
- package/dist/channels/github/github-channel.d.ts +29 -39
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +68 -101
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.js +1 -1
- package/dist/channels/github/state.d.ts +2 -0
- package/dist/channels/github/state.d.ts.map +1 -1
- package/dist/channels/github/state.js +14 -11
- package/dist/channels/github/types.d.ts +2 -4
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +91 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +150 -0
- package/dist/channels/gitlab/binding.d.ts +58 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +139 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +126 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +65 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +60 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +28 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +397 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +206 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +214 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +4 -2
- package/dist/channels/origin/origin-channel.d.ts +4 -9
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +8 -48
- package/dist/channels/origin/types.d.ts +20 -2
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -1
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +1 -7
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +28 -0
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +3 -3
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +6 -13
- package/dist/channels/slack/types.d.ts +1 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +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/ab.html +4 -4
- package/dist/docs/assets/{app.BASO9Kih.js → app.DW9pXkpL.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.YZMHgPgg.js} +2 -2
- package/dist/docs/assets/{concepts.md.lwAgBIMI.js → concepts.md.DgEcZOfT.js} +1 -1
- package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.lean.js +1 -0
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.DKYiT9do.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
- package/dist/docs/assets/index.md.D75GWhPl.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.D75GWhPl.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.Dz8Cnudp.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
- package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.DuBu9a96.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +1 -1
- package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
- package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.aGrn99hP.js} +2 -2
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.haibFyoB.lean.js} +1 -1
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +5 -7
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/runtime-abstraction.md +2 -3
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +9 -7
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +91 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +0 -1
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/opentelemetry.html +11 -12
- package/dist/docs/guides/opentelemetry.md +41 -17
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +7 -3
- package/dist/docs/llms-full.txt +765 -209
- package/dist/docs/llms.txt +3 -1
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +6 -10
- package/dist/docs/reference/artifacts.html +5 -5
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +18 -8
- package/dist/docs/reference/cli.html +5 -5
- package/dist/docs/reference/cli.md +3 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +88 -0
- package/dist/docs/reference/extensions.md +264 -0
- package/dist/docs/reference/hooks.html +69 -10
- package/dist/docs/reference/hooks.md +215 -46
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +3 -0
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +4 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.html +45 -0
- package/dist/docs/reference/result.md +89 -0
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +3 -1
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +3 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +3 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +7 -7
- package/dist/docs/skills/otel.md +8 -3
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +0 -3
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/evals.d.ts +1 -1
- package/dist/evals.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
- package/dist/extensions.d.ts +54 -17
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +83 -15
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +21 -4
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +38 -21
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/ab-snapshot.js +0 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +1 -3
- package/dist/internal/authored-alias-hooks.d.ts +4 -13
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +4 -20
- package/dist/internal/authored-loaders.d.ts +2 -3
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +6 -20
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +77 -0
- package/dist/internal/chat-client.d.ts +1 -1
- package/dist/internal/chat-client.js +1 -1
- package/dist/internal/cli-ax.d.ts +5 -5
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +5 -5
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +359 -0
- package/dist/internal/cli-convert-automation.d.ts +1 -1
- package/dist/internal/cli-convert-automation.js +2 -2
- package/dist/internal/cli-cursor.d.ts +1 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -4
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -6
- package/dist/internal/cli-github.d.ts +1 -1
- package/dist/internal/cli-github.js +3 -3
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +380 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +2 -6
- package/dist/internal/cli-slack.d.ts +1 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +2 -4
- package/dist/internal/continuation-channel.d.ts +14 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +56 -3
- package/dist/internal/continuation-identity.d.ts +14 -15
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +182 -7
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +17 -18
- package/dist/internal/convert-automation/types.d.ts +1 -1
- package/dist/internal/convert-automation/types.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +1 -3
- package/dist/internal/cursor/backend-client.d.ts +13 -5
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +30 -15
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +39 -5
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +58 -8
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +12 -1
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +16 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +2 -4
- package/dist/internal/cursor-deployment-relay.d.ts +6 -2
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +13 -9
- package/dist/internal/deploy-manifest.d.ts +1 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +1 -1
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +113 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +255 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +422 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +568 -0
- package/dist/internal/discovery/extension-overlay.d.ts +32 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +191 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +375 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +61 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +147 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +107 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +293 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +118 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +21 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +134 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +128 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -63
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +6 -2504
- package/dist/internal/distribution.d.ts +10 -27
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +25 -73
- package/dist/internal/docs-site.js +1 -1
- package/dist/internal/eval-run-store.d.ts +0 -1
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.d.ts +8 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +14 -14
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/github-fanout.d.ts +1 -1
- package/dist/internal/github-fanout.js +1 -1
- package/dist/internal/guest-network.d.ts +101 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +304 -0
- package/dist/internal/host-otel.d.ts +3 -3
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +8 -4
- package/dist/internal/hosted-admission-adapter.d.ts +8 -7
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +18 -5
- package/dist/internal/hosted-delivery.d.ts +18 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +248 -118
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -3
- package/dist/internal/init-interview.d.ts.map +1 -1
- package/dist/internal/init-interview.js +1 -3
- package/dist/internal/init-project.d.ts +2 -2
- package/dist/internal/init-project.js +2 -2
- package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
- package/dist/internal/inline-stdio-define-stub.js +1 -1
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -10
- package/dist/internal/local-control-plane.d.ts +1 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +3 -20
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -3
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +37 -20
- package/dist/internal/otel/collector.d.ts +22 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +145 -126
- package/dist/internal/otel/config.d.ts +0 -2
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +17 -20
- package/dist/internal/otel/http.d.ts +2 -0
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +8 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +55 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +26 -1
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +166 -15
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +3 -11
- package/dist/internal/playground/toolchain.d.ts +1 -1
- package/dist/internal/playground/toolchain.d.ts.map +1 -1
- package/dist/internal/playground/toolchain.js +1 -1
- package/dist/internal/request-error-status.d.ts +12 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +52 -0
- package/dist/internal/resolve-prod-target.d.ts +1 -1
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +3 -7
- package/dist/internal/result-output.d.ts +18 -0
- package/dist/internal/result-output.d.ts.map +1 -0
- package/dist/internal/result-output.js +33 -0
- package/dist/internal/run-client.d.ts +2 -2
- package/dist/internal/run-client.js +2 -2
- package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +2 -15
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +3 -6
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +110 -35
- package/dist/internal/session-cost.d.ts +3 -3
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +3 -3
- package/dist/internal/session-engine.d.ts +31 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +208 -102
- package/dist/internal/session-run-log.d.ts +2 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -17
- package/dist/internal/skills-sync.d.ts +1 -4
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +10 -50
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/start-log-store.d.ts +1 -1
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +12 -14
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/tenant-slack/relay.d.ts +73 -0
- package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
- package/dist/internal/tenant-slack/relay.js +138 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/internal/workspace-sync.d.ts +22 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +49 -0
- package/dist/internal/workspace.d.ts +7 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +13 -0
- package/dist/otel.d.ts +39 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +118 -1
- package/dist/playground/assets/index-59KvgREd.js +67 -0
- package/dist/playground/assets/index-MbMxXg-y.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/result.d.ts +24 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +27 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +7 -4
- package/dist/storage-protocol.d.ts +24 -23
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +69 -68
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +126 -23
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +7 -3
- package/docs/concepts.md +5 -7
- package/docs/design/runtime-abstraction.md +2 -3
- package/docs/evals.md +9 -7
- package/docs/guides/cloud-agents.md +96 -0
- package/docs/guides/github.md +0 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +18 -8
- package/docs/reference/cli.md +3 -4
- package/docs/reference/extensions.md +269 -0
- package/docs/reference/hooks.md +215 -46
- package/docs/reference/playground.md +3 -0
- package/docs/reference/project-layout.md +4 -0
- package/docs/reference/result.md +94 -0
- package/docs/reference/sessions.md +3 -1
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +3 -2
- package/docs/templates/pr-autofixer.md +0 -3
- package/package.json +29 -10
- package/skills/framework-map/SKILL.md +3 -0
- package/skills/otel/SKILL.md +8 -3
- package/src/ab.ts +1 -1
- package/src/bin/agent-serve.ts +121 -21
- package/src/channels/bitbucket/api.ts +623 -0
- package/src/channels/bitbucket/binding.ts +414 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
- package/src/channels/bitbucket/checks.ts +154 -0
- package/src/channels/bitbucket/cursor-account.ts +117 -0
- package/src/channels/bitbucket/defaults.ts +110 -0
- package/src/channels/bitbucket/events.ts +84 -0
- package/src/channels/bitbucket/index.ts +49 -0
- package/src/channels/bitbucket/replay.ts +439 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +266 -0
- package/src/channels/deployments/deployments-channel.ts +25 -43
- package/src/channels/deployments/types.ts +12 -6
- package/src/channels/github/binding.ts +8 -1
- package/src/channels/github/cursor-account.ts +17 -6
- package/src/channels/github/events.ts +1 -1
- package/src/channels/github/forward.ts +3 -2
- package/src/channels/github/github-channel.ts +74 -221
- package/src/channels/github/replay.ts +1 -1
- package/src/channels/github/state.ts +6 -0
- package/src/channels/github/types.ts +2 -5
- package/src/channels/gitlab/api.ts +228 -0
- package/src/channels/gitlab/binding.ts +233 -0
- package/src/channels/gitlab/checks.ts +243 -0
- package/src/channels/gitlab/cursor-account.ts +114 -0
- package/src/channels/gitlab/defaults.ts +93 -0
- package/src/channels/gitlab/events.ts +44 -0
- package/src/channels/gitlab/gitlab-channel.ts +176 -0
- package/src/channels/gitlab/gitlab-webhook.ts +555 -0
- package/src/channels/gitlab/index.ts +43 -0
- package/src/channels/gitlab/replay.ts +347 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +263 -0
- package/src/channels/origin/api.ts +4 -2
- package/src/channels/origin/origin-channel.ts +19 -94
- package/src/channels/origin/types.ts +23 -2
- package/src/channels/slack/api.ts +4 -2
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/eval-directive.ts +1 -6
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/init.ts +6 -3
- package/src/channels/slack/manifest.ts +2 -1
- package/src/channels/slack/setup.ts +7 -6
- package/src/channels/slack/types.ts +1 -1
- package/src/channels.ts +0 -1
- package/src/client.ts +1 -1
- package/src/connections.ts +1 -1
- package/src/evals.ts +1 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
- package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +100 -15
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +64 -37
- package/src/index.ts +27 -26
- package/src/internal/ab-snapshot.ts +0 -3
- package/src/internal/advertise-tools.ts +1 -4
- package/src/internal/authored-alias-hooks.ts +4 -21
- package/src/internal/authored-loaders.ts +6 -23
- package/src/internal/channel-dispatch.ts +160 -0
- package/src/internal/chat-client.ts +1 -1
- package/src/internal/cli-ax.ts +5 -5
- package/src/internal/cli-bitbucket.ts +477 -0
- package/src/internal/cli-convert-automation.ts +7 -7
- package/src/internal/cli-cursor.ts +2 -5
- package/src/internal/cli-deploy.ts +2 -8
- package/src/internal/cli-github.ts +3 -3
- package/src/internal/cli-gitlab.ts +485 -0
- package/src/internal/cli-mcp.ts +2 -7
- package/src/internal/cli-slack.ts +2 -5
- package/src/internal/continuation-channel.ts +82 -1
- package/src/internal/continuation-identity.ts +229 -11
- package/src/internal/conversation-mirror.ts +27 -21
- package/src/internal/convert-automation/types.ts +1 -1
- package/src/internal/cursor/account-mcp.ts +1 -4
- package/src/internal/cursor/backend-client.ts +41 -20
- package/src/internal/cursor/bound-secret-file.ts +108 -0
- package/src/internal/cursor/credentials.ts +75 -10
- package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
- package/src/internal/cursor/hosted-store-secrets.ts +28 -1
- package/src/internal/cursor-account-mcp-auth.ts +2 -5
- package/src/internal/cursor-deployment-relay.ts +11 -7
- package/src/internal/deploy-manifest.ts +4 -2
- package/src/internal/discovery/ab.ts +131 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +319 -0
- package/src/internal/discovery/channels.ts +105 -0
- package/src/internal/discovery/connections.ts +545 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +705 -0
- package/src/internal/discovery/extension-overlay.ts +274 -0
- package/src/internal/discovery/extensions.ts +573 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +186 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +113 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +341 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +160 -0
- package/src/internal/discovery/skills.ts +186 -0
- package/src/internal/discovery/subagent.ts +136 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +18 -3081
- package/src/internal/distribution.ts +35 -83
- package/src/internal/docs-site.ts +1 -1
- package/src/internal/eval-run-store.ts +0 -7
- package/src/internal/eval-runner.ts +0 -1
- package/src/internal/framework-file-storage.ts +14 -14
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +383 -0
- package/src/internal/host-otel.ts +8 -4
- package/src/internal/hosted-admission-adapter.ts +8 -8
- package/src/internal/hosted-delivery-protocol.ts +26 -1
- package/src/internal/hosted-delivery.ts +376 -192
- package/src/internal/http-channel.ts +1 -4
- package/src/internal/init-interview.ts +1 -4
- package/src/internal/init-project.ts +2 -2
- package/src/internal/inline-stdio-define-stub.ts +1 -1
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +19 -10
- package/src/internal/local-control-plane.ts +5 -24
- package/src/internal/mcp-endpoint.ts +1 -4
- package/src/internal/mcp-host.ts +84 -31
- package/src/internal/otel/collector.ts +200 -165
- package/src/internal/otel/config.ts +10 -14
- package/src/internal/otel/http.ts +16 -13
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +242 -25
- package/src/internal/package-inline-stdio.ts +3 -12
- package/src/internal/playground/toolchain.ts +1 -1
- package/src/internal/request-error-status.ts +72 -0
- package/src/internal/resolve-prod-target.ts +3 -8
- package/src/internal/result-output.ts +34 -0
- package/src/internal/run-client.ts +2 -2
- package/src/internal/runtime-dispatch-runner.ts +3 -21
- package/src/internal/sdk-runner.ts +3 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +274 -81
- package/src/internal/session-run-log.ts +18 -20
- package/src/internal/skills-sync.ts +13 -63
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +13 -16
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/store-mirror.ts +86 -0
- package/src/internal/tenant-slack/relay.ts +179 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/internal/workspace-sync.ts +55 -0
- package/src/internal/workspace.ts +14 -0
- package/src/otel.ts +180 -2
- package/src/result.ts +36 -0
- package/src/storage-backends/cursor-hosted.ts +7 -4
- package/src/storage-protocol.ts +102 -95
- package/src/storage.ts +4 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +146 -34
- package/templates/triage/agent/lib/types.ts +0 -2
- package/dist/continuation.d.ts +0 -20
- package/dist/continuation.d.ts.map +0 -1
- package/dist/continuation.js +0 -18
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/docs/guides/cloud-runtime.html +0 -35
- package/dist/docs/guides/cloud-runtime.md +0 -115
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
- package/dist/internal/convert-automation/index.d.ts +0 -3
- package/dist/internal/convert-automation/index.d.ts.map +0 -1
- package/dist/internal/convert-automation/index.js +0 -1
- package/dist/internal/grokbot/runner.d.ts +0 -64
- package/dist/internal/grokbot/runner.d.ts.map +0 -1
- package/dist/internal/grokbot/runner.js +0 -282
- package/dist/internal/managed-delivery.d.ts +0 -80
- package/dist/internal/managed-delivery.d.ts.map +0 -1
- package/dist/internal/managed-delivery.js +0 -86
- package/dist/internal/review-comments.d.ts +0 -370
- package/dist/internal/review-comments.d.ts.map +0 -1
- package/dist/internal/review-comments.js +0 -921
- package/dist/internal/shallow-clone.d.ts +0 -176
- package/dist/internal/shallow-clone.d.ts.map +0 -1
- package/dist/internal/shallow-clone.js +0 -419
- package/dist/playground/assets/index-BnNN1-EK.js +0 -69
- package/dist/playground/assets/index-DBQCwFp0.css +0 -1
- package/docs/guides/cloud-runtime.md +0 -120
- package/src/continuation.ts +0 -49
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
- package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
- package/src/internal/convert-automation/index.ts +0 -10
- package/src/internal/grokbot/runner.ts +0 -370
- package/src/internal/managed-delivery.ts +0 -125
- package/src/internal/review-comments.ts +0 -1363
- package/src/internal/shallow-clone.ts +0 -609
- /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cursor backend as the tools use it: launches go through the public
|
|
3
|
+
* v1 Cloud Agents API (the only surface that takes per-launch `envVars`),
|
|
4
|
+
* everything about an existing agent goes through the same
|
|
5
|
+
* `aiserver.v1.BackgroundComposerService` RPCs Sand's CloudAgent tool
|
|
6
|
+
* calls, so follow-ups queue, runs pause, and the full conversation is
|
|
7
|
+
* readable. Both authenticate with the host's Cursor API key; the RPCs
|
|
8
|
+
* exchange it for a session token the way the dashboard client does.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { randomUUID } from "node:crypto";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import { CursorBackendClient } from "../../../internal/cursor/backend-client.js";
|
|
14
|
+
import {
|
|
15
|
+
cursorBackendUrl,
|
|
16
|
+
cursorExternalApiUrl,
|
|
17
|
+
cursorWebsiteUrl,
|
|
18
|
+
resolveApiKeySync,
|
|
19
|
+
SIGN_IN_HINT,
|
|
20
|
+
} from "../../../internal/cursor/credentials.js";
|
|
21
|
+
import { toModelSelection } from "../../../internal/sdk-runner.js";
|
|
22
|
+
import type { AgentCloudOptions, ModelSetting } from "../../../types.js";
|
|
23
|
+
import extension from "../extension.js";
|
|
24
|
+
|
|
25
|
+
const SERVICE = "BackgroundComposerService";
|
|
26
|
+
/** Launches and follow-ups from this extension carry the SDK source, like the v1 API. */
|
|
27
|
+
const SOURCE = "BACKGROUND_COMPOSER_SOURCE_SDK";
|
|
28
|
+
const RPC_TIMEOUT_MS = 60_000;
|
|
29
|
+
// The create call returns once the initial run exists, which can wait on a VM.
|
|
30
|
+
const LAUNCH_TIMEOUT_MS = 300_000;
|
|
31
|
+
|
|
32
|
+
export class CloudAgentsApiError extends Error {
|
|
33
|
+
constructor(
|
|
34
|
+
message: string,
|
|
35
|
+
readonly status?: number
|
|
36
|
+
) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = "CloudAgentsApiError";
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type CloudAgentStatus =
|
|
43
|
+
| "creating"
|
|
44
|
+
| "running"
|
|
45
|
+
| "finished"
|
|
46
|
+
| "error"
|
|
47
|
+
| "expired"
|
|
48
|
+
| "unknown";
|
|
49
|
+
|
|
50
|
+
// Type aliases, not interfaces: these flow into tool results.
|
|
51
|
+
export type CloudAgentInfo = {
|
|
52
|
+
agentId: string;
|
|
53
|
+
name: string;
|
|
54
|
+
status: CloudAgentStatus;
|
|
55
|
+
archived: boolean;
|
|
56
|
+
url: string;
|
|
57
|
+
branch?: string;
|
|
58
|
+
prUrl?: string;
|
|
59
|
+
summary?: string;
|
|
60
|
+
error?: string;
|
|
61
|
+
changes?: { filesChanged: number; linesAdded: number; linesRemoved: number };
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type CloudAgentToolCall = {
|
|
65
|
+
name: string;
|
|
66
|
+
args: unknown;
|
|
67
|
+
content?: string;
|
|
68
|
+
error?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type CloudAgentMessage = {
|
|
72
|
+
role: "user" | "assistant";
|
|
73
|
+
text?: string;
|
|
74
|
+
thinking?: string;
|
|
75
|
+
toolCalls?: CloudAgentToolCall[];
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type CloudAgentLaunch = {
|
|
79
|
+
agentId: string;
|
|
80
|
+
runId: string;
|
|
81
|
+
status: string;
|
|
82
|
+
url: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type LaunchRequest = {
|
|
86
|
+
prompt: string;
|
|
87
|
+
name?: string;
|
|
88
|
+
cloud: AgentCloudOptions;
|
|
89
|
+
model?: ModelSetting;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
// Proto-JSON response schemas (camelCase; default-valued fields are omitted)
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
const composerSchema = z.object({
|
|
97
|
+
bcId: z.string(),
|
|
98
|
+
name: z.string().optional(),
|
|
99
|
+
status: z.string().optional(),
|
|
100
|
+
isArchived: z.boolean().optional(),
|
|
101
|
+
branchName: z.string().optional(),
|
|
102
|
+
prUrl: z.string().optional(),
|
|
103
|
+
linesAdded: z.number().optional(),
|
|
104
|
+
linesRemoved: z.number().optional(),
|
|
105
|
+
filesChanged: z.number().optional(),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const errorDetailsSchema = z.object({
|
|
109
|
+
details: z
|
|
110
|
+
.object({ title: z.string().optional(), detail: z.string().optional() })
|
|
111
|
+
.optional(),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const infoResponseSchema = z.object({
|
|
115
|
+
composer: z.object({
|
|
116
|
+
composer: composerSchema,
|
|
117
|
+
summary: z.string().optional(),
|
|
118
|
+
startError: errorDetailsSchema.optional(),
|
|
119
|
+
permanentError: errorDetailsSchema.optional(),
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const toolResultSchema = z.object({
|
|
124
|
+
toolName: z.string().optional(),
|
|
125
|
+
args: z.string().optional(),
|
|
126
|
+
rawArgs: z.string().optional(),
|
|
127
|
+
content: z.string().optional(),
|
|
128
|
+
error: z
|
|
129
|
+
.object({ clientVisibleErrorMessage: z.string().optional() })
|
|
130
|
+
.optional(),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const conversationResponseSchema = z.object({
|
|
134
|
+
conversation: z
|
|
135
|
+
.array(
|
|
136
|
+
z.object({
|
|
137
|
+
type: z.string().optional(),
|
|
138
|
+
text: z.string().optional(),
|
|
139
|
+
thinking: z.object({ text: z.string().optional() }).optional(),
|
|
140
|
+
toolResults: z.array(toolResultSchema).optional(),
|
|
141
|
+
})
|
|
142
|
+
)
|
|
143
|
+
.optional(),
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const followupResponseSchema = z.object({ runId: z.string().optional() });
|
|
147
|
+
|
|
148
|
+
const launchResponseSchema = z.object({
|
|
149
|
+
agent: z.object({ id: z.string(), url: z.string().optional() }),
|
|
150
|
+
run: z.object({ id: z.string(), status: z.string() }),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
export class CloudAgentsBackend {
|
|
156
|
+
private readonly rpcClient: CursorBackendClient;
|
|
157
|
+
|
|
158
|
+
constructor(
|
|
159
|
+
private readonly apiKey: () => string,
|
|
160
|
+
private readonly fetchImpl: typeof fetch = fetch
|
|
161
|
+
) {
|
|
162
|
+
// The key is read per call: the host can sign in after the mount.
|
|
163
|
+
this.rpcClient = new CursorBackendClient({
|
|
164
|
+
backendUrl: cursorBackendUrl(),
|
|
165
|
+
apiKey: "",
|
|
166
|
+
getApiKey: apiKey,
|
|
167
|
+
fetchImpl,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** `POST /v1/agents`: create the agent and start its first run in one call. */
|
|
172
|
+
async launch(request: LaunchRequest): Promise<CloudAgentLaunch> {
|
|
173
|
+
const { cloud } = request;
|
|
174
|
+
const body = {
|
|
175
|
+
prompt: { text: request.prompt },
|
|
176
|
+
name: request.name,
|
|
177
|
+
model:
|
|
178
|
+
request.model === undefined
|
|
179
|
+
? undefined
|
|
180
|
+
: toModelSelection(request.model),
|
|
181
|
+
env: cloud.env,
|
|
182
|
+
envVars: cloud.envVars,
|
|
183
|
+
repos: cloud.repos,
|
|
184
|
+
workOnCurrentBranch: cloud.workOnCurrentBranch,
|
|
185
|
+
autoCreatePR: cloud.autoCreatePR,
|
|
186
|
+
skipReviewerRequest: cloud.skipReviewerRequest,
|
|
187
|
+
};
|
|
188
|
+
let response: Response;
|
|
189
|
+
try {
|
|
190
|
+
response = await this.fetchImpl(`${cursorExternalApiUrl()}/v1/agents`, {
|
|
191
|
+
method: "POST",
|
|
192
|
+
headers: {
|
|
193
|
+
"content-type": "application/json",
|
|
194
|
+
authorization: `Bearer ${this.apiKey()}`,
|
|
195
|
+
"x-ghost-mode": "true",
|
|
196
|
+
"x-cursor-client-type": "agent-serve",
|
|
197
|
+
"x-request-id": randomUUID(),
|
|
198
|
+
},
|
|
199
|
+
body: JSON.stringify(body),
|
|
200
|
+
signal: AbortSignal.timeout(LAUNCH_TIMEOUT_MS),
|
|
201
|
+
});
|
|
202
|
+
} catch (error) {
|
|
203
|
+
throw new CloudAgentsApiError(
|
|
204
|
+
`Cloud agent launch failed: ${error instanceof Error ? error.message : String(error)}`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
const text = await response.text();
|
|
208
|
+
if (!response.ok) {
|
|
209
|
+
throw new CloudAgentsApiError(
|
|
210
|
+
`Cloud agent launch failed (${response.status}): ${apiErrorMessage(text)}`,
|
|
211
|
+
response.status
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
const parsed = launchResponseSchema.parse(JSON.parse(text));
|
|
215
|
+
return {
|
|
216
|
+
agentId: parsed.agent.id,
|
|
217
|
+
runId: parsed.run.id,
|
|
218
|
+
status: parsed.run.status.toLowerCase(),
|
|
219
|
+
url: parsed.agent.url ?? agentUrl(parsed.agent.id),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
async info(agentId: string): Promise<CloudAgentInfo> {
|
|
224
|
+
const { composer } = infoResponseSchema.parse(
|
|
225
|
+
await this.rpcClient.serviceRpc(
|
|
226
|
+
SERVICE,
|
|
227
|
+
"GetBackgroundComposerInfo",
|
|
228
|
+
{ bcId: agentId },
|
|
229
|
+
RPC_TIMEOUT_MS
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
const { composer: summary } = composer;
|
|
233
|
+
const failure = composer.permanentError ?? composer.startError;
|
|
234
|
+
return {
|
|
235
|
+
agentId: summary.bcId,
|
|
236
|
+
name: summary.name ?? "",
|
|
237
|
+
status: statusOf(summary.status),
|
|
238
|
+
archived: summary.isArchived === true,
|
|
239
|
+
url: agentUrl(summary.bcId),
|
|
240
|
+
branch: emptyToUndefined(summary.branchName),
|
|
241
|
+
prUrl: emptyToUndefined(summary.prUrl),
|
|
242
|
+
summary: emptyToUndefined(composer.summary),
|
|
243
|
+
error: failureMessage(failure),
|
|
244
|
+
changes:
|
|
245
|
+
summary.filesChanged === undefined
|
|
246
|
+
? undefined
|
|
247
|
+
: {
|
|
248
|
+
filesChanged: summary.filesChanged,
|
|
249
|
+
linesAdded: summary.linesAdded ?? 0,
|
|
250
|
+
linesRemoved: summary.linesRemoved ?? 0,
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async conversation(agentId: string): Promise<CloudAgentMessage[]> {
|
|
256
|
+
const { conversation } = conversationResponseSchema.parse(
|
|
257
|
+
await this.rpcClient.serviceRpc(
|
|
258
|
+
SERVICE,
|
|
259
|
+
"GetBackgroundComposerConversation",
|
|
260
|
+
{ bcId: agentId },
|
|
261
|
+
RPC_TIMEOUT_MS
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
return (conversation ?? []).map((message) => {
|
|
265
|
+
const toolCalls = (message.toolResults ?? []).map((result) => ({
|
|
266
|
+
name: result.toolName ?? "",
|
|
267
|
+
args: parseArgs(result.args ?? result.rawArgs),
|
|
268
|
+
content: result.content,
|
|
269
|
+
error: result.error?.clientVisibleErrorMessage,
|
|
270
|
+
}));
|
|
271
|
+
return {
|
|
272
|
+
role: message.type === "MESSAGE_TYPE_HUMAN" ? "user" : "assistant",
|
|
273
|
+
text: emptyToUndefined(message.text),
|
|
274
|
+
thinking: emptyToUndefined(message.thinking?.text),
|
|
275
|
+
toolCalls: toolCalls.length === 0 ? undefined : toolCalls,
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Queue a follow-up behind the current run, or with `interrupt` cancel the
|
|
282
|
+
* in-flight step and run it now; the backend's `synchronous` switch.
|
|
283
|
+
*/
|
|
284
|
+
async followUp(
|
|
285
|
+
agentId: string,
|
|
286
|
+
prompt: string,
|
|
287
|
+
interrupt: boolean
|
|
288
|
+
): Promise<{ runId: string | undefined }> {
|
|
289
|
+
const { runId } = followupResponseSchema.parse(
|
|
290
|
+
await this.rpcClient.serviceRpc(
|
|
291
|
+
SERVICE,
|
|
292
|
+
"AddAsyncFollowupBackgroundComposer",
|
|
293
|
+
{
|
|
294
|
+
bcId: agentId,
|
|
295
|
+
synchronous: interrupt,
|
|
296
|
+
followupSource: SOURCE,
|
|
297
|
+
followupMessage: {
|
|
298
|
+
text: prompt,
|
|
299
|
+
type: "MESSAGE_TYPE_HUMAN",
|
|
300
|
+
bubbleId: randomUUID(),
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
RPC_TIMEOUT_MS
|
|
304
|
+
)
|
|
305
|
+
);
|
|
306
|
+
return { runId };
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async pause(agentId: string): Promise<void> {
|
|
310
|
+
await this.rpcClient.serviceRpc(
|
|
311
|
+
SERVICE,
|
|
312
|
+
"PauseBackgroundComposer",
|
|
313
|
+
{ bcId: agentId, source: SOURCE },
|
|
314
|
+
RPC_TIMEOUT_MS
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
let backend: CloudAgentsBackend | undefined;
|
|
320
|
+
|
|
321
|
+
/** The process-wide backend for this mount, built on first use. */
|
|
322
|
+
export function cloudAgentsBackend(): CloudAgentsBackend {
|
|
323
|
+
backend ??= new CloudAgentsBackend(apiKey);
|
|
324
|
+
return backend;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export function apiKey(): string {
|
|
328
|
+
const key = resolveApiKeySync({ apiKey: extension.config.apiKey });
|
|
329
|
+
if (key === undefined) {
|
|
330
|
+
throw new Error(`Cloud agents need a Cursor API key. ${SIGN_IN_HINT}`);
|
|
331
|
+
}
|
|
332
|
+
return key.apiKey;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export function agentUrl(agentId: string): string {
|
|
336
|
+
return `${cursorWebsiteUrl()}/agents/${agentId}`;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function statusOf(status: string | undefined): CloudAgentStatus {
|
|
340
|
+
switch (status) {
|
|
341
|
+
case "BACKGROUND_COMPOSER_STATUS_CREATING":
|
|
342
|
+
return "creating";
|
|
343
|
+
case "BACKGROUND_COMPOSER_STATUS_RUNNING":
|
|
344
|
+
return "running";
|
|
345
|
+
case "BACKGROUND_COMPOSER_STATUS_FINISHED":
|
|
346
|
+
return "finished";
|
|
347
|
+
case "BACKGROUND_COMPOSER_STATUS_ERROR":
|
|
348
|
+
return "error";
|
|
349
|
+
case "BACKGROUND_COMPOSER_STATUS_EXPIRED":
|
|
350
|
+
return "expired";
|
|
351
|
+
default:
|
|
352
|
+
return "unknown";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function failureMessage(
|
|
357
|
+
failure: z.infer<typeof errorDetailsSchema> | undefined
|
|
358
|
+
): string | undefined {
|
|
359
|
+
const parts = [failure?.details?.title, failure?.details?.detail].filter(
|
|
360
|
+
(part): part is string => part !== undefined && part !== ""
|
|
361
|
+
);
|
|
362
|
+
return parts.length === 0 ? undefined : parts.join(": ");
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function parseArgs(args: string | undefined): unknown {
|
|
366
|
+
if (args === undefined || args === "") {
|
|
367
|
+
return undefined;
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
return JSON.parse(args) as unknown;
|
|
371
|
+
} catch {
|
|
372
|
+
return args;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
function emptyToUndefined(value: string | undefined): string | undefined {
|
|
377
|
+
return value === undefined || value === "" ? undefined : value;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
function apiErrorMessage(text: string): string {
|
|
381
|
+
try {
|
|
382
|
+
const parsed = JSON.parse(text) as {
|
|
383
|
+
error?: { code?: string; message?: string };
|
|
384
|
+
code?: string;
|
|
385
|
+
message?: string;
|
|
386
|
+
};
|
|
387
|
+
const code = parsed.error?.code ?? parsed.code;
|
|
388
|
+
const message = parsed.error?.message ?? parsed.message;
|
|
389
|
+
return (
|
|
390
|
+
[code, message].filter((part) => part !== undefined).join(": ") || text
|
|
391
|
+
);
|
|
392
|
+
} catch {
|
|
393
|
+
return text;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A cloud agent's conversation as JSONL lines, one message per line. */
|
|
2
|
+
|
|
3
|
+
import type { CloudAgentMessage } from "./backend.js";
|
|
4
|
+
|
|
5
|
+
/** Workspace-relative path of a dumped transcript; the directory Sand uses too. */
|
|
6
|
+
export function transcriptPath(agentId: string): string {
|
|
7
|
+
return `cloud-agent-transcripts/${agentId}.jsonl`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function transcriptLines(messages: CloudAgentMessage[]): string[] {
|
|
11
|
+
return messages.map((message) => JSON.stringify(message));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The text of the last assistant message, the agent's report. */
|
|
15
|
+
export function lastAssistantText(
|
|
16
|
+
messages: CloudAgentMessage[]
|
|
17
|
+
): string | undefined {
|
|
18
|
+
return messages
|
|
19
|
+
.toReversed()
|
|
20
|
+
.find(
|
|
21
|
+
(message) => message.role === "assistant" && message.text !== undefined
|
|
22
|
+
)?.text;
|
|
23
|
+
}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to
|
|
2
|
+
description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to look an agent up by id, read what it did, reply, and cancel."
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Cloud agent handoff
|
|
6
6
|
|
|
7
7
|
Hand work to a Cursor cloud agent when it needs a repository checkout, a long run, or an isolated machine: implementing a change, running a test suite, opening a pull request. Answer questions and small reads yourself.
|
|
8
8
|
|
|
9
|
-
The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on.
|
|
9
|
+
The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on. Every agent is addressed by its `agent_id` (`bc-...`).
|
|
10
10
|
|
|
11
11
|
## Launch
|
|
12
12
|
|
|
13
|
-
Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `
|
|
13
|
+
Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `starting_ref` or `pr_url` to pick a branch or pull request; `repo` must be one of the configured repositories.
|
|
14
14
|
|
|
15
15
|
The result carries `agentId` (`bc-...`) and a `url`. Report both in full. Never truncate the id.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Look an agent up by id
|
|
18
18
|
|
|
19
|
-
Call `
|
|
19
|
+
Call `get` with the `agent_id`. It returns the agent's `status` (`creating`, `running`, `finished`, `error`, or `expired`), its `branch` and pull request `prUrl` once pushed, the `changes` it made so far (files and lines), a `summary` when one exists, and an `error` when it failed. A run takes minutes: check when asked or when you need the result, not in a tight loop. The final report itself comes from `dump`.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Read what it did
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
To read the report or understand what was done, call `dump` with the `agent_id`. It writes the agent's whole conversation, every run, to `cloud-agent-transcripts/<agent_id>.jsonl` in your workspace and returns the absolute `path` plus the `finalMessage`. Each line is one JSON message with `role` (`user` or `assistant`) and, for assistant lines, `text`, `thinking`, and `toolCalls` (tool `name`, `args`, `content`, `error`). Read it with your file and shell tools, using the returned path:
|
|
24
|
+
|
|
25
|
+
- `tail -n 1 <path>` gives the final report.
|
|
26
|
+
- `grep '"toolCalls"' <path>` shows the commands and edits it made.
|
|
27
|
+
- `grep '"role":"user"' <path>` shows every prompt it received, including replies.
|
|
28
|
+
|
|
29
|
+
Use `dump` before summarizing an agent's work for a person, and to understand a failure before replying with a fix.
|
|
30
|
+
|
|
31
|
+
## Reply
|
|
32
|
+
|
|
33
|
+
Call `reply` with the `agent_id` and a prompt to steer an agent or ask for changes on its branch. The follow-up queues behind the current run and starts when it finishes; pass `interrupt: true` to stop the current step and deliver it now. Do not launch a second agent for follow-up work on the same branch.
|
|
34
|
+
|
|
35
|
+
## Cancel
|
|
36
|
+
|
|
37
|
+
Call `cancel` with the `agent_id` to stop the active run. The agent keeps its branch and conversation, so a `reply` can continue from where it stopped.
|
|
24
38
|
|
|
25
39
|
## Fleet
|
|
26
40
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineTool } from "../../../tools.js";
|
|
2
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
3
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
4
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
5
|
+
import { agentRef } from "../lib/inputs.js";
|
|
6
|
+
|
|
7
|
+
const cancel: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"Stop a cloud agent's active run. The agent keeps its branch and conversation; reply to it to continue.",
|
|
10
|
+
effect: "write",
|
|
11
|
+
inputSchema: agentRef,
|
|
12
|
+
async execute(input, ctx) {
|
|
13
|
+
await assertOwned(ctx, input.agent_id);
|
|
14
|
+
await cloudAgentsBackend().pause(input.agent_id);
|
|
15
|
+
return { agentId: input.agent_id, cancelled: true };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default cancel;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { defineTool } from "../../../tools.js";
|
|
4
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
7
|
+
import { agentRef } from "../lib/inputs.js";
|
|
8
|
+
import {
|
|
9
|
+
lastAssistantText,
|
|
10
|
+
transcriptLines,
|
|
11
|
+
transcriptPath,
|
|
12
|
+
} from "../lib/transcript.js";
|
|
13
|
+
|
|
14
|
+
const dump: ToolDefinition = defineTool({
|
|
15
|
+
description:
|
|
16
|
+
"Write a cloud agent's full conversation to a JSONL file in your workspace so you can read what it did: one JSON message per line (prompts, assistant text, thinking, tool calls). Read the last line for the final report.",
|
|
17
|
+
effect: "read",
|
|
18
|
+
inputSchema: agentRef,
|
|
19
|
+
async execute(input, ctx) {
|
|
20
|
+
await assertOwned(ctx, input.agent_id);
|
|
21
|
+
const backend = cloudAgentsBackend();
|
|
22
|
+
const [messages, info] = await Promise.all([
|
|
23
|
+
backend.conversation(input.agent_id),
|
|
24
|
+
backend.info(input.agent_id),
|
|
25
|
+
]);
|
|
26
|
+
if (messages.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
agentId: input.agent_id,
|
|
29
|
+
lineCount: 0,
|
|
30
|
+
status: info.status,
|
|
31
|
+
note: "The agent has not produced any transcript yet.",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Absolute: the harness's shell does not run in the workspace directory.
|
|
35
|
+
const path = join(ctx.workspaceDir, transcriptPath(input.agent_id));
|
|
36
|
+
const jsonl = `${transcriptLines(messages).join("\n")}\n`;
|
|
37
|
+
await mkdir(dirname(path), { recursive: true });
|
|
38
|
+
await writeFile(path, jsonl, "utf8");
|
|
39
|
+
return {
|
|
40
|
+
agentId: input.agent_id,
|
|
41
|
+
path,
|
|
42
|
+
sizeBytes: Buffer.byteLength(jsonl),
|
|
43
|
+
lineCount: messages.length,
|
|
44
|
+
status: info.status,
|
|
45
|
+
finalMessage: lastAssistantText(messages),
|
|
46
|
+
note: `One JSON message per line. Grep it, or read the final report with \`tail -n 1 ${path}\`.`,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export default dump;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineTool } from "../../../tools.js";
|
|
2
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
3
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
4
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
5
|
+
import { agentRef } from "../lib/inputs.js";
|
|
6
|
+
|
|
7
|
+
const get: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"Look up a cloud agent you launched by id: its status, branch, pull request, changed-file counts, summary, and any error. Use dump to read everything it did.",
|
|
10
|
+
effect: "read",
|
|
11
|
+
inputSchema: agentRef,
|
|
12
|
+
async execute(input, ctx) {
|
|
13
|
+
await assertOwned(ctx, input.agent_id);
|
|
14
|
+
return cloudAgentsBackend().info(input.agent_id);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default get;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Agent } from "@cursor/sdk";
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
import { defineTool } from "../../../tools.js";
|
|
4
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
5
4
|
import extension from "../extension.js";
|
|
6
|
-
import {
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
7
6
|
import { recordLaunch } from "../lib/fleet.js";
|
|
8
7
|
import { launchRepos } from "../lib/repos.js";
|
|
9
8
|
|
|
10
9
|
const launch: ToolDefinition = defineTool({
|
|
11
10
|
description:
|
|
12
|
-
"Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check
|
|
11
|
+
"Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check on it with get, read what it did with dump.",
|
|
13
12
|
effect: "write",
|
|
14
13
|
needsApproval: () => extension.config.needsApproval,
|
|
15
14
|
inputSchema: z.object({
|
|
@@ -26,8 +25,13 @@ const launch: ToolDefinition = defineTool({
|
|
|
26
25
|
.describe(
|
|
27
26
|
"GitHub repository URL, one of the configured repositories. Defaults to the configured repository."
|
|
28
27
|
),
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
starting_ref: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe(
|
|
32
|
+
"Branch or commit to start from; defaults to the configured or default branch."
|
|
33
|
+
),
|
|
34
|
+
pr_url: z
|
|
31
35
|
.string()
|
|
32
36
|
.url()
|
|
33
37
|
.optional()
|
|
@@ -39,45 +43,21 @@ const launch: ToolDefinition = defineTool({
|
|
|
39
43
|
.describe("Display name; derived from the prompt when omitted."),
|
|
40
44
|
}),
|
|
41
45
|
async execute(input, ctx) {
|
|
42
|
-
const { cloud } = extension.config;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
apiKey: key,
|
|
46
|
-
model: modelSelection(),
|
|
46
|
+
const { cloud, model } = extension.config;
|
|
47
|
+
const launched = await cloudAgentsBackend().launch({
|
|
48
|
+
prompt: input.prompt,
|
|
47
49
|
name: input.name,
|
|
48
|
-
|
|
50
|
+
model,
|
|
51
|
+
cloud: {
|
|
52
|
+
...cloud,
|
|
53
|
+
repos: launchRepos(
|
|
54
|
+
{ repo: input.repo, ref: input.starting_ref, prUrl: input.pr_url },
|
|
55
|
+
cloud
|
|
56
|
+
),
|
|
57
|
+
},
|
|
49
58
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await recordLaunch(ctx, agent.agentId, input.name);
|
|
53
|
-
return {
|
|
54
|
-
agentId: agent.agentId,
|
|
55
|
-
runId: run.id,
|
|
56
|
-
status: run.status,
|
|
57
|
-
url: agentUrl(agent.agentId),
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
// The API can fail after the agent exists (slow admission,
|
|
61
|
-
// post-create checks). The SDK seeded the id unless envVars made
|
|
62
|
-
// the server mint it, so read the agent back and keep the handle;
|
|
63
|
-
// envVars launches have no id to read back and surface the error.
|
|
64
|
-
const info =
|
|
65
|
-
cloud.envVars === undefined
|
|
66
|
-
? await Agent.get(agent.agentId, { apiKey: key }).catch(
|
|
67
|
-
() => undefined
|
|
68
|
-
)
|
|
69
|
-
: undefined;
|
|
70
|
-
if (info === undefined) {
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
await recordLaunch(ctx, info.agentId, input.name);
|
|
74
|
-
return {
|
|
75
|
-
...agentView(info),
|
|
76
|
-
launchError: error instanceof Error ? error.message : String(error),
|
|
77
|
-
};
|
|
78
|
-
} finally {
|
|
79
|
-
agent.close();
|
|
80
|
-
}
|
|
59
|
+
await recordLaunch(ctx, launched.agentId, input.name);
|
|
60
|
+
return launched;
|
|
81
61
|
},
|
|
82
62
|
});
|
|
83
63
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineTool } from "../../../tools.js";
|
|
3
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
-
import { agentUrl } from "../lib/
|
|
4
|
+
import { agentUrl } from "../lib/backend.js";
|
|
5
5
|
import { listFleet } from "../lib/fleet.js";
|
|
6
6
|
|
|
7
7
|
const list: ToolDefinition = defineTool({
|