@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
package/dist/docs/llms-full.txt
CHANGED
|
@@ -506,11 +506,12 @@ name. For example, `agent/tools/get_weather.ts` creates a tool named
|
|
|
506
506
|
| `agent/host-connections/<name>.ts` | Privileged MCP servers for host tools only |
|
|
507
507
|
| `agent/channels/*.ts` | HTTP, Slack, and GitHub entry points |
|
|
508
508
|
| `agent/ab.ts` or `agent/ab/*.ts` | Sticky variants and live performance metrics |
|
|
509
|
+
| `agent/result.ts` | Optional host `commit` on the final assistant text |
|
|
509
510
|
| `evals/**/*.eval.ts` | Repeatable checks at the project root |
|
|
510
511
|
|
|
511
|
-
Other folders add subagents, hooks, schedules, and workspace
|
|
512
|
-
don't register them elsewhere. Run `agent-sdk validate` to
|
|
513
|
-
invalid files before serving the project.
|
|
512
|
+
Other folders add subagents, extensions, hooks, schedules, and workspace
|
|
513
|
+
files. You don't register them elsewhere. Run `agent-sdk validate` to
|
|
514
|
+
catch invalid files before serving the project.
|
|
514
515
|
|
|
515
516
|
See [Project layout](/docs/reference/project-layout.md) for the folder
|
|
516
517
|
structure.
|
|
@@ -581,7 +582,7 @@ Choose a runtime in `agent/agent.ts`:
|
|
|
581
582
|
| Approvals (`needsApproval`) | Supported | Not supported (local runtime only) |
|
|
582
583
|
| Agent tool scripts | Supported | Supported |
|
|
583
584
|
| Skills | Added to the session workspace | Available automatically |
|
|
584
|
-
| Seeded files | Added to the session workspace |
|
|
585
|
+
| Seeded files | Added to the session workspace | Available in a shared directory the first prompt names |
|
|
585
586
|
| Repository | You provide it | The cloud agent checks it out |
|
|
586
587
|
|
|
587
588
|
Use the local runtime when the host has the tools and files the agent
|
|
@@ -589,8 +590,6 @@ needs. Use the cloud runtime when each turn needs an isolated repository
|
|
|
589
590
|
checkout. `agent-sdk validate` warns when a cloud agent uses a
|
|
590
591
|
local-only capability.
|
|
591
592
|
|
|
592
|
-
See [Cloud runtime](/docs/guides/cloud-runtime.md) for setup and trade-offs.
|
|
593
|
-
|
|
594
593
|
## What files can a local session access?
|
|
595
594
|
|
|
596
595
|
Each local session gets its own workspace. The Agent SDK writes the
|
|
@@ -638,7 +637,6 @@ See [Agent-to-agent](/docs/guides/agent-to-agent.md) for a complete example.
|
|
|
638
637
|
- [Sessions and streaming](/docs/reference/sessions.md)
|
|
639
638
|
- [Channels](/docs/reference/channels.md)
|
|
640
639
|
- [Live A/B metrics](/docs/ab.md)
|
|
641
|
-
- [Cloud runtime](/docs/guides/cloud-runtime.md)
|
|
642
640
|
|
|
643
641
|
---
|
|
644
642
|
|
|
@@ -1100,8 +1098,8 @@ Source: /docs/design/runtime-abstraction.md
|
|
|
1100
1098
|
> until this document has been reviewed.
|
|
1101
1099
|
> **Audience:** Agent SDK and cursor-sdk maintainers; change-monitor as the
|
|
1102
1100
|
> first consumer that is already faking a third runtime.
|
|
1103
|
-
> **Companions:** [
|
|
1104
|
-
> user-facing contract),
|
|
1101
|
+
> **Companions:** [agent-config.md](/docs/reference/agent-config.md#choose-a-runtime)
|
|
1102
|
+
> (today's user-facing contract),
|
|
1105
1103
|
> [factory/change-monitor/docs/tools.md](https://github.com/cursor/cursor/blob/main/factory/change-monitor/docs/tools.md)
|
|
1106
1104
|
> (why change-monitor is pinned to local),
|
|
1107
1105
|
> [factory/change-monitor/docs/computer-use.md](https://github.com/cursor/cursor/blob/main/factory/change-monitor/docs/computer-use.md)
|
|
@@ -2699,7 +2697,6 @@ sandbox })`, next to `cloudRuntime({ repos })`. Sibling
|
|
|
2699
2697
|
| Page | Change |
|
|
2700
2698
|
|---|---|
|
|
2701
2699
|
| [reference/agent-config.md](/docs/reference/agent-config.md) | `runtime` type becomes constructors **or** the deprecated string. Table + "Choose a runtime" show `localRuntime(opts)` / `cloudRuntime(opts)` / `virtualRuntime(fs)` first. Move cwd / sandbox / workspaceDir onto the `localRuntime` section. Mark sibling `local` / `cloud` and string `runtime` deprecated. |
|
|
2702
|
-
| [guides/cloud-runtime.md](/docs/guides/cloud-runtime.md) | Open with `cloudRuntime({ repos })`. Keep `runtime: "cloud"` as the still-supported form. Cloud is a turn host, not a filesystem. Hybrid is `send({ runtime: cloudRuntime(opts) })`; local overlay is `send({ runtime: localRuntime(opts) })`. `send({ cloud })` / `send({ workspaceDir })` deprecated. |
|
|
2703
2700
|
| [concepts.md](/docs/concepts.md) | Local vs cloud table: same facts, constructor names. Add one line that `virtualRuntime` is local-with-your-files, not a third host. |
|
|
2704
2701
|
|
|
2705
2702
|
**New page**
|
|
@@ -3009,17 +3006,19 @@ Drive the agent with `t.send(message, options?)`. It runs one turn and
|
|
|
3009
3006
|
waits for the session to park or fail. Multiple sends in one case share
|
|
3010
3007
|
the session, which is how you write multi-turn evals.
|
|
3011
3008
|
|
|
3012
|
-
Each `t.send` resolves to a turn result with `message`,
|
|
3013
|
-
`events`, `toolCalls`, `ok`, and `index`. The turn carries
|
|
3014
|
-
assertion vocabulary as `t`, scoped to that turn, so you can
|
|
3015
|
-
intermediate turn before the next send overwrites `t.reply`.
|
|
3016
|
-
`turn.expectOk()` throws when the turn failed, for later
|
|
3017
|
-
depend on it.
|
|
3009
|
+
Each `t.send` resolves to a turn result with `message`,
|
|
3010
|
+
`sessionId`, `events`, `toolCalls`, `ok`, and `index`. The turn carries
|
|
3011
|
+
the same assertion vocabulary as `t`, scoped to that turn, so you can
|
|
3012
|
+
grade an intermediate turn before the next send overwrites `t.reply`.
|
|
3013
|
+
`turn.expectOk()` throws when the turn failed, for later
|
|
3014
|
+
steps that depend on it.
|
|
3018
3015
|
|
|
3019
3016
|
Read the full case state with `t.reply` (the last assistant text),
|
|
3020
3017
|
`t.events` (session events captured so far), `t.turns` (settled
|
|
3021
3018
|
turns, oldest first), and `t.sessionId`. `t.signal` aborts when the
|
|
3022
|
-
case hits its timeout; pass it to your own async work.
|
|
3019
|
+
case hits its timeout; pass it to your own async work. A thrown
|
|
3020
|
+
[turn result](/docs/reference/result.md) `commit` fails the turn, so
|
|
3021
|
+
`t.succeeded()` fails too.
|
|
3023
3022
|
|
|
3024
3023
|
Assert with the gates:
|
|
3025
3024
|
|
|
@@ -3436,123 +3435,99 @@ Continue with these pages:
|
|
|
3436
3435
|
|
|
3437
3436
|
---
|
|
3438
3437
|
|
|
3439
|
-
Source: /docs/guides/cloud-
|
|
3440
|
-
|
|
3441
|
-
# Cloud runtime
|
|
3438
|
+
Source: /docs/guides/cloud-agents.md
|
|
3442
3439
|
|
|
3443
|
-
|
|
3444
|
-
machine as the server. Set `runtime: "cloud"` and turns execute on
|
|
3445
|
-
Cursor cloud agents instead. They're ephemeral VMs that carry a repo
|
|
3446
|
-
checkout, run `gh`, `git`, and tests for real, and scale past what one
|
|
3447
|
-
host's disk and CPU can do. The serve host keeps handling routing, host
|
|
3448
|
-
preparation, sessions, and bookkeeping.
|
|
3440
|
+
# Cursor cloud agents
|
|
3449
3441
|
|
|
3450
|
-
|
|
3451
|
-
|
|
3442
|
+
The `cursor-cloud-agents` extension lets an agent delegate coding work
|
|
3443
|
+
to Cursor cloud agents and stay in the conversation while they do it.
|
|
3444
|
+
The cloud agents work on real repository checkouts and push branches and
|
|
3445
|
+
pull requests; your agent hands off the task, reports back, and answers
|
|
3446
|
+
questions in the meantime. A Slack triage agent turns a bug report into
|
|
3447
|
+
a PR, a planner fans a refactor out across repositories, a reviewer asks
|
|
3448
|
+
a cloud agent to address its own comments.
|
|
3452
3449
|
|
|
3453
|
-
|
|
3450
|
+
This is different from
|
|
3451
|
+
[`runtime: "cloud"`](/docs/reference/agent-config.md#choose-a-runtime). The
|
|
3452
|
+
runtime moves *this* agent's turns onto a cloud VM. The extension keeps
|
|
3453
|
+
the agent where it is and lets it start *other* cloud agents.
|
|
3454
3454
|
|
|
3455
|
-
|
|
3456
|
-
don't scale to hundreds of engineers opening PRs. When the job needs a
|
|
3457
|
-
repo checkout at scale, use cloud. The signals:
|
|
3455
|
+
## Mount it
|
|
3458
3456
|
|
|
3459
|
-
|
|
3460
|
-
different refs concurrently.
|
|
3461
|
-
- Turns are long and heavy, and you don't want them competing with the
|
|
3462
|
-
server for resources.
|
|
3463
|
-
- The work product is a PR or branch the VM can push, not a local file.
|
|
3464
|
-
|
|
3465
|
-
Stay local when the agent is conversational, tool-driven against APIs,
|
|
3466
|
-
or works over host-prepared evidence. Local turns are cheaper, start
|
|
3467
|
-
faster, and support the full authored surface.
|
|
3468
|
-
|
|
3469
|
-
## Configure it
|
|
3470
|
-
|
|
3471
|
-
Cloud runtime is two fields on the agent config.
|
|
3457
|
+
The extension ships with `@cursor/july`. Mount it with one file.
|
|
3472
3458
|
|
|
3473
3459
|
```ts
|
|
3474
|
-
|
|
3460
|
+
// agent/extensions/cloud.ts
|
|
3461
|
+
import cursorCloudAgents from "@cursor/july/extensions/cursor-cloud-agents";
|
|
3475
3462
|
|
|
3476
|
-
export default
|
|
3477
|
-
runtime: "cloud",
|
|
3463
|
+
export default cursorCloudAgents({
|
|
3478
3464
|
cloud: {
|
|
3479
|
-
repos: [{ url: "https://github.com/
|
|
3480
|
-
|
|
3465
|
+
repos: [{ url: "https://github.com/acme/api", startingRef: "main" }],
|
|
3466
|
+
autoCreatePR: true,
|
|
3481
3467
|
},
|
|
3482
3468
|
});
|
|
3483
3469
|
```
|
|
3484
3470
|
|
|
3485
|
-
|
|
3471
|
+
Launches run under the host's signed-in account (`agent-sdk login` or
|
|
3472
|
+
`CURSOR_API_KEY`) and spend its cloud-agent budget. Name the
|
|
3473
|
+
repositories the agent may target, and keep approval on when you can't.
|
|
3474
|
+
|
|
3475
|
+
Mount it on an agent that runs on the local runtime; that is where
|
|
3476
|
+
launches park for approval. On the cloud runtime approvals don't
|
|
3477
|
+
resolve.
|
|
3478
|
+
|
|
3479
|
+
## What the agent can do
|
|
3480
|
+
|
|
3481
|
+
With the extension mounted, the agent can hand off coding work and stay
|
|
3482
|
+
in the conversation while it happens:
|
|
3483
|
+
|
|
3484
|
+
- **Hand off a task.** Launch a cloud agent on one of your repositories,
|
|
3485
|
+
or on a pull request, with a self-contained brief. It gets back an
|
|
3486
|
+
agent id and a URL to share.
|
|
3487
|
+
- **Check on it.** See whether the agent is still running, what it
|
|
3488
|
+
produced, and which branches or pull requests it pushed.
|
|
3489
|
+
- **Read what was done.** Pull the agent's full conversation into the
|
|
3490
|
+
workspace, quote its final report, or trace the exact edits before
|
|
3491
|
+
summarizing for a person.
|
|
3492
|
+
- **Steer or stop.** Send a follow-up to an agent it launched; it queues
|
|
3493
|
+
behind the current run, or interrupts it on request. Cancel a run that
|
|
3494
|
+
went sideways.
|
|
3495
|
+
- **Keep track.** List the agents launched in this conversation, or
|
|
3496
|
+
everything it has launched before.
|
|
3497
|
+
|
|
3498
|
+
A skill teaches the model when to delegate, how to write a brief a cloud
|
|
3499
|
+
agent can act on alone, and how to follow up. Everything the extension
|
|
3500
|
+
launches stays bound to whoever launched it: an agent started by another
|
|
3501
|
+
user, or outside the extension, is out of reach. That separation is only
|
|
3502
|
+
as fine as your host's auth; a shared bearer token or `--allow-anonymous`
|
|
3503
|
+
makes every caller one principal, so use
|
|
3504
|
+
[authored auth](/docs/reference/channels.md#auth-policies) when callers need
|
|
3505
|
+
their own.
|
|
3486
3506
|
|
|
3487
|
-
|
|
3488
|
-
> Cloud agents run against the Cursor backend under the signed-in
|
|
3489
|
-
> account, and every wake spends real cloud-agent budget. Decide
|
|
3490
|
-
> explicitly what may trigger one.
|
|
3507
|
+
## Configure it
|
|
3491
3508
|
|
|
3492
|
-
|
|
3509
|
+
| Option | What it controls |
|
|
3510
|
+
| --- | --- |
|
|
3511
|
+
| `cloud` | Launch defaults, in the same shape as the agent's own [cloud options](/docs/reference/agent-config.md#cloud-options). |
|
|
3512
|
+
| `cloud.repos` | The repositories the agent may hand work to, with a default branch or pull request for each. Without it, launches run with no repository and the model can't name one, so secrets in `cloud.envVars` never reach a repository you didn't list. |
|
|
3513
|
+
| `model` | The model launched agents run. Omit it to use the account default. |
|
|
3514
|
+
| `needsApproval` | Park launches and follow-ups for a [human decision](/docs/guides/human-in-the-loop.md). Defaults to `true` when no `cloud.repos` are configured, `false` otherwise. |
|
|
3515
|
+
| `apiKey` | A Cursor API key to launch with instead of the host's own. |
|
|
3493
3516
|
|
|
3494
|
-
|
|
3495
|
-
mapping shifts:
|
|
3517
|
+
## Adjust it
|
|
3496
3518
|
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
| 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 |
|
|
3501
|
-
| Agent tools (`execution: "agent"`) | scripts in the session workspace | catalog + script bodies on the first prompt |
|
|
3502
|
-
| `skills/*` | `.cursor/skills/` in the workspace | native discovery after the first turn, from the hosted store or the signed-in account |
|
|
3503
|
-
| `mcp-connections/*.ts` | SDK `mcpServers` | SDK `mcpServers` (peers need `--public-url`) |
|
|
3504
|
-
| `host-connections/*.ts` | `ctx.host.mcp` only | `ctx.host.mcp` only |
|
|
3505
|
-
| `sandbox/workspace/**` | seeded into the session workspace | ignored |
|
|
3506
|
-
| Tool approvals (`needsApproval`) | supported | not supported; keep approval-gated tools on local turns |
|
|
3507
|
-
|
|
3508
|
-
Authored skills are discovered natively after the first cloud turn,
|
|
3509
|
-
using the hosted store or the signed-in account.
|
|
3510
|
-
|
|
3511
|
-
Approvals are a local-runtime contract. On cloud, a `needsApproval` tool
|
|
3512
|
-
call rides one HTTP MCP request from the VM, and a parked call would
|
|
3513
|
-
hold that request open until it times out; there is no durable approval
|
|
3514
|
-
flow for cloud turns.
|
|
3515
|
-
|
|
3516
|
-
Peer MCP connections need `--public-url` for cloud turns. Without one,
|
|
3517
|
-
peers are omitted and the server warns at startup.
|
|
3518
|
-
|
|
3519
|
-
## Hybrid: local agent, cloud sessions
|
|
3520
|
-
|
|
3521
|
-
A local-runtime agent can still open cloud-attached sessions per send.
|
|
3522
|
-
Channel handlers may pass a `cloud` block (repos pinned to a PR ref, say)
|
|
3523
|
-
in `send` options, and Slack handlers may return `cloud` from a mention
|
|
3524
|
-
hook. A PR driver works this way: chat stays local, and the `drive`
|
|
3525
|
-
flow attaches the PR to a cloud VM. The agent-level `cloud` config is the
|
|
3526
|
-
base that per-session options merge over.
|
|
3527
|
-
|
|
3528
|
-
## Patterns that hold up
|
|
3529
|
-
|
|
3530
|
-
These come from running a PR driver against real PR traffic:
|
|
3531
|
-
|
|
3532
|
-
- One cloud session per unit of work, keyed with a stable continuation
|
|
3533
|
-
token (`pr:owner/repo#N`) so every wake lands on the same conversation.
|
|
3534
|
-
- Keep the host deterministic: fetch briefs and metadata on the host,
|
|
3535
|
-
send the VM a compact prompt, and let the VM re-read source of truth
|
|
3536
|
-
with its own `gh` and `git` instead of trusting payload snapshots.
|
|
3537
|
-
- Limit exposure: add repository allowlists on webhook channels,
|
|
3538
|
-
because every wake spends the account's budget.
|
|
3539
|
-
|
|
3540
|
-
## Verify cloud agents
|
|
3541
|
-
|
|
3542
|
-
`agent-sdk run` and `eval` work unchanged. The trajectory records the
|
|
3543
|
-
same event vocabulary plus `agent.bound` with the cloud URL, so you can
|
|
3544
|
-
open the cloud conversation for any session. Cloud turns take minutes.
|
|
3545
|
-
Pass generous `--timeout-ms` values, and keep curl timeouts long when
|
|
3546
|
-
driving channels directly.
|
|
3519
|
+
To take a capability away, such as sending follow-ups, mount as a
|
|
3520
|
+
directory and disable that tool; see
|
|
3521
|
+
[overlays](/docs/reference/extensions.md#adjust-a-mounted-extension).
|
|
3547
3522
|
|
|
3548
3523
|
## What's next
|
|
3549
3524
|
|
|
3550
3525
|
Continue with these pages:
|
|
3551
3526
|
|
|
3552
|
-
- [
|
|
3553
|
-
|
|
3554
|
-
- [
|
|
3555
|
-
|
|
3527
|
+
- [Extensions](/docs/reference/extensions.md): how mounts, namespaces, and
|
|
3528
|
+
overrides work
|
|
3529
|
+
- [Human-in-the-loop approvals](/docs/guides/human-in-the-loop.md): where parked
|
|
3530
|
+
launches get approved
|
|
3556
3531
|
|
|
3557
3532
|
---
|
|
3558
3533
|
|
|
@@ -4006,7 +3981,6 @@ key. Handlers you author replace the matching defaults (same as
|
|
|
4006
3981
|
- [Webhooks and custom channels](/docs/guides/webhooks.md): the HTTP mechanism under
|
|
4007
3982
|
this pack
|
|
4008
3983
|
- [Evals](/docs/evals.md): turn replay snapshots into regression fixtures
|
|
4009
|
-
- [Cloud runtime](/docs/guides/cloud-runtime.md): attach PRs to cloud VMs
|
|
4010
3984
|
- [Hooks](/docs/reference/hooks.md): observe-only; use channel `progress` for
|
|
4011
3985
|
GitHub surfaces
|
|
4012
3986
|
|
|
@@ -4324,7 +4298,7 @@ Source: /docs/guides/opentelemetry.md
|
|
|
4324
4298
|
Agent SDK can push traces, metrics, and logs from the serve process to
|
|
4325
4299
|
an OTLP collector you run. Point the process at the collector with
|
|
4326
4300
|
standard `OTEL_EXPORTER_OTLP_*` env, or author `agent/otel.ts`. Traces
|
|
4327
|
-
cover the inbound request,
|
|
4301
|
+
cover the inbound request, each turn, and every tool call.
|
|
4328
4302
|
|
|
4329
4303
|
Export is opt-in. Nothing leaves the process until you set an endpoint
|
|
4330
4304
|
or a `defineOtel` config.
|
|
@@ -4333,7 +4307,7 @@ or a `defineOtel` config.
|
|
|
4333
4307
|
|
|
4334
4308
|
| Signal | Default | What you get |
|
|
4335
4309
|
| --- | --- | --- |
|
|
4336
|
-
| Traces | on | `agent_sdk.http`
|
|
4310
|
+
| Traces | on | `agent_sdk.http` (per request) and `agent_sdk.turn` → `agent_sdk.tool` / `agent_sdk.subagent` |
|
|
4337
4311
|
| Metrics | on | `cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`, plus `agent_sdk.*` session and turn counts |
|
|
4338
4312
|
| Logs | off | Session events as log records. Prompt text, tool payloads, and failure messages stay off unless you opt in |
|
|
4339
4313
|
|
|
@@ -4405,7 +4379,17 @@ destination with `signals: ["traces"]`.
|
|
|
4405
4379
|
|
|
4406
4380
|
You can also pass the same object to `serve(dir, { otel })`. Precedence
|
|
4407
4381
|
is `serve({ otel })` over `agent/otel.ts` over env. An empty
|
|
4408
|
-
`defineOtel()` still
|
|
4382
|
+
`defineOtel()` still records traces; export starts when
|
|
4383
|
+
`OTEL_EXPORTER_OTLP_*` or a factory-returned `exporters` list appears.
|
|
4384
|
+
|
|
4385
|
+
Hosted v2 binds deployment secrets after bake, onto the already-listening
|
|
4386
|
+
process. Pass a factory so flush can re-read them. Spans record from
|
|
4387
|
+
bake; the hosted handler flush constructs the OTLP client and sends the
|
|
4388
|
+
queued batch.
|
|
4389
|
+
|
|
4390
|
+
```ts
|
|
4391
|
+
export default defineOtel(() => resolveMyOtelConfig());
|
|
4392
|
+
```
|
|
4409
4393
|
|
|
4410
4394
|
The companion skill is [`skills/otel/SKILL.md`](/docs/skills/otel.md).
|
|
4411
4395
|
|
|
@@ -4413,17 +4397,23 @@ The companion skill is [`skills/otel/SKILL.md`](/docs/skills/otel.md).
|
|
|
4413
4397
|
|
|
4414
4398
|
```text
|
|
4415
4399
|
agent_sdk.http inbound channel request (W3C traceparent)
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
└─ agent_sdk.tool
|
|
4400
|
+
agent_sdk.turn one root per turn (`agent_sdk.session_id` = session id)
|
|
4401
|
+
├─ agent_sdk.tool
|
|
4402
|
+
└─ agent_sdk.subagent
|
|
4403
|
+
└─ agent_sdk.tool
|
|
4421
4404
|
```
|
|
4422
4405
|
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4406
|
+
Conversational sessions stay on `session.waiting` and can take more
|
|
4407
|
+
turns, so there is no `agent_sdk.session` span — it would never end
|
|
4408
|
+
and OTel only exports ended spans. Each turn is its own root. Inbound
|
|
4409
|
+
HTTP is a separate SERVER span (it extracts W3C `traceparent`) and
|
|
4410
|
+
does not parent the turn, so the turn tree can export when the turn
|
|
4411
|
+
ends. Hosted flush ends that SERVER span before the one-shot export so
|
|
4412
|
+
`agent_sdk.http` is in the same batch.
|
|
4413
|
+
|
|
4414
|
+
Turns that resume after restore, or a direct `callTool` with no
|
|
4415
|
+
`turn.started` in this process, open a synthetic turn span so tool
|
|
4416
|
+
calls still nest.
|
|
4427
4417
|
|
|
4428
4418
|
## Which attributes land on the wire?
|
|
4429
4419
|
|
|
@@ -4434,6 +4424,12 @@ Every signal carries these resource attributes:
|
|
|
4434
4424
|
- `cursor.surface=unspecified`
|
|
4435
4425
|
- `agent_sdk.framework=@cursor/july`
|
|
4436
4426
|
|
|
4427
|
+
Span attributes (not process resource attributes — one serve process
|
|
4428
|
+
handles many sessions):
|
|
4429
|
+
|
|
4430
|
+
- `agent_sdk.session_id` / `cursor.conversation.id`: the session id.
|
|
4431
|
+
Search all turns for one conversation with `@agent_sdk.session_id`.
|
|
4432
|
+
|
|
4437
4433
|
Shared names (same keys as enterprise export):
|
|
4438
4434
|
|
|
4439
4435
|
- `cursor.conversation.id`: the session id
|
|
@@ -4444,22 +4440,24 @@ Shared names (same keys as enterprise export):
|
|
|
4444
4440
|
`cursor.tool.status`
|
|
4445
4441
|
- `cursor.cost.usage` (USD)
|
|
4446
4442
|
|
|
4447
|
-
Agent SDK only (`agent_sdk.*`): agent name, turn id, channel,
|
|
4448
|
-
subagent name, session mode, and HTTP duration
|
|
4443
|
+
Agent SDK only (`agent_sdk.*`): session id, agent name, turn id, channel,
|
|
4444
|
+
call id, subagent name, session mode, and HTTP duration
|
|
4445
|
+
(`agent_sdk.http.duration`).
|
|
4449
4446
|
|
|
4450
4447
|
## How do I emit my own metrics?
|
|
4451
4448
|
|
|
4452
4449
|
`ctx.host.otel` is always present on tools, hooks, and channel
|
|
4453
4450
|
handlers. Counters and histograms no-op when no meter is running.
|
|
4454
|
-
`setAttributes` still tags
|
|
4451
|
+
`setAttributes` still tags open turn/tool spans when a collector is
|
|
4455
4452
|
attached.
|
|
4456
4453
|
|
|
4457
4454
|
Prefix metric names with your team or agent. First-party names
|
|
4458
4455
|
(`cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`,
|
|
4459
4456
|
`agent_sdk.session.count`, `agent_sdk.turn.count`,
|
|
4460
4457
|
`agent_sdk.subagent.count`, `agent_sdk.http.duration`) and join keys
|
|
4461
|
-
(`cursor.conversation.id`, `agent_sdk.
|
|
4462
|
-
`agent_sdk.framework`) are reserved. Custom spans
|
|
4458
|
+
(`cursor.conversation.id`, `agent_sdk.session_id`, `agent_sdk.agent`,
|
|
4459
|
+
`agent_sdk.turn_id`, `agent_sdk.framework`) are reserved. Custom spans
|
|
4460
|
+
are not on this
|
|
4463
4461
|
surface.
|
|
4464
4462
|
|
|
4465
4463
|
```ts
|
|
@@ -5404,6 +5402,7 @@ npx @cursor/july docs
|
|
|
5404
5402
|
| Starting from a packaged template | [Demo](/docs/templates/demo.md), [Code wiki](/docs/templates/code-wiki.md), [Living AGENTS.md](/docs/templates/agents-md.md), [Security reviewer](/docs/templates/security-reviewer.md), [Security help](/docs/templates/security-help.md), [Triage](/docs/templates/triage.md), or [Agentic Owners](/docs/templates/agentic-owners.md) |
|
|
5405
5403
|
| Wiring an agent to GitHub webhooks | [GitHub guide](/docs/guides/github.md) |
|
|
5406
5404
|
| Driving PRs from a cloud VM | [PR autofixer template](/docs/templates/pr-autofixer.md) |
|
|
5405
|
+
| Handing coding work to Cursor cloud agents | [Cursor cloud agents](/docs/guides/cloud-agents.md) |
|
|
5407
5406
|
| Driving an agent from Linear (or another tracker) | [Webhooks guide: Linear example](/docs/guides/webhooks.md#example-linear-as-the-control-plane) |
|
|
5408
5407
|
| Making an existing agent measurably better | [Evals](/docs/evals.md), then [Hillclimbing](/docs/hillclimbing.md) |
|
|
5409
5408
|
| Comparing variants on live traffic | [Live A/B metrics](/docs/ab.md) |
|
|
@@ -5468,8 +5467,8 @@ npx @cursor/july docs
|
|
|
5468
5467
|
on hosted deployments (`--store`).
|
|
5469
5468
|
- [Agent-to-agent](/docs/guides/agent-to-agent.md): every agent is an MCP
|
|
5470
5469
|
server; agents can delegate to each other.
|
|
5471
|
-
- [
|
|
5472
|
-
agents
|
|
5470
|
+
- [Cursor cloud agents](/docs/guides/cloud-agents.md): let the agent launch
|
|
5471
|
+
and steer cloud agents through the `cursor-cloud-agents` extension.
|
|
5473
5472
|
- [OpenTelemetry](/docs/guides/opentelemetry.md): push session, turn, and
|
|
5474
5473
|
tool traces to an OTLP collector you run.
|
|
5475
5474
|
|
|
@@ -5489,10 +5488,13 @@ npx @cursor/july docs
|
|
|
5489
5488
|
[`prompt`](/docs/reference/prompt.md) ·
|
|
5490
5489
|
[Skills](/docs/reference/skills.md) ·
|
|
5491
5490
|
[MCP connections](/docs/reference/connections.md) ·
|
|
5492
|
-
[Subagents](/docs/reference/subagents.md)
|
|
5491
|
+
[Subagents](/docs/reference/subagents.md) ·
|
|
5492
|
+
[Extensions](/docs/reference/extensions.md)
|
|
5493
5493
|
- [Channels](/docs/reference/channels.md) ·
|
|
5494
5494
|
[Schedules and reminders](/docs/reference/schedules.md) ·
|
|
5495
5495
|
[Hooks](/docs/reference/hooks.md) ·
|
|
5496
|
+
[Artifacts](/docs/reference/artifacts.md) ·
|
|
5497
|
+
[Turn result](/docs/reference/result.md) ·
|
|
5496
5498
|
[Sessions and streaming](/docs/reference/sessions.md) ·
|
|
5497
5499
|
[Playground](/docs/reference/playground.md)
|
|
5498
5500
|
- [CLI](/docs/reference/cli.md) · [HTTP API](/docs/reference/http-api.md)
|
|
@@ -5970,11 +5972,10 @@ the first prompt, because the local session workspace is not the cloud
|
|
|
5970
5972
|
VM.
|
|
5971
5973
|
|
|
5972
5974
|
`validate` warns when `runtime: "cloud"` is combined with agent tools
|
|
5973
|
-
|
|
5974
|
-
when skills are present (they sync onto an Agent Store
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
up are in the [Cloud runtime guide](/docs/guides/cloud-runtime.md).
|
|
5975
|
+
(they are described on the first prompt instead of written to the VM),
|
|
5976
|
+
when skills or sandbox seeds are present (they sync onto an Agent Store
|
|
5977
|
+
rather than the session workspace), and when the `cloud` block is
|
|
5978
|
+
missing.
|
|
5978
5979
|
|
|
5979
5980
|
## Local options
|
|
5980
5981
|
|
|
@@ -6060,9 +6061,8 @@ set `local: { sandbox: true }`.
|
|
|
6060
6061
|
Cloud agent defaults forwarded to the Cursor SDK: `repos` (each
|
|
6061
6062
|
`{ url, startingRef? }`), environment selection, `envVars`, and the
|
|
6062
6063
|
rest. A local agent uses the same block as the base config when a
|
|
6063
|
-
channel opens a cloud-attached session per send
|
|
6064
|
-
|
|
6065
|
-
[Cloud runtime](/docs/guides/cloud-runtime.md#hybrid-local-agent-cloud-sessions).
|
|
6064
|
+
channel opens a cloud-attached session per send (the `cloud` option on
|
|
6065
|
+
[`send`](/docs/reference/channels.md#handler-arguments)).
|
|
6066
6066
|
|
|
6067
6067
|
## Concurrency
|
|
6068
6068
|
|
|
@@ -6139,8 +6139,6 @@ Continue with these pages:
|
|
|
6139
6139
|
|
|
6140
6140
|
- [Instructions](/docs/reference/instructions.md): the required half of a minimal
|
|
6141
6141
|
agent
|
|
6142
|
-
- [Cloud runtime](/docs/guides/cloud-runtime.md): when and how to leave
|
|
6143
|
-
the host
|
|
6144
6142
|
- [CLI](/docs/reference/cli.md): the `serve` flags `serve()` accepts
|
|
6145
6143
|
|
|
6146
6144
|
---
|
|
@@ -6403,8 +6401,10 @@ The `events` map subscribes the channel to stream events for the
|
|
|
6403
6401
|
sessions it owns. Keys are event types from the
|
|
6404
6402
|
[event vocabulary](/docs/reference/sessions.md#which-events-can-i-stream), or `"*"`.
|
|
6405
6403
|
Handlers receive `(event, channel, ctx)`, where `channel.state` is the
|
|
6406
|
-
per-session adapter state
|
|
6407
|
-
|
|
6404
|
+
per-session adapter state, `ctx.session` is the session info, and
|
|
6405
|
+
`ctx.host` is the shared host services, bound to that session as in a
|
|
6406
|
+
[hook](/docs/reference/hooks.md#handler-context). This is where a channel delivers
|
|
6407
|
+
replies back to its surface.
|
|
6408
6408
|
|
|
6409
6409
|
## State and lifecycle
|
|
6410
6410
|
|
|
@@ -6477,13 +6477,21 @@ converge a merge-box check and sticky PR comment from default stream
|
|
|
6477
6477
|
events. Guide: [GitHub](/docs/guides/github.md).
|
|
6478
6478
|
|
|
6479
6479
|
**Deployments** (`@cursor/july/channels/deployments`): pull deploy
|
|
6480
|
-
events.
|
|
6481
|
-
|
|
6482
|
-
`
|
|
6480
|
+
events. Declare `events` and handle each one in `onEvent`. Each event
|
|
6481
|
+
carries `deploySourceUri` and `deployVersion`. Author
|
|
6482
|
+
`agent/channels/deployments.ts` with `deploymentsChannel()`.
|
|
6483
|
+
|
|
6484
|
+
Omit `deploySourceUris` on hosted v2. The control plane binds
|
|
6485
|
+
`deploy_source` edges from the deploy's watched `repositories` and the
|
|
6486
|
+
channel admits what it is sent, which is what makes it multi-tenant
|
|
6487
|
+
safe.
|
|
6488
|
+
|
|
6489
|
+
Name sources to narrow below that scope, or to drive the self-hosted
|
|
6490
|
+
pull relay, which has no deploy scope to inherit. There, subscribe per
|
|
6491
|
+
deploy source with `deploySourceUris` and narrow with `environments` /
|
|
6492
|
+
`events`. Each entry must match `Deployment.deploy_source_uri` as your
|
|
6483
6493
|
deployment writer records it; matching is case-insensitive but
|
|
6484
|
-
otherwise literal.
|
|
6485
|
-
`deployVersion`. Author `agent/channels/deployments.ts` with
|
|
6486
|
-
`deploymentsChannel()`. It uses the host credential. A restart resumes
|
|
6494
|
+
otherwise literal. It uses the host credential. A restart resumes
|
|
6487
6495
|
rather than dropping events. An empty `deploySourceUris` list mounts
|
|
6488
6496
|
the channel but starts no pull, so an env-configured agent stays inert
|
|
6489
6497
|
until its deploy sources are set.
|
|
@@ -6515,10 +6523,9 @@ Source: /docs/reference/cli.md
|
|
|
6515
6523
|
|
|
6516
6524
|
# CLI reference
|
|
6517
6525
|
|
|
6518
|
-
`@cursor/july` installs
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
streams from the Cursor SDK.
|
|
6526
|
+
`@cursor/july` installs one command, `agent-sdk`; `npx @cursor/july <cmd>`
|
|
6527
|
+
runs it. Run the CLI with Node 22.13 or newer. Don't run it with Bun; Bun
|
|
6528
|
+
corrupts tool-result streams from the Cursor SDK.
|
|
6522
6529
|
|
|
6523
6530
|
`agent-sdk help` prints the built-in summary. The Slack and GitHub packs
|
|
6524
6531
|
also provide `agent-sdk slack help` and `agent-sdk github help`.
|
|
@@ -7789,60 +7796,392 @@ Continue with these pages:
|
|
|
7789
7796
|
|
|
7790
7797
|
---
|
|
7791
7798
|
|
|
7799
|
+
Source: /docs/reference/extensions.md
|
|
7800
|
+
|
|
7801
|
+
# Extensions
|
|
7802
|
+
|
|
7803
|
+
An extension packages the same contributions an agent authors under
|
|
7804
|
+
`agent/` and installs them as one unit. You mount it with a single file
|
|
7805
|
+
under `agent/extensions/`, and its contributions join the agent under a
|
|
7806
|
+
namespace. The package updates like any other dependency; nothing is
|
|
7807
|
+
copied into your project. A Cursor plugin mounts the same way; see
|
|
7808
|
+
[Mount a Cursor plugin](#mount-a-cursor-plugin).
|
|
7809
|
+
|
|
7810
|
+
Extensions are native to the Agent SDK. Slot files use the `@cursor/july`
|
|
7811
|
+
helpers, so a package built on another agent framework fails
|
|
7812
|
+
`agent-sdk validate` until you rewrite it onto `@cursor/july`.
|
|
7813
|
+
|
|
7814
|
+
## Mount an extension
|
|
7815
|
+
|
|
7816
|
+
Install the package, then add one file. The filename is the namespace.
|
|
7817
|
+
|
|
7818
|
+
```ts
|
|
7819
|
+
// agent/extensions/ci.ts
|
|
7820
|
+
import ci from "@acme/ci-triage";
|
|
7821
|
+
|
|
7822
|
+
export default ci({ org: "acme", token: process.env.BUILDKITE_TOKEN! });
|
|
7823
|
+
```
|
|
7824
|
+
|
|
7825
|
+
Every contribution is exposed as `<namespace>__<name>`. A `failed_jobs`
|
|
7826
|
+
tool from this mount runs in the agent as `ci__failed_jobs`, and a
|
|
7827
|
+
`triage` skill loads as `ci__triage`. `agent-sdk info` lists each mount
|
|
7828
|
+
with what it contributed, and `GET /v1/info` returns the same under
|
|
7829
|
+
`extensions`.
|
|
7830
|
+
|
|
7831
|
+
Pass the configuration the extension asks for. The extension validates it
|
|
7832
|
+
when the agent loads, so a missing or mistyped field fails
|
|
7833
|
+
`agent-sdk validate` instead of a tool call later.
|
|
7834
|
+
|
|
7835
|
+
Namespaces follow the tool-name rule, and `__` is reserved: an authored
|
|
7836
|
+
`agent/tools/ci__failed_jobs.ts` fails discovery, so nothing outside a
|
|
7837
|
+
mount can pose as one of its tools.
|
|
7838
|
+
|
|
7839
|
+
## What an extension can contribute
|
|
7840
|
+
|
|
7841
|
+
An extension tree uses the same slots as [`agent/`](/docs/reference/project-layout.md).
|
|
7842
|
+
Each shareable contribution lands on the agent under the mount's
|
|
7843
|
+
namespace:
|
|
7844
|
+
|
|
7845
|
+
| Path | Becomes |
|
|
7846
|
+
| --- | --- |
|
|
7847
|
+
| `tools/<name>.ts` | tool `<ns>__<name>` |
|
|
7848
|
+
| `skills/<name>` | skill `<ns>__<name>` |
|
|
7849
|
+
| `mcp-connections/<name>.ts` | connection `<ns>__<name>` |
|
|
7850
|
+
| `host-connections/<name>.ts` | host connection `<ns>__<name>` |
|
|
7851
|
+
| `hooks/<name>.ts` | hook `<ns>__<name>` |
|
|
7852
|
+
| `channels/<name>.ts` | channel `<ns>__<name>` |
|
|
7853
|
+
| `schedules/<name>` | schedule `<ns>__<name>` |
|
|
7854
|
+
| `subagents/<id>/` | subagent `<ns>__<id>` |
|
|
7855
|
+
| `instructions.md` / `.ts` / dir | appended to the agent's system prompt |
|
|
7856
|
+
| `sandbox/workspace/**` | seeded into each local session workspace |
|
|
7857
|
+
| `ab.ts` / `ab/<name>.ts` | A/B experiment `<ns>__<name>` |
|
|
7858
|
+
| `artifacts.ts` | artifact kinds `<ns>__<kind>` |
|
|
7859
|
+
|
|
7860
|
+
The root agent still needs its own `instructions.md`. Extension
|
|
7861
|
+
instructions are extra fragments, not a substitute.
|
|
7862
|
+
|
|
7863
|
+
`httpChannel()` stays on the agent. An extension authors
|
|
7864
|
+
`defineChannel` only; a file named `http.ts` becomes `<ns>__http`.
|
|
7865
|
+
|
|
7866
|
+
These stay on the agent that mounts the extension. Each is a singleton
|
|
7867
|
+
or is outside discovery:
|
|
7868
|
+
|
|
7869
|
+
| Path | Why it stays on the agent |
|
|
7870
|
+
| --- | --- |
|
|
7871
|
+
| `agent.ts` | One `defineAgent` runtime per agent |
|
|
7872
|
+
| `storage.ts` | One `host.kv` / `host.files` backend |
|
|
7873
|
+
| `otel.ts` | One OTLP exporter |
|
|
7874
|
+
| `ab.config.ts` | One experiment-platform config; `ab.ts` / `ab/` still merge |
|
|
7875
|
+
| `playground/` | Custom chips are a Vite glob of the agent tree, not a discovery walk |
|
|
7876
|
+
| `extensions/` | Nested mounts are not loaded |
|
|
7877
|
+
| `sandbox.ts` | Custom sandbox backends stay on the agent |
|
|
7878
|
+
|
|
7879
|
+
`agent-sdk validate` warns when a tree carries those paths.
|
|
7880
|
+
|
|
7881
|
+
## Adjust a mounted extension
|
|
7882
|
+
|
|
7883
|
+
To replace or remove a contribution, mount the extension as a directory
|
|
7884
|
+
and overlay the slot you want to change.
|
|
7885
|
+
|
|
7886
|
+
```text
|
|
7887
|
+
agent/extensions/ci/
|
|
7888
|
+
├── extension.ts # the mount: export default ci({ ... })
|
|
7889
|
+
├── tools/
|
|
7890
|
+
│ ├── job_log.ts # replaces ci__job_log with your own defineTool
|
|
7891
|
+
│ └── retry_job.ts # export default disableTool() removes ci__retry_job
|
|
7892
|
+
├── hooks/
|
|
7893
|
+
│ └── audit.ts # export default disableHook() removes ci__audit
|
|
7894
|
+
└── skills/
|
|
7895
|
+
└── triage.ts # export default disableSkill() removes ci__triage
|
|
7896
|
+
```
|
|
7897
|
+
|
|
7898
|
+
Use the extension's own names inside the directory, without the
|
|
7899
|
+
namespace. A file with a name the extension doesn't contribute adds a
|
|
7900
|
+
new contribution under the namespace. Each helper comes from
|
|
7901
|
+
`@cursor/july/extensions` and fails discovery when it names a
|
|
7902
|
+
contribution the extension doesn't have, so a typo can't silently keep
|
|
7903
|
+
it alive.
|
|
7904
|
+
|
|
7905
|
+
| Slot | Helper |
|
|
7906
|
+
| --- | --- |
|
|
7907
|
+
| `tools/<name>.ts` | `disableTool()` |
|
|
7908
|
+
| `mcp-connections/<name>.ts` / `host-connections/<name>.ts` | `disableConnection()` |
|
|
7909
|
+
| `skills/<name>.ts` | `disableSkill()` |
|
|
7910
|
+
| `hooks/<name>.ts` | `disableHook()` |
|
|
7911
|
+
| `channels/<name>.ts` | `disableChannel()` |
|
|
7912
|
+
| `schedules/<name>.ts` | `disableSchedule()` |
|
|
7913
|
+
| `subagents/<id>.ts` | `disableSubagent()` |
|
|
7914
|
+
| `instructions.ts` | `disableInstructions()` |
|
|
7915
|
+
| `ab.ts` / `ab/<name>.ts` | `disableAB()` |
|
|
7916
|
+
| `artifacts.ts` | `disableArtifacts()` |
|
|
7917
|
+
|
|
7918
|
+
`disable()` is the same brand as the slot helpers above and works in
|
|
7919
|
+
any of those files.
|
|
7920
|
+
|
|
7921
|
+
A Cursor plugin mount overlays its MCP servers the same way; see below.
|
|
7922
|
+
|
|
7923
|
+
## Mount a Cursor plugin
|
|
7924
|
+
|
|
7925
|
+
A Cursor plugin is a directory with `.cursor-plugin/plugin.json` (or
|
|
7926
|
+
`.claude-plugin/plugin.json`, or `plugin.json`) and any of `skills/`,
|
|
7927
|
+
`commands/`, `agents/`, and `mcp.json`. Copy the plugin into your project
|
|
7928
|
+
and mount it with `cursorPlugin`. The filename is the namespace, as with
|
|
7929
|
+
any extension.
|
|
7930
|
+
|
|
7931
|
+
```ts
|
|
7932
|
+
// agent/extensions/notion.ts
|
|
7933
|
+
import { cursorPlugin } from "@cursor/july/extensions";
|
|
7934
|
+
|
|
7935
|
+
export default cursorPlugin({
|
|
7936
|
+
path: "plugins/notion-workspace", // relative to the project root
|
|
7937
|
+
variables: { NOTION_TOKEN: process.env.NOTION_TOKEN! },
|
|
7938
|
+
});
|
|
7939
|
+
```
|
|
7940
|
+
|
|
7941
|
+
The plugin joins the agent under that namespace:
|
|
7942
|
+
|
|
7943
|
+
| Plugin content | Becomes |
|
|
7944
|
+
| --- | --- |
|
|
7945
|
+
| `skills/<name>/SKILL.md` | skill `notion__<name>` |
|
|
7946
|
+
| `commands/<name>.md` | skill `notion__<name>`, since a command is a procedure the model runs on request |
|
|
7947
|
+
| `agents/<name>.md` | subagent `notion__<name>` |
|
|
7948
|
+
| MCP servers in `mcp.json` or the manifest | connection `notion__<server>` |
|
|
7949
|
+
|
|
7950
|
+
`variables` fills the `${NAME}` placeholders the plugin's MCP config
|
|
7951
|
+
declares; names you leave out come from the environment by exact name. A
|
|
7952
|
+
placeholder nothing fills fails `agent-sdk validate`, so a server never
|
|
7953
|
+
attaches half configured. A server that declares an OAuth client
|
|
7954
|
+
authorizes through [host MCP OAuth](/docs/guides/mcp-oauth.md) as
|
|
7955
|
+
`agent-sdk mcp oauth notion__<server>`; its secret names collapse the
|
|
7956
|
+
namespace separator, so `notion__notion` stores `MCP_OAUTH_NOTION_NOTION_*`.
|
|
7957
|
+
A server that lists `enabledTools` mounts as an advertised connection with
|
|
7958
|
+
that allowlist and requires the local runtime; `agent-sdk validate` fails
|
|
7959
|
+
otherwise.
|
|
7960
|
+
|
|
7961
|
+
Mounting a plugin trusts it like authored code: its servers run the
|
|
7962
|
+
commands and read the environment variables its config names. Review a
|
|
7963
|
+
plugin before you vendor it.
|
|
7964
|
+
|
|
7965
|
+
Plugin rules and hooks are not mounted; `agent-sdk validate` warns when a
|
|
7966
|
+
plugin carries them. To drop or reconfigure one of the plugin's servers,
|
|
7967
|
+
mount as a directory and overlay `mcp-connections/<server>.ts`. An
|
|
7968
|
+
overlaid server is never read from the plugin, so it needs no variables.
|
|
7969
|
+
|
|
7970
|
+
```text
|
|
7971
|
+
agent/extensions/cloudflare/
|
|
7972
|
+
├── extension.ts # export default cursorPlugin({ path: "plugins/cloudflare" })
|
|
7973
|
+
└── mcp-connections/
|
|
7974
|
+
├── cloudflare-docs.ts # replaces cloudflare__cloudflare-docs with your defineConnection
|
|
7975
|
+
└── cloudflare-bindings.ts # export default disableConnection() drops it
|
|
7976
|
+
```
|
|
7977
|
+
|
|
7978
|
+
`disableConnection()` comes from `@cursor/july/extensions` and fails
|
|
7979
|
+
discovery when it names a server the plugin doesn't declare.
|
|
7980
|
+
|
|
7981
|
+
## Build an extension
|
|
7982
|
+
|
|
7983
|
+
An extension is a directory laid out like `agent/`. `extension.ts`
|
|
7984
|
+
declares it; the slots in [What an extension can contribute](#what-an-extension-can-contribute)
|
|
7985
|
+
use the same authoring forms as the rest of this reference.
|
|
7986
|
+
|
|
7987
|
+
```text
|
|
7988
|
+
@acme/ci-triage/
|
|
7989
|
+
├── package.json
|
|
7990
|
+
├── extension.ts # defineExtension
|
|
7991
|
+
├── tools/
|
|
7992
|
+
│ ├── failed_jobs.ts
|
|
7993
|
+
│ ├── job_log.ts
|
|
7994
|
+
│ └── retry_job.ts
|
|
7995
|
+
├── skills/
|
|
7996
|
+
│ └── triage.md
|
|
7997
|
+
├── hooks/
|
|
7998
|
+
│ └── audit.ts
|
|
7999
|
+
├── mcp-connections/
|
|
8000
|
+
│ └── buildkite.ts
|
|
8001
|
+
└── lib/
|
|
8002
|
+
└── buildkite.ts # shared code, never discovered
|
|
8003
|
+
```
|
|
8004
|
+
|
|
8005
|
+
Declare the extension with its root and, when consumers must configure
|
|
8006
|
+
it, a schema for their settings.
|
|
8007
|
+
|
|
8008
|
+
```ts
|
|
8009
|
+
// extension.ts
|
|
8010
|
+
import { defineExtension } from "@cursor/july/extensions";
|
|
8011
|
+
import { z } from "zod";
|
|
8012
|
+
|
|
8013
|
+
export default defineExtension({
|
|
8014
|
+
root: import.meta.dirname,
|
|
8015
|
+
description: "Investigate failing CI builds on Buildkite.",
|
|
8016
|
+
config: z.object({
|
|
8017
|
+
org: z.string(),
|
|
8018
|
+
token: z.string(),
|
|
8019
|
+
logTailLines: z.number().int().positive().default(200),
|
|
8020
|
+
}),
|
|
8021
|
+
});
|
|
8022
|
+
```
|
|
8023
|
+
|
|
8024
|
+
The default export is what consumers call to mount the extension, and it
|
|
8025
|
+
is also how your own modules read the consumer's settings. Import it and
|
|
8026
|
+
read `extension.config`; the value is validated and has defaults applied.
|
|
8027
|
+
|
|
8028
|
+
```ts
|
|
8029
|
+
// tools/job_log.ts
|
|
8030
|
+
import { defineTool } from "@cursor/july/tools";
|
|
8031
|
+
import { z } from "zod";
|
|
8032
|
+
import extension from "../extension.js";
|
|
8033
|
+
import { jobLogTail } from "../lib/buildkite.js";
|
|
8034
|
+
|
|
8035
|
+
export default defineTool({
|
|
8036
|
+
description: "Read the tail of a CI job's log.",
|
|
8037
|
+
effect: "read",
|
|
8038
|
+
inputSchema: z.object({ pipeline: z.string(), build: z.number(), job: z.string() }),
|
|
8039
|
+
async execute({ pipeline, build, job }) {
|
|
8040
|
+
const { org, token, logTailLines } = extension.config;
|
|
8041
|
+
return jobLogTail({ org, token, pipeline, build, job, lines: logTailLines });
|
|
8042
|
+
},
|
|
8043
|
+
});
|
|
8044
|
+
```
|
|
8045
|
+
|
|
8046
|
+
Because the consumer picks the namespace, have skills and tool
|
|
8047
|
+
descriptions refer to sibling tools by their short names and say they
|
|
8048
|
+
appear under the mount's namespace (`<namespace>__job_log`).
|
|
8049
|
+
|
|
8050
|
+
Publish the built `extension.js` as the package entry point with the
|
|
8051
|
+
slot directories beside it. `root` is read from the built file, so copy
|
|
8052
|
+
`skills/*.md` and `instructions.md` into the build output or author them
|
|
8053
|
+
as `.ts`.
|
|
8054
|
+
|
|
8055
|
+
## What's next
|
|
8056
|
+
|
|
8057
|
+
Continue with these pages:
|
|
8058
|
+
|
|
8059
|
+
- [Cursor cloud agents](/docs/guides/cloud-agents.md): the extension that
|
|
8060
|
+
lets an agent launch and steer cloud agents
|
|
8061
|
+
- [Tools](/docs/reference/tools.md): the tool contract extensions contribute to
|
|
8062
|
+
- [Skills](/docs/reference/skills.md): the skill forms an extension can carry
|
|
8063
|
+
- [Project layout](/docs/reference/project-layout.md): where `agent/extensions/` sits
|
|
8064
|
+
in the tree
|
|
8065
|
+
|
|
8066
|
+
---
|
|
8067
|
+
|
|
7792
8068
|
Source: /docs/reference/hooks.md
|
|
7793
8069
|
|
|
7794
8070
|
# Hooks
|
|
7795
8071
|
|
|
7796
|
-
A hook
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
8072
|
+
A hook subscribes to the session event stream and runs a side effect
|
|
8073
|
+
after each event is recorded: an audit line, a metric, a copy of the
|
|
8074
|
+
transcript in your own store, or derived state for later turns. Hooks
|
|
8075
|
+
run in the serving process for every session of the agent, on local and
|
|
8076
|
+
cloud runtime turns alike.
|
|
8077
|
+
|
|
8078
|
+
Hooks observe. They can't change the turn, the prompt, or the reply, and
|
|
8079
|
+
a handler that throws is logged and skipped. Treat the event as
|
|
8080
|
+
read-only; later subscribers see the same object. That makes hooks safe
|
|
8081
|
+
to add to a production agent, and the wrong tool for anything that must
|
|
8082
|
+
happen before the model runs or must fail a turn; see
|
|
8083
|
+
[When not to use a hook](#when-not-to-use-a-hook).
|
|
7802
8084
|
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
`
|
|
7806
|
-
|
|
7807
|
-
|
|
8085
|
+
`defineHook` is unrelated to
|
|
8086
|
+
[Cursor Agent hooks](https://cursor.com/docs/agent/hooks), the
|
|
8087
|
+
`.cursor/hooks.json` scripts that can observe, block, or modify the
|
|
8088
|
+
agent loop. Those still run inside a local session workspace.
|
|
8089
|
+
|
|
8090
|
+
## Author a hook
|
|
7808
8091
|
|
|
7809
8092
|
Author `agent/hooks/<name>.ts` with `defineHook` from
|
|
7810
|
-
`@cursor/july/hooks
|
|
8093
|
+
`@cursor/july/hooks`. This one meters tokens:
|
|
7811
8094
|
|
|
7812
8095
|
```ts
|
|
8096
|
+
// agent/hooks/usage.ts
|
|
7813
8097
|
import { defineHook } from "@cursor/july/hooks";
|
|
7814
8098
|
|
|
7815
8099
|
export default defineHook({
|
|
7816
8100
|
events: {
|
|
7817
8101
|
async "turn.completed"(event, ctx) {
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
8102
|
+
if (ctx.session.purpose === "eval" || event.data.usage === undefined) {
|
|
8103
|
+
return;
|
|
8104
|
+
}
|
|
8105
|
+
const { inputTokens, outputTokens } = event.data.usage;
|
|
8106
|
+
ctx.host.otel.increment("acme.tokens.input", inputTokens);
|
|
8107
|
+
ctx.host.otel.increment("acme.tokens.output", outputTokens);
|
|
7821
8108
|
},
|
|
7822
|
-
async "turn.failed"(
|
|
7823
|
-
|
|
8109
|
+
async "turn.failed"(_event, ctx) {
|
|
8110
|
+
ctx.host.otel.increment("acme.turn.failed", { channel: ctx.channel.id });
|
|
7824
8111
|
},
|
|
7825
8112
|
},
|
|
7826
8113
|
});
|
|
7827
8114
|
```
|
|
7828
8115
|
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
8116
|
+
Any module under `agent/hooks/`, subfolders included, is a hook named by
|
|
8117
|
+
its path without the extension: `agent/hooks/audit/usage.ts` is
|
|
8118
|
+
`audit/usage`. `*.test.ts` and `*.spec.ts` files are skipped. The
|
|
8119
|
+
default export must be `defineHook(...)`, names can't contain `__`, and
|
|
8120
|
+
an empty `events` map skips the hook with a warning; `agent-sdk validate`
|
|
8121
|
+
reports all three. An extension mounts its hooks as `<ns>__<name>`, and
|
|
8122
|
+
`disableHook()` removes one
|
|
8123
|
+
([Adjust a mounted extension](/docs/reference/extensions.md#adjust-a-mounted-extension)).
|
|
8124
|
+
|
|
8125
|
+
`agent-sdk init` scaffolds `agent/hooks/memory.ts`, which exports
|
|
8126
|
+
`memoryHook()` from `@cursor/july/memory` and journals every turn for
|
|
8127
|
+
later sessions to read. Delete the file to opt out.
|
|
8128
|
+
|
|
8129
|
+
## Events and payloads
|
|
8130
|
+
|
|
8131
|
+
Keys are event types from the
|
|
8132
|
+
[event vocabulary](/docs/reference/sessions.md#which-events-can-i-stream), or `"*"`
|
|
8133
|
+
for every event. A typed key narrows `event.data`; a `"*"` handler
|
|
8134
|
+
receives the union, so switch on `event.type`. Every event carries the
|
|
8135
|
+
stream envelope `{ type, index, sessionId, turnId?, at, data }`, with
|
|
8136
|
+
`turnId` set on turn-scoped events.
|
|
8137
|
+
|
|
8138
|
+
The payloads hooks read most often:
|
|
8139
|
+
|
|
8140
|
+
| Event | `event.data` |
|
|
8141
|
+
| --- | --- |
|
|
8142
|
+
| `message.received` | `{ text }` |
|
|
8143
|
+
| `turn.completed` | `{ result?, usage?, cost? }`. `usage` has `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, and optional `reasoningTokens`. `cost` has `totalUsd` and the `model` it was priced against |
|
|
8144
|
+
| `turn.failed` | `{ message }` |
|
|
8145
|
+
| `actions.requested` | `{ calls: [{ callId, toolName, args? }] }`. A call with `parentCallId` belongs to a subagent |
|
|
8146
|
+
| `action.result` | `{ callId, toolName, output?, isError, stubbed? }`. `stubbed` means a dry-run session answered a write without running it |
|
|
8147
|
+
|
|
8148
|
+
The types are `SessionEvent`, `SessionEventType`, and `HookContext`,
|
|
8149
|
+
exported from `@cursor/july`.
|
|
8150
|
+
|
|
8151
|
+
## Handler context
|
|
7833
8152
|
|
|
7834
8153
|
| Member | What it is |
|
|
7835
8154
|
| --- | --- |
|
|
7836
|
-
| `ctx.session` | Read-only session info: id
|
|
8155
|
+
| `ctx.session` | Read-only session info: `id`, `channelId`, `mode` (`chat` or `task`), `purpose` (`live` or `eval`), `auth`, plus `title`, `sdkAgentId`, and `abs` when set |
|
|
7837
8156
|
| `ctx.agent` | `{ name }` of the agent the event belongs to |
|
|
7838
|
-
| `ctx.channel` | `{ id, continuationToken }`
|
|
7839
|
-
| `ctx.
|
|
7840
|
-
| `ctx.host` |
|
|
7841
|
-
| `ctx.
|
|
8157
|
+
| `ctx.channel` | `{ id, continuationToken }`. The token is `null` when the session can't take follow-ups |
|
|
8158
|
+
| `ctx.host.kv` | Durable JSON, shared by every session of the agent; the [storage backend](/docs/storage.md#author-kv-ctx-host-kv) decides whether it survives a hosted replace. Prefix keys with `ctx.session.id` for per-session state |
|
|
8159
|
+
| `ctx.host.files` | Durable files, bound to this session. Pass `{ scope: "deployment" }` for agent-wide files |
|
|
8160
|
+
| `ctx.host.otel` | Counters, histograms, and tags, attributed to this session |
|
|
8161
|
+
| `ctx.host.mcp`, `ctx.host.github`, `ctx.host.slack` | The same shared clients tools get |
|
|
8162
|
+
| `ctx.host.reminders` | Per-session [reminders](/docs/reference/schedules.md), the same API tools get |
|
|
8163
|
+
| `ctx.artifacts` | Session-bound [artifacts](/docs/reference/artifacts.md) facade: `tag` fills in `sessionId` and `turnId` |
|
|
8164
|
+
| `ctx.stateRoot` | Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in `kv` or `files` |
|
|
8165
|
+
|
|
8166
|
+
## When hooks run
|
|
8167
|
+
|
|
8168
|
+
A hook runs after the event is durably recorded. It never delays the
|
|
8169
|
+
model turn and never sees an event that wasn't recorded.
|
|
7842
8170
|
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
8171
|
+
Within one session, events dispatch in order, one at a time: the
|
|
8172
|
+
channel's `events` handlers first, then each hook in discovery order.
|
|
8173
|
+
Sessions don't wait on each other.
|
|
8174
|
+
|
|
8175
|
+
Two consequences:
|
|
8176
|
+
|
|
8177
|
+
- A slow handler holds up the next event's handlers for that session,
|
|
8178
|
+
not the model. Keep handlers short and queue anything slow.
|
|
8179
|
+
- Hooks fire for eval sessions too. Check
|
|
8180
|
+
`ctx.session.purpose === "eval"` before metering or paging.
|
|
8181
|
+
|
|
8182
|
+
Each event reaches a hook at most once. A restart doesn't replay the log
|
|
8183
|
+
into hooks, so a mirror needs no dedupe, and the event log rather than
|
|
8184
|
+
the hook's copy is the source of truth.
|
|
7846
8185
|
|
|
7847
8186
|
## Hooks, channel events, evals, or A/B?
|
|
7848
8187
|
|
|
@@ -7850,37 +8189,143 @@ All of them consume the same stream, for different jobs:
|
|
|
7850
8189
|
|
|
7851
8190
|
| | Hooks | Channel `events` | Evals | A/B (`defineAB`) |
|
|
7852
8191
|
| --- | --- | --- | --- | --- |
|
|
7853
|
-
| Scope | every session
|
|
7854
|
-
| Job | observe: audit, metrics, mirrors, derived state | deliver: replies back to the channel's surface | assert: gates over the trajectory |
|
|
8192
|
+
| Scope | every session of the agent | sessions the channel owns | one test turn | every live session; enrollment at creation, metrics on each turn |
|
|
8193
|
+
| Job | observe: audit, metrics, mirrors, derived state | deliver: replies back to the channel's surface | assert: gates over the trajectory | compare: sticky arms, then fold the stream into `onSample` metrics |
|
|
8194
|
+
| Context | `ctx.host`, `ctx.artifacts`, session info | `channel.state`, `setContinuationToken`, `ctx.host`, session info | the `t` assertion helpers | per-session samples in `onSample` |
|
|
7855
8195
|
| Can affect the run | no | yes, it owns the surface | n/a | yes through arm instructions or `session.abs`; collection is observe-only |
|
|
7856
8196
|
| Authored at | `agent/hooks/*.ts` | channel config | `evals/**/*.eval.ts` | [`agent/ab.ts` or `agent/ab/*.ts`](/docs/ab.md) |
|
|
7857
8197
|
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
8198
|
+
## When not to use a hook
|
|
8199
|
+
|
|
8200
|
+
| You want to | Use instead |
|
|
8201
|
+
| --- | --- |
|
|
8202
|
+
| Add context before the model runs | The channel's `send` message and `workspaceFiles`, `instructions.md`, skills, or `sandbox/workspace/` seed files |
|
|
8203
|
+
| Reply on Slack, comment on a PR, or post any other delivery | The channel's `events` map, or the Slack and GitHub packs |
|
|
8204
|
+
| Show PR progress (merge-box check, sticky banner) | `githubChannel({ progress: { commitStatus, banner } })`; see [Show PR progress](/docs/guides/github.md#show-pr-progress) |
|
|
8205
|
+
| Block, approve, or rewrite a tool call | [`needsApproval`](/docs/reference/tools.md#gate-a-tool-on-human-approval) on the tool |
|
|
8206
|
+
| Act on the final assistant text, or fail a bad turn | [`defineResult`](/docs/reference/result.md) |
|
|
8207
|
+
| Gate a change on behavior | [Evals](/docs/evals.md) |
|
|
8208
|
+
| Compare two prompts on live traffic | [`defineAB`](/docs/ab.md) |
|
|
7865
8209
|
|
|
7866
8210
|
## Patterns
|
|
7867
8211
|
|
|
7868
|
-
Usage metering
|
|
7869
|
-
|
|
8212
|
+
Usage metering is the [authoring example](#author-a-hook). Three more:
|
|
8213
|
+
|
|
8214
|
+
### Alert on failure
|
|
8215
|
+
|
|
8216
|
+
`turn.failed` carries the message, and `ctx.session.id` points at the
|
|
8217
|
+
trace. Skip interrupted turns; those are preemptions, not failures. Read
|
|
8218
|
+
secrets inside the handler: hosted deployments bind them after the
|
|
8219
|
+
process starts, so a module-scope read stays empty. Give the call a
|
|
8220
|
+
timeout, since a stalled request holds up later handlers on that
|
|
8221
|
+
session.
|
|
8222
|
+
|
|
8223
|
+
```ts
|
|
8224
|
+
// agent/hooks/page-on-failure.ts
|
|
8225
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
8226
|
+
|
|
8227
|
+
export default defineHook({
|
|
8228
|
+
events: {
|
|
8229
|
+
async "turn.failed"(event, ctx) {
|
|
8230
|
+
const pagerUrl = process.env.PAGER_WEBHOOK_URL;
|
|
8231
|
+
if (
|
|
8232
|
+
pagerUrl === undefined ||
|
|
8233
|
+
ctx.session.purpose === "eval" ||
|
|
8234
|
+
event.data.message === "turn interrupted"
|
|
8235
|
+
) {
|
|
8236
|
+
return;
|
|
8237
|
+
}
|
|
8238
|
+
await fetch(pagerUrl, {
|
|
8239
|
+
method: "POST",
|
|
8240
|
+
headers: { "content-type": "application/json" },
|
|
8241
|
+
body: JSON.stringify({
|
|
8242
|
+
agent: ctx.agent.name,
|
|
8243
|
+
session: ctx.session.id,
|
|
8244
|
+
channel: ctx.channel.id,
|
|
8245
|
+
message: event.data.message,
|
|
8246
|
+
}),
|
|
8247
|
+
signal: AbortSignal.timeout(5_000),
|
|
8248
|
+
});
|
|
8249
|
+
},
|
|
8250
|
+
},
|
|
8251
|
+
});
|
|
8252
|
+
```
|
|
8253
|
+
|
|
8254
|
+
### Mirror the transcript
|
|
7870
8255
|
|
|
7871
|
-
|
|
7872
|
-
`
|
|
8256
|
+
Subscribe to `"*"` and write one file per event, skipping the
|
|
8257
|
+
`*.appended` deltas: they arrive per token, and `message.completed`
|
|
8258
|
+
carries the final text. Session scope keeps transcripts apart without a
|
|
8259
|
+
session id in the path. The mirror holds reasoning text and raw tool
|
|
8260
|
+
arguments and outputs, so pick the store accordingly, and write to your
|
|
8261
|
+
own store instead when you need cross-session queries.
|
|
7873
8262
|
|
|
7874
|
-
|
|
7875
|
-
|
|
8263
|
+
```ts
|
|
8264
|
+
// agent/hooks/mirror.ts
|
|
8265
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
7876
8266
|
|
|
7877
|
-
|
|
8267
|
+
export default defineHook({
|
|
8268
|
+
events: {
|
|
8269
|
+
async "*"(event, ctx) {
|
|
8270
|
+
if (event.type.endsWith(".appended")) {
|
|
8271
|
+
return;
|
|
8272
|
+
}
|
|
8273
|
+
const name = String(event.index).padStart(6, "0");
|
|
8274
|
+
await ctx.host.files.write(
|
|
8275
|
+
`transcript/${name}.json`,
|
|
8276
|
+
JSON.stringify(event)
|
|
8277
|
+
);
|
|
8278
|
+
},
|
|
8279
|
+
},
|
|
8280
|
+
});
|
|
8281
|
+
```
|
|
8282
|
+
|
|
8283
|
+
### Keep derived state across a replace
|
|
8284
|
+
|
|
8285
|
+
Write it to `ctx.host.kv` under a session-prefixed key; a tool reads it
|
|
8286
|
+
back with `ctx.host.kv.get`.
|
|
8287
|
+
|
|
8288
|
+
```ts
|
|
8289
|
+
// agent/hooks/last-result.ts
|
|
8290
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
8291
|
+
|
|
8292
|
+
export default defineHook({
|
|
8293
|
+
events: {
|
|
8294
|
+
async "turn.completed"(event, ctx) {
|
|
8295
|
+
await ctx.host.kv.put(`last-result/${ctx.session.id}`, {
|
|
8296
|
+
at: event.at,
|
|
8297
|
+
result: event.data.result ?? null,
|
|
8298
|
+
});
|
|
8299
|
+
},
|
|
8300
|
+
},
|
|
8301
|
+
});
|
|
8302
|
+
```
|
|
8303
|
+
|
|
8304
|
+
## Test and debug a hook
|
|
8305
|
+
|
|
8306
|
+
A hook definition is a plain object, so a unit test calls
|
|
8307
|
+
`hook.events["turn.completed"]` directly with an event and a stub
|
|
8308
|
+
`HookContext`. Discovery skips `*.test.ts`, so the test can live next to
|
|
8309
|
+
the hook.
|
|
8310
|
+
|
|
8311
|
+
At runtime:
|
|
8312
|
+
|
|
8313
|
+
- `agent-sdk validate --dir .` reports discovery errors and the
|
|
8314
|
+
empty-handlers warning.
|
|
8315
|
+
- `agent-sdk info --dir . --json` lists the loaded hooks under
|
|
8316
|
+
`agents[].hooks`.
|
|
8317
|
+
- Send a turn with `agent-sdk dev` or `agent-sdk run --dir . --message "…"`
|
|
8318
|
+
and watch the serve log for
|
|
8319
|
+
`hook "<name>" handler for <event> threw: …`. `run` prints that log on
|
|
8320
|
+
stderr. On hosting, read it with [`agent-sdk logs`](/docs/reference/cli.md#logs).
|
|
7878
8321
|
|
|
7879
8322
|
## What's next
|
|
7880
8323
|
|
|
7881
8324
|
Continue with these pages:
|
|
7882
8325
|
|
|
8326
|
+
- [Turn result](/docs/reference/result.md): fail a turn from `commit`, not from a hook
|
|
7883
8327
|
- [Sessions and streaming](/docs/reference/sessions.md): the event vocabulary hooks observe
|
|
8328
|
+
- [Storage](/docs/storage.md): where `ctx.host.kv` and `ctx.host.files` live
|
|
7884
8329
|
- [OpenTelemetry](/docs/guides/opentelemetry.md): OTLP traces and metrics
|
|
7885
8330
|
from the same event stream
|
|
7886
8331
|
- [Deployment](/docs/deployment.md#observability): runtime logs and export
|
|
@@ -8263,6 +8708,9 @@ Use the playground to chat, try channel routes, and inspect sessions.
|
|
|
8263
8708
|
`/v1/dev/evals`). Schedule hand-dispatch still requires `--dev`.
|
|
8264
8709
|
- **The surface**: inspect the discovered tools, skills, subagents, MCP
|
|
8265
8710
|
connections, channels, and hooks.
|
|
8711
|
+
- **Custom tool chips**: drop `agent/playground/tools/<toolName>.tsx` to
|
|
8712
|
+
change how that tool renders. Chips compile from the agent tree;
|
|
8713
|
+
an [extension](/docs/reference/extensions.md) cannot contribute them.
|
|
8266
8714
|
- **Raw events pane**: flip it on to inspect the event stream.
|
|
8267
8715
|
- **Logs tab**: recent server log lines, polled from `GET /v1/logs`.
|
|
8268
8716
|
- **A/Bs tab**: per-session and aggregate
|
|
@@ -8314,6 +8762,8 @@ experiments can override their file-derived name.
|
|
|
8314
8762
|
| `agent/host-connections/anytool.ts` | Host MCP connection `anytool` (host + `mcp oauth` only) |
|
|
8315
8763
|
| `agent/skills/pr-review.md` | skill `pr-review` |
|
|
8316
8764
|
| `agent/subagents/reviewer/` | subagent `reviewer` |
|
|
8765
|
+
| `agent/extensions/ci.ts` | extension mount `ci`; its contributions become `ci__<name>` |
|
|
8766
|
+
| `agent/extensions/notion.ts` | Cursor plugin mount `notion` (`cursorPlugin`); its skills, agents, and MCP servers become `notion__<name>` |
|
|
8317
8767
|
| `agent/channels/drive.ts` | channel `drive`, routes under `/v1/channels/drive` |
|
|
8318
8768
|
| `agent/ab.ts` | A/B experiment `ab` unless `name` overrides it |
|
|
8319
8769
|
| `agent/ab/concise.ts` | A/B experiment `concise` unless `name` overrides it |
|
|
@@ -8364,6 +8814,7 @@ Each path maps to a capability and a reference page.
|
|
|
8364
8814
|
| `agent/mcp-connections/<name>.ts` | MCP servers, available to the model, to server tools (`ctx.host.mcp`), and to channel/schedule handlers (`args.host.mcp`) | [MCP connections](/docs/reference/connections.md) |
|
|
8365
8815
|
| `agent/host-connections/<name>.ts` | Privileged MCP servers for `ctx.host.mcp` and `mcp oauth`. The model never sees them. | [MCP connections](/docs/reference/connections.md) |
|
|
8366
8816
|
| `agent/subagents/<id>/` | Child agent directory; `description` required | [Subagents](/docs/reference/subagents.md) |
|
|
8817
|
+
| `agent/extensions/<ns>.ts` or `agent/extensions/<ns>/` | A mounted extension or Cursor plugin; its contributions become `<ns>__<name>` | [Extensions](/docs/reference/extensions.md) |
|
|
8367
8818
|
| `agent/channels/*.ts` | HTTP surfaces beyond the built-in session API; `slack.ts` and `github.ts` use the platform packs | [Channels](/docs/reference/channels.md) |
|
|
8368
8819
|
| `agent/hooks/*.ts` | Observe-only event subscribers, never fatal | [Hooks](/docs/reference/hooks.md) |
|
|
8369
8820
|
| `agent/otel.ts` | `defineOtel` OTLP export (traces, metrics, optional logs) | [OpenTelemetry](/docs/guides/opentelemetry.md) |
|
|
@@ -8371,6 +8822,7 @@ Each path maps to a capability and a reference page.
|
|
|
8371
8822
|
| `agent/ab.config.ts` | `defineABConfig` shared A/B settings | [Live A/B metrics](/docs/ab.md) |
|
|
8372
8823
|
| `agent/storage.ts` | `defineStorage` backend for the durable `host.kv` / `host.files` APIs | [Storage](/docs/storage.md) |
|
|
8373
8824
|
| `agent/artifacts.ts` | `defineArtifacts` kinds, the `tag_artifact` opt-in, and retention | [Artifacts](/docs/reference/artifacts.md) |
|
|
8825
|
+
| `agent/result.ts` | `defineResult` host `commit` on the final assistant text | [Turn result](/docs/reference/result.md) |
|
|
8374
8826
|
| `agent/schedules/*` | Cron-driven runs (UTC, 5-field; never auto-fire under `--dev`) | [Schedules](/docs/reference/schedules.md) |
|
|
8375
8827
|
| `agent/sandbox/workspace/**` | Seed files copied into each local session workspace | [Sessions](/docs/reference/sessions.md#what-goes-into-a-local-session-workspace) |
|
|
8376
8828
|
| `agent/playground/` | Custom playground tool chips | [Playground](/docs/reference/playground.md) |
|
|
@@ -8457,6 +8909,100 @@ context: prompt.lines`
|
|
|
8457
8909
|
|
|
8458
8910
|
---
|
|
8459
8911
|
|
|
8912
|
+
Source: /docs/reference/result.md
|
|
8913
|
+
|
|
8914
|
+
# Turn result
|
|
8915
|
+
|
|
8916
|
+
Judgment agents need a place to act on the model's last message: parse
|
|
8917
|
+
it, then page, comment, or close a ticket. Author `agent/result.ts`
|
|
8918
|
+
with `defineResult` from `@cursor/july/result`. When that file exists,
|
|
8919
|
+
every finished turn runs `commit` on the serving host with the full
|
|
8920
|
+
assistant text.
|
|
8921
|
+
|
|
8922
|
+
A thrown `commit` fails the turn. Empty assistant text fails it too.
|
|
8923
|
+
Hooks still observe only; they cannot fail a valid turn.
|
|
8924
|
+
|
|
8925
|
+
Use this for an end-of-turn actuation. Mid-turn actions belong in
|
|
8926
|
+
[tools](/docs/reference/tools.md). Durable records that outlive a session belong in
|
|
8927
|
+
[artifacts](/docs/reference/artifacts.md).
|
|
8928
|
+
|
|
8929
|
+
## Author `agent/result.ts`
|
|
8930
|
+
|
|
8931
|
+
```ts
|
|
8932
|
+
import { defineResult } from "@cursor/july/result";
|
|
8933
|
+
import { applyDecision, parseDecision } from "./lib/actuate.js";
|
|
8934
|
+
|
|
8935
|
+
export default defineResult({
|
|
8936
|
+
async commit(ctx) {
|
|
8937
|
+
if (ctx.session.purpose === "eval") {
|
|
8938
|
+
return;
|
|
8939
|
+
}
|
|
8940
|
+
await applyDecision(parseDecision(ctx.text), ctx.host);
|
|
8941
|
+
},
|
|
8942
|
+
});
|
|
8943
|
+
```
|
|
8944
|
+
|
|
8945
|
+
`commit` is required. Parse `ctx.text` however the agent needs. Tell
|
|
8946
|
+
the model the document shape in `instructions.md`. The Agent SDK does
|
|
8947
|
+
not inject a schema.
|
|
8948
|
+
|
|
8949
|
+
Put `result.ts` on the root agent only. A copy under a subagent is
|
|
8950
|
+
ignored with a warning.
|
|
8951
|
+
|
|
8952
|
+
## Commit on the host
|
|
8953
|
+
|
|
8954
|
+
`commit` runs in the serving process after the model finishes, before
|
|
8955
|
+
the turn completes. `ctx` is the same host surface a server tool gets,
|
|
8956
|
+
plus the turn text:
|
|
8957
|
+
|
|
8958
|
+
| Member | What it is |
|
|
8959
|
+
| --- | --- |
|
|
8960
|
+
| `ctx.session` | The session that produced this turn, including `purpose` |
|
|
8961
|
+
| `ctx.host` | Shared host services (`kv`, `files`, `mcp`) |
|
|
8962
|
+
| `ctx.artifacts` | Session-bound [artifacts](/docs/reference/artifacts.md) facade |
|
|
8963
|
+
| `ctx.stateRoot` | The agent's durable state root |
|
|
8964
|
+
| `ctx.workspaceDir` | The session workspace |
|
|
8965
|
+
| `ctx.text` | The full assistant string |
|
|
8966
|
+
|
|
8967
|
+
A dry-run session skips `commit` and still completes. Eval sessions do
|
|
8968
|
+
run `commit`; return early when `ctx.session.purpose === "eval"` if the
|
|
8969
|
+
handler must not actuate.
|
|
8970
|
+
|
|
8971
|
+
On cloud runtime, the model still runs on the VM. `commit` runs on the
|
|
8972
|
+
serving host after the turn returns.
|
|
8973
|
+
|
|
8974
|
+
`GET /v1/info` reports `result: true` when the file is authored.
|
|
8975
|
+
|
|
8976
|
+
## Assert in evals
|
|
8977
|
+
|
|
8978
|
+
`t.succeeded()` fails when `commit` throws or the turn produced no
|
|
8979
|
+
text, because those are turn failures. Read the document on `t.reply`.
|
|
8980
|
+
|
|
8981
|
+
```ts
|
|
8982
|
+
import { defineEval, includes } from "@cursor/july/evals";
|
|
8983
|
+
|
|
8984
|
+
export default defineEval({
|
|
8985
|
+
async test(t) {
|
|
8986
|
+
await t.send("Triage LIN-1842. It duplicates LIN-1801.");
|
|
8987
|
+
t.succeeded();
|
|
8988
|
+
t.check(t.reply, includes("duplicate"));
|
|
8989
|
+
},
|
|
8990
|
+
});
|
|
8991
|
+
```
|
|
8992
|
+
|
|
8993
|
+
## What's next
|
|
8994
|
+
|
|
8995
|
+
Continue with these pages:
|
|
8996
|
+
|
|
8997
|
+
- [Evals](/docs/evals.md): `t.succeeded` and `t.reply`
|
|
8998
|
+
- [Sessions and streaming](/docs/reference/sessions.md): `turn.completed` and
|
|
8999
|
+
`turn.failed`
|
|
9000
|
+
- [Hooks](/docs/reference/hooks.md): observe the stream after the turn has already
|
|
9001
|
+
settled
|
|
9002
|
+
- [Project layout](/docs/reference/project-layout.md): where `agent/result.ts` lives
|
|
9003
|
+
|
|
9004
|
+
---
|
|
9005
|
+
|
|
8460
9006
|
Source: /docs/reference/schedules.md
|
|
8461
9007
|
|
|
8462
9008
|
# Schedules and reminders
|
|
@@ -8769,7 +9315,9 @@ within one session. The `at` field is an ISO-8601 timestamp.
|
|
|
8769
9315
|
|
|
8770
9316
|
Pair `actions.requested` with `action.result` to reconstruct the tool
|
|
8771
9317
|
trajectory. Read `turn.completed.data.usage` for input, output, and
|
|
8772
|
-
cache token counts.
|
|
9318
|
+
cache token counts. When `agent/result.ts` is authored, a thrown
|
|
9319
|
+
`commit` or empty assistant text emits `turn.failed` instead of
|
|
9320
|
+
`turn.completed`. See [Turn result](/docs/reference/result.md).
|
|
8773
9321
|
|
|
8774
9322
|
## How do I stream or replay session events?
|
|
8775
9323
|
|
|
@@ -8926,6 +9474,8 @@ Continue with these pages:
|
|
|
8926
9474
|
|
|
8927
9475
|
- [Instructions](/docs/reference/instructions.md): what stays always-on
|
|
8928
9476
|
- [Tools](/docs/reference/tools.md): when prose needs to become code
|
|
9477
|
+
- [Extensions](/docs/reference/extensions.md): skills installed as a package under a
|
|
9478
|
+
namespace
|
|
8929
9479
|
- [Project layout](/docs/reference/project-layout.md): where skills sit in the tree
|
|
8930
9480
|
|
|
8931
9481
|
---
|
|
@@ -9024,8 +9574,7 @@ access to `process.env` and your `agent/lib/` code. Local turns call
|
|
|
9024
9574
|
server tools as SDK custom tools. Cloud turns reach them over
|
|
9025
9575
|
authenticated HTTP MCP back to the serve host when `--public-url` or
|
|
9026
9576
|
`--cloud-tools-url` is set; without either, the server warns at startup
|
|
9027
|
-
and cloud turns omit them
|
|
9028
|
-
[Cloud runtime](/docs/guides/cloud-runtime.md#what-changes-on-cloud)).
|
|
9577
|
+
and cloud turns omit them.
|
|
9029
9578
|
|
|
9030
9579
|
```ts
|
|
9031
9580
|
// agent/tools/inspect_pr.ts
|
|
@@ -9348,6 +9897,8 @@ Continue with these pages:
|
|
|
9348
9897
|
lifecycle in full
|
|
9349
9898
|
- [MCP connections](/docs/reference/connections.md): tools that come from MCP servers
|
|
9350
9899
|
instead
|
|
9900
|
+
- [Extensions](/docs/reference/extensions.md): tools installed as a package under a
|
|
9901
|
+
namespace
|
|
9351
9902
|
- [Evals](/docs/evals.md): gating tool decisions with `calledTool`
|
|
9352
9903
|
|
|
9353
9904
|
---
|
|
@@ -9891,8 +10442,11 @@ Path is identity. Full list: README "Folder structure".
|
|
|
9891
10442
|
| `agent/mcp-connections/<name>.ts` | MCP. Never name an account file `cursor.ts`. `advertiseTools: true` for named local tools |
|
|
9892
10443
|
| `agent/host-connections/<name>.ts` | Privileged MCP for `ctx.host.mcp` / `mcp oauth` |
|
|
9893
10444
|
| `agent/subagents/<id>/` | Child agent (`description` required) |
|
|
10445
|
+
| `agent/extensions/<ns>.ts` | Mounted extension or Cursor plugin (`cursorPlugin`); contributions are `<ns>__<name>` |
|
|
9894
10446
|
| `agent/channels/*.ts` | Slack / GitHub / custom HTTP |
|
|
9895
10447
|
| `agent/hooks/*.ts` | Observe-only |
|
|
10448
|
+
| `agent/artifacts.ts` | Durable tagged outputs (`defineArtifacts`) |
|
|
10449
|
+
| `agent/result.ts` | Host `commit` on the final assistant text (`defineResult`) |
|
|
9896
10450
|
| `agent/ab.ts` or `agent/ab/*.ts` | Live A/B (`defineAB`) |
|
|
9897
10451
|
| `agent/otel.ts` | OpenTelemetry (`defineOtel`) |
|
|
9898
10452
|
| `agent/schedules/*` | Cron. Never auto-fire under `--dev` |
|
|
@@ -10246,9 +10800,13 @@ export default defineOtel({
|
|
|
10246
10800
|
3. `serve(dir, { otel: { … } })`. `otel: false` disables env and
|
|
10247
10801
|
authored config.
|
|
10248
10802
|
|
|
10803
|
+
Hosted v2 secrets arrive after bake. Use `defineOtel(() => …)` so flush
|
|
10804
|
+
re-resolves exporters. Authored `agent/otel.ts` records from process
|
|
10805
|
+
start even when the factory returns no exporters yet.
|
|
10806
|
+
|
|
10249
10807
|
| Signal | Default |
|
|
10250
10808
|
| --- | --- |
|
|
10251
|
-
| Traces | on (`agent_sdk.http`
|
|
10809
|
+
| Traces | on (`agent_sdk.http`; `agent_sdk.turn` → tool / subagent) |
|
|
10252
10810
|
| Metrics | on (`cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`) |
|
|
10253
10811
|
| Logs | off (`logs: true` or `OTEL_LOGS_EXPORTER=otlp`) |
|
|
10254
10812
|
|
|
@@ -10264,8 +10822,9 @@ ctx.host.otel.record("abc.approval.duration_ms", 1420);
|
|
|
10264
10822
|
```
|
|
10265
10823
|
|
|
10266
10824
|
Prefix names with team or agent. No custom spans. Join on
|
|
10267
|
-
`cursor.conversation.id` and
|
|
10268
|
-
own process when Agent SDK
|
|
10825
|
+
`agent_sdk.session_id` / `cursor.conversation.id` and
|
|
10826
|
+
`agent_sdk.agent`. Run `serve` as its own process when Agent SDK
|
|
10827
|
+
should own the destination.
|
|
10269
10828
|
|
|
10270
10829
|
---
|
|
10271
10830
|
|
|
@@ -11107,9 +11666,6 @@ Run it from the agent's git checkout. It infers repository, ref, path,
|
|
|
11107
11666
|
and slug, builds on Cursor-managed hosting, and prints the URL.
|
|
11108
11667
|
`agent-sdk deployments` shows status.
|
|
11109
11668
|
|
|
11110
|
-
See [Cloud runtime](/docs/guides/cloud-runtime.md) for what changes on
|
|
11111
|
-
the VM.
|
|
11112
|
-
|
|
11113
11669
|
---
|
|
11114
11670
|
|
|
11115
11671
|
Source: /docs/templates/security-help.md
|