@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
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Minimal Connect-JSON client for the handful of `aiserver.v1.DashboardService`
|
|
3
3
|
* RPCs agent-serve needs — `GetMe`, `ListSandMcpTools`, `ExecuteSandMcpTool`,
|
|
4
4
|
* and the login-time key lifecycle (`CreateUserApiKey`, `ListUserApiKeys`,
|
|
5
|
-
* `RevokeUserApiKey`).
|
|
5
|
+
* `RevokeUserApiKey`) — plus {@link CursorBackendClient.serviceRpc} for the
|
|
6
|
+
* odd unary call on another `aiserver.v1` service under the same token.
|
|
6
7
|
*
|
|
7
8
|
* Plain `fetch` POSTs with proto-JSON bodies and zod-validated responses:
|
|
8
9
|
* agent-serve is a published package and should not pull the generated
|
|
@@ -16,6 +17,8 @@
|
|
|
16
17
|
import { randomUUID } from "node:crypto";
|
|
17
18
|
import { z } from "zod";
|
|
18
19
|
import type { McpToolAnnotations } from "../../types.js";
|
|
20
|
+
import { describeError } from "../describe-error.js";
|
|
21
|
+
import { CLI_COMMAND_NAME as CLI } from "../distribution.js";
|
|
19
22
|
import { boundedToolAnnotations } from "../mcp-host.js";
|
|
20
23
|
import {
|
|
21
24
|
CURSOR_SESSION_EXCHANGE_PATH,
|
|
@@ -25,7 +28,7 @@ import {
|
|
|
25
28
|
} from "./session-token.js";
|
|
26
29
|
|
|
27
30
|
const CLIENT_VERSION = "agent-serve-0.1.0";
|
|
28
|
-
const
|
|
31
|
+
const DASHBOARD_SERVICE = "DashboardService";
|
|
29
32
|
const LIST_TIMEOUT_MS = 60_000;
|
|
30
33
|
/** Backend-executed tools call out to third-party servers; be generous. */
|
|
31
34
|
const EXECUTE_TIMEOUT_MS = 120_000;
|
|
@@ -235,9 +238,10 @@ export interface AccountMcpCallResult {
|
|
|
235
238
|
// ============================================================================
|
|
236
239
|
|
|
237
240
|
/** One DashboardService Connect-JSON POST; auth is the caller's bearer. */
|
|
238
|
-
async function
|
|
241
|
+
async function connectRpc(args: {
|
|
239
242
|
fetchImpl: typeof fetch;
|
|
240
243
|
backendUrl: string;
|
|
244
|
+
service: string;
|
|
241
245
|
method: string;
|
|
242
246
|
bearer: string;
|
|
243
247
|
body: unknown;
|
|
@@ -246,7 +250,7 @@ async function dashboardRpc(args: {
|
|
|
246
250
|
}): Promise<Response> {
|
|
247
251
|
try {
|
|
248
252
|
return await args.fetchImpl(
|
|
249
|
-
`${args.backendUrl}
|
|
253
|
+
`${args.backendUrl}/aiserver.v1.${args.service}/${args.method}`,
|
|
250
254
|
{
|
|
251
255
|
method: "POST",
|
|
252
256
|
headers: {
|
|
@@ -298,9 +302,10 @@ export interface CursorBackendClientOptions {
|
|
|
298
302
|
backendUrl: string;
|
|
299
303
|
apiKey: string;
|
|
300
304
|
/**
|
|
301
|
-
* Re-
|
|
302
|
-
* unsigned and
|
|
303
|
-
*
|
|
305
|
+
* Re-resolve the key on each authenticated call. Hosted freeze listens
|
|
306
|
+
* unsigned and only gains a credential at task time (hosted deliveries
|
|
307
|
+
* consume the bind file into `CURSOR_API_KEY` before authored work); a
|
|
308
|
+
* constructor-frozen key would miss that bind.
|
|
304
309
|
*/
|
|
305
310
|
getApiKey?: () => string;
|
|
306
311
|
logger?: (line: string) => void;
|
|
@@ -485,20 +490,36 @@ export class CursorBackendClient {
|
|
|
485
490
|
return githubTokenResponseSchema.parse(parsed);
|
|
486
491
|
}
|
|
487
492
|
|
|
493
|
+
/**
|
|
494
|
+
* One unary Connect-JSON call on `aiserver.v1.<service>` with the same
|
|
495
|
+
* token exchange and 401 retry as the dashboard RPCs. Callers parse the
|
|
496
|
+
* proto-JSON response themselves.
|
|
497
|
+
*/
|
|
498
|
+
serviceRpc(
|
|
499
|
+
service: string,
|
|
500
|
+
method: string,
|
|
501
|
+
body: unknown,
|
|
502
|
+
timeoutMs: number = LIST_TIMEOUT_MS
|
|
503
|
+
): Promise<unknown> {
|
|
504
|
+
return this.rpc(method, body, timeoutMs, { service });
|
|
505
|
+
}
|
|
506
|
+
|
|
488
507
|
private async rpc(
|
|
489
508
|
method: string,
|
|
490
509
|
body: unknown,
|
|
491
510
|
timeoutMs = LIST_TIMEOUT_MS,
|
|
492
|
-
options?: { teamId?: number }
|
|
511
|
+
options?: { teamId?: number; service?: string }
|
|
493
512
|
): Promise<unknown> {
|
|
513
|
+
const service = options?.service ?? DASHBOARD_SERVICE;
|
|
494
514
|
const extraHeaders =
|
|
495
515
|
options?.teamId === undefined
|
|
496
516
|
? undefined
|
|
497
517
|
: { "x-cursor-team-id": String(options.teamId) };
|
|
498
518
|
const bearer = await this.getAccessToken();
|
|
499
|
-
const first = await
|
|
519
|
+
const first = await connectRpc({
|
|
500
520
|
fetchImpl: this.fetchImpl,
|
|
501
521
|
backendUrl: this.backendUrl,
|
|
522
|
+
service,
|
|
502
523
|
method,
|
|
503
524
|
bearer,
|
|
504
525
|
body,
|
|
@@ -516,9 +537,10 @@ export class CursorBackendClient {
|
|
|
516
537
|
this.token = undefined;
|
|
517
538
|
}
|
|
518
539
|
const retryBearer = await this.getAccessToken();
|
|
519
|
-
const second = await
|
|
540
|
+
const second = await connectRpc({
|
|
520
541
|
fetchImpl: this.fetchImpl,
|
|
521
542
|
backendUrl: this.backendUrl,
|
|
543
|
+
service,
|
|
522
544
|
method,
|
|
523
545
|
bearer: retryBearer,
|
|
524
546
|
body,
|
|
@@ -588,7 +610,7 @@ export class CursorBackendClient {
|
|
|
588
610
|
}
|
|
589
611
|
throw new CursorBackendError(
|
|
590
612
|
error.status === 401
|
|
591
|
-
?
|
|
613
|
+
? `The Cursor API key was rejected. Run \`${CLI} login\` again or update CURSOR_API_KEY.`
|
|
592
614
|
: `Cursor API key exchange failed (${error.status}).`,
|
|
593
615
|
error.status
|
|
594
616
|
);
|
|
@@ -604,7 +626,7 @@ export class CursorBackendClient {
|
|
|
604
626
|
|
|
605
627
|
/**
|
|
606
628
|
* Mint a named user API key from a short-lived login session token. Used
|
|
607
|
-
* exactly once per `agent-
|
|
629
|
+
* exactly once per `agent-sdk login`; the session token is then discarded.
|
|
608
630
|
*/
|
|
609
631
|
export async function createUserApiKeyWithSessionToken(args: {
|
|
610
632
|
backendUrl: string;
|
|
@@ -612,11 +634,12 @@ export async function createUserApiKeyWithSessionToken(args: {
|
|
|
612
634
|
keyName: string;
|
|
613
635
|
fetchImpl?: typeof fetch;
|
|
614
636
|
}): Promise<string> {
|
|
615
|
-
const response = await
|
|
637
|
+
const response = await connectRpc({
|
|
616
638
|
fetchImpl: args.fetchImpl ?? fetch,
|
|
617
639
|
backendUrl: args.backendUrl.endsWith("/")
|
|
618
640
|
? args.backendUrl.slice(0, -1)
|
|
619
641
|
: args.backendUrl,
|
|
642
|
+
service: DASHBOARD_SERVICE,
|
|
620
643
|
method: "CreateUserApiKey",
|
|
621
644
|
bearer: args.sessionToken,
|
|
622
645
|
body: { name: args.keyName },
|
|
@@ -666,9 +689,10 @@ export async function revokeMintedUserApiKey(args: {
|
|
|
666
689
|
? args.backendUrl.slice(0, -1)
|
|
667
690
|
: args.backendUrl;
|
|
668
691
|
|
|
669
|
-
const listResponse = await
|
|
692
|
+
const listResponse = await connectRpc({
|
|
670
693
|
fetchImpl,
|
|
671
694
|
backendUrl,
|
|
695
|
+
service: DASHBOARD_SERVICE,
|
|
672
696
|
method: "ListUserApiKeys",
|
|
673
697
|
bearer: args.sessionToken,
|
|
674
698
|
body: {},
|
|
@@ -686,9 +710,10 @@ export async function revokeMintedUserApiKey(args: {
|
|
|
686
710
|
// lagging replica — skip rather than touch any other key.
|
|
687
711
|
return;
|
|
688
712
|
}
|
|
689
|
-
const revokeResponse = await
|
|
713
|
+
const revokeResponse = await connectRpc({
|
|
690
714
|
fetchImpl,
|
|
691
715
|
backendUrl,
|
|
716
|
+
service: DASHBOARD_SERVICE,
|
|
692
717
|
method: "RevokeUserApiKey",
|
|
693
718
|
bearer: args.sessionToken,
|
|
694
719
|
body: { id: match.id },
|
|
@@ -845,7 +870,7 @@ function describeGithubTokenHttpFailure(
|
|
|
845
870
|
if (status === 401) {
|
|
846
871
|
return `The Cursor API key was rejected${
|
|
847
872
|
detail === undefined ? "" : `: ${detail}`
|
|
848
|
-
}. Run
|
|
873
|
+
}. Run \`${CLI} login\` again or update CURSOR_API_KEY.`;
|
|
849
874
|
}
|
|
850
875
|
if (detail !== undefined) {
|
|
851
876
|
return detail;
|
|
@@ -877,10 +902,6 @@ function retryAfterMsFromResponse(response: Response): number | undefined {
|
|
|
877
902
|
return Math.min(retryAfter * 1000, MAX_GITHUB_TOKEN_RETRY_AFTER_MS);
|
|
878
903
|
}
|
|
879
904
|
|
|
880
|
-
function describeError(error: unknown): string {
|
|
881
|
-
return error instanceof Error ? error.message : String(error);
|
|
882
|
-
}
|
|
883
|
-
|
|
884
905
|
/** Release undici/fetch connection slots on responses we will not parse. */
|
|
885
906
|
async function drainResponseBody(response: Response): Promise<void> {
|
|
886
907
|
try {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Destroying a hosted v2 task-bind secret file after its value is in
|
|
3
|
+
* `process.env`.
|
|
4
|
+
*
|
|
5
|
+
* The bind files under `/run/cursor/secrets/` are an IPC channel, not a
|
|
6
|
+
* credential store: the control plane cannot set another process's
|
|
7
|
+
* environment, so it drops the value on tmpfs and July copies it into
|
|
8
|
+
* `process.env` before anything authored runs. Once that copy succeeds the
|
|
9
|
+
* on-disk value is pure liability — authored agent code runs in this pod and
|
|
10
|
+
* can read any world-readable path.
|
|
11
|
+
*
|
|
12
|
+
* Unlink is preferred. It is not always available: pod-daemon writes the
|
|
13
|
+
* files as root, and removing a directory entry needs write permission on
|
|
14
|
+
* `/run/cursor/secrets`, which is root-owned. Making that directory writable
|
|
15
|
+
* by the guest is not the fix — untrusted guest code could then plant a
|
|
16
|
+
* symlink that the next root-side bind write would follow. The binder instead
|
|
17
|
+
* relaxes the two secret files themselves so the guest can truncate them, and
|
|
18
|
+
* this module falls back to a zero-length overwrite. Both readers treat an
|
|
19
|
+
* empty bind file as unsigned.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
closeSync,
|
|
24
|
+
fsyncSync,
|
|
25
|
+
ftruncateSync,
|
|
26
|
+
openSync,
|
|
27
|
+
readFileSync,
|
|
28
|
+
unlinkSync,
|
|
29
|
+
} from "node:fs";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* What happened to a bind file. Only `readable` is a failure: the secret
|
|
33
|
+
* survived the consume and callers must not run authored code.
|
|
34
|
+
*/
|
|
35
|
+
export type BoundSecretFileDisposal =
|
|
36
|
+
/** Nothing recoverable was there — missing, empty, or unreadable already. */
|
|
37
|
+
| { state: "absent" }
|
|
38
|
+
/** Directory entry removed. */
|
|
39
|
+
| { state: "unlinked" }
|
|
40
|
+
/** Truncated to zero length and fsynced; an empty file remains. */
|
|
41
|
+
| { state: "wiped" }
|
|
42
|
+
/** Still recoverable by a later `readFile`. */
|
|
43
|
+
| { state: "readable"; reason: string };
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether a later `readFile` of this path could still recover a secret.
|
|
47
|
+
* A read failure counts as unrecoverable: this process just read the file
|
|
48
|
+
* during hydrate, so losing access to it means the content is gone.
|
|
49
|
+
*/
|
|
50
|
+
export function boundSecretFileIsReadable(path: string): boolean {
|
|
51
|
+
try {
|
|
52
|
+
return readFileSync(path, "utf8").trim() !== "";
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function errorReason(error: unknown): string {
|
|
59
|
+
const code = (error as { code?: unknown } | undefined)?.code;
|
|
60
|
+
return typeof code === "string" ? code : "unknown";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Remove a bind file's contents from disk, preferring unlink over an empty
|
|
65
|
+
* leftover. Callers must have already copied the value into `process.env`:
|
|
66
|
+
* this is destructive and there is no second bind until the control plane
|
|
67
|
+
* rewrites the file before the next hosted request.
|
|
68
|
+
*/
|
|
69
|
+
export function destroyBoundSecretFile(path: string): BoundSecretFileDisposal {
|
|
70
|
+
if (!boundSecretFileIsReadable(path)) {
|
|
71
|
+
// Nothing recoverable, so nothing to fail over. Still try to clear the
|
|
72
|
+
// empty leftover: whether that succeeds does not change the disposal,
|
|
73
|
+
// because there is no secret here either way.
|
|
74
|
+
try {
|
|
75
|
+
unlinkSync(path);
|
|
76
|
+
} catch {
|
|
77
|
+
// Already gone, or a directory the guest cannot write. Both are fine.
|
|
78
|
+
}
|
|
79
|
+
return { state: "absent" };
|
|
80
|
+
}
|
|
81
|
+
let unlinkReason: string | undefined;
|
|
82
|
+
try {
|
|
83
|
+
unlinkSync(path);
|
|
84
|
+
if (!boundSecretFileIsReadable(path)) {
|
|
85
|
+
return { state: "unlinked" };
|
|
86
|
+
}
|
|
87
|
+
unlinkReason = "recreated";
|
|
88
|
+
} catch (error) {
|
|
89
|
+
unlinkReason = errorReason(error);
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const fd = openSync(path, "r+");
|
|
93
|
+
try {
|
|
94
|
+
ftruncateSync(fd, 0);
|
|
95
|
+
fsyncSync(fd);
|
|
96
|
+
} finally {
|
|
97
|
+
closeSync(fd);
|
|
98
|
+
}
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
state: "readable",
|
|
102
|
+
reason: `unlink ${unlinkReason}, truncate ${errorReason(error)}`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return boundSecretFileIsReadable(path)
|
|
106
|
+
? { state: "readable", reason: `unlink ${unlinkReason}, truncate no-op` }
|
|
107
|
+
: { state: "wiped" };
|
|
108
|
+
}
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* Exactly one kind of secret exists at runtime: a **personal Cursor user API
|
|
5
5
|
* key**. Two ways to obtain it, one code path after that:
|
|
6
6
|
*
|
|
7
|
-
* - `agent-
|
|
7
|
+
* - `agent-sdk login` runs the same PKCE browser flow as `cursor-agent`
|
|
8
8
|
* and Sand, then uses the short-lived session once to mint a named,
|
|
9
9
|
* dashboard-revocable user API key — only the key is stored.
|
|
10
10
|
* - `CURSOR_API_KEY` (or `serve({ apiKey })`) wins over the stored key, so
|
|
11
11
|
* CI and hosted deployments stay env-driven.
|
|
12
12
|
* - `CURSOR_API_KEY_FILE` (or the hosted default path) is next: freeze bind
|
|
13
|
-
* drops the key at task time without restarting July.
|
|
13
|
+
* drops the key at task time without restarting July. On the hosted path
|
|
14
|
+
* that file is consumed into `CURSOR_API_KEY` and destroyed before
|
|
15
|
+
* anything authored runs, so this fallback is there for local,
|
|
16
|
+
* self-hosted, and the unsigned window before the first bind.
|
|
14
17
|
* - Stored `july login` is last. Same order for hosted and self-hosted:
|
|
15
18
|
* option → env → file → login.
|
|
16
19
|
*
|
|
@@ -26,6 +29,10 @@ import { homedir } from "node:os";
|
|
|
26
29
|
import { dirname, join } from "node:path";
|
|
27
30
|
import { z } from "zod";
|
|
28
31
|
import { CLI_COMMAND_NAME } from "../distribution.js";
|
|
32
|
+
import {
|
|
33
|
+
type BoundSecretFileDisposal,
|
|
34
|
+
destroyBoundSecretFile,
|
|
35
|
+
} from "./bound-secret-file.js";
|
|
29
36
|
|
|
30
37
|
export const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
|
|
31
38
|
export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
@@ -182,9 +189,11 @@ export interface ResolvedApiKey {
|
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
191
|
* Hosted task-bind path. Not a secret: the snapshot may name this path.
|
|
185
|
-
* The binder writes the key here after restore
|
|
186
|
-
*
|
|
187
|
-
*
|
|
192
|
+
* The binder writes the key here after restore, and hosted admission /
|
|
193
|
+
* execution consume it into `process.env.CURSOR_API_KEY` and destroy the
|
|
194
|
+
* file before authored work — this is an IPC handoff, not a credential
|
|
195
|
+
* source July keeps reading. Override with `CURSOR_API_KEY_FILE`. A missing
|
|
196
|
+
* file is unsigned — self-hosted then uses `CURSOR_API_KEY` or stored login.
|
|
188
197
|
*/
|
|
189
198
|
export const DEFAULT_CURSOR_API_KEY_FILE: string =
|
|
190
199
|
"/run/cursor/secrets/CURSOR_API_KEY";
|
|
@@ -195,12 +204,18 @@ export const DEFAULT_CURSOR_API_KEY_FILE: string =
|
|
|
195
204
|
* listens before the binder drops the key; self-hosted falls through to
|
|
196
205
|
* env or login.
|
|
197
206
|
*/
|
|
207
|
+
export function resolveCursorApiKeyFilePath(
|
|
208
|
+
filePath?: string,
|
|
209
|
+
env: NodeJS.ProcessEnv = process.env
|
|
210
|
+
): string {
|
|
211
|
+
const configured = filePath ?? env.CURSOR_API_KEY_FILE;
|
|
212
|
+
return configured !== undefined && configured.trim() !== ""
|
|
213
|
+
? configured.trim()
|
|
214
|
+
: DEFAULT_CURSOR_API_KEY_FILE;
|
|
215
|
+
}
|
|
216
|
+
|
|
198
217
|
export function readApiKeyFromFile(filePath?: string): string | undefined {
|
|
199
|
-
const
|
|
200
|
-
const path =
|
|
201
|
-
configured !== undefined && configured.trim() !== ""
|
|
202
|
-
? configured.trim()
|
|
203
|
-
: DEFAULT_CURSOR_API_KEY_FILE;
|
|
218
|
+
const path = resolveCursorApiKeyFilePath(filePath);
|
|
204
219
|
try {
|
|
205
220
|
const raw = readFileSync(path, "utf8").trim();
|
|
206
221
|
return raw === "" ? undefined : raw;
|
|
@@ -209,6 +224,56 @@ export function readApiKeyFromFile(filePath?: string): string | undefined {
|
|
|
209
224
|
}
|
|
210
225
|
}
|
|
211
226
|
|
|
227
|
+
export type BoundCursorApiKeyConsumeResult = {
|
|
228
|
+
/** The file supplied `CURSOR_API_KEY` on this call. */
|
|
229
|
+
applied: boolean;
|
|
230
|
+
disposal: BoundSecretFileDisposal;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Copy the task-bind key file into `process.env.CURSOR_API_KEY`, then destroy
|
|
235
|
+
* the file.
|
|
236
|
+
*
|
|
237
|
+
* Hosted v2 cannot set another process's environment from the binder, so it
|
|
238
|
+
* drops a tmpfs file. Teaching every reader to open that file misses authored
|
|
239
|
+
* `process.env.CURSOR_API_KEY` and leaves a secret on disk. Hosted admission /
|
|
240
|
+
* execution call this once per request, next to the deployment-secrets
|
|
241
|
+
* consume: after it returns, env-only readers work and the key is no longer
|
|
242
|
+
* recoverable from disk. The control plane re-binds before the next request.
|
|
243
|
+
*
|
|
244
|
+
* The env write always happens before the destroy, never the other way round.
|
|
245
|
+
* An already-set `CURSOR_API_KEY` is not overwritten, but the file is still
|
|
246
|
+
* destroyed — env is the source, the file is only the handoff.
|
|
247
|
+
*
|
|
248
|
+
* A `readable` disposal means the secret survived; callers on the hosted path
|
|
249
|
+
* must fail the request rather than run authored code.
|
|
250
|
+
*/
|
|
251
|
+
export function consumeBoundCursorApiKey(options?: {
|
|
252
|
+
filePath?: string;
|
|
253
|
+
env?: NodeJS.ProcessEnv;
|
|
254
|
+
}): BoundCursorApiKeyConsumeResult {
|
|
255
|
+
const env = options?.env ?? process.env;
|
|
256
|
+
const path = resolveCursorApiKeyFilePath(options?.filePath, env);
|
|
257
|
+
const envKeyAlreadySet =
|
|
258
|
+
env.CURSOR_API_KEY !== undefined && env.CURSOR_API_KEY.trim() !== "";
|
|
259
|
+
let raw = "";
|
|
260
|
+
try {
|
|
261
|
+
raw = readFileSync(path, "utf8").trim();
|
|
262
|
+
} catch {
|
|
263
|
+
return { applied: false, disposal: { state: "absent" } };
|
|
264
|
+
}
|
|
265
|
+
if (raw === "") {
|
|
266
|
+
return { applied: false, disposal: destroyBoundSecretFile(path) };
|
|
267
|
+
}
|
|
268
|
+
if (!envKeyAlreadySet) {
|
|
269
|
+
env.CURSOR_API_KEY = raw;
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
applied: !envKeyAlreadySet,
|
|
273
|
+
disposal: destroyBoundSecretFile(path),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
212
277
|
/**
|
|
213
278
|
* First present source wins. We define the order; operators do not.
|
|
214
279
|
* `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hosted v2 per-request secret handoff: bind files in, `process.env` out,
|
|
3
|
+
* nothing recoverable left on disk.
|
|
4
|
+
*
|
|
5
|
+
* The control plane rewrites `/run/cursor/secrets/` before every hosted
|
|
6
|
+
* admission and execution because it cannot set the already-running July
|
|
7
|
+
* process's environment. This module closes that handoff at the top of each
|
|
8
|
+
* request: copy both documents into `process.env`, then destroy them. Hosted
|
|
9
|
+
* request code and authored agents read env from there on — nothing on the
|
|
10
|
+
* hosted path should open these paths again.
|
|
11
|
+
*
|
|
12
|
+
* It fails closed. A secret that survives the consume would sit world-readable
|
|
13
|
+
* next to authored agent code for the length of a turn, so the caller returns
|
|
14
|
+
* a retryable error instead of dispatching. The next request re-binds and
|
|
15
|
+
* consumes again.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
consumeBoundCursorApiKey,
|
|
20
|
+
DEFAULT_CURSOR_API_KEY_FILE,
|
|
21
|
+
} from "./credentials.js";
|
|
22
|
+
import {
|
|
23
|
+
consumeBoundDeploymentSecrets,
|
|
24
|
+
DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE,
|
|
25
|
+
} from "./hosted-deployment-secrets.js";
|
|
26
|
+
|
|
27
|
+
/** Wire error code for a bind file that outlived its consume. */
|
|
28
|
+
export const BOUND_SECRETS_NOT_CONSUMED = "bound_secrets_not_consumed";
|
|
29
|
+
|
|
30
|
+
export type HostedBoundSecretsResult =
|
|
31
|
+
| { ok: true }
|
|
32
|
+
| { ok: false; code: typeof BOUND_SECRETS_NOT_CONSUMED; message: string };
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Hydrate `process.env` from both bind files and remove them from disk.
|
|
36
|
+
* Returns a failure when either secret is still readable afterwards.
|
|
37
|
+
*
|
|
38
|
+
* Both paths are platform constants, deliberately not the `CURSOR_API_KEY_FILE`
|
|
39
|
+
* override that {@link resolveApiKeySync} honors. That override is a read
|
|
40
|
+
* chain; this is a destructive consume. Following it here would let authored
|
|
41
|
+
* code redirect the destroy at a decoy path — reporting success while the real
|
|
42
|
+
* bind file stays live — and would delete an operator's own long-lived key
|
|
43
|
+
* file on a surface that points the variable at one.
|
|
44
|
+
*/
|
|
45
|
+
export function consumeHostedBoundSecrets(options?: {
|
|
46
|
+
apiKeyFilePath?: string;
|
|
47
|
+
deploymentSecretsFilePath?: string;
|
|
48
|
+
}): HostedBoundSecretsResult {
|
|
49
|
+
const survivors: string[] = [];
|
|
50
|
+
|
|
51
|
+
const secretsPath =
|
|
52
|
+
options?.deploymentSecretsFilePath ??
|
|
53
|
+
DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE;
|
|
54
|
+
const secrets = consumeBoundDeploymentSecrets(secretsPath);
|
|
55
|
+
if (secrets.disposal.state === "readable") {
|
|
56
|
+
survivors.push(`${secretsPath} (${secrets.disposal.reason})`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const apiKeyPath = options?.apiKeyFilePath ?? DEFAULT_CURSOR_API_KEY_FILE;
|
|
60
|
+
const apiKey = consumeBoundCursorApiKey({ filePath: apiKeyPath });
|
|
61
|
+
if (apiKey.disposal.state === "readable") {
|
|
62
|
+
survivors.push(`${apiKeyPath} (${apiKey.disposal.reason})`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (survivors.length === 0) {
|
|
66
|
+
return { ok: true };
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
ok: false,
|
|
70
|
+
code: BOUND_SECRETS_NOT_CONSUMED,
|
|
71
|
+
message:
|
|
72
|
+
`Task-bind secrets are still readable after being hydrated into the ` +
|
|
73
|
+
`environment, so authored work did not run: ${survivors.join(", ")}.`,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -4,11 +4,18 @@
|
|
|
4
4
|
* The deployment host rewrites this tmpfs document before each admission and
|
|
5
5
|
* execution request. July reloads it synchronously because the process was
|
|
6
6
|
* already running in the frozen snapshot when the task-specific values
|
|
7
|
-
* arrived.
|
|
7
|
+
* arrived, then destroys the document: `process.env` is the source authored
|
|
8
|
+
* code reads, and the file is only how the value crossed the process
|
|
9
|
+
* boundary.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { readFileSync } from "node:fs";
|
|
11
13
|
|
|
14
|
+
import {
|
|
15
|
+
type BoundSecretFileDisposal,
|
|
16
|
+
destroyBoundSecretFile,
|
|
17
|
+
} from "./bound-secret-file.js";
|
|
18
|
+
|
|
12
19
|
export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE =
|
|
13
20
|
"/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
|
|
14
21
|
|
|
@@ -48,17 +55,11 @@ function parseBoundSecrets(path: string): Record<string, string> | undefined {
|
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
58
|
+
* Apply the latest bound document to `process.env`. An empty valid document
|
|
59
|
+
* removes values loaded by an earlier bind after the deployment secret was
|
|
60
|
+
* unset, which is why the applied names are tracked across calls.
|
|
54
61
|
*/
|
|
55
|
-
|
|
56
|
-
path: string = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE
|
|
57
|
-
): void {
|
|
58
|
-
const secrets = parseBoundSecrets(path);
|
|
59
|
-
if (secrets === undefined) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
+
function applyBoundSecrets(secrets: Record<string, string>): void {
|
|
62
63
|
for (const name of appliedSecretNames) {
|
|
63
64
|
if (!(name in secrets)) {
|
|
64
65
|
delete process.env[name];
|
|
@@ -70,3 +71,33 @@ export function refreshBoundDeploymentSecrets(
|
|
|
70
71
|
appliedSecretNames.add(name);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
export type BoundDeploymentSecretsConsumeResult = {
|
|
76
|
+
/** The document supplied values on this call. */
|
|
77
|
+
applied: boolean;
|
|
78
|
+
disposal: BoundSecretFileDisposal;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Apply the bound document to `process.env`, then destroy it.
|
|
83
|
+
*
|
|
84
|
+
* The env refresh always runs first, so a failed destroy never costs the
|
|
85
|
+
* request its secrets. A malformed document is destroyed too: it carries no
|
|
86
|
+
* values this process can use, and leaving it on disk only leaves whatever
|
|
87
|
+
* the control plane did manage to write.
|
|
88
|
+
*
|
|
89
|
+
* A `readable` disposal means the document survived; hosted callers must fail
|
|
90
|
+
* the request rather than run authored code next to a live secrets file.
|
|
91
|
+
*/
|
|
92
|
+
export function consumeBoundDeploymentSecrets(
|
|
93
|
+
path: string = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE
|
|
94
|
+
): BoundDeploymentSecretsConsumeResult {
|
|
95
|
+
const secrets = parseBoundSecrets(path);
|
|
96
|
+
if (secrets !== undefined) {
|
|
97
|
+
applyBoundSecrets(secrets);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
applied: secrets !== undefined,
|
|
101
|
+
disposal: destroyBoundSecretFile(path),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Task-time bind paths for hosted deployment file-store source ids.
|
|
3
3
|
*
|
|
4
|
-
* Freeze v2 snapshots start `agent-
|
|
4
|
+
* Freeze v2 snapshots start `agent-sdk serve` at bake time without a service
|
|
5
5
|
* account, so neither store id is in process env. Execute-from-freeze binds
|
|
6
6
|
* the deployment credential and store ids into `/run/cursor/secrets/` without
|
|
7
7
|
* restarting July — the same pattern as {@link DEFAULT_CURSOR_API_KEY_FILE}.
|
|
@@ -70,3 +70,30 @@ export function resolveFrameworkStoreSourceIdSync(
|
|
|
70
70
|
env
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
export type CursorManagedV2StoreIds = {
|
|
75
|
+
deploymentStoreSourceId: string;
|
|
76
|
+
frameworkStoreSourceId: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Resolve the complete managed-v2 store identity at the process boundary.
|
|
81
|
+
*
|
|
82
|
+
* Freeze snapshots construct storage before task bind, so callers keep this
|
|
83
|
+
* resolver lazy. Once an operation needs storage, both ids are mandatory.
|
|
84
|
+
*/
|
|
85
|
+
export function requireCursorManagedV2StoreIdsSync(
|
|
86
|
+
env: NodeJS.ProcessEnv = process.env
|
|
87
|
+
): CursorManagedV2StoreIds {
|
|
88
|
+
const deploymentStoreSourceId = resolveDeploymentStoreSourceIdSync(env);
|
|
89
|
+
const frameworkStoreSourceId = resolveFrameworkStoreSourceIdSync(env);
|
|
90
|
+
if (
|
|
91
|
+
deploymentStoreSourceId === undefined ||
|
|
92
|
+
frameworkStoreSourceId === undefined
|
|
93
|
+
) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
"Cursor-managed AgentSDK v2 requires AGENT_SERVE_STORE_SOURCE_ID and AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID"
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return { deploymentStoreSourceId, frameworkStoreSourceId };
|
|
99
|
+
}
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
} from "./cursor/backend-client.js";
|
|
21
21
|
import { LOG_PREFIX } from "./distribution.js";
|
|
22
22
|
import { openBrowser } from "./mcp-oauth.js";
|
|
23
|
+
import { sleep as defaultSleep } from "./sleep.js";
|
|
23
24
|
|
|
24
25
|
const DEFAULT_POLL_INTERVAL_MS = 3_000;
|
|
25
26
|
const DEFAULT_POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
@@ -66,10 +67,6 @@ export interface AuthorizeCursorAccountConnectorsResult {
|
|
|
66
67
|
errored: Array<{ name: string; error: string }>;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
function sleepMs(ms: number): Promise<void> {
|
|
70
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
70
|
/**
|
|
74
71
|
* Authorize the deployment service account for the connection's connectors.
|
|
75
72
|
* Already-authorized connectors are skipped; the rest get a browser OAuth
|
|
@@ -81,7 +78,7 @@ export async function authorizeCursorAccountConnectors(
|
|
|
81
78
|
const { backendClient, teamId, serviceAccountId, connectionName, out, err } =
|
|
82
79
|
args;
|
|
83
80
|
const open = args.openBrowserImpl ?? openBrowser;
|
|
84
|
-
const sleep = args.sleep ??
|
|
81
|
+
const sleep = args.sleep ?? defaultSleep;
|
|
85
82
|
const pollIntervalMs = args.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
86
83
|
const pollTimeoutMs = args.pollTimeoutMs ?? DEFAULT_POLL_TIMEOUT_MS;
|
|
87
84
|
const redirectUri = mcpOauthRedirectUri();
|
|
@@ -60,14 +60,18 @@ export function currentDeploymentSubscriptions(
|
|
|
60
60
|
return typeof subscriptions === "function" ? subscriptions() : subscriptions;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Normalize the channel's `deploySourceUris` option into concrete
|
|
65
|
+
* subscriptions. An omitted or empty option resolves to none, which callers
|
|
66
|
+
* read as "defer to the deploy scope".
|
|
67
|
+
*/
|
|
64
68
|
export function resolveDeploymentSubscriptions(options: {
|
|
65
|
-
deploySourceUris
|
|
69
|
+
deploySourceUris?: readonly (string | DeploymentSubscription)[];
|
|
66
70
|
environments?: readonly string[];
|
|
67
71
|
events?: readonly DeploymentEventType[];
|
|
68
72
|
}): ResolvedSubscription[] {
|
|
69
73
|
const bySource = new Map<string, ResolvedSubscription>();
|
|
70
|
-
for (const entry of options.deploySourceUris) {
|
|
74
|
+
for (const entry of options.deploySourceUris ?? []) {
|
|
71
75
|
const subscription: DeploymentSubscription =
|
|
72
76
|
typeof entry === "string" ? { deploySourceUri: entry } : entry;
|
|
73
77
|
// Case-folded only: `Deployment.deploy_source_uri` has no documented
|
|
@@ -106,10 +110,10 @@ export function resolveDeploymentSubscriptions(options: {
|
|
|
106
110
|
? []
|
|
107
111
|
: [...new Set([...existing.environments, ...environments])];
|
|
108
112
|
}
|
|
109
|
-
// Empty
|
|
110
|
-
//
|
|
111
|
-
// heartbeat, so a channel that later
|
|
112
|
-
//
|
|
113
|
+
// Empty means "this channel names nothing". The relay wire reads that as
|
|
114
|
+
// deregistration, hosted admission reads it as "defer to the deploy
|
|
115
|
+
// scope". The host re-resolves on each heartbeat, so a channel that later
|
|
116
|
+
// fills `deploySourceUris` registers without a restart.
|
|
113
117
|
return [...bySource.values()];
|
|
114
118
|
}
|
|
115
119
|
|