@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
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Cloud runtime"
|
|
3
|
-
description: "Run turns on Cursor cloud agents instead of the local harness: when to switch, what changes, and the patterns that hold up."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Cloud runtime
|
|
7
|
-
|
|
8
|
-
By default, turns execute on the Cursor SDK's local harness, on the same
|
|
9
|
-
machine as the server. Set `runtime: "cloud"` and turns execute on
|
|
10
|
-
Cursor cloud agents instead. They're ephemeral VMs that carry a repo
|
|
11
|
-
checkout, run `gh`, `git`, and tests for real, and scale past what one
|
|
12
|
-
host's disk and CPU can do. The serve host keeps handling routing, host
|
|
13
|
-
preparation, sessions, and bookkeeping.
|
|
14
|
-
|
|
15
|
-
A canonical use is a PR driver whose triage runs on cloud VMs. The
|
|
16
|
-
patterns in this guide come from running one against real PR traffic.
|
|
17
|
-
|
|
18
|
-
## When to switch
|
|
19
|
-
|
|
20
|
-
A guideline from running PR agents at scale: per-PR worktrees on the serve host
|
|
21
|
-
don't scale to hundreds of engineers opening PRs. When the job needs a
|
|
22
|
-
repo checkout at scale, use cloud. The signals:
|
|
23
|
-
|
|
24
|
-
- The agent must run repo commands (tests, builds, `git`) against many
|
|
25
|
-
different refs concurrently.
|
|
26
|
-
- Turns are long and heavy, and you don't want them competing with the
|
|
27
|
-
server for resources.
|
|
28
|
-
- The work product is a PR or branch the VM can push, not a local file.
|
|
29
|
-
|
|
30
|
-
Stay local when the agent is conversational, tool-driven against APIs,
|
|
31
|
-
or works over host-prepared evidence. Local turns are cheaper, start
|
|
32
|
-
faster, and support the full authored surface.
|
|
33
|
-
|
|
34
|
-
## Configure it
|
|
35
|
-
|
|
36
|
-
Cloud runtime is two fields on the agent config.
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
import { defineAgent } from "@cursor/july";
|
|
40
|
-
|
|
41
|
-
export default defineAgent({
|
|
42
|
-
runtime: "cloud",
|
|
43
|
-
cloud: {
|
|
44
|
-
repos: [{ url: "https://github.com/org/repo", startingRef: "main" }],
|
|
45
|
-
// env / envVars / … forwarded to the Cursor SDK
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
The host must be signed in (`agent-sdk login` or `CURSOR_API_KEY`).
|
|
51
|
-
|
|
52
|
-
> [!IMPORTANT]
|
|
53
|
-
> Cloud agents run against the Cursor backend under the signed-in
|
|
54
|
-
> account, and every wake spends real cloud-agent budget. Decide
|
|
55
|
-
> explicitly what may trigger one.
|
|
56
|
-
|
|
57
|
-
## What changes on cloud
|
|
58
|
-
|
|
59
|
-
Cloud turns run on a VM without your authored files, so the runtime
|
|
60
|
-
mapping shifts:
|
|
61
|
-
|
|
62
|
-
| Folder or file | Local runtime | Cloud runtime |
|
|
63
|
-
| --- | --- | --- |
|
|
64
|
-
| `instructions.*` | `AGENTS.md` in the session workspace | prepended to the first prompt |
|
|
65
|
-
| Server tools (`execution: "server"`) | in-process SDK custom tools | authenticated HTTP MCP back to the AgentSDK host, when `--public-url` or `--cloud-tools-url` is set |
|
|
66
|
-
| Agent tools (`execution: "agent"`) | scripts in the session workspace | catalog + script bodies on the first prompt |
|
|
67
|
-
| `skills/*` | `.cursor/skills/` in the workspace | native discovery after the first turn, from the hosted store or the signed-in account |
|
|
68
|
-
| `mcp-connections/*.ts` | SDK `mcpServers` | SDK `mcpServers` (peers need `--public-url`) |
|
|
69
|
-
| `host-connections/*.ts` | `ctx.host.mcp` only | `ctx.host.mcp` only |
|
|
70
|
-
| `sandbox/workspace/**` | seeded into the session workspace | ignored |
|
|
71
|
-
| Tool approvals (`needsApproval`) | supported | not supported; keep approval-gated tools on local turns |
|
|
72
|
-
|
|
73
|
-
Authored skills are discovered natively after the first cloud turn,
|
|
74
|
-
using the hosted store or the signed-in account.
|
|
75
|
-
|
|
76
|
-
Approvals are a local-runtime contract. On cloud, a `needsApproval` tool
|
|
77
|
-
call rides one HTTP MCP request from the VM, and a parked call would
|
|
78
|
-
hold that request open until it times out; there is no durable approval
|
|
79
|
-
flow for cloud turns.
|
|
80
|
-
|
|
81
|
-
Peer MCP connections need `--public-url` for cloud turns. Without one,
|
|
82
|
-
peers are omitted and the server warns at startup.
|
|
83
|
-
|
|
84
|
-
## Hybrid: local agent, cloud sessions
|
|
85
|
-
|
|
86
|
-
A local-runtime agent can still open cloud-attached sessions per send.
|
|
87
|
-
Channel handlers may pass a `cloud` block (repos pinned to a PR ref, say)
|
|
88
|
-
in `send` options, and Slack handlers may return `cloud` from a mention
|
|
89
|
-
hook. A PR driver works this way: chat stays local, and the `drive`
|
|
90
|
-
flow attaches the PR to a cloud VM. The agent-level `cloud` config is the
|
|
91
|
-
base that per-session options merge over.
|
|
92
|
-
|
|
93
|
-
## Patterns that hold up
|
|
94
|
-
|
|
95
|
-
These come from running a PR driver against real PR traffic:
|
|
96
|
-
|
|
97
|
-
- One cloud session per unit of work, keyed with a stable continuation
|
|
98
|
-
token (`pr:owner/repo#N`) so every wake lands on the same conversation.
|
|
99
|
-
- Keep the host deterministic: fetch briefs and metadata on the host,
|
|
100
|
-
send the VM a compact prompt, and let the VM re-read source of truth
|
|
101
|
-
with its own `gh` and `git` instead of trusting payload snapshots.
|
|
102
|
-
- Limit exposure: add repository allowlists on webhook channels,
|
|
103
|
-
because every wake spends the account's budget.
|
|
104
|
-
|
|
105
|
-
## Verify cloud agents
|
|
106
|
-
|
|
107
|
-
`agent-sdk run` and `eval` work unchanged. The trajectory records the
|
|
108
|
-
same event vocabulary plus `agent.bound` with the cloud URL, so you can
|
|
109
|
-
open the cloud conversation for any session. Cloud turns take minutes.
|
|
110
|
-
Pass generous `--timeout-ms` values, and keep curl timeouts long when
|
|
111
|
-
driving channels directly.
|
|
112
|
-
|
|
113
|
-
## What's next
|
|
114
|
-
|
|
115
|
-
Continue with these pages:
|
|
116
|
-
|
|
117
|
-
- [Agent config](../reference/agent-config.md): the `runtime` and
|
|
118
|
-
`cloud` fields
|
|
119
|
-
- [GitHub guide](./github.md): the webhook patterns that pair with
|
|
120
|
-
cloud triage
|
package/src/continuation.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public continuation-identity surface for `@cursor/july`.
|
|
3
|
-
*
|
|
4
|
-
* Omitted `continuation` on a channel constructor stays `/v1` (engine
|
|
5
|
-
* minting). Deploy onto the v2 control plane with a root architecture
|
|
6
|
-
* flag; omitted channels then inherit the kind `/v2` default:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* export default defineAgent({
|
|
10
|
-
* architecture: "v2",
|
|
11
|
-
* });
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Per-channel selectors still override type (`"github.issue/v2"`,
|
|
15
|
-
* `"github.none/v2"`). Other `/v2` selectors: `"slack.thread/v2"`,
|
|
16
|
-
* `"origin.pr/v2"`, `"deployments.deployment/v2"`, `"none/v2"`.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export type {
|
|
20
|
-
ContinuationBuiltin,
|
|
21
|
-
ContinuationClaim,
|
|
22
|
-
ContinuationIdentity,
|
|
23
|
-
ContinuationProtocolVersion,
|
|
24
|
-
ContinuationSelector,
|
|
25
|
-
ConversationType,
|
|
26
|
-
MailboxContinuation,
|
|
27
|
-
ParsedContinuation,
|
|
28
|
-
} from "./internal/continuation-identity.js";
|
|
29
|
-
export {
|
|
30
|
-
BUILTINS,
|
|
31
|
-
bindMailboxContinuationSend,
|
|
32
|
-
builtinForType,
|
|
33
|
-
CONTINUATION_SELECTORS,
|
|
34
|
-
continuationSource,
|
|
35
|
-
defaultContinuationSelector,
|
|
36
|
-
extractContinuation,
|
|
37
|
-
formatConversationKey,
|
|
38
|
-
handshakeContinuation,
|
|
39
|
-
isContinuationSelector,
|
|
40
|
-
isV2DurableContinuationKey,
|
|
41
|
-
mintClaim,
|
|
42
|
-
newEvtKey,
|
|
43
|
-
normalizeIdentity,
|
|
44
|
-
parseContinuationSelector,
|
|
45
|
-
resolveContinuation,
|
|
46
|
-
resolveV2Key,
|
|
47
|
-
stampMailboxContinuation,
|
|
48
|
-
V2EngineError,
|
|
49
|
-
} from "./internal/continuation-identity.js";
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/** The Cursor SDK surface the tools share: auth, model, result views. */
|
|
2
|
-
|
|
3
|
-
import type { ModelSelection, Run, RunStatus, SDKAgentInfo } from "@cursor/sdk";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import {
|
|
6
|
-
cursorWebsiteUrl,
|
|
7
|
-
resolveApiKeySync,
|
|
8
|
-
SIGN_IN_HINT,
|
|
9
|
-
} from "../../../internal/cursor/credentials.js";
|
|
10
|
-
import { toModelSelection } from "../../../internal/sdk-runner.js";
|
|
11
|
-
import extension from "../extension.js";
|
|
12
|
-
|
|
13
|
-
export const agentRef: z.ZodObject<{ agentId: z.ZodString }> = z.object({
|
|
14
|
-
agentId: z.string().describe("Agent id (`bc-...`) returned by a launch."),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export function apiKey(): string {
|
|
18
|
-
const key = resolveApiKeySync({ apiKey: extension.config.apiKey });
|
|
19
|
-
if (key === undefined) {
|
|
20
|
-
throw new Error(`Cloud agents need a Cursor API key. ${SIGN_IN_HINT}`);
|
|
21
|
-
}
|
|
22
|
-
return key.apiKey;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function modelSelection(): ModelSelection | undefined {
|
|
26
|
-
const { model } = extension.config;
|
|
27
|
-
return model === undefined ? undefined : toModelSelection(model);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function agentUrl(agentId: string): string {
|
|
31
|
-
return `${cursorWebsiteUrl()}/agents/${agentId}`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Type aliases, not interfaces: views flow into tool results.
|
|
35
|
-
export type AgentView = {
|
|
36
|
-
agentId: string;
|
|
37
|
-
name: string;
|
|
38
|
-
archived: boolean | undefined;
|
|
39
|
-
url: string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export type RunView = {
|
|
43
|
-
id: string;
|
|
44
|
-
status: RunStatus;
|
|
45
|
-
result: string | undefined;
|
|
46
|
-
error: string | undefined;
|
|
47
|
-
durationMs: number | undefined;
|
|
48
|
-
branches:
|
|
49
|
-
| Array<{
|
|
50
|
-
repoUrl: string;
|
|
51
|
-
branch: string | undefined;
|
|
52
|
-
prUrl: string | undefined;
|
|
53
|
-
}>
|
|
54
|
-
| undefined;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export function agentView(info: SDKAgentInfo): AgentView {
|
|
58
|
-
return {
|
|
59
|
-
agentId: info.agentId,
|
|
60
|
-
name: info.name,
|
|
61
|
-
archived: info.archived,
|
|
62
|
-
url: agentUrl(info.agentId),
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function runView(run: Run): RunView {
|
|
67
|
-
return {
|
|
68
|
-
id: run.id,
|
|
69
|
-
status: run.status,
|
|
70
|
-
result: run.result,
|
|
71
|
-
error: run.error?.message,
|
|
72
|
-
durationMs: run.durationMs,
|
|
73
|
-
branches: run.git?.branches.map((branch) => ({
|
|
74
|
-
repoUrl: branch.repoUrl,
|
|
75
|
-
branch: branch.branch,
|
|
76
|
-
prUrl: branch.prUrl,
|
|
77
|
-
})),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Agent } from "@cursor/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { defineTool } from "../../../tools.js";
|
|
4
|
-
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
-
import extension from "../extension.js";
|
|
6
|
-
import { agentRef, apiKey } from "../lib/cloud.js";
|
|
7
|
-
import { assertOwned } from "../lib/fleet.js";
|
|
8
|
-
|
|
9
|
-
const follow_up: ToolDefinition = defineTool({
|
|
10
|
-
description:
|
|
11
|
-
"Send a follow-up prompt to a cloud agent you launched. The agent must be idle; a busy agent rejects the follow-up.",
|
|
12
|
-
effect: "write",
|
|
13
|
-
needsApproval: () => extension.config.needsApproval,
|
|
14
|
-
inputSchema: agentRef.extend({
|
|
15
|
-
prompt: z.string().min(1).describe("The follow-up instruction."),
|
|
16
|
-
}),
|
|
17
|
-
async execute(input, ctx) {
|
|
18
|
-
await assertOwned(ctx, input.agentId);
|
|
19
|
-
const agent = await Agent.resume(input.agentId, { apiKey: apiKey() });
|
|
20
|
-
try {
|
|
21
|
-
const run = await agent.send(input.prompt);
|
|
22
|
-
return { agentId: input.agentId, runId: run.id, status: run.status };
|
|
23
|
-
} finally {
|
|
24
|
-
agent.close();
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export default follow_up;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Agent } from "@cursor/sdk";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { defineTool } from "../../../tools.js";
|
|
4
|
-
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
-
import { agentRef, agentView, apiKey, runView } from "../lib/cloud.js";
|
|
6
|
-
import { assertOwned } from "../lib/fleet.js";
|
|
7
|
-
|
|
8
|
-
const status: ToolDefinition = defineTool({
|
|
9
|
-
description:
|
|
10
|
-
"Read a cloud agent you launched and its latest run: state, final result text, error, and pushed branches or pull requests.",
|
|
11
|
-
effect: "read",
|
|
12
|
-
inputSchema: agentRef.extend({
|
|
13
|
-
runId: z
|
|
14
|
-
.string()
|
|
15
|
-
.optional()
|
|
16
|
-
.describe("A specific run; defaults to the latest."),
|
|
17
|
-
}),
|
|
18
|
-
async execute(input, ctx) {
|
|
19
|
-
await assertOwned(ctx, input.agentId);
|
|
20
|
-
const key = apiKey();
|
|
21
|
-
const cloud = { runtime: "cloud", apiKey: key } as const;
|
|
22
|
-
const info = await Agent.get(input.agentId, { apiKey: key });
|
|
23
|
-
// The run list carries no result text; fetch the run itself.
|
|
24
|
-
const runId =
|
|
25
|
-
input.runId ??
|
|
26
|
-
(await Agent.listRuns(input.agentId, { ...cloud, limit: 1 })).items[0]
|
|
27
|
-
?.id;
|
|
28
|
-
const run =
|
|
29
|
-
runId === undefined
|
|
30
|
-
? undefined
|
|
31
|
-
: await Agent.getRun(runId, { ...cloud, agentId: input.agentId });
|
|
32
|
-
return {
|
|
33
|
-
...agentView(info),
|
|
34
|
-
run: run === undefined ? undefined : runView(run),
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export default status;
|
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The grokbot runtime's remote client — a thin client like `"cloud"`.
|
|
3
|
-
* Turns execute on Cursor's hosted Grok Bot (Sand) harness (the Temporal
|
|
4
|
-
* turn workflow and the account's own computer), reached through the
|
|
5
|
-
* public `/v0/grokbot` session API.
|
|
6
|
-
*
|
|
7
|
-
* Sand delivery contract, preserved end to end: only content the agent
|
|
8
|
-
* delivers through SendToUser becomes the user-visible reply. The hosted
|
|
9
|
-
* transcript exposes those deliveries as `send-message` entries; the
|
|
10
|
-
* agent's internal monologue never appears in the transcript, so it can
|
|
11
|
-
* never leak into the session reply.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { randomUUID } from "node:crypto";
|
|
15
|
-
import type { RunnerTurnRequest, TurnOutcome } from "../../types.js";
|
|
16
|
-
import {
|
|
17
|
-
cursorExternalApiUrl,
|
|
18
|
-
resolveApiKeySync,
|
|
19
|
-
} from "../cursor/credentials.js";
|
|
20
|
-
import type { AgentRunner } from "./../sdk-runner.js";
|
|
21
|
-
|
|
22
|
-
export interface GrokBotRunnerOptions {
|
|
23
|
-
/** Cursor API key. Resolved as option → env → file → stored login. */
|
|
24
|
-
apiKey?: string;
|
|
25
|
-
/** Test seam. Defaults to global fetch. */
|
|
26
|
-
fetchImpl?: typeof fetch;
|
|
27
|
-
/**
|
|
28
|
-
* Test seam. Defaults to {@link cursorExternalApiUrl} (`api.cursor.com`).
|
|
29
|
-
* `/v0/grokbot` is an external-api microlith route — it 404s on api2.
|
|
30
|
-
*/
|
|
31
|
-
backendUrl?: string;
|
|
32
|
-
/** Test seam. Poll interval while a turn runs. */
|
|
33
|
-
pollIntervalMs?: number;
|
|
34
|
-
/** Test seam. Hard turn deadline. */
|
|
35
|
-
turnTimeoutMs?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** One transcript entry as `/v0/grokbot/sessions/:id/entries` exposes it. */
|
|
39
|
-
export interface GrokBotEntry {
|
|
40
|
-
seq: string;
|
|
41
|
-
updatedSeq: string;
|
|
42
|
-
kind: string;
|
|
43
|
-
role?: string;
|
|
44
|
-
text?: string;
|
|
45
|
-
createdAtMs: number;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface GrokBotTurnStatus {
|
|
49
|
-
idle: boolean;
|
|
50
|
-
inFlight: boolean;
|
|
51
|
-
queued: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
interface EntriesPage {
|
|
55
|
-
entries: GrokBotEntry[];
|
|
56
|
-
latestUpdatedSeq: string;
|
|
57
|
-
turn: GrokBotTurnStatus;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface HostedAgent {
|
|
61
|
-
/** The `/v0/grokbot` session id (the hosted agent's durable id). */
|
|
62
|
-
remoteId: string;
|
|
63
|
-
/** Transcript cursor: newest `updatedSeq` this client has consumed. */
|
|
64
|
-
lastUpdatedSeq: bigint;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const DEFAULT_POLL_INTERVAL_MS = 750;
|
|
68
|
-
const DEFAULT_TURN_TIMEOUT_MS = 20 * 60 * 1000;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Idle polls required after a send before the turn is considered settled
|
|
72
|
-
* when the workflow never reported busy — covers the window between the
|
|
73
|
-
* accepted dispatch and the workflow picking the signal up.
|
|
74
|
-
*/
|
|
75
|
-
const MIN_IDLE_POLLS_WITHOUT_BUSY = 4;
|
|
76
|
-
|
|
77
|
-
class GrokBotApiError extends Error {
|
|
78
|
-
constructor(
|
|
79
|
-
readonly status: number,
|
|
80
|
-
readonly path: string,
|
|
81
|
-
body: string
|
|
82
|
-
) {
|
|
83
|
-
super(
|
|
84
|
-
`Grok Bot API ${path} failed (HTTP ${status}): ${body.slice(0, 300)}`
|
|
85
|
-
);
|
|
86
|
-
this.name = "GrokBotApiError";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Minimal `/v0/grokbot` client: bearer API key, JSON in/out. */
|
|
91
|
-
class GrokBotApiClient {
|
|
92
|
-
private readonly fetchImpl: typeof fetch;
|
|
93
|
-
private readonly baseUrl: string;
|
|
94
|
-
private readonly apiKey: string;
|
|
95
|
-
|
|
96
|
-
constructor(options: GrokBotRunnerOptions) {
|
|
97
|
-
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
98
|
-
this.baseUrl = (options.backendUrl ?? cursorExternalApiUrl()).replace(
|
|
99
|
-
/\/$/,
|
|
100
|
-
""
|
|
101
|
-
);
|
|
102
|
-
const apiKey = resolveApiKeySync({
|
|
103
|
-
apiKey: options.apiKey,
|
|
104
|
-
backendUrl: options.backendUrl,
|
|
105
|
-
})?.apiKey;
|
|
106
|
-
if (apiKey === undefined || apiKey === "") {
|
|
107
|
-
throw new Error(
|
|
108
|
-
'runtime: "grokbot" needs a Cursor API key (CURSOR_API_KEY, CURSOR_API_KEY_FILE, or agent-sdk login) to reach the hosted Grok Bot harness.'
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
this.apiKey = apiKey;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private async request<T>(args: {
|
|
115
|
-
method: string;
|
|
116
|
-
path: string;
|
|
117
|
-
body?: unknown;
|
|
118
|
-
}): Promise<T> {
|
|
119
|
-
const headers: Record<string, string> = {
|
|
120
|
-
authorization: `Bearer ${this.apiKey}`,
|
|
121
|
-
};
|
|
122
|
-
if (args.body !== undefined) {
|
|
123
|
-
headers["content-type"] = "application/json";
|
|
124
|
-
}
|
|
125
|
-
const response = await this.fetchImpl(`${this.baseUrl}${args.path}`, {
|
|
126
|
-
method: args.method,
|
|
127
|
-
headers,
|
|
128
|
-
body: args.body === undefined ? undefined : JSON.stringify(args.body),
|
|
129
|
-
});
|
|
130
|
-
if (!response.ok) {
|
|
131
|
-
throw new GrokBotApiError(
|
|
132
|
-
response.status,
|
|
133
|
-
args.path,
|
|
134
|
-
await response.text().catch(() => "")
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return (await response.json()) as T;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async createSession(args: {
|
|
141
|
-
name: string;
|
|
142
|
-
instructions: string | undefined;
|
|
143
|
-
}): Promise<{ id: string; latestUpdatedSeq: string }> {
|
|
144
|
-
return await this.request({
|
|
145
|
-
method: "POST",
|
|
146
|
-
path: "/v0/grokbot/sessions",
|
|
147
|
-
body: { name: args.name, instructions: args.instructions },
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async sendMessage(args: {
|
|
152
|
-
sessionId: string;
|
|
153
|
-
text: string;
|
|
154
|
-
}): Promise<{ messageId: string; delivery: string }> {
|
|
155
|
-
return await this.request({
|
|
156
|
-
method: "POST",
|
|
157
|
-
path: `/v0/grokbot/sessions/${args.sessionId}/messages`,
|
|
158
|
-
body: { text: args.text, messageId: randomUUID() },
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
async listEntries(args: {
|
|
163
|
-
sessionId: string;
|
|
164
|
-
afterUpdatedSeq: bigint;
|
|
165
|
-
}): Promise<EntriesPage> {
|
|
166
|
-
return await this.request({
|
|
167
|
-
method: "GET",
|
|
168
|
-
path: `/v0/grokbot/sessions/${args.sessionId}/entries?afterUpdatedSeq=${args.afterUpdatedSeq}`,
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
async interrupt(args: { sessionId: string; reason: string }): Promise<void> {
|
|
173
|
-
await this.request({
|
|
174
|
-
method: "POST",
|
|
175
|
-
path: `/v0/grokbot/sessions/${args.sessionId}/interrupt`,
|
|
176
|
-
body: { reason: args.reason },
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export class GrokBotRunner implements AgentRunner {
|
|
182
|
-
/**
|
|
183
|
-
* One hosted Grok Bot agent per SDK agent name — the backend
|
|
184
|
-
* get-or-creates by name, so every SDK session forwards into the same
|
|
185
|
-
* hosted agent and conversation, and the Grok Bot app shows one agent
|
|
186
|
-
* rather than one per session.
|
|
187
|
-
*/
|
|
188
|
-
private readonly agents = new Map<string, HostedAgent>();
|
|
189
|
-
/**
|
|
190
|
-
* Per-hosted-agent turn chain. Sessions share one hosted conversation
|
|
191
|
-
* and one transcript cursor, so turns run one at a time per agent:
|
|
192
|
-
* deliveries attribute to the turn that sent them, and an abort only
|
|
193
|
-
* interrupts its own turn — mirroring the hosted workflow's own queue.
|
|
194
|
-
*/
|
|
195
|
-
private readonly turns = new Map<string, Promise<unknown>>();
|
|
196
|
-
private client: GrokBotApiClient | undefined;
|
|
197
|
-
|
|
198
|
-
constructor(private readonly options: GrokBotRunnerOptions = {}) {}
|
|
199
|
-
|
|
200
|
-
async runTurn(request: RunnerTurnRequest): Promise<TurnOutcome> {
|
|
201
|
-
if (request.runtime !== "grokbot") {
|
|
202
|
-
throw new Error(
|
|
203
|
-
`Session ${request.sessionId} is a ${request.runtime} turn, which the Grok Bot runner cannot execute.`
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
if (request.images !== undefined && request.images.length > 0) {
|
|
207
|
-
// Attachments ride the hosted box's upload path, which the /v0
|
|
208
|
-
// session API does not expose yet. Refuse rather than silently
|
|
209
|
-
// dropping what the user attached.
|
|
210
|
-
throw new Error(
|
|
211
|
-
"Image attachments are not supported on grokbot turns yet."
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
const name = hostedAgentName(request);
|
|
215
|
-
const previous = this.turns.get(name) ?? Promise.resolve();
|
|
216
|
-
const run = previous.then(() => this.executeTurn(request));
|
|
217
|
-
this.turns.set(
|
|
218
|
-
name,
|
|
219
|
-
run.catch(() => {})
|
|
220
|
-
);
|
|
221
|
-
return await run;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
private async executeTurn(request: RunnerTurnRequest): Promise<TurnOutcome> {
|
|
225
|
-
const signal = request.signal;
|
|
226
|
-
if (signal?.aborted === true) {
|
|
227
|
-
return { status: "cancelled" };
|
|
228
|
-
}
|
|
229
|
-
const client = this.ensureClient();
|
|
230
|
-
const entry = await this.getAgent(client, request);
|
|
231
|
-
|
|
232
|
-
const send = await client.sendMessage({
|
|
233
|
-
sessionId: entry.remoteId,
|
|
234
|
-
text: request.prompt,
|
|
235
|
-
});
|
|
236
|
-
if (
|
|
237
|
-
send.delivery !== "accepted_temporal" &&
|
|
238
|
-
send.delivery !== "duplicate"
|
|
239
|
-
) {
|
|
240
|
-
throw new Error(
|
|
241
|
-
`The hosted Grok Bot harness did not accept the turn (delivery: ${send.delivery}).`
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const pollIntervalMs =
|
|
246
|
-
this.options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
247
|
-
const turnTimeoutMs = this.options.turnTimeoutMs ?? DEFAULT_TURN_TIMEOUT_MS;
|
|
248
|
-
const deadline = Date.now() + turnTimeoutMs;
|
|
249
|
-
const delivered: string[] = [];
|
|
250
|
-
let sawBusy = false;
|
|
251
|
-
let idlePolls = 0;
|
|
252
|
-
|
|
253
|
-
while (true) {
|
|
254
|
-
// On abort: interrupt the hosted run, drain entries once so a reply
|
|
255
|
-
// that already landed still streams out, then cancel.
|
|
256
|
-
const aborted = isAborted(signal);
|
|
257
|
-
if (aborted) {
|
|
258
|
-
await client
|
|
259
|
-
.interrupt({
|
|
260
|
-
sessionId: entry.remoteId,
|
|
261
|
-
reason: "The user sent a new message.",
|
|
262
|
-
})
|
|
263
|
-
.catch(() => {});
|
|
264
|
-
}
|
|
265
|
-
const page = await client.listEntries({
|
|
266
|
-
sessionId: entry.remoteId,
|
|
267
|
-
afterUpdatedSeq: entry.lastUpdatedSeq,
|
|
268
|
-
});
|
|
269
|
-
entry.lastUpdatedSeq = BigInt(page.latestUpdatedSeq);
|
|
270
|
-
for (const item of page.entries) {
|
|
271
|
-
if (item.kind !== "send-message" || item.text === undefined) {
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
const delta = delivered.length === 0 ? item.text : `\n\n${item.text}`;
|
|
275
|
-
delivered.push(item.text);
|
|
276
|
-
// The emit callback may be async; a rejection must never escape
|
|
277
|
-
// the poll loop.
|
|
278
|
-
void Promise.resolve(
|
|
279
|
-
request.onUpdate({ type: "text-delta", text: delta })
|
|
280
|
-
).catch(() => {});
|
|
281
|
-
}
|
|
282
|
-
if (aborted) {
|
|
283
|
-
return { status: "cancelled" };
|
|
284
|
-
}
|
|
285
|
-
if (page.turn.inFlight || page.turn.queued > 0) {
|
|
286
|
-
sawBusy = true;
|
|
287
|
-
} else if (page.turn.idle) {
|
|
288
|
-
idlePolls += 1;
|
|
289
|
-
if (sawBusy || idlePolls >= MIN_IDLE_POLLS_WITHOUT_BUSY) {
|
|
290
|
-
return {
|
|
291
|
-
status: "finished",
|
|
292
|
-
result: delivered.length === 0 ? undefined : delivered.join("\n\n"),
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
if (Date.now() >= deadline) {
|
|
297
|
-
throw new Error(
|
|
298
|
-
`The grokbot turn for session ${request.sessionId} did not settle within ${Math.round(turnTimeoutMs / 60_000)} minutes.`
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
await this.sleep(pollIntervalMs, signal);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
async dispose(): Promise<void> {
|
|
306
|
-
// Hosted agents live server-side (the account's Grok Bot agents);
|
|
307
|
-
// nothing in this process holds conversation state.
|
|
308
|
-
this.agents.clear();
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
private ensureClient(): GrokBotApiClient {
|
|
312
|
-
this.client ??= new GrokBotApiClient(this.options);
|
|
313
|
-
return this.client;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
private async getAgent(
|
|
317
|
-
client: GrokBotApiClient,
|
|
318
|
-
request: RunnerTurnRequest
|
|
319
|
-
): Promise<HostedAgent> {
|
|
320
|
-
const name = hostedAgentName(request);
|
|
321
|
-
const existing = this.agents.get(name);
|
|
322
|
-
if (existing !== undefined) {
|
|
323
|
-
return existing;
|
|
324
|
-
}
|
|
325
|
-
// Get-or-create: a reconnect (new process, same agent name) lands on
|
|
326
|
-
// the existing hosted agent. The returned tail seq starts the cursor
|
|
327
|
-
// after the hosted conversation's history so an old transcript never
|
|
328
|
-
// replays into this turn's reply.
|
|
329
|
-
const created = await client.createSession({
|
|
330
|
-
name,
|
|
331
|
-
instructions: request.instructions,
|
|
332
|
-
});
|
|
333
|
-
const entry: HostedAgent = {
|
|
334
|
-
remoteId: created.id,
|
|
335
|
-
lastUpdatedSeq: BigInt(created.latestUpdatedSeq),
|
|
336
|
-
};
|
|
337
|
-
this.agents.set(name, entry);
|
|
338
|
-
return entry;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
private async sleep(
|
|
342
|
-
ms: number,
|
|
343
|
-
signal: AbortSignal | undefined
|
|
344
|
-
): Promise<void> {
|
|
345
|
-
await new Promise<void>((resolve) => {
|
|
346
|
-
const timer = setTimeout(() => {
|
|
347
|
-
signal?.removeEventListener("abort", onAbort);
|
|
348
|
-
resolve();
|
|
349
|
-
}, ms);
|
|
350
|
-
const onAbort = (): void => {
|
|
351
|
-
clearTimeout(timer);
|
|
352
|
-
resolve();
|
|
353
|
-
};
|
|
354
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
function hostedAgentName(request: RunnerTurnRequest): string {
|
|
360
|
-
return request.agentName ?? "Agent SDK agent";
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* `AbortSignal.aborted` is readonly to TypeScript, so an inline recheck
|
|
365
|
-
* after an await narrows to the stale pre-await value; the function
|
|
366
|
-
* boundary keeps the recheck honest.
|
|
367
|
-
*/
|
|
368
|
-
function isAborted(signal: AbortSignal | undefined): boolean {
|
|
369
|
-
return signal?.aborted === true;
|
|
370
|
-
}
|