@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,56 @@
|
|
|
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
|
+
* What happened to a bind file. Only `readable` is a failure: the secret
|
|
23
|
+
* survived the consume and callers must not run authored code.
|
|
24
|
+
*/
|
|
25
|
+
export type BoundSecretFileDisposal =
|
|
26
|
+
/** Nothing recoverable was there — missing, empty, or unreadable already. */
|
|
27
|
+
{
|
|
28
|
+
state: "absent";
|
|
29
|
+
}
|
|
30
|
+
/** Directory entry removed. */
|
|
31
|
+
| {
|
|
32
|
+
state: "unlinked";
|
|
33
|
+
}
|
|
34
|
+
/** Truncated to zero length and fsynced; an empty file remains. */
|
|
35
|
+
| {
|
|
36
|
+
state: "wiped";
|
|
37
|
+
}
|
|
38
|
+
/** Still recoverable by a later `readFile`. */
|
|
39
|
+
| {
|
|
40
|
+
state: "readable";
|
|
41
|
+
reason: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Whether a later `readFile` of this path could still recover a secret.
|
|
45
|
+
* A read failure counts as unrecoverable: this process just read the file
|
|
46
|
+
* during hydrate, so losing access to it means the content is gone.
|
|
47
|
+
*/
|
|
48
|
+
export declare function boundSecretFileIsReadable(path: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Remove a bind file's contents from disk, preferring unlink over an empty
|
|
51
|
+
* leftover. Callers must have already copied the value into `process.env`:
|
|
52
|
+
* this is destructive and there is no second bind until the control plane
|
|
53
|
+
* rewrites the file before the next hosted request.
|
|
54
|
+
*/
|
|
55
|
+
export declare function destroyBoundSecretFile(path: string): BoundSecretFileDisposal;
|
|
56
|
+
//# sourceMappingURL=bound-secret-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bound-secret-file.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/bound-secret-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAWH;;;GAGG;AACH,MAAM,MAAM,uBAAuB;AACjC,6EAA6E;AAC3E;IAAE,KAAK,EAAE,QAAQ,CAAA;CAAE;AACrB,+BAA+B;GAC7B;IAAE,KAAK,EAAE,UAAU,CAAA;CAAE;AACvB,mEAAmE;GACjE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE;AACpB,+CAA+C;GAC7C;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM/D;AAOD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAuC5E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
import { closeSync, fsyncSync, ftruncateSync, openSync, readFileSync, unlinkSync, } from "node:fs";
|
|
22
|
+
/**
|
|
23
|
+
* Whether a later `readFile` of this path could still recover a secret.
|
|
24
|
+
* A read failure counts as unrecoverable: this process just read the file
|
|
25
|
+
* during hydrate, so losing access to it means the content is gone.
|
|
26
|
+
*/
|
|
27
|
+
export function boundSecretFileIsReadable(path) {
|
|
28
|
+
try {
|
|
29
|
+
return readFileSync(path, "utf8").trim() !== "";
|
|
30
|
+
}
|
|
31
|
+
catch (_a) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function errorReason(error) {
|
|
36
|
+
const code = error === null || error === void 0 ? void 0 : error.code;
|
|
37
|
+
return typeof code === "string" ? code : "unknown";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Remove a bind file's contents from disk, preferring unlink over an empty
|
|
41
|
+
* leftover. Callers must have already copied the value into `process.env`:
|
|
42
|
+
* this is destructive and there is no second bind until the control plane
|
|
43
|
+
* rewrites the file before the next hosted request.
|
|
44
|
+
*/
|
|
45
|
+
export function destroyBoundSecretFile(path) {
|
|
46
|
+
if (!boundSecretFileIsReadable(path)) {
|
|
47
|
+
// Nothing recoverable, so nothing to fail over. Still try to clear the
|
|
48
|
+
// empty leftover: whether that succeeds does not change the disposal,
|
|
49
|
+
// because there is no secret here either way.
|
|
50
|
+
try {
|
|
51
|
+
unlinkSync(path);
|
|
52
|
+
}
|
|
53
|
+
catch (_a) {
|
|
54
|
+
// Already gone, or a directory the guest cannot write. Both are fine.
|
|
55
|
+
}
|
|
56
|
+
return { state: "absent" };
|
|
57
|
+
}
|
|
58
|
+
let unlinkReason;
|
|
59
|
+
try {
|
|
60
|
+
unlinkSync(path);
|
|
61
|
+
if (!boundSecretFileIsReadable(path)) {
|
|
62
|
+
return { state: "unlinked" };
|
|
63
|
+
}
|
|
64
|
+
unlinkReason = "recreated";
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
unlinkReason = errorReason(error);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const fd = openSync(path, "r+");
|
|
71
|
+
try {
|
|
72
|
+
ftruncateSync(fd, 0);
|
|
73
|
+
fsyncSync(fd);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
closeSync(fd);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return {
|
|
81
|
+
state: "readable",
|
|
82
|
+
reason: `unlink ${unlinkReason}, truncate ${errorReason(error)}`,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return boundSecretFileIsReadable(path)
|
|
86
|
+
? { state: "readable", reason: `unlink ${unlinkReason}, truncate no-op` }
|
|
87
|
+
: { state: "wiped" };
|
|
88
|
+
}
|
|
@@ -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
|
*
|
|
@@ -19,6 +22,7 @@
|
|
|
19
22
|
* on demand from the API key (see `backend-client.ts`).
|
|
20
23
|
*/
|
|
21
24
|
import { z } from "zod";
|
|
25
|
+
import { type BoundSecretFileDisposal } from "./bound-secret-file.js";
|
|
22
26
|
export declare const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
|
|
23
27
|
export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
24
28
|
/**
|
|
@@ -65,9 +69,11 @@ export interface ResolvedApiKey {
|
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
71
|
* Hosted task-bind path. Not a secret: the snapshot may name this path.
|
|
68
|
-
* The binder writes the key here after restore
|
|
69
|
-
*
|
|
70
|
-
*
|
|
72
|
+
* The binder writes the key here after restore, and hosted admission /
|
|
73
|
+
* execution consume it into `process.env.CURSOR_API_KEY` and destroy the
|
|
74
|
+
* file before authored work — this is an IPC handoff, not a credential
|
|
75
|
+
* source July keeps reading. Override with `CURSOR_API_KEY_FILE`. A missing
|
|
76
|
+
* file is unsigned — self-hosted then uses `CURSOR_API_KEY` or stored login.
|
|
71
77
|
*/
|
|
72
78
|
export declare const DEFAULT_CURSOR_API_KEY_FILE: string;
|
|
73
79
|
/**
|
|
@@ -76,7 +82,35 @@ export declare const DEFAULT_CURSOR_API_KEY_FILE: string;
|
|
|
76
82
|
* listens before the binder drops the key; self-hosted falls through to
|
|
77
83
|
* env or login.
|
|
78
84
|
*/
|
|
85
|
+
export declare function resolveCursorApiKeyFilePath(filePath?: string, env?: NodeJS.ProcessEnv): string;
|
|
79
86
|
export declare function readApiKeyFromFile(filePath?: string): string | undefined;
|
|
87
|
+
export type BoundCursorApiKeyConsumeResult = {
|
|
88
|
+
/** The file supplied `CURSOR_API_KEY` on this call. */
|
|
89
|
+
applied: boolean;
|
|
90
|
+
disposal: BoundSecretFileDisposal;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Copy the task-bind key file into `process.env.CURSOR_API_KEY`, then destroy
|
|
94
|
+
* the file.
|
|
95
|
+
*
|
|
96
|
+
* Hosted v2 cannot set another process's environment from the binder, so it
|
|
97
|
+
* drops a tmpfs file. Teaching every reader to open that file misses authored
|
|
98
|
+
* `process.env.CURSOR_API_KEY` and leaves a secret on disk. Hosted admission /
|
|
99
|
+
* execution call this once per request, next to the deployment-secrets
|
|
100
|
+
* consume: after it returns, env-only readers work and the key is no longer
|
|
101
|
+
* recoverable from disk. The control plane re-binds before the next request.
|
|
102
|
+
*
|
|
103
|
+
* The env write always happens before the destroy, never the other way round.
|
|
104
|
+
* An already-set `CURSOR_API_KEY` is not overwritten, but the file is still
|
|
105
|
+
* destroyed — env is the source, the file is only the handoff.
|
|
106
|
+
*
|
|
107
|
+
* A `readable` disposal means the secret survived; callers on the hosted path
|
|
108
|
+
* must fail the request rather than run authored code.
|
|
109
|
+
*/
|
|
110
|
+
export declare function consumeBoundCursorApiKey(options?: {
|
|
111
|
+
filePath?: string;
|
|
112
|
+
env?: NodeJS.ProcessEnv;
|
|
113
|
+
}): BoundCursorApiKeyConsumeResult;
|
|
80
114
|
/**
|
|
81
115
|
* First present source wins. We define the order; operators do not.
|
|
82
116
|
* `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AACnE,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAUD,QAAA,MAAM,uBAAuB,EAAE,CAAC,CAAC,SAAS,CACxC;IAAE,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;CAAE,EAChD,OAAO,CAKP,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAED,6CAA6C;AAC7C,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAqBD,wBAAgB,yBAAyB,IAAI,iBAAiB,GAAG,SAAS,CAQzE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CACpD,iBAAiB,GAAG,SAAS,CAC9B,CAQA;AAED,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAO/D;AAMD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,EAAE,MACJ,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,CAAC,EAAE,MAAM,EACjB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAKR;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQxE;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GAAG,8BAA8B,CAqBjC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,cAAc,GAAG,SAAS,CAkB7B;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,CAAC,EAAE;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAEtC;AAED,yEAAyE;AACzE,eAAO,MAAM,YAAY,EAAE,MAAoH,CAAC;AAQhJ,MAAM,WAAW,UAAU;IACzB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAU9C;AAKD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmG3B"}
|
|
@@ -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
|
*
|
|
@@ -34,6 +37,7 @@ import { homedir } from "node:os";
|
|
|
34
37
|
import { dirname, join } from "node:path";
|
|
35
38
|
import { z } from "zod";
|
|
36
39
|
import { CLI_COMMAND_NAME } from "../distribution.js";
|
|
40
|
+
import { destroyBoundSecretFile, } from "./bound-secret-file.js";
|
|
37
41
|
export const DEFAULT_CURSOR_BACKEND_URL = "https://api2.cursor.sh";
|
|
38
42
|
export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
39
43
|
const DEFAULT_CURSOR_WEBSITE_URL = "https://cursor.com";
|
|
@@ -152,9 +156,11 @@ export function clearStoredCredentials() {
|
|
|
152
156
|
}
|
|
153
157
|
/**
|
|
154
158
|
* Hosted task-bind path. Not a secret: the snapshot may name this path.
|
|
155
|
-
* The binder writes the key here after restore
|
|
156
|
-
*
|
|
157
|
-
*
|
|
159
|
+
* The binder writes the key here after restore, and hosted admission /
|
|
160
|
+
* execution consume it into `process.env.CURSOR_API_KEY` and destroy the
|
|
161
|
+
* file before authored work — this is an IPC handoff, not a credential
|
|
162
|
+
* source July keeps reading. Override with `CURSOR_API_KEY_FILE`. A missing
|
|
163
|
+
* file is unsigned — self-hosted then uses `CURSOR_API_KEY` or stored login.
|
|
158
164
|
*/
|
|
159
165
|
export const DEFAULT_CURSOR_API_KEY_FILE = "/run/cursor/secrets/CURSOR_API_KEY";
|
|
160
166
|
/**
|
|
@@ -163,11 +169,14 @@ export const DEFAULT_CURSOR_API_KEY_FILE = "/run/cursor/secrets/CURSOR_API_KEY";
|
|
|
163
169
|
* listens before the binder drops the key; self-hosted falls through to
|
|
164
170
|
* env or login.
|
|
165
171
|
*/
|
|
166
|
-
export function
|
|
167
|
-
const configured = filePath !== null && filePath !== void 0 ? filePath :
|
|
168
|
-
|
|
172
|
+
export function resolveCursorApiKeyFilePath(filePath, env = process.env) {
|
|
173
|
+
const configured = filePath !== null && filePath !== void 0 ? filePath : env.CURSOR_API_KEY_FILE;
|
|
174
|
+
return configured !== undefined && configured.trim() !== ""
|
|
169
175
|
? configured.trim()
|
|
170
176
|
: DEFAULT_CURSOR_API_KEY_FILE;
|
|
177
|
+
}
|
|
178
|
+
export function readApiKeyFromFile(filePath) {
|
|
179
|
+
const path = resolveCursorApiKeyFilePath(filePath);
|
|
171
180
|
try {
|
|
172
181
|
const raw = readFileSync(path, "utf8").trim();
|
|
173
182
|
return raw === "" ? undefined : raw;
|
|
@@ -176,6 +185,47 @@ export function readApiKeyFromFile(filePath) {
|
|
|
176
185
|
return undefined;
|
|
177
186
|
}
|
|
178
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Copy the task-bind key file into `process.env.CURSOR_API_KEY`, then destroy
|
|
190
|
+
* the file.
|
|
191
|
+
*
|
|
192
|
+
* Hosted v2 cannot set another process's environment from the binder, so it
|
|
193
|
+
* drops a tmpfs file. Teaching every reader to open that file misses authored
|
|
194
|
+
* `process.env.CURSOR_API_KEY` and leaves a secret on disk. Hosted admission /
|
|
195
|
+
* execution call this once per request, next to the deployment-secrets
|
|
196
|
+
* consume: after it returns, env-only readers work and the key is no longer
|
|
197
|
+
* recoverable from disk. The control plane re-binds before the next request.
|
|
198
|
+
*
|
|
199
|
+
* The env write always happens before the destroy, never the other way round.
|
|
200
|
+
* An already-set `CURSOR_API_KEY` is not overwritten, but the file is still
|
|
201
|
+
* destroyed — env is the source, the file is only the handoff.
|
|
202
|
+
*
|
|
203
|
+
* A `readable` disposal means the secret survived; callers on the hosted path
|
|
204
|
+
* must fail the request rather than run authored code.
|
|
205
|
+
*/
|
|
206
|
+
export function consumeBoundCursorApiKey(options) {
|
|
207
|
+
var _a;
|
|
208
|
+
const env = (_a = options === null || options === void 0 ? void 0 : options.env) !== null && _a !== void 0 ? _a : process.env;
|
|
209
|
+
const path = resolveCursorApiKeyFilePath(options === null || options === void 0 ? void 0 : options.filePath, env);
|
|
210
|
+
const envKeyAlreadySet = env.CURSOR_API_KEY !== undefined && env.CURSOR_API_KEY.trim() !== "";
|
|
211
|
+
let raw = "";
|
|
212
|
+
try {
|
|
213
|
+
raw = readFileSync(path, "utf8").trim();
|
|
214
|
+
}
|
|
215
|
+
catch (_b) {
|
|
216
|
+
return { applied: false, disposal: { state: "absent" } };
|
|
217
|
+
}
|
|
218
|
+
if (raw === "") {
|
|
219
|
+
return { applied: false, disposal: destroyBoundSecretFile(path) };
|
|
220
|
+
}
|
|
221
|
+
if (!envKeyAlreadySet) {
|
|
222
|
+
env.CURSOR_API_KEY = raw;
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
applied: !envKeyAlreadySet,
|
|
226
|
+
disposal: destroyBoundSecretFile(path),
|
|
227
|
+
};
|
|
228
|
+
}
|
|
179
229
|
/**
|
|
180
230
|
* First present source wins. We define the order; operators do not.
|
|
181
231
|
* `--api-key` / `serve({ apiKey })` → `CURSOR_API_KEY` → `CURSOR_API_KEY_FILE`
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
/** Wire error code for a bind file that outlived its consume. */
|
|
18
|
+
export declare const BOUND_SECRETS_NOT_CONSUMED = "bound_secrets_not_consumed";
|
|
19
|
+
export type HostedBoundSecretsResult = {
|
|
20
|
+
ok: true;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
code: typeof BOUND_SECRETS_NOT_CONSUMED;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Hydrate `process.env` from both bind files and remove them from disk.
|
|
28
|
+
* Returns a failure when either secret is still readable afterwards.
|
|
29
|
+
*
|
|
30
|
+
* Both paths are platform constants, deliberately not the `CURSOR_API_KEY_FILE`
|
|
31
|
+
* override that {@link resolveApiKeySync} honors. That override is a read
|
|
32
|
+
* chain; this is a destructive consume. Following it here would let authored
|
|
33
|
+
* code redirect the destroy at a decoy path — reporting success while the real
|
|
34
|
+
* bind file stays live — and would delete an operator's own long-lived key
|
|
35
|
+
* file on a surface that points the variable at one.
|
|
36
|
+
*/
|
|
37
|
+
export declare function consumeHostedBoundSecrets(options?: {
|
|
38
|
+
apiKeyFilePath?: string;
|
|
39
|
+
deploymentSecretsFilePath?: string;
|
|
40
|
+
}): HostedBoundSecretsResult;
|
|
41
|
+
//# sourceMappingURL=hosted-bound-secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-bound-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-bound-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,OAAO,0BAA0B,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,wBAAwB,CA2B3B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
import { consumeBoundCursorApiKey, DEFAULT_CURSOR_API_KEY_FILE, } from "./credentials.js";
|
|
18
|
+
import { consumeBoundDeploymentSecrets, DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE, } from "./hosted-deployment-secrets.js";
|
|
19
|
+
/** Wire error code for a bind file that outlived its consume. */
|
|
20
|
+
export const BOUND_SECRETS_NOT_CONSUMED = "bound_secrets_not_consumed";
|
|
21
|
+
/**
|
|
22
|
+
* Hydrate `process.env` from both bind files and remove them from disk.
|
|
23
|
+
* Returns a failure when either secret is still readable afterwards.
|
|
24
|
+
*
|
|
25
|
+
* Both paths are platform constants, deliberately not the `CURSOR_API_KEY_FILE`
|
|
26
|
+
* override that {@link resolveApiKeySync} honors. That override is a read
|
|
27
|
+
* chain; this is a destructive consume. Following it here would let authored
|
|
28
|
+
* code redirect the destroy at a decoy path — reporting success while the real
|
|
29
|
+
* bind file stays live — and would delete an operator's own long-lived key
|
|
30
|
+
* file on a surface that points the variable at one.
|
|
31
|
+
*/
|
|
32
|
+
export function consumeHostedBoundSecrets(options) {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
const survivors = [];
|
|
35
|
+
const secretsPath = (_a = options === null || options === void 0 ? void 0 : options.deploymentSecretsFilePath) !== null && _a !== void 0 ? _a : DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE;
|
|
36
|
+
const secrets = consumeBoundDeploymentSecrets(secretsPath);
|
|
37
|
+
if (secrets.disposal.state === "readable") {
|
|
38
|
+
survivors.push(`${secretsPath} (${secrets.disposal.reason})`);
|
|
39
|
+
}
|
|
40
|
+
const apiKeyPath = (_b = options === null || options === void 0 ? void 0 : options.apiKeyFilePath) !== null && _b !== void 0 ? _b : DEFAULT_CURSOR_API_KEY_FILE;
|
|
41
|
+
const apiKey = consumeBoundCursorApiKey({ filePath: apiKeyPath });
|
|
42
|
+
if (apiKey.disposal.state === "readable") {
|
|
43
|
+
survivors.push(`${apiKeyPath} (${apiKey.disposal.reason})`);
|
|
44
|
+
}
|
|
45
|
+
if (survivors.length === 0) {
|
|
46
|
+
return { ok: true };
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
ok: false,
|
|
50
|
+
code: BOUND_SECRETS_NOT_CONSUMED,
|
|
51
|
+
message: `Task-bind secrets are still readable after being hydrated into the ` +
|
|
52
|
+
`environment, so authored work did not run: ${survivors.join(", ")}.`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -4,13 +4,27 @@
|
|
|
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
|
*/
|
|
11
|
+
import { type BoundSecretFileDisposal } from "./bound-secret-file.js";
|
|
9
12
|
export declare const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
|
|
13
|
+
export type BoundDeploymentSecretsConsumeResult = {
|
|
14
|
+
/** The document supplied values on this call. */
|
|
15
|
+
applied: boolean;
|
|
16
|
+
disposal: BoundSecretFileDisposal;
|
|
17
|
+
};
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
19
|
+
* Apply the bound document to `process.env`, then destroy it.
|
|
20
|
+
*
|
|
21
|
+
* The env refresh always runs first, so a failed destroy never costs the
|
|
22
|
+
* request its secrets. A malformed document is destroyed too: it carries no
|
|
23
|
+
* values this process can use, and leaving it on disk only leaves whatever
|
|
24
|
+
* the control plane did manage to write.
|
|
25
|
+
*
|
|
26
|
+
* A `readable` disposal means the document survived; hosted callers must fail
|
|
27
|
+
* the request rather than run authored code next to a live secrets file.
|
|
14
28
|
*/
|
|
15
|
-
export declare function
|
|
29
|
+
export declare function consumeBoundDeploymentSecrets(path?: string): BoundDeploymentSecretsConsumeResult;
|
|
16
30
|
//# sourceMappingURL=hosted-deployment-secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-deployment-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-deployment-secrets.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosted-deployment-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-deployment-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,2CAA2C,4DACG,CAAC;AAuD5D,MAAM,MAAM,mCAAmC,GAAG;IAChD,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,GAAE,MAAoD,GACzD,mCAAmC,CASrC"}
|
|
@@ -4,9 +4,12 @@
|
|
|
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
|
import { readFileSync } from "node:fs";
|
|
12
|
+
import { destroyBoundSecretFile, } from "./bound-secret-file.js";
|
|
10
13
|
export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE = "/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
|
|
11
14
|
const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
|
|
12
15
|
const appliedSecretNames = new Set();
|
|
@@ -39,15 +42,11 @@ function parseBoundSecrets(path) {
|
|
|
39
42
|
return secrets;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
+
* Apply the latest bound document to `process.env`. An empty valid document
|
|
46
|
+
* removes values loaded by an earlier bind after the deployment secret was
|
|
47
|
+
* unset, which is why the applied names are tracked across calls.
|
|
45
48
|
*/
|
|
46
|
-
|
|
47
|
-
const secrets = parseBoundSecrets(path);
|
|
48
|
-
if (secrets === undefined) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
49
|
+
function applyBoundSecrets(secrets) {
|
|
51
50
|
for (const name of appliedSecretNames) {
|
|
52
51
|
if (!(name in secrets)) {
|
|
53
52
|
delete process.env[name];
|
|
@@ -59,3 +58,24 @@ export function refreshBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYM
|
|
|
59
58
|
appliedSecretNames.add(name);
|
|
60
59
|
}
|
|
61
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Apply the bound document to `process.env`, then destroy it.
|
|
63
|
+
*
|
|
64
|
+
* The env refresh always runs first, so a failed destroy never costs the
|
|
65
|
+
* request its secrets. A malformed document is destroyed too: it carries no
|
|
66
|
+
* values this process can use, and leaving it on disk only leaves whatever
|
|
67
|
+
* the control plane did manage to write.
|
|
68
|
+
*
|
|
69
|
+
* A `readable` disposal means the document survived; hosted callers must fail
|
|
70
|
+
* the request rather than run authored code next to a live secrets file.
|
|
71
|
+
*/
|
|
72
|
+
export function consumeBoundDeploymentSecrets(path = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE) {
|
|
73
|
+
const secrets = parseBoundSecrets(path);
|
|
74
|
+
if (secrets !== undefined) {
|
|
75
|
+
applyBoundSecrets(secrets);
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
applied: secrets !== undefined,
|
|
79
|
+
disposal: destroyBoundSecretFile(path),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -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}.
|
|
@@ -12,4 +12,15 @@ export declare const DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE = "/run/
|
|
|
12
12
|
export declare function resolveDeploymentStoreSourceIdSync(env?: NodeJS.ProcessEnv): string | undefined;
|
|
13
13
|
/** Engine framework store: env, then task-bind file. */
|
|
14
14
|
export declare function resolveFrameworkStoreSourceIdSync(env?: NodeJS.ProcessEnv): string | undefined;
|
|
15
|
+
export type CursorManagedV2StoreIds = {
|
|
16
|
+
deploymentStoreSourceId: string;
|
|
17
|
+
frameworkStoreSourceId: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Resolve the complete managed-v2 store identity at the process boundary.
|
|
21
|
+
*
|
|
22
|
+
* Freeze snapshots construct storage before task bind, so callers keep this
|
|
23
|
+
* resolver lazy. Once an operation needs storage, both ids are mandatory.
|
|
24
|
+
*/
|
|
25
|
+
export declare function requireCursorManagedV2StoreIdsSync(env?: NodeJS.ProcessEnv): CursorManagedV2StoreIds;
|
|
15
26
|
//# sourceMappingURL=hosted-store-secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AA4B9D,4DAA4D;AAC5D,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,wDAAwD;AACxD,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB"}
|
|
1
|
+
{"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AA4B9D,4DAA4D;AAC5D,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,wDAAwD;AACxD,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,uBAAuB,CAYzB"}
|
|
@@ -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}.
|
|
@@ -46,3 +46,18 @@ export function resolveFrameworkStoreSourceIdSync(env = process.env) {
|
|
|
46
46
|
}
|
|
47
47
|
return readBoundSecretFile(FRAMEWORK_STORE_SOURCE_ID_FILE_ENV, DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE, env);
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the complete managed-v2 store identity at the process boundary.
|
|
51
|
+
*
|
|
52
|
+
* Freeze snapshots construct storage before task bind, so callers keep this
|
|
53
|
+
* resolver lazy. Once an operation needs storage, both ids are mandatory.
|
|
54
|
+
*/
|
|
55
|
+
export function requireCursorManagedV2StoreIdsSync(env = process.env) {
|
|
56
|
+
const deploymentStoreSourceId = resolveDeploymentStoreSourceIdSync(env);
|
|
57
|
+
const frameworkStoreSourceId = resolveFrameworkStoreSourceIdSync(env);
|
|
58
|
+
if (deploymentStoreSourceId === undefined ||
|
|
59
|
+
frameworkStoreSourceId === undefined) {
|
|
60
|
+
throw new Error("Cursor-managed AgentSDK v2 requires AGENT_SERVE_STORE_SOURCE_ID and AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID");
|
|
61
|
+
}
|
|
62
|
+
return { deploymentStoreSourceId, frameworkStoreSourceId };
|
|
63
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-account-mcp-auth.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-account-mcp-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"cursor-account-mcp-auth.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-account-mcp-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AAQpC,iFAAiF;AACjF,wBAAgB,mBAAmB,IAAI,MAAM,CAM5C;AAED,MAAM,WAAW,oCAAoC;IACnD,aAAa,EAAE,IAAI,CACjB,mBAAmB,EACnB,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,CAAC;IACzB,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/B,yEAAyE;IACzE,WAAW,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,kBAAkB;IAClB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sCAAsC;IACrD,0DAA0D;IAC1D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,oCAAoC,GACzC,OAAO,CAAC,sCAAsC,CAAC,CA8FjD;AA2DD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,MAAM,EAAE,IAAI,CACV,mBAAmB,EACnB,wBAAwB,GAAG,oBAAoB,CAChD,CAAC;IACF,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0C/B"}
|
|
@@ -23,6 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
};
|
|
24
24
|
import { LOG_PREFIX } from "./distribution.js";
|
|
25
25
|
import { openBrowser } from "./mcp-oauth.js";
|
|
26
|
+
import { sleep as defaultSleep } from "./sleep.js";
|
|
26
27
|
const DEFAULT_POLL_INTERVAL_MS = 3000;
|
|
27
28
|
const DEFAULT_POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
28
29
|
/** Same default the dashboard uses; MCP_OAUTH_REDIRECT_URI overrides for dev. */
|
|
@@ -33,9 +34,6 @@ export function mcpOauthRedirectUri() {
|
|
|
33
34
|
}
|
|
34
35
|
return "https://www.cursor.com/agents/mcp/oauth/callback";
|
|
35
36
|
}
|
|
36
|
-
function sleepMs(ms) {
|
|
37
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
38
|
-
}
|
|
39
37
|
/**
|
|
40
38
|
* Authorize the deployment service account for the connection's connectors.
|
|
41
39
|
* Already-authorized connectors are skipped; the rest get a browser OAuth
|
|
@@ -46,7 +44,7 @@ export function authorizeCursorAccountConnectors(args) {
|
|
|
46
44
|
var _a, _b, _c, _d, _e, _f;
|
|
47
45
|
const { backendClient, teamId, serviceAccountId, connectionName, out, err } = args;
|
|
48
46
|
const open = (_a = args.openBrowserImpl) !== null && _a !== void 0 ? _a : openBrowser;
|
|
49
|
-
const sleep = (_b = args.sleep) !== null && _b !== void 0 ? _b :
|
|
47
|
+
const sleep = (_b = args.sleep) !== null && _b !== void 0 ? _b : defaultSleep;
|
|
50
48
|
const pollIntervalMs = (_c = args.pollIntervalMs) !== null && _c !== void 0 ? _c : DEFAULT_POLL_INTERVAL_MS;
|
|
51
49
|
const pollTimeoutMs = (_d = args.pollTimeoutMs) !== null && _d !== void 0 ? _d : DEFAULT_POLL_TIMEOUT_MS;
|
|
52
50
|
const redirectUri = mcpOauthRedirectUri();
|