@cursor/july 0.1.101 → 0.1.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +34 -32
- package/README.md +28 -3
- package/dist/ab.d.ts +1 -1
- package/dist/ab.js +1 -1
- package/dist/bin/agent-serve.d.ts +12 -12
- package/dist/bin/agent-serve.js +114 -36
- package/dist/channels/bitbucket/api.d.ts +176 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +419 -0
- package/dist/channels/bitbucket/binding.d.ts +71 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +269 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +73 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +64 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +304 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +229 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/deployments/deployments-channel.d.ts +22 -14
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +25 -27
- package/dist/channels/deployments/types.d.ts +12 -6
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/binding.d.ts +6 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +3 -3
- package/dist/channels/github/cursor-account.d.ts +7 -3
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +10 -6
- package/dist/channels/github/events.d.ts +1 -1
- package/dist/channels/github/events.js +1 -1
- package/dist/channels/github/forward.d.ts +1 -1
- package/dist/channels/github/forward.d.ts.map +1 -1
- package/dist/channels/github/forward.js +3 -2
- package/dist/channels/github/github-channel.d.ts +29 -39
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +68 -101
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.js +1 -1
- package/dist/channels/github/state.d.ts +2 -0
- package/dist/channels/github/state.d.ts.map +1 -1
- package/dist/channels/github/state.js +14 -11
- package/dist/channels/github/types.d.ts +2 -4
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +91 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +150 -0
- package/dist/channels/gitlab/binding.d.ts +58 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +139 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +126 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +65 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +60 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +28 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +397 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +206 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +214 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +4 -2
- package/dist/channels/origin/origin-channel.d.ts +4 -9
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +8 -48
- package/dist/channels/origin/types.d.ts +20 -2
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -1
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +1 -7
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +28 -0
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +3 -3
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +6 -13
- package/dist/channels/slack/types.d.ts +1 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.BASO9Kih.js → app.DW9pXkpL.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.YZMHgPgg.js} +2 -2
- package/dist/docs/assets/{concepts.md.lwAgBIMI.js → concepts.md.DgEcZOfT.js} +1 -1
- package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.lean.js +1 -0
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.DKYiT9do.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
- package/dist/docs/assets/index.md.D75GWhPl.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.D75GWhPl.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.Dz8Cnudp.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
- package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.DuBu9a96.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +1 -1
- package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
- package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.aGrn99hP.js} +2 -2
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.haibFyoB.lean.js} +1 -1
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +5 -7
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/runtime-abstraction.md +2 -3
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +9 -7
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +91 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +0 -1
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/opentelemetry.html +11 -12
- package/dist/docs/guides/opentelemetry.md +41 -17
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +7 -3
- package/dist/docs/llms-full.txt +765 -209
- package/dist/docs/llms.txt +3 -1
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +6 -10
- package/dist/docs/reference/artifacts.html +5 -5
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +18 -8
- package/dist/docs/reference/cli.html +5 -5
- package/dist/docs/reference/cli.md +3 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +88 -0
- package/dist/docs/reference/extensions.md +264 -0
- package/dist/docs/reference/hooks.html +69 -10
- package/dist/docs/reference/hooks.md +215 -46
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +3 -0
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +4 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.html +45 -0
- package/dist/docs/reference/result.md +89 -0
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +3 -1
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +3 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +3 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +7 -7
- package/dist/docs/skills/otel.md +8 -3
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +0 -3
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/evals.d.ts +1 -1
- package/dist/evals.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
- package/dist/extensions.d.ts +54 -17
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +83 -15
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +21 -4
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +38 -21
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/ab-snapshot.js +0 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +1 -3
- package/dist/internal/authored-alias-hooks.d.ts +4 -13
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +4 -20
- package/dist/internal/authored-loaders.d.ts +2 -3
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +6 -20
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +77 -0
- package/dist/internal/chat-client.d.ts +1 -1
- package/dist/internal/chat-client.js +1 -1
- package/dist/internal/cli-ax.d.ts +5 -5
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +5 -5
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +359 -0
- package/dist/internal/cli-convert-automation.d.ts +1 -1
- package/dist/internal/cli-convert-automation.js +2 -2
- package/dist/internal/cli-cursor.d.ts +1 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -4
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -6
- package/dist/internal/cli-github.d.ts +1 -1
- package/dist/internal/cli-github.js +3 -3
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +380 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +2 -6
- package/dist/internal/cli-slack.d.ts +1 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +2 -4
- package/dist/internal/continuation-channel.d.ts +14 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +56 -3
- package/dist/internal/continuation-identity.d.ts +14 -15
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +182 -7
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +17 -18
- package/dist/internal/convert-automation/types.d.ts +1 -1
- package/dist/internal/convert-automation/types.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +1 -3
- package/dist/internal/cursor/backend-client.d.ts +13 -5
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +30 -15
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +39 -5
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +58 -8
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +12 -1
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +16 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +2 -4
- package/dist/internal/cursor-deployment-relay.d.ts +6 -2
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +13 -9
- package/dist/internal/deploy-manifest.d.ts +1 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +1 -1
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +113 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +255 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +422 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +568 -0
- package/dist/internal/discovery/extension-overlay.d.ts +32 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +191 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +375 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +61 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +147 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +107 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +293 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +118 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +21 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +134 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +128 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -63
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +6 -2504
- package/dist/internal/distribution.d.ts +10 -27
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +25 -73
- package/dist/internal/docs-site.js +1 -1
- package/dist/internal/eval-run-store.d.ts +0 -1
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.d.ts +8 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +14 -14
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/github-fanout.d.ts +1 -1
- package/dist/internal/github-fanout.js +1 -1
- package/dist/internal/guest-network.d.ts +101 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +304 -0
- package/dist/internal/host-otel.d.ts +3 -3
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +8 -4
- package/dist/internal/hosted-admission-adapter.d.ts +8 -7
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +18 -5
- package/dist/internal/hosted-delivery.d.ts +18 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +248 -118
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -3
- package/dist/internal/init-interview.d.ts.map +1 -1
- package/dist/internal/init-interview.js +1 -3
- package/dist/internal/init-project.d.ts +2 -2
- package/dist/internal/init-project.js +2 -2
- package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
- package/dist/internal/inline-stdio-define-stub.js +1 -1
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -10
- package/dist/internal/local-control-plane.d.ts +1 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +3 -20
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -3
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +37 -20
- package/dist/internal/otel/collector.d.ts +22 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +145 -126
- package/dist/internal/otel/config.d.ts +0 -2
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +17 -20
- package/dist/internal/otel/http.d.ts +2 -0
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +8 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +55 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +26 -1
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +166 -15
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +3 -11
- package/dist/internal/playground/toolchain.d.ts +1 -1
- package/dist/internal/playground/toolchain.d.ts.map +1 -1
- package/dist/internal/playground/toolchain.js +1 -1
- package/dist/internal/request-error-status.d.ts +12 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +52 -0
- package/dist/internal/resolve-prod-target.d.ts +1 -1
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +3 -7
- package/dist/internal/result-output.d.ts +18 -0
- package/dist/internal/result-output.d.ts.map +1 -0
- package/dist/internal/result-output.js +33 -0
- package/dist/internal/run-client.d.ts +2 -2
- package/dist/internal/run-client.js +2 -2
- package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +2 -15
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +3 -6
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +110 -35
- package/dist/internal/session-cost.d.ts +3 -3
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +3 -3
- package/dist/internal/session-engine.d.ts +31 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +208 -102
- package/dist/internal/session-run-log.d.ts +2 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -17
- package/dist/internal/skills-sync.d.ts +1 -4
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +10 -50
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/start-log-store.d.ts +1 -1
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +12 -14
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/tenant-slack/relay.d.ts +73 -0
- package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
- package/dist/internal/tenant-slack/relay.js +138 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/internal/workspace-sync.d.ts +22 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +49 -0
- package/dist/internal/workspace.d.ts +7 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +13 -0
- package/dist/otel.d.ts +39 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +118 -1
- package/dist/playground/assets/index-59KvgREd.js +67 -0
- package/dist/playground/assets/index-MbMxXg-y.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/result.d.ts +24 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +27 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +7 -4
- package/dist/storage-protocol.d.ts +24 -23
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +69 -68
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +126 -23
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +7 -3
- package/docs/concepts.md +5 -7
- package/docs/design/runtime-abstraction.md +2 -3
- package/docs/evals.md +9 -7
- package/docs/guides/cloud-agents.md +96 -0
- package/docs/guides/github.md +0 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +18 -8
- package/docs/reference/cli.md +3 -4
- package/docs/reference/extensions.md +269 -0
- package/docs/reference/hooks.md +215 -46
- package/docs/reference/playground.md +3 -0
- package/docs/reference/project-layout.md +4 -0
- package/docs/reference/result.md +94 -0
- package/docs/reference/sessions.md +3 -1
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +3 -2
- package/docs/templates/pr-autofixer.md +0 -3
- package/package.json +29 -10
- package/skills/framework-map/SKILL.md +3 -0
- package/skills/otel/SKILL.md +8 -3
- package/src/ab.ts +1 -1
- package/src/bin/agent-serve.ts +121 -21
- package/src/channels/bitbucket/api.ts +623 -0
- package/src/channels/bitbucket/binding.ts +414 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
- package/src/channels/bitbucket/checks.ts +154 -0
- package/src/channels/bitbucket/cursor-account.ts +117 -0
- package/src/channels/bitbucket/defaults.ts +110 -0
- package/src/channels/bitbucket/events.ts +84 -0
- package/src/channels/bitbucket/index.ts +49 -0
- package/src/channels/bitbucket/replay.ts +439 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +266 -0
- package/src/channels/deployments/deployments-channel.ts +25 -43
- package/src/channels/deployments/types.ts +12 -6
- package/src/channels/github/binding.ts +8 -1
- package/src/channels/github/cursor-account.ts +17 -6
- package/src/channels/github/events.ts +1 -1
- package/src/channels/github/forward.ts +3 -2
- package/src/channels/github/github-channel.ts +74 -221
- package/src/channels/github/replay.ts +1 -1
- package/src/channels/github/state.ts +6 -0
- package/src/channels/github/types.ts +2 -5
- package/src/channels/gitlab/api.ts +228 -0
- package/src/channels/gitlab/binding.ts +233 -0
- package/src/channels/gitlab/checks.ts +243 -0
- package/src/channels/gitlab/cursor-account.ts +114 -0
- package/src/channels/gitlab/defaults.ts +93 -0
- package/src/channels/gitlab/events.ts +44 -0
- package/src/channels/gitlab/gitlab-channel.ts +176 -0
- package/src/channels/gitlab/gitlab-webhook.ts +555 -0
- package/src/channels/gitlab/index.ts +43 -0
- package/src/channels/gitlab/replay.ts +347 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +263 -0
- package/src/channels/origin/api.ts +4 -2
- package/src/channels/origin/origin-channel.ts +19 -94
- package/src/channels/origin/types.ts +23 -2
- package/src/channels/slack/api.ts +4 -2
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/eval-directive.ts +1 -6
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/init.ts +6 -3
- package/src/channels/slack/manifest.ts +2 -1
- package/src/channels/slack/setup.ts +7 -6
- package/src/channels/slack/types.ts +1 -1
- package/src/channels.ts +0 -1
- package/src/client.ts +1 -1
- package/src/connections.ts +1 -1
- package/src/evals.ts +1 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
- package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +100 -15
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +64 -37
- package/src/index.ts +27 -26
- package/src/internal/ab-snapshot.ts +0 -3
- package/src/internal/advertise-tools.ts +1 -4
- package/src/internal/authored-alias-hooks.ts +4 -21
- package/src/internal/authored-loaders.ts +6 -23
- package/src/internal/channel-dispatch.ts +160 -0
- package/src/internal/chat-client.ts +1 -1
- package/src/internal/cli-ax.ts +5 -5
- package/src/internal/cli-bitbucket.ts +477 -0
- package/src/internal/cli-convert-automation.ts +7 -7
- package/src/internal/cli-cursor.ts +2 -5
- package/src/internal/cli-deploy.ts +2 -8
- package/src/internal/cli-github.ts +3 -3
- package/src/internal/cli-gitlab.ts +485 -0
- package/src/internal/cli-mcp.ts +2 -7
- package/src/internal/cli-slack.ts +2 -5
- package/src/internal/continuation-channel.ts +82 -1
- package/src/internal/continuation-identity.ts +229 -11
- package/src/internal/conversation-mirror.ts +27 -21
- package/src/internal/convert-automation/types.ts +1 -1
- package/src/internal/cursor/account-mcp.ts +1 -4
- package/src/internal/cursor/backend-client.ts +41 -20
- package/src/internal/cursor/bound-secret-file.ts +108 -0
- package/src/internal/cursor/credentials.ts +75 -10
- package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
- package/src/internal/cursor/hosted-store-secrets.ts +28 -1
- package/src/internal/cursor-account-mcp-auth.ts +2 -5
- package/src/internal/cursor-deployment-relay.ts +11 -7
- package/src/internal/deploy-manifest.ts +4 -2
- package/src/internal/discovery/ab.ts +131 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +319 -0
- package/src/internal/discovery/channels.ts +105 -0
- package/src/internal/discovery/connections.ts +545 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +705 -0
- package/src/internal/discovery/extension-overlay.ts +274 -0
- package/src/internal/discovery/extensions.ts +573 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +186 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +113 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +341 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +160 -0
- package/src/internal/discovery/skills.ts +186 -0
- package/src/internal/discovery/subagent.ts +136 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +18 -3081
- package/src/internal/distribution.ts +35 -83
- package/src/internal/docs-site.ts +1 -1
- package/src/internal/eval-run-store.ts +0 -7
- package/src/internal/eval-runner.ts +0 -1
- package/src/internal/framework-file-storage.ts +14 -14
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +383 -0
- package/src/internal/host-otel.ts +8 -4
- package/src/internal/hosted-admission-adapter.ts +8 -8
- package/src/internal/hosted-delivery-protocol.ts +26 -1
- package/src/internal/hosted-delivery.ts +376 -192
- package/src/internal/http-channel.ts +1 -4
- package/src/internal/init-interview.ts +1 -4
- package/src/internal/init-project.ts +2 -2
- package/src/internal/inline-stdio-define-stub.ts +1 -1
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +19 -10
- package/src/internal/local-control-plane.ts +5 -24
- package/src/internal/mcp-endpoint.ts +1 -4
- package/src/internal/mcp-host.ts +84 -31
- package/src/internal/otel/collector.ts +200 -165
- package/src/internal/otel/config.ts +10 -14
- package/src/internal/otel/http.ts +16 -13
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +242 -25
- package/src/internal/package-inline-stdio.ts +3 -12
- package/src/internal/playground/toolchain.ts +1 -1
- package/src/internal/request-error-status.ts +72 -0
- package/src/internal/resolve-prod-target.ts +3 -8
- package/src/internal/result-output.ts +34 -0
- package/src/internal/run-client.ts +2 -2
- package/src/internal/runtime-dispatch-runner.ts +3 -21
- package/src/internal/sdk-runner.ts +3 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +274 -81
- package/src/internal/session-run-log.ts +18 -20
- package/src/internal/skills-sync.ts +13 -63
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +13 -16
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/store-mirror.ts +86 -0
- package/src/internal/tenant-slack/relay.ts +179 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/internal/workspace-sync.ts +55 -0
- package/src/internal/workspace.ts +14 -0
- package/src/otel.ts +180 -2
- package/src/result.ts +36 -0
- package/src/storage-backends/cursor-hosted.ts +7 -4
- package/src/storage-protocol.ts +102 -95
- package/src/storage.ts +4 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +146 -34
- package/templates/triage/agent/lib/types.ts +0 -2
- package/dist/continuation.d.ts +0 -20
- package/dist/continuation.d.ts.map +0 -1
- package/dist/continuation.js +0 -18
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/docs/guides/cloud-runtime.html +0 -35
- package/dist/docs/guides/cloud-runtime.md +0 -115
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
- package/dist/internal/convert-automation/index.d.ts +0 -3
- package/dist/internal/convert-automation/index.d.ts.map +0 -1
- package/dist/internal/convert-automation/index.js +0 -1
- package/dist/internal/grokbot/runner.d.ts +0 -64
- package/dist/internal/grokbot/runner.d.ts.map +0 -1
- package/dist/internal/grokbot/runner.js +0 -282
- package/dist/internal/managed-delivery.d.ts +0 -80
- package/dist/internal/managed-delivery.d.ts.map +0 -1
- package/dist/internal/managed-delivery.js +0 -86
- package/dist/internal/review-comments.d.ts +0 -370
- package/dist/internal/review-comments.d.ts.map +0 -1
- package/dist/internal/review-comments.js +0 -921
- package/dist/internal/shallow-clone.d.ts +0 -176
- package/dist/internal/shallow-clone.d.ts.map +0 -1
- package/dist/internal/shallow-clone.js +0 -419
- package/dist/playground/assets/index-BnNN1-EK.js +0 -69
- package/dist/playground/assets/index-DBQCwFp0.css +0 -1
- package/docs/guides/cloud-runtime.md +0 -120
- package/src/continuation.ts +0 -49
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
- package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
- package/src/internal/convert-automation/index.ts +0 -10
- package/src/internal/grokbot/runner.ts +0 -370
- package/src/internal/managed-delivery.ts +0 -125
- package/src/internal/review-comments.ts +0 -1363
- package/src/internal/shallow-clone.ts +0 -609
- /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent/extensions/<ns>.ts` | `agent/extensions/<ns>/extension.ts`:
|
|
3
|
+
* agent-shaped trees and Cursor plugins mounted under a namespace.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Dirent } from "node:fs";
|
|
7
|
+
import { join, resolve } from "node:path";
|
|
8
|
+
import type {
|
|
9
|
+
ArtifactsDefinition,
|
|
10
|
+
ConnectionDefinition,
|
|
11
|
+
DiscoveredAB,
|
|
12
|
+
DiscoveredChannel,
|
|
13
|
+
DiscoveredConnection,
|
|
14
|
+
DiscoveredExtension,
|
|
15
|
+
DiscoveredHook,
|
|
16
|
+
DiscoveredSchedule,
|
|
17
|
+
DiscoveredSkill,
|
|
18
|
+
DiscoveredTool,
|
|
19
|
+
ExtensionMount,
|
|
20
|
+
ResolvedAgent,
|
|
21
|
+
SeedFile,
|
|
22
|
+
ToolDefinition,
|
|
23
|
+
} from "../../types.js";
|
|
24
|
+
import { buildIdentityPreamble, withIdentityPreamble } from "../workspace.js";
|
|
25
|
+
import { loadABs } from "./ab.js";
|
|
26
|
+
import { loadChannels } from "./channels.js";
|
|
27
|
+
import {
|
|
28
|
+
compileConnection,
|
|
29
|
+
compileHostConnection,
|
|
30
|
+
loadConnections,
|
|
31
|
+
loadHostConnections,
|
|
32
|
+
} from "./connections.js";
|
|
33
|
+
import { type DiscoveryContext, displayPath } from "./context.js";
|
|
34
|
+
import { type CursorPluginAgent, readCursorPlugin } from "./cursor-plugin.js";
|
|
35
|
+
import {
|
|
36
|
+
overlayAbs,
|
|
37
|
+
overlayArtifacts,
|
|
38
|
+
overlayChannels,
|
|
39
|
+
overlayHooks,
|
|
40
|
+
overlayInstructionsFragment,
|
|
41
|
+
overlaySchedules,
|
|
42
|
+
overlaySkills,
|
|
43
|
+
overlaySlot,
|
|
44
|
+
overlaySubagents,
|
|
45
|
+
} from "./extension-overlay.js";
|
|
46
|
+
import {
|
|
47
|
+
findModuleFile,
|
|
48
|
+
isDirectory,
|
|
49
|
+
isFile,
|
|
50
|
+
isModuleFile,
|
|
51
|
+
moduleStem,
|
|
52
|
+
sortedEntries,
|
|
53
|
+
} from "./fs.js";
|
|
54
|
+
import { loadHooks } from "./hooks.js";
|
|
55
|
+
import { loadInstructions } from "./instructions.js";
|
|
56
|
+
import { importDefault, moduleEntries } from "./modules.js";
|
|
57
|
+
import { validateName } from "./names.js";
|
|
58
|
+
import { loadSchedules } from "./schedules.js";
|
|
59
|
+
import { loadSeedFiles } from "./seed-files.js";
|
|
60
|
+
import { loadArtifacts, mergeArtifacts } from "./services.js";
|
|
61
|
+
import { loadSkills } from "./skills.js";
|
|
62
|
+
import { loadSubagents, subagent } from "./subagent.js";
|
|
63
|
+
import { compileTool, loadTools } from "./tools.js";
|
|
64
|
+
|
|
65
|
+
/** The agent's authored slot lists that mounted extensions append to. */
|
|
66
|
+
export interface ExtensionContributions {
|
|
67
|
+
tools: DiscoveredTool[];
|
|
68
|
+
skills: DiscoveredSkill[];
|
|
69
|
+
connections: DiscoveredConnection[];
|
|
70
|
+
hostConnections: DiscoveredConnection[];
|
|
71
|
+
subagents: ResolvedAgent[];
|
|
72
|
+
hooks: DiscoveredHook[];
|
|
73
|
+
channels: DiscoveredChannel[];
|
|
74
|
+
schedules: DiscoveredSchedule[];
|
|
75
|
+
instructionParts: string[];
|
|
76
|
+
seedFiles: SeedFile[];
|
|
77
|
+
abs: DiscoveredAB[];
|
|
78
|
+
artifacts: ArtifactsDefinition | undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Mount every extension under `agent/extensions/` and append what it
|
|
83
|
+
* contributes to the authored lists as `<ns>__<name>`, stamped with
|
|
84
|
+
* `extension`. The namespace is the mount's filename stem or directory name.
|
|
85
|
+
*/
|
|
86
|
+
export async function appendExtensions(
|
|
87
|
+
ctx: DiscoveryContext,
|
|
88
|
+
extensionsDir: string,
|
|
89
|
+
into: ExtensionContributions
|
|
90
|
+
): Promise<DiscoveredExtension[]> {
|
|
91
|
+
if (!(await isDirectory(extensionsDir))) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
const extensions: DiscoveredExtension[] = [];
|
|
95
|
+
for (const entry of await sortedEntries(extensionsDir)) {
|
|
96
|
+
const path = join(extensionsDir, entry.name);
|
|
97
|
+
const site = await resolveMountSite(ctx, path, entry);
|
|
98
|
+
if (site === undefined) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (extensions.some((extension) => extension.name === site.ns)) {
|
|
102
|
+
ctx.diagnostics.push({
|
|
103
|
+
severity: "error",
|
|
104
|
+
path: displayPath(ctx, path),
|
|
105
|
+
message: `Extension "${site.ns}" is mounted twice (as a file and as a directory).`,
|
|
106
|
+
});
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const mount = await importDefault(ctx, site.mountPath, "extension");
|
|
110
|
+
if (mount === undefined) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
extensions.push(
|
|
114
|
+
await mountExtension(ctx, site, mount as ExtensionMount, into)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return extensions;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface MountSite {
|
|
121
|
+
ns: string;
|
|
122
|
+
/** The module default-exporting the {@link ExtensionMount}. */
|
|
123
|
+
mountPath: string;
|
|
124
|
+
/** A directory mount; its slots overlay the extension's. */
|
|
125
|
+
overlayDir?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function resolveMountSite(
|
|
129
|
+
ctx: DiscoveryContext,
|
|
130
|
+
path: string,
|
|
131
|
+
entry: Dirent
|
|
132
|
+
): Promise<MountSite | undefined> {
|
|
133
|
+
if (entry.isDirectory()) {
|
|
134
|
+
if (!validateName(ctx, "extension", entry.name, path)) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
const mountPath = await findModuleFile(path, "extension");
|
|
138
|
+
if (mountPath === undefined) {
|
|
139
|
+
ctx.diagnostics.push({
|
|
140
|
+
severity: "error",
|
|
141
|
+
path: displayPath(ctx, path),
|
|
142
|
+
message:
|
|
143
|
+
"A directory mount needs an extension.ts default-exporting the mount (`export default ci({ ... })`).",
|
|
144
|
+
});
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
return { ns: entry.name, mountPath, overlayDir: path };
|
|
148
|
+
}
|
|
149
|
+
if (!entry.isFile() || !isModuleFile(entry.name)) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
const ns = moduleStem(entry.name);
|
|
153
|
+
return validateName(ctx, "extension", ns, path)
|
|
154
|
+
? { ns, mountPath: path }
|
|
155
|
+
: undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** What a mounted tree contributes, under the tree's own names. */
|
|
159
|
+
interface ExtensionTree {
|
|
160
|
+
description?: string;
|
|
161
|
+
tools: DiscoveredTool[];
|
|
162
|
+
skills: DiscoveredSkill[];
|
|
163
|
+
connections: DiscoveredConnection[];
|
|
164
|
+
hostConnections: DiscoveredConnection[];
|
|
165
|
+
/** Connection names the tree declares but left to the mount's overlay. */
|
|
166
|
+
overlaidServers: string[];
|
|
167
|
+
agents: CursorPluginAgent[];
|
|
168
|
+
subagents: ResolvedAgent[];
|
|
169
|
+
hooks: DiscoveredHook[];
|
|
170
|
+
channels: DiscoveredChannel[];
|
|
171
|
+
schedules: DiscoveredSchedule[];
|
|
172
|
+
instructions?: string;
|
|
173
|
+
seedFiles: SeedFile[];
|
|
174
|
+
abs: DiscoveredAB[];
|
|
175
|
+
artifacts?: ArtifactsDefinition;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function emptyDiscovered(
|
|
179
|
+
ns: string,
|
|
180
|
+
description?: string
|
|
181
|
+
): DiscoveredExtension {
|
|
182
|
+
return {
|
|
183
|
+
name: ns,
|
|
184
|
+
description,
|
|
185
|
+
tools: [],
|
|
186
|
+
skills: [],
|
|
187
|
+
connections: [],
|
|
188
|
+
hostConnections: [],
|
|
189
|
+
subagents: [],
|
|
190
|
+
hooks: [],
|
|
191
|
+
channels: [],
|
|
192
|
+
schedules: [],
|
|
193
|
+
instructions: false,
|
|
194
|
+
seedFiles: [],
|
|
195
|
+
abs: [],
|
|
196
|
+
artifactKinds: [],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Read the extension's tree, lay the mount's overlay on top (a same-named
|
|
202
|
+
* file replaces, `disable()` / `disableTool()` removes), then namespace
|
|
203
|
+
* what is left.
|
|
204
|
+
*/
|
|
205
|
+
async function mountExtension(
|
|
206
|
+
ctx: DiscoveryContext,
|
|
207
|
+
site: MountSite,
|
|
208
|
+
mount: ExtensionMount,
|
|
209
|
+
into: ExtensionContributions
|
|
210
|
+
): Promise<DiscoveredExtension> {
|
|
211
|
+
const mounted = emptyDiscovered(site.ns, mount.extension.description);
|
|
212
|
+
const root = resolve(ctx.rootDir, mount.extension.root);
|
|
213
|
+
if (!(await isDirectory(root))) {
|
|
214
|
+
const hint =
|
|
215
|
+
"layout" in mount.extension
|
|
216
|
+
? "Point `path` at the plugin directory."
|
|
217
|
+
: "Pass `import.meta.dirname` from extension.ts.";
|
|
218
|
+
ctx.diagnostics.push({
|
|
219
|
+
severity: "error",
|
|
220
|
+
path: displayPath(ctx, site.mountPath),
|
|
221
|
+
message: `Extension "${site.ns}" declares root ${root}, which is not a directory. ${hint}`,
|
|
222
|
+
});
|
|
223
|
+
return mounted;
|
|
224
|
+
}
|
|
225
|
+
const tree = await readExtensionTree(ctx, site, mount, root);
|
|
226
|
+
if (tree === undefined) {
|
|
227
|
+
return mounted;
|
|
228
|
+
}
|
|
229
|
+
mounted.description = mount.extension.description ?? tree.description;
|
|
230
|
+
|
|
231
|
+
const tools = byName(tree.tools);
|
|
232
|
+
const skills = byName(tree.skills);
|
|
233
|
+
const connections = byName(tree.connections);
|
|
234
|
+
const hostConnections = byName(tree.hostConnections);
|
|
235
|
+
const hooks = byName(tree.hooks);
|
|
236
|
+
const channels = byId(tree.channels);
|
|
237
|
+
const schedules = byName(tree.schedules);
|
|
238
|
+
const subagents = byName(tree.subagents);
|
|
239
|
+
for (const agent of tree.agents) {
|
|
240
|
+
subagents.set(agent.name, subagent(agent.name, agent));
|
|
241
|
+
}
|
|
242
|
+
const seedFiles = new Map(
|
|
243
|
+
tree.seedFiles.map((seed) => [seed.relativePath, seed])
|
|
244
|
+
);
|
|
245
|
+
const abs = byAbSource(tree.abs);
|
|
246
|
+
let artifacts = tree.artifacts;
|
|
247
|
+
let instructions = tree.instructions;
|
|
248
|
+
|
|
249
|
+
if (site.overlayDir !== undefined) {
|
|
250
|
+
const connectionOverlay = await moduleEntries(
|
|
251
|
+
ctx,
|
|
252
|
+
join(site.overlayDir, "mcp-connections"),
|
|
253
|
+
"connection"
|
|
254
|
+
);
|
|
255
|
+
await overlaySlot(
|
|
256
|
+
ctx,
|
|
257
|
+
site,
|
|
258
|
+
tools,
|
|
259
|
+
await moduleEntries(ctx, join(site.overlayDir, "tools"), "tool"),
|
|
260
|
+
{
|
|
261
|
+
kind: "tool",
|
|
262
|
+
disabledKind: "disabled-tool",
|
|
263
|
+
disableHelper: "disableTool",
|
|
264
|
+
declared: new Set(tools.keys()),
|
|
265
|
+
compile: (ctx, path, name, definition) =>
|
|
266
|
+
compileTool(ctx, path, name, definition as ToolDefinition),
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
await overlaySlot(ctx, site, connections, connectionOverlay, {
|
|
270
|
+
kind: "connection",
|
|
271
|
+
disabledKind: "disabled-connection",
|
|
272
|
+
disableHelper: "disableConnection",
|
|
273
|
+
declared: new Set([...connections.keys(), ...tree.overlaidServers]),
|
|
274
|
+
compile: (ctx, path, name, definition) =>
|
|
275
|
+
compileConnection(
|
|
276
|
+
ctx,
|
|
277
|
+
path,
|
|
278
|
+
name,
|
|
279
|
+
definition as ConnectionDefinition,
|
|
280
|
+
"model"
|
|
281
|
+
),
|
|
282
|
+
});
|
|
283
|
+
await overlaySlot(
|
|
284
|
+
ctx,
|
|
285
|
+
site,
|
|
286
|
+
hostConnections,
|
|
287
|
+
await moduleEntries(
|
|
288
|
+
ctx,
|
|
289
|
+
join(site.overlayDir, "host-connections"),
|
|
290
|
+
"connection"
|
|
291
|
+
),
|
|
292
|
+
{
|
|
293
|
+
kind: "connection",
|
|
294
|
+
disabledKind: "disabled-connection",
|
|
295
|
+
disableHelper: "disableConnection",
|
|
296
|
+
declared: new Set(hostConnections.keys()),
|
|
297
|
+
compile: (ctx, path, name, definition) =>
|
|
298
|
+
compileHostConnection(
|
|
299
|
+
ctx,
|
|
300
|
+
path,
|
|
301
|
+
name,
|
|
302
|
+
definition as ConnectionDefinition
|
|
303
|
+
),
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
await overlaySkills(ctx, site, skills, join(site.overlayDir, "skills"));
|
|
307
|
+
await overlayHooks(ctx, site, hooks, join(site.overlayDir, "hooks"));
|
|
308
|
+
await overlayChannels(
|
|
309
|
+
ctx,
|
|
310
|
+
site,
|
|
311
|
+
channels,
|
|
312
|
+
join(site.overlayDir, "channels")
|
|
313
|
+
);
|
|
314
|
+
await overlaySchedules(
|
|
315
|
+
ctx,
|
|
316
|
+
site,
|
|
317
|
+
schedules,
|
|
318
|
+
join(site.overlayDir, "schedules")
|
|
319
|
+
);
|
|
320
|
+
await overlaySubagents(
|
|
321
|
+
ctx,
|
|
322
|
+
site,
|
|
323
|
+
subagents,
|
|
324
|
+
join(site.overlayDir, "subagents")
|
|
325
|
+
);
|
|
326
|
+
const overlayInstructions = await overlayInstructionsFragment(
|
|
327
|
+
ctx,
|
|
328
|
+
site.overlayDir
|
|
329
|
+
);
|
|
330
|
+
if (overlayInstructions !== "keep") {
|
|
331
|
+
instructions = overlayInstructions;
|
|
332
|
+
}
|
|
333
|
+
for (const seed of await loadSeedFiles(ctx, site.overlayDir)) {
|
|
334
|
+
seedFiles.set(seed.relativePath, seed);
|
|
335
|
+
}
|
|
336
|
+
await overlayAbs(ctx, site, abs, site.overlayDir);
|
|
337
|
+
artifacts = await overlayArtifacts(ctx, site.overlayDir, artifacts);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
for (const [name, tool] of tools) {
|
|
341
|
+
const composed = `${site.ns}__${name}`;
|
|
342
|
+
into.tools.push({ ...tool, name: composed, extension: site.ns });
|
|
343
|
+
mounted.tools.push(composed);
|
|
344
|
+
}
|
|
345
|
+
for (const [name, skill] of skills) {
|
|
346
|
+
const composed = `${site.ns}__${name}`;
|
|
347
|
+
into.skills.push({ ...skill, name: composed, extension: site.ns });
|
|
348
|
+
mounted.skills.push(composed);
|
|
349
|
+
}
|
|
350
|
+
const modelNames = new Set<string>();
|
|
351
|
+
for (const [name, connection] of connections) {
|
|
352
|
+
const composed = `${site.ns}__${name}`;
|
|
353
|
+
modelNames.add(composed);
|
|
354
|
+
into.connections.push({ ...connection, name: composed });
|
|
355
|
+
mounted.connections.push(composed);
|
|
356
|
+
}
|
|
357
|
+
for (const [name, connection] of hostConnections) {
|
|
358
|
+
const composed = `${site.ns}__${name}`;
|
|
359
|
+
if (modelNames.has(composed)) {
|
|
360
|
+
ctx.diagnostics.push({
|
|
361
|
+
severity: "error",
|
|
362
|
+
path: displayPath(ctx, join(root, "host-connections", `${name}.ts`)),
|
|
363
|
+
message: `Host connection "${composed}" collides with MCP connection "${composed}". Rename one of them.`,
|
|
364
|
+
});
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
into.hostConnections.push({ ...connection, name: composed });
|
|
368
|
+
mounted.hostConnections.push(composed);
|
|
369
|
+
}
|
|
370
|
+
for (const [name, child] of subagents) {
|
|
371
|
+
const composed = `${site.ns}__${name}`;
|
|
372
|
+
into.subagents.push(namespaceSubagent(composed, child));
|
|
373
|
+
mounted.subagents.push(composed);
|
|
374
|
+
}
|
|
375
|
+
for (const [name, hook] of hooks) {
|
|
376
|
+
const composed = `${site.ns}__${name}`;
|
|
377
|
+
into.hooks.push({ ...hook, name: composed });
|
|
378
|
+
mounted.hooks.push(composed);
|
|
379
|
+
}
|
|
380
|
+
for (const [id, channel] of channels) {
|
|
381
|
+
const composed = `${site.ns}__${id}`;
|
|
382
|
+
into.channels.push({ ...channel, id: composed });
|
|
383
|
+
mounted.channels.push(composed);
|
|
384
|
+
}
|
|
385
|
+
for (const [name, schedule] of schedules) {
|
|
386
|
+
const composed = `${site.ns}__${name}`;
|
|
387
|
+
into.schedules.push({ ...schedule, name: composed });
|
|
388
|
+
mounted.schedules.push(composed);
|
|
389
|
+
}
|
|
390
|
+
if (instructions !== undefined && instructions !== "") {
|
|
391
|
+
into.instructionParts.push(instructions);
|
|
392
|
+
mounted.instructions = true;
|
|
393
|
+
}
|
|
394
|
+
for (const seed of seedFiles.values()) {
|
|
395
|
+
if (
|
|
396
|
+
into.seedFiles.some(
|
|
397
|
+
(existing) => existing.relativePath === seed.relativePath
|
|
398
|
+
)
|
|
399
|
+
) {
|
|
400
|
+
ctx.diagnostics.push({
|
|
401
|
+
severity: "warning",
|
|
402
|
+
path: displayPath(ctx, seed.sourcePath),
|
|
403
|
+
message: `Extension seed "${seed.relativePath}" collides with an existing workspace seed; keeping the first.`,
|
|
404
|
+
});
|
|
405
|
+
continue;
|
|
406
|
+
}
|
|
407
|
+
into.seedFiles.push(seed);
|
|
408
|
+
mounted.seedFiles.push(seed.relativePath);
|
|
409
|
+
}
|
|
410
|
+
for (const experiment of abs.values()) {
|
|
411
|
+
const composed = `${site.ns}__${experiment.name}`;
|
|
412
|
+
into.abs.push({
|
|
413
|
+
name: composed,
|
|
414
|
+
definition: experiment.definition,
|
|
415
|
+
});
|
|
416
|
+
mounted.abs.push(composed);
|
|
417
|
+
}
|
|
418
|
+
if (artifacts !== undefined) {
|
|
419
|
+
const kinds: NonNullable<ArtifactsDefinition["kinds"]> = {};
|
|
420
|
+
for (const [kind, config] of Object.entries(artifacts.kinds ?? {})) {
|
|
421
|
+
const composed = `${site.ns}__${kind}`;
|
|
422
|
+
kinds[composed] = config;
|
|
423
|
+
mounted.artifactKinds.push(composed);
|
|
424
|
+
}
|
|
425
|
+
into.artifacts = mergeArtifacts(into.artifacts, {
|
|
426
|
+
...artifacts,
|
|
427
|
+
kinds,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
return mounted;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
async function readExtensionTree(
|
|
434
|
+
ctx: DiscoveryContext,
|
|
435
|
+
site: MountSite,
|
|
436
|
+
mount: ExtensionMount,
|
|
437
|
+
root: string
|
|
438
|
+
): Promise<ExtensionTree | undefined> {
|
|
439
|
+
if ("layout" in mount.extension) {
|
|
440
|
+
const connectionOverlay =
|
|
441
|
+
site.overlayDir === undefined
|
|
442
|
+
? []
|
|
443
|
+
: await moduleEntries(
|
|
444
|
+
ctx,
|
|
445
|
+
join(site.overlayDir, "mcp-connections"),
|
|
446
|
+
"connection"
|
|
447
|
+
);
|
|
448
|
+
const plugin = await readCursorPlugin(
|
|
449
|
+
ctx,
|
|
450
|
+
root,
|
|
451
|
+
site.mountPath,
|
|
452
|
+
mount.extension.variables,
|
|
453
|
+
new Set(connectionOverlay.map((entry) => entry.name))
|
|
454
|
+
);
|
|
455
|
+
if (plugin === undefined) {
|
|
456
|
+
return undefined;
|
|
457
|
+
}
|
|
458
|
+
return {
|
|
459
|
+
...plugin,
|
|
460
|
+
tools: [],
|
|
461
|
+
hostConnections: [],
|
|
462
|
+
subagents: [],
|
|
463
|
+
hooks: [],
|
|
464
|
+
channels: [],
|
|
465
|
+
schedules: [],
|
|
466
|
+
seedFiles: [],
|
|
467
|
+
abs: [],
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
return readNativeTree(ctx, root);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
async function readNativeTree(
|
|
474
|
+
ctx: DiscoveryContext,
|
|
475
|
+
root: string
|
|
476
|
+
): Promise<ExtensionTree> {
|
|
477
|
+
await warnAgentRootOnlySlots(ctx, root);
|
|
478
|
+
const connections = await loadConnections(ctx, join(root, "mcp-connections"));
|
|
479
|
+
return {
|
|
480
|
+
tools: await loadTools(ctx, join(root, "tools")),
|
|
481
|
+
skills: await loadSkills(ctx, join(root, "skills")),
|
|
482
|
+
connections,
|
|
483
|
+
hostConnections: await loadHostConnections(ctx, root, connections),
|
|
484
|
+
overlaidServers: [],
|
|
485
|
+
agents: [],
|
|
486
|
+
subagents: await loadSubagents(ctx, join(root, "subagents")),
|
|
487
|
+
hooks: await loadHooks(ctx, join(root, "hooks")),
|
|
488
|
+
channels: (await loadChannels(ctx, join(root, "channels"), "extension"))
|
|
489
|
+
.channels,
|
|
490
|
+
schedules: await loadSchedules(ctx, join(root, "schedules")),
|
|
491
|
+
instructions: await loadInstructions(ctx, root, undefined, false),
|
|
492
|
+
seedFiles: await loadSeedFiles(ctx, root),
|
|
493
|
+
abs: await loadABs(ctx, root),
|
|
494
|
+
artifacts: await loadArtifacts(ctx, root),
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function namespaceSubagent(
|
|
499
|
+
composed: string,
|
|
500
|
+
child: ResolvedAgent
|
|
501
|
+
): ResolvedAgent {
|
|
502
|
+
const oldPreamble = buildIdentityPreamble(child.name);
|
|
503
|
+
let body = child.instructions;
|
|
504
|
+
if (
|
|
505
|
+
body !== undefined &&
|
|
506
|
+
oldPreamble !== "" &&
|
|
507
|
+
body.startsWith(oldPreamble)
|
|
508
|
+
) {
|
|
509
|
+
body = body.slice(oldPreamble.length).replace(/^\n+/, "");
|
|
510
|
+
}
|
|
511
|
+
return {
|
|
512
|
+
...child,
|
|
513
|
+
name: composed,
|
|
514
|
+
instructions: withIdentityPreamble(composed, body),
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function byName<T extends { name: string }>(items: T[]): Map<string, T> {
|
|
519
|
+
return new Map(items.map((item) => [item.name, item]));
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
function byAbSource(items: DiscoveredAB[]): Map<string, DiscoveredAB> {
|
|
523
|
+
return new Map(items.map((item) => [item.source ?? item.name, item]));
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function byId<T extends { id: string }>(items: T[]): Map<string, T> {
|
|
527
|
+
return new Map(items.map((item) => [item.id, item]));
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Agent-singleton slots: one runtime (`agent.ts`), one storage backend,
|
|
532
|
+
* one OTLP exporter, one A/B platform config. Playground chips are a
|
|
533
|
+
* Vite glob of the agent tree, not a discovery walk. Nested
|
|
534
|
+
* `extensions/` are not mounted.
|
|
535
|
+
*/
|
|
536
|
+
async function warnAgentRootOnlySlots(
|
|
537
|
+
ctx: DiscoveryContext,
|
|
538
|
+
root: string
|
|
539
|
+
): Promise<void> {
|
|
540
|
+
const files = [
|
|
541
|
+
["agent.ts", "agent.ts"],
|
|
542
|
+
["storage.ts", "storage"],
|
|
543
|
+
["otel.ts", "otel"],
|
|
544
|
+
["ab.config.ts", "A/B config"],
|
|
545
|
+
] as const;
|
|
546
|
+
for (const [file, label] of files) {
|
|
547
|
+
const path = join(root, file);
|
|
548
|
+
if (await isFile(path)) {
|
|
549
|
+
ctx.diagnostics.push({
|
|
550
|
+
severity: "warning",
|
|
551
|
+
path: displayPath(ctx, path),
|
|
552
|
+
message: `The agent that mounts this extension owns ${label}; ignoring.`,
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
const dirs = [
|
|
557
|
+
[
|
|
558
|
+
"playground",
|
|
559
|
+
"Playground chips are a Vite glob of the agent tree, not an extension slot; ignoring.",
|
|
560
|
+
],
|
|
561
|
+
["extensions", "Nested extensions are not mounted; ignoring."],
|
|
562
|
+
] as const;
|
|
563
|
+
for (const [slot, message] of dirs) {
|
|
564
|
+
const path = join(root, slot);
|
|
565
|
+
if (await isDirectory(path)) {
|
|
566
|
+
ctx.diagnostics.push({
|
|
567
|
+
severity: "warning",
|
|
568
|
+
path: displayPath(ctx, path),
|
|
569
|
+
message,
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem primitives discovery walks with: module-file detection, directory listing, and project-root markers.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { Dirent } from "node:fs";
|
|
6
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
7
|
+
import { extname, join } from "node:path";
|
|
8
|
+
|
|
9
|
+
const MODULE_EXTENSIONS = new Set([".ts", ".mts", ".js", ".mjs"]);
|
|
10
|
+
|
|
11
|
+
export async function findModuleFile(
|
|
12
|
+
dir: string,
|
|
13
|
+
stem: string
|
|
14
|
+
): Promise<string | undefined> {
|
|
15
|
+
for (const extension of [".ts", ".mts", ".js", ".mjs"]) {
|
|
16
|
+
const candidate = join(dir, `${stem}${extension}`);
|
|
17
|
+
if (await isFile(candidate)) {
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function isModuleFile(fileName: string): boolean {
|
|
25
|
+
if (fileName.endsWith(".d.ts") || fileName.startsWith(".")) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (!MODULE_EXTENSIONS.has(extname(fileName))) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
// Colocated unit tests (Vitest/Jest convention) are not definitions.
|
|
32
|
+
// Without this, `channels/slack.test.ts` is scanned as a channel named
|
|
33
|
+
// "slack.test", fails NAME_PATTERN, and the whole agent refuses to serve.
|
|
34
|
+
const stem = moduleStem(fileName);
|
|
35
|
+
return !stem.endsWith(".test") && !stem.endsWith(".spec");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function moduleStem(fileName: string): string {
|
|
39
|
+
return fileName.slice(0, -extname(fileName).length);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function sortedEntries(dir: string): Promise<Dirent[]> {
|
|
43
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
44
|
+
return entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function walkFiles(dir: string): Promise<string[]> {
|
|
48
|
+
const files: string[] = [];
|
|
49
|
+
for (const entry of await sortedEntries(dir)) {
|
|
50
|
+
if (entry.name.startsWith(".")) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const entryPath = join(dir, entry.name);
|
|
54
|
+
if (entry.isDirectory()) {
|
|
55
|
+
files.push(...(await walkFiles(entryPath)));
|
|
56
|
+
} else if (entry.isFile()) {
|
|
57
|
+
files.push(entryPath);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return files;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export async function isDirectory(path: string): Promise<boolean> {
|
|
64
|
+
try {
|
|
65
|
+
return (await stat(path)).isDirectory();
|
|
66
|
+
} catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function isFile(path: string): Promise<boolean> {
|
|
72
|
+
try {
|
|
73
|
+
return (await stat(path)).isFile();
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function toPosix(path: string): string {
|
|
80
|
+
return path.split("\\").join("/");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export async function hasFlatLayoutMarkers(rootDir: string): Promise<boolean> {
|
|
84
|
+
if (await isFile(join(rootDir, "instructions.md"))) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return (await findModuleFile(rootDir, "agent")) !== undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export async function readPackageName(
|
|
91
|
+
rootDir: string
|
|
92
|
+
): Promise<string | undefined> {
|
|
93
|
+
const packageJsonPath = join(rootDir, "package.json");
|
|
94
|
+
if (!(await isFile(packageJsonPath))) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
const parsed = JSON.parse(await readFile(packageJsonPath, "utf8")) as {
|
|
99
|
+
name?: unknown;
|
|
100
|
+
};
|
|
101
|
+
if (typeof parsed.name === "string" && parsed.name !== "") {
|
|
102
|
+
return parsed.name;
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
// Malformed package.json falls back to the directory name.
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|