@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
|
@@ -28,12 +28,16 @@ import { resolveDedicatedSlackHostBinding } from "../channels/slack/slack-channe
|
|
|
28
28
|
import {
|
|
29
29
|
AGENT_SERVE_USER_STORE_FILES_SOURCE_ID,
|
|
30
30
|
agentStoreKeys,
|
|
31
|
+
DEPLOYMENT_STORE_MOUNT_PATH,
|
|
32
|
+
type FileSink,
|
|
33
|
+
USER_STORE_MOUNT_PATH,
|
|
31
34
|
} from "../files.js";
|
|
32
35
|
import {
|
|
33
36
|
cursorHostedFiles,
|
|
34
37
|
isCursorHostedFilesAvailable,
|
|
35
38
|
isCursorUserStoreFilesAvailable,
|
|
36
39
|
} from "../files-backends/cursor-hosted.js";
|
|
40
|
+
import { storageKeysForArchitecture } from "../storage.js";
|
|
37
41
|
import {
|
|
38
42
|
type AgentProject,
|
|
39
43
|
type AgentRuntime,
|
|
@@ -69,6 +73,7 @@ import {
|
|
|
69
73
|
type RunnerTurnRequest,
|
|
70
74
|
type SendMessageFn,
|
|
71
75
|
type SendMessageOptions,
|
|
76
|
+
type SessionContext,
|
|
72
77
|
type SessionEvent,
|
|
73
78
|
type SessionEventPayload,
|
|
74
79
|
type SessionInfo,
|
|
@@ -115,6 +120,7 @@ import {
|
|
|
115
120
|
resolveV2Key,
|
|
116
121
|
V2EngineError,
|
|
117
122
|
} from "./continuation-identity.js";
|
|
123
|
+
import { describeError } from "./describe-error.js";
|
|
118
124
|
import { isDevMode } from "./dev-mode.js";
|
|
119
125
|
import { type EventLogMemoryStats, EventLogStore } from "./event-log.js";
|
|
120
126
|
import { TurnEventMapper } from "./event-mapper.js";
|
|
@@ -151,6 +157,7 @@ import {
|
|
|
151
157
|
SCHEDULE_CHANNEL_PREFIX,
|
|
152
158
|
} from "./prompt-context.js";
|
|
153
159
|
import { assertCloudCanHonorAccountServersFilters } from "./resolved-connections.js";
|
|
160
|
+
import { applyAuthoredResult } from "./result-output.js";
|
|
154
161
|
import type { AgentRunner, SteerAckOutcome } from "./sdk-runner.js";
|
|
155
162
|
import { sessionExternalLinks } from "./session-links.js";
|
|
156
163
|
import { SessionStore } from "./session-store.js";
|
|
@@ -168,19 +175,34 @@ import {
|
|
|
168
175
|
import { TurnGovernor } from "./turn-governor.js";
|
|
169
176
|
import { TurnLeaseStore } from "./turn-lease-store.js";
|
|
170
177
|
import { TurnOutbox } from "./turn-outbox.js";
|
|
178
|
+
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
171
179
|
import {
|
|
172
180
|
buildAgentsMdContent,
|
|
173
181
|
buildCloudMemorySection,
|
|
182
|
+
buildCloudWorkspaceSection,
|
|
174
183
|
ensureOwnGitRoot,
|
|
175
184
|
isNestedInGitRepo,
|
|
176
185
|
materializeWorkspace,
|
|
177
186
|
SERVER_TOOLS_MCP_SERVER_NAME,
|
|
178
187
|
writeWorkspaceFiles,
|
|
179
188
|
} from "./workspace.js";
|
|
189
|
+
import { syncWorkspaceToStore } from "./workspace-sync.js";
|
|
180
190
|
|
|
181
191
|
export const HTTP_CHANNEL_ID = "http";
|
|
182
192
|
export { SCHEDULE_CHANNEL_PREFIX } from "./prompt-context.js";
|
|
183
193
|
|
|
194
|
+
/** Authored surfaces mirrored onto the Agent Store before a first cloud prompt. */
|
|
195
|
+
type CloudSyncSurface = "skills" | "workspace";
|
|
196
|
+
|
|
197
|
+
/** The Agent Store cloud turns read authored files from, and where the VM mounts it. */
|
|
198
|
+
interface CloudStoreTarget {
|
|
199
|
+
sink: FileSink;
|
|
200
|
+
mountPath: string;
|
|
201
|
+
skillsPrefix: string;
|
|
202
|
+
workspacePrefix: string;
|
|
203
|
+
label: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
184
206
|
export class SessionBusyError extends Error {
|
|
185
207
|
constructor(sessionId: string) {
|
|
186
208
|
super(
|
|
@@ -404,8 +426,8 @@ export class SessionEngine {
|
|
|
404
426
|
>();
|
|
405
427
|
/** Once-per-process cache for the A/B snapshot backfill (see abSnapshot). */
|
|
406
428
|
private restoredAbSnapshot: Promise<ABSnapshot | undefined> | undefined;
|
|
407
|
-
/** In-flight
|
|
408
|
-
private
|
|
429
|
+
/** In-flight authored files → Agent Store syncs (see syncToCloudStore). */
|
|
430
|
+
private readonly cloudSyncs = new Map<CloudSyncSurface, Promise<boolean>>();
|
|
409
431
|
|
|
410
432
|
private readonly runner: AgentRunner;
|
|
411
433
|
private readonly logger: (line: string) => void;
|
|
@@ -537,20 +559,36 @@ export class SessionEngine {
|
|
|
537
559
|
agentName: options.project.name,
|
|
538
560
|
projectRoot: options.project.rootDir,
|
|
539
561
|
logger: this.logger,
|
|
562
|
+
keys: storageKeysForArchitecture(
|
|
563
|
+
options.project.agent.architecture
|
|
564
|
+
),
|
|
540
565
|
});
|
|
541
566
|
this.kvApi = createHostKvApi({
|
|
542
567
|
agentName: options.project.name,
|
|
543
568
|
stateRoot: options.stateRoot,
|
|
544
569
|
...(this.storage === undefined ? {} : { storage: this.storage }),
|
|
545
570
|
});
|
|
571
|
+
const v2Hosting = resolveAgentV2Hosting({
|
|
572
|
+
architecture: options.project.agent.architecture,
|
|
573
|
+
});
|
|
574
|
+
const managedV2Files =
|
|
575
|
+
v2Hosting.kind === "cursor-managed"
|
|
576
|
+
? () =>
|
|
577
|
+
cursorHostedFiles({
|
|
578
|
+
resolveStoreSourceId: () =>
|
|
579
|
+
v2Hosting.resolveStoreIds().deploymentStoreSourceId,
|
|
580
|
+
})
|
|
581
|
+
: undefined;
|
|
546
582
|
this.filesApi = createHostFilesApi({
|
|
547
583
|
agentName: options.project.name,
|
|
548
584
|
stateRoot: options.stateRoot,
|
|
585
|
+
sink: managedV2Files?.(),
|
|
549
586
|
});
|
|
550
587
|
this.artifactsStore = new ArtifactsStore({
|
|
551
588
|
stateRoot: options.stateRoot,
|
|
552
589
|
agentName: options.project.name,
|
|
553
590
|
config: options.project.artifacts,
|
|
591
|
+
sink: managedV2Files?.(),
|
|
554
592
|
});
|
|
555
593
|
this.abCollector = new ABCollector(
|
|
556
594
|
options.project.abs,
|
|
@@ -660,9 +698,9 @@ export class SessionEngine {
|
|
|
660
698
|
}
|
|
661
699
|
|
|
662
700
|
/**
|
|
663
|
-
* Host services with `files` bound to one session, so a relative
|
|
664
|
-
*
|
|
665
|
-
*
|
|
701
|
+
* Host services with `files` and `otel` bound to one session, so a relative
|
|
702
|
+
* path resolves to that session's scope and can never read another
|
|
703
|
+
* session's. Unbound (no session) keeps `host.files` usable for
|
|
666
704
|
* `{ scope: "deployment" }` and fails loudly on session-scoped calls.
|
|
667
705
|
*/
|
|
668
706
|
private hostForSession(sessionId: string | undefined): HostContext {
|
|
@@ -1988,7 +2026,9 @@ export class SessionEngine {
|
|
|
1988
2026
|
this.activeToolContexts.set(sessionId, { record, turnId, emit });
|
|
1989
2027
|
this.stubbedCallIds.set(sessionId, stubbed);
|
|
1990
2028
|
try {
|
|
1991
|
-
outcome = await this.
|
|
2029
|
+
outcome = await this.runTurnExecute(record, turnId, () =>
|
|
2030
|
+
this.runner.runTurn(request)
|
|
2031
|
+
);
|
|
1992
2032
|
} finally {
|
|
1993
2033
|
this.activeToolContexts.delete(sessionId);
|
|
1994
2034
|
this.stubbedCallIds.delete(sessionId);
|
|
@@ -2031,14 +2071,39 @@ export class SessionEngine {
|
|
|
2031
2071
|
outcome = { ...outcome, cost: finalCost };
|
|
2032
2072
|
}
|
|
2033
2073
|
|
|
2074
|
+
const authored = this.project.result;
|
|
2075
|
+
if (outcome.status === "finished" && authored !== undefined) {
|
|
2076
|
+
const settled = await applyAuthoredResult({
|
|
2077
|
+
definition: authored,
|
|
2078
|
+
text: finalResult,
|
|
2079
|
+
dryRun: record.dryRun === true,
|
|
2080
|
+
ctx: {
|
|
2081
|
+
session: this.sessionInfo(record),
|
|
2082
|
+
host: this.hostForSession(sessionId),
|
|
2083
|
+
artifacts: this.artifactsApi({ sessionId, turnId }),
|
|
2084
|
+
stateRoot: this.stateRoot,
|
|
2085
|
+
workspaceDir: harnessCwd,
|
|
2086
|
+
},
|
|
2087
|
+
});
|
|
2088
|
+
if (!settled.ok) {
|
|
2089
|
+
outcome = {
|
|
2090
|
+
status: "error",
|
|
2091
|
+
result: finalResult,
|
|
2092
|
+
errorMessage: `turn output failed: ${settled.message}`,
|
|
2093
|
+
usage: finalUsage,
|
|
2094
|
+
cost: finalCost,
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2034
2099
|
if (outcome.status === "finished") {
|
|
2035
2100
|
await this.appendEvent(sessionId, {
|
|
2036
2101
|
type: "turn.completed",
|
|
2037
2102
|
turnId,
|
|
2038
2103
|
data: {
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2104
|
+
result: finalResult,
|
|
2105
|
+
usage: finalUsage,
|
|
2106
|
+
cost: finalCost,
|
|
2042
2107
|
},
|
|
2043
2108
|
});
|
|
2044
2109
|
} else {
|
|
@@ -2080,8 +2145,8 @@ export class SessionEngine {
|
|
|
2080
2145
|
|
|
2081
2146
|
return {
|
|
2082
2147
|
...outcome,
|
|
2083
|
-
|
|
2084
|
-
|
|
2148
|
+
result: finalResult,
|
|
2149
|
+
usage: finalUsage,
|
|
2085
2150
|
};
|
|
2086
2151
|
}
|
|
2087
2152
|
|
|
@@ -2092,48 +2157,75 @@ export class SessionEngine {
|
|
|
2092
2157
|
* first-turn S3 scan can discover them. False when the sync fails: the
|
|
2093
2158
|
* turn then runs without store skills rather than pointing discovery at
|
|
2094
2159
|
* paths that do not exist.
|
|
2095
|
-
|
|
2096
|
-
|
|
2160
|
+
*/
|
|
2161
|
+
private ensureCloudSkillsSynced(store: CloudStoreTarget): Promise<boolean> {
|
|
2162
|
+
const skills = this.project.agent.skills;
|
|
2163
|
+
return this.syncToCloudStore("skills", store, skills.length > 0, () =>
|
|
2164
|
+
syncSkillsToStore({
|
|
2165
|
+
sink: store.sink,
|
|
2166
|
+
agentName: this.project.name,
|
|
2167
|
+
skills,
|
|
2168
|
+
skillsPrefix: store.skillsPrefix,
|
|
2169
|
+
})
|
|
2170
|
+
);
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* Sync `agent/sandbox/workspace/**` seeds onto the Agent Store at
|
|
2175
|
+
* `workspace/…` (hosted) or `agent-serve/<agent>/workspace/…`
|
|
2176
|
+
* (personal-key local+cloud) before the first cloud prompt, which names
|
|
2177
|
+
* the mounted directory (see buildCloudWorkspaceSection).
|
|
2178
|
+
*/
|
|
2179
|
+
private ensureCloudWorkspaceSynced(
|
|
2180
|
+
store: CloudStoreTarget
|
|
2181
|
+
): Promise<boolean> {
|
|
2182
|
+
const seedFiles = this.project.agent.seedFiles;
|
|
2183
|
+
return this.syncToCloudStore("workspace", store, seedFiles.length > 0, () =>
|
|
2184
|
+
syncWorkspaceToStore({
|
|
2185
|
+
sink: store.sink,
|
|
2186
|
+
seedFiles,
|
|
2187
|
+
workspacePrefix: store.workspacePrefix,
|
|
2188
|
+
})
|
|
2189
|
+
);
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
/**
|
|
2193
|
+
* With files authored, every first cloud turn re-copies the authored
|
|
2097
2194
|
* bytes and the memo only dedupes concurrent first turns. The mount is
|
|
2098
2195
|
* writable from cloud sessions, so a once-per-process copy would let one
|
|
2099
2196
|
* session's edits masquerade as agent definition for every later session
|
|
2100
2197
|
* until the engine restarts; re-syncing keeps the store true to discovery
|
|
2101
2198
|
* the same way local materialization always rewrites skills. Without
|
|
2102
|
-
*
|
|
2103
|
-
* process is enough, success or not — a deployment without the files
|
|
2199
|
+
* authored files the sync is best-effort stale cleanup and one attempt
|
|
2200
|
+
* per process is enough, success or not — a deployment without the files
|
|
2104
2201
|
* surface must not fail and log on every new session for a feature it
|
|
2105
2202
|
* does not use.
|
|
2106
2203
|
*/
|
|
2107
|
-
private
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2204
|
+
private syncToCloudStore(
|
|
2205
|
+
surface: CloudSyncSurface,
|
|
2206
|
+
store: CloudStoreTarget,
|
|
2207
|
+
authored: boolean,
|
|
2208
|
+
run: () => Promise<void>
|
|
2209
|
+
): Promise<boolean> {
|
|
2210
|
+
const inFlight = this.cloudSyncs.get(surface);
|
|
2211
|
+
if (inFlight !== undefined) {
|
|
2212
|
+
return inFlight;
|
|
2115
2213
|
}
|
|
2116
|
-
|
|
2117
|
-
let sync = syncSkillsToStore({
|
|
2118
|
-
sink: target.sink,
|
|
2119
|
-
agentName: this.project.name,
|
|
2120
|
-
skills,
|
|
2121
|
-
skillsPrefix: target.skillsPrefix,
|
|
2122
|
-
}).then(
|
|
2214
|
+
let sync = run().then(
|
|
2123
2215
|
() => true,
|
|
2124
2216
|
(error) => {
|
|
2125
2217
|
this.logger(
|
|
2126
|
-
`[
|
|
2218
|
+
`[${surface}] ${store.label} sync failed: ${error instanceof Error ? error.message : String(error)}`
|
|
2127
2219
|
);
|
|
2128
2220
|
return false;
|
|
2129
2221
|
}
|
|
2130
2222
|
);
|
|
2131
|
-
if (
|
|
2223
|
+
if (authored) {
|
|
2132
2224
|
sync = sync.finally(() => {
|
|
2133
|
-
this.
|
|
2225
|
+
this.cloudSyncs.delete(surface);
|
|
2134
2226
|
});
|
|
2135
2227
|
}
|
|
2136
|
-
this.
|
|
2228
|
+
this.cloudSyncs.set(surface, sync);
|
|
2137
2229
|
return sync;
|
|
2138
2230
|
}
|
|
2139
2231
|
|
|
@@ -2141,26 +2233,36 @@ export class SessionEngine {
|
|
|
2141
2233
|
* Hosted deployments own the deployment store. Local `serve`/`run` with
|
|
2142
2234
|
* a personal API key writes into the USER store under `agent-serve/`.
|
|
2143
2235
|
*/
|
|
2144
|
-
private
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2236
|
+
private cloudStore(): CloudStoreTarget | undefined {
|
|
2237
|
+
const v2Hosting = resolveAgentV2Hosting({
|
|
2238
|
+
architecture: this.project.agent.architecture,
|
|
2239
|
+
});
|
|
2240
|
+
const deployment = {
|
|
2241
|
+
mountPath: DEPLOYMENT_STORE_MOUNT_PATH,
|
|
2242
|
+
skillsPrefix: agentStoreKeys.skillsPrefix(),
|
|
2243
|
+
workspacePrefix: agentStoreKeys.workspacePrefix(),
|
|
2244
|
+
label: "deployment store",
|
|
2245
|
+
};
|
|
2246
|
+
if (v2Hosting.kind === "cursor-managed") {
|
|
2152
2247
|
return {
|
|
2153
|
-
sink: cursorHostedFiles(
|
|
2154
|
-
|
|
2155
|
-
|
|
2248
|
+
sink: cursorHostedFiles({
|
|
2249
|
+
resolveStoreSourceId: () =>
|
|
2250
|
+
v2Hosting.resolveStoreIds().deploymentStoreSourceId,
|
|
2251
|
+
}),
|
|
2252
|
+
...deployment,
|
|
2156
2253
|
};
|
|
2157
2254
|
}
|
|
2255
|
+
if (v2Hosting.kind === "not-v2" && isCursorHostedFilesAvailable()) {
|
|
2256
|
+
return { sink: cursorHostedFiles(), ...deployment };
|
|
2257
|
+
}
|
|
2158
2258
|
if (isCursorUserStoreFilesAvailable()) {
|
|
2159
2259
|
return {
|
|
2160
2260
|
sink: cursorHostedFiles({
|
|
2161
2261
|
storeSourceId: AGENT_SERVE_USER_STORE_FILES_SOURCE_ID,
|
|
2162
2262
|
}),
|
|
2263
|
+
mountPath: USER_STORE_MOUNT_PATH,
|
|
2163
2264
|
skillsPrefix: agentStoreKeys.userSkillsPrefix(this.project.name),
|
|
2265
|
+
workspacePrefix: agentStoreKeys.userWorkspacePrefix(this.project.name),
|
|
2164
2266
|
label: "user store",
|
|
2165
2267
|
};
|
|
2166
2268
|
}
|
|
@@ -2232,13 +2334,14 @@ export class SessionEngine {
|
|
|
2232
2334
|
if (isFirstTurn) {
|
|
2233
2335
|
if (runtime === "cloud") {
|
|
2234
2336
|
// Cloud VMs have no materialized workspace: ship the full context,
|
|
2235
|
-
// including agent tool script bodies.
|
|
2236
|
-
//
|
|
2237
|
-
//
|
|
2238
|
-
//
|
|
2239
|
-
//
|
|
2240
|
-
//
|
|
2241
|
-
//
|
|
2337
|
+
// including agent tool script bodies. Authored skills and workspace
|
|
2338
|
+
// seeds land on the store mount (skills for native discovery, seeds
|
|
2339
|
+
// for the model's file tools), and on hosted deployments the shared
|
|
2340
|
+
// memory journal is on that mount too — say where. When the turn
|
|
2341
|
+
// carries the session-bound server-tool MCP endpoint, the preamble
|
|
2342
|
+
// catalogs server tools under that MCP server name *before* the
|
|
2343
|
+
// agent-tool "write the script if missing" recipe, so a model told
|
|
2344
|
+
// to "use <server tool>" calls MCP instead of inventing a .sh.
|
|
2242
2345
|
const preamble = buildAgentsMdContent(agent, {
|
|
2243
2346
|
includeScripts: true,
|
|
2244
2347
|
serverToolsMcpName:
|
|
@@ -2247,17 +2350,30 @@ export class SessionEngine {
|
|
|
2247
2350
|
: SERVER_TOOLS_MCP_SERVER_NAME,
|
|
2248
2351
|
});
|
|
2249
2352
|
const hosted = isCursorHostedFilesAvailable();
|
|
2250
|
-
// Synced whenever a store is reachable, not just when skills
|
|
2251
|
-
// removing the last
|
|
2252
|
-
//
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2353
|
+
// Synced whenever a store is reachable, not just when skills or
|
|
2354
|
+
// seeds exist: removing the last one has to delete its store copies
|
|
2355
|
+
// too.
|
|
2356
|
+
const store =
|
|
2357
|
+
hosted || isCursorUserStoreFilesAvailable()
|
|
2358
|
+
? this.cloudStore()
|
|
2359
|
+
: undefined;
|
|
2360
|
+
let sections = "";
|
|
2361
|
+
if (store !== undefined) {
|
|
2362
|
+
const [, seedsSynced] = await Promise.all([
|
|
2363
|
+
this.ensureCloudSkillsSynced(store),
|
|
2364
|
+
this.ensureCloudWorkspaceSynced(store),
|
|
2365
|
+
]);
|
|
2366
|
+
// Only name the mount when the bytes landed; a failed sync must
|
|
2367
|
+
// not send the model looking for files that are not there.
|
|
2368
|
+
if (seedsSynced && agent.seedFiles.length > 0) {
|
|
2369
|
+
const dir = `${store.mountPath}/${store.workspacePrefix}`;
|
|
2370
|
+
sections += `\n\n${buildCloudWorkspaceSection(dir)}`;
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
if (hosted) {
|
|
2374
|
+
sections += `\n\n${buildCloudMemorySection(this.project.name)}`;
|
|
2256
2375
|
}
|
|
2257
|
-
|
|
2258
|
-
? `\n\n${buildCloudMemorySection(this.project.name)}`
|
|
2259
|
-
: "";
|
|
2260
|
-
turnPrompt = `${preamble}${memorySection}\n\n${turnPrompt}`;
|
|
2376
|
+
turnPrompt = `${preamble}${sections}\n\n${turnPrompt}`;
|
|
2261
2377
|
} else if (runtime === "local" && instructionsInvisibleToHarness) {
|
|
2262
2378
|
// Local workspace whose AGENTS.md the harness will not load. With a
|
|
2263
2379
|
// borrowed harness cwd, agent tool scripts live only in the durable
|
|
@@ -2747,6 +2863,7 @@ export class SessionEngine {
|
|
|
2747
2863
|
this.getChannelSession(channelId, sessionId),
|
|
2748
2864
|
emit: args.emit,
|
|
2749
2865
|
now: sessionClock(args.record.asOf),
|
|
2866
|
+
...(args.record.asOf === undefined ? {} : { asOf: args.record.asOf }),
|
|
2750
2867
|
};
|
|
2751
2868
|
try {
|
|
2752
2869
|
// Before the approval gate: a dry run is unattended, so parking a write
|
|
@@ -2815,15 +2932,24 @@ export class SessionEngine {
|
|
|
2815
2932
|
}
|
|
2816
2933
|
const started = Date.now();
|
|
2817
2934
|
this.logger(`[session] tool ${args.tool.name} start`);
|
|
2818
|
-
const result = await
|
|
2935
|
+
const result = await this.runToolExecute(
|
|
2819
2936
|
{
|
|
2820
|
-
|
|
2937
|
+
record: args.record,
|
|
2821
2938
|
turnId: args.turnId,
|
|
2822
2939
|
callId: toolCallId,
|
|
2823
2940
|
toolName: args.tool.name,
|
|
2824
|
-
emit: args.emit,
|
|
2825
2941
|
},
|
|
2826
|
-
() =>
|
|
2942
|
+
() =>
|
|
2943
|
+
mcpAuthAls.run(
|
|
2944
|
+
{
|
|
2945
|
+
sessionId: args.record.sessionId,
|
|
2946
|
+
turnId: args.turnId,
|
|
2947
|
+
callId: toolCallId,
|
|
2948
|
+
toolName: args.tool.name,
|
|
2949
|
+
emit: args.emit,
|
|
2950
|
+
},
|
|
2951
|
+
() => execute(validation.value as never, toolCtx)
|
|
2952
|
+
)
|
|
2827
2953
|
);
|
|
2828
2954
|
this.logger(
|
|
2829
2955
|
`[session] tool ${args.tool.name} done (${Date.now() - started}ms)`
|
|
@@ -2839,6 +2965,61 @@ export class SessionEngine {
|
|
|
2839
2965
|
}
|
|
2840
2966
|
}
|
|
2841
2967
|
|
|
2968
|
+
/**
|
|
2969
|
+
* Bind outbound inject (Factory / Cursor API `traceparent`) to the
|
|
2970
|
+
* turn span for the whole harness run. Host files / VFS RPCs happen
|
|
2971
|
+
* here, not under `runInCall`. No-op when OTel is off.
|
|
2972
|
+
*/
|
|
2973
|
+
private runTurnExecute<T>(
|
|
2974
|
+
record: SessionRecord,
|
|
2975
|
+
turnId: string,
|
|
2976
|
+
fn: () => T | Promise<T>
|
|
2977
|
+
): Promise<T> {
|
|
2978
|
+
const otel = this.otel;
|
|
2979
|
+
const run = (): Promise<T> => Promise.resolve(fn());
|
|
2980
|
+
if (otel === undefined) {
|
|
2981
|
+
return run();
|
|
2982
|
+
}
|
|
2983
|
+
return otel.runInTurn(
|
|
2984
|
+
{
|
|
2985
|
+
sessionId: record.sessionId,
|
|
2986
|
+
session: this.sessionInfo(record),
|
|
2987
|
+
turnId,
|
|
2988
|
+
},
|
|
2989
|
+
run
|
|
2990
|
+
);
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
/**
|
|
2994
|
+
* Bind outbound inject (Factory / Cursor API `traceparent`) to the
|
|
2995
|
+
* tool span. No-op when OTel is off.
|
|
2996
|
+
*/
|
|
2997
|
+
private runToolExecute<T>(
|
|
2998
|
+
args: {
|
|
2999
|
+
record: SessionRecord;
|
|
3000
|
+
turnId: string;
|
|
3001
|
+
callId: string;
|
|
3002
|
+
toolName: string;
|
|
3003
|
+
},
|
|
3004
|
+
fn: () => T | Promise<T>
|
|
3005
|
+
): Promise<T> {
|
|
3006
|
+
const otel = this.otel;
|
|
3007
|
+
const run = (): Promise<T> => Promise.resolve(fn());
|
|
3008
|
+
if (otel === undefined) {
|
|
3009
|
+
return run();
|
|
3010
|
+
}
|
|
3011
|
+
return otel.runInCall(
|
|
3012
|
+
{
|
|
3013
|
+
sessionId: args.record.sessionId,
|
|
3014
|
+
session: this.sessionInfo(args.record),
|
|
3015
|
+
turnId: args.turnId,
|
|
3016
|
+
callId: args.callId,
|
|
3017
|
+
toolName: args.toolName,
|
|
3018
|
+
},
|
|
3019
|
+
run
|
|
3020
|
+
);
|
|
3021
|
+
}
|
|
3022
|
+
|
|
2842
3023
|
/**
|
|
2843
3024
|
* Park a server-tool call until a human approves or denies. Emits
|
|
2844
3025
|
* `action.approval_requested` / `action.approval_resolved` on the
|
|
@@ -3712,20 +3893,34 @@ export class SessionEngine {
|
|
|
3712
3893
|
this.getChannelSession(channelId, sessionId),
|
|
3713
3894
|
emit,
|
|
3714
3895
|
now: sessionClock(record?.asOf),
|
|
3896
|
+
...(record?.asOf === undefined ? {} : { asOf: record.asOf }),
|
|
3715
3897
|
});
|
|
3716
|
-
|
|
3898
|
+
const executeBody =
|
|
3717
3899
|
record !== undefined && emit !== undefined
|
|
3718
|
-
?
|
|
3900
|
+
? () =>
|
|
3901
|
+
mcpAuthAls.run(
|
|
3902
|
+
{
|
|
3903
|
+
sessionId: record.sessionId,
|
|
3904
|
+
turnId: callId,
|
|
3905
|
+
callId,
|
|
3906
|
+
toolName,
|
|
3907
|
+
emit,
|
|
3908
|
+
},
|
|
3909
|
+
run
|
|
3910
|
+
)
|
|
3911
|
+
: run;
|
|
3912
|
+
result = normalizeToolResult(
|
|
3913
|
+
record !== undefined
|
|
3914
|
+
? await this.runToolExecute(
|
|
3719
3915
|
{
|
|
3720
|
-
|
|
3916
|
+
record,
|
|
3721
3917
|
turnId: callId,
|
|
3722
3918
|
callId,
|
|
3723
3919
|
toolName,
|
|
3724
|
-
emit,
|
|
3725
3920
|
},
|
|
3726
|
-
|
|
3921
|
+
executeBody
|
|
3727
3922
|
)
|
|
3728
|
-
: await
|
|
3923
|
+
: await executeBody()
|
|
3729
3924
|
);
|
|
3730
3925
|
isError = isErrorEnvelope(result);
|
|
3731
3926
|
}
|
|
@@ -3926,7 +4121,10 @@ export class SessionEngine {
|
|
|
3926
4121
|
return;
|
|
3927
4122
|
}
|
|
3928
4123
|
|
|
3929
|
-
const sessionCtx = {
|
|
4124
|
+
const sessionCtx: SessionContext = {
|
|
4125
|
+
session: this.sessionInfo(record),
|
|
4126
|
+
host: this.hostForSession(record.sessionId),
|
|
4127
|
+
};
|
|
3930
4128
|
const channelEvents = this.channelEventHandlersFor(record.channelId);
|
|
3931
4129
|
if (channelEvents !== undefined) {
|
|
3932
4130
|
// Handlers are declared against the narrowed event for their key; the
|
|
@@ -3969,14 +4167,13 @@ export class SessionEngine {
|
|
|
3969
4167
|
}
|
|
3970
4168
|
try {
|
|
3971
4169
|
await handler(event, {
|
|
4170
|
+
...sessionCtx,
|
|
3972
4171
|
agent: { name: this.project.name },
|
|
3973
4172
|
channel: {
|
|
3974
4173
|
id: record.channelId,
|
|
3975
4174
|
continuationToken: record.continuationKey,
|
|
3976
4175
|
},
|
|
3977
|
-
session: this.sessionInfo(record),
|
|
3978
4176
|
stateRoot: this.stateRoot,
|
|
3979
|
-
host: this.hostForSession(record.sessionId),
|
|
3980
4177
|
artifacts: this.artifactsApi({
|
|
3981
4178
|
sessionId: record.sessionId,
|
|
3982
4179
|
turnId: event.turnId,
|
|
@@ -3993,12 +4190,12 @@ export class SessionEngine {
|
|
|
3993
4190
|
if (this.abCollector.enabled) {
|
|
3994
4191
|
await this.abCollector.onEvent(
|
|
3995
4192
|
event,
|
|
3996
|
-
|
|
4193
|
+
sessionCtx.session,
|
|
3997
4194
|
this.project.name
|
|
3998
4195
|
);
|
|
3999
4196
|
}
|
|
4000
4197
|
|
|
4001
|
-
this.otel?.onEvent(event,
|
|
4198
|
+
this.otel?.onEvent(event, sessionCtx.session);
|
|
4002
4199
|
}
|
|
4003
4200
|
|
|
4004
4201
|
private channelEventHandlersFor(
|
|
@@ -5106,10 +5303,6 @@ function buildRunnerSubagents(agent: ResolvedAgent): RunnerSubagent[] {
|
|
|
5106
5303
|
}));
|
|
5107
5304
|
}
|
|
5108
5305
|
|
|
5109
|
-
function describeError(error: unknown): string {
|
|
5110
|
-
return error instanceof Error ? error.message : String(error);
|
|
5111
|
-
}
|
|
5112
|
-
|
|
5113
5306
|
function toolErrorResult(message: string): SDKCustomToolResult {
|
|
5114
5307
|
return {
|
|
5115
5308
|
content: [{ type: "text", text: message }],
|
|
@@ -15,21 +15,20 @@
|
|
|
15
15
|
* persist so a store outage never changes the hosted-execution HTTP reply.
|
|
16
16
|
*
|
|
17
17
|
* Same flush moments as `hosted-execution.json` and the start.log tee —
|
|
18
|
-
* see `hosted-execution-flush.ts`. Keys:
|
|
18
|
+
* see `hosted-execution-flush.ts`. Keys:
|
|
19
|
+
* {@link agentSdkStorageKeys.sessionRun}.
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
22
|
import type { FileSink } from "../files.js";
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
cursorHostedFiles,
|
|
25
|
-
} from "../files-backends/cursor-hosted.js";
|
|
26
|
-
import { storageKeys } from "../storage-protocol.js";
|
|
23
|
+
import { cursorHostedFiles } from "../files-backends/cursor-hosted.js";
|
|
24
|
+
import { agentSdkStorageKeys } from "../storage-protocol.js";
|
|
27
25
|
import type { AgentProject } from "../types.js";
|
|
28
26
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
29
|
-
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
30
27
|
import { describeError } from "./describe-error.js";
|
|
31
28
|
import type { HostedExecutionDiagAbortReason } from "./hosted-execution-diag.js";
|
|
29
|
+
import { isRecord } from "./is-record.js";
|
|
32
30
|
import type { LogRingEntry } from "./log-ring.js";
|
|
31
|
+
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
33
32
|
|
|
34
33
|
export const SESSION_RUN_LOG_VERSION = 1;
|
|
35
34
|
/** Last N log-ring lines kept on each execution. */
|
|
@@ -195,10 +194,6 @@ export function snapshotSessionRunLogs(
|
|
|
195
194
|
}));
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
199
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
197
|
function decodeSinkBody(body: Uint8Array | { body: Uint8Array }): Uint8Array {
|
|
203
198
|
return body instanceof Uint8Array ? body : body.body;
|
|
204
199
|
}
|
|
@@ -442,7 +437,7 @@ export function createSessionRunLogStore(input: {
|
|
|
442
437
|
const readDocument = async (
|
|
443
438
|
sessionPublicId: string
|
|
444
439
|
): Promise<SessionRunLogDocument | undefined> => {
|
|
445
|
-
const key =
|
|
440
|
+
const key = agentSdkStorageKeys.sessionRun(agentName, sessionPublicId);
|
|
446
441
|
const body = await sink.get(key);
|
|
447
442
|
if (body === undefined) {
|
|
448
443
|
return undefined;
|
|
@@ -479,7 +474,10 @@ export function createSessionRunLogStore(input: {
|
|
|
479
474
|
updatedAt: fitted.writtenAt,
|
|
480
475
|
executions,
|
|
481
476
|
});
|
|
482
|
-
const key =
|
|
477
|
+
const key = agentSdkStorageKeys.sessionRun(
|
|
478
|
+
agentName,
|
|
479
|
+
document.sessionPublicId
|
|
480
|
+
);
|
|
483
481
|
try {
|
|
484
482
|
await sink.put(key, new TextEncoder().encode(JSON.stringify(document)));
|
|
485
483
|
} catch (error) {
|
|
@@ -558,17 +556,17 @@ export function selectSessionRunLogStore(input: {
|
|
|
558
556
|
env?: Record<string, string | undefined>;
|
|
559
557
|
snapshotLogs?: () => readonly LogRingEntry[];
|
|
560
558
|
}): SessionRunLogStore | undefined {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
if (
|
|
559
|
+
const hosting = resolveAgentV2Hosting({
|
|
560
|
+
architecture: input.project.agent.architecture,
|
|
561
|
+
env: input.env as NodeJS.ProcessEnv | undefined,
|
|
562
|
+
});
|
|
563
|
+
if (hosting.kind !== "cursor-managed") {
|
|
566
564
|
return undefined;
|
|
567
565
|
}
|
|
568
|
-
const envSnapshot = env as NodeJS.ProcessEnv;
|
|
569
566
|
return createSessionRunLogStore({
|
|
570
567
|
sink: cursorHostedFiles({
|
|
571
|
-
resolveStoreSourceId: () =>
|
|
568
|
+
resolveStoreSourceId: () =>
|
|
569
|
+
hosting.resolveStoreIds().frameworkStoreSourceId,
|
|
572
570
|
resolveApiKey: () => resolveApiKeySync()?.apiKey,
|
|
573
571
|
}),
|
|
574
572
|
agentName: input.project.name,
|