@cursor/july 0.1.100 → 0.1.102
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/README.md +27 -0
- package/dist/bin/agent-serve.js +3 -2
- package/dist/channels/deployments/deployments-channel.d.ts +41 -5
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +88 -8
- package/dist/channels/deployments/types.d.ts +4 -3
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +111 -0
- package/dist/channels/origin/index.d.ts +2 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +2 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +24 -3
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +23 -1
- 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 +5 -2
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +168 -0
- 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/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/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +11 -4
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/connections.d.ts +18 -2
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +18 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DZ1e0Ycq.js → app.CLA03RCz.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.l8omwc6D.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.JVcD6gel.js → theme.DWCwM6p-.js} +2 -2
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.lean.js +1 -0
- package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.js → guides_cloud-runtime.md.BRirbRAN.js} +1 -1
- package/dist/docs/assets/index.md.Kiht7ell.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.Kiht7ell.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BiGoBAk2.js → reference_connections.md.Di6jJAXF.js} +12 -2
- package/dist/docs/assets/{reference_connections.md.BiGoBAk2.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.js +56 -0
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +1 -0
- package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.CA6QP6Lw.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.CA6QP6Lw.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.B1up2r9W.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.DDa4MeEW.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 +3 -3
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- 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 +93 -0
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +2 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +5 -5
- 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 +5 -1
- package/dist/docs/llms-full.txt +353 -5
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +5 -5
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +16 -6
- package/dist/docs/reference/connections.md +31 -0
- package/dist/docs/reference/extensions.html +82 -0
- package/dist/docs/reference/extensions.md +200 -0
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +1 -1
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +3 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- 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 +2 -0
- 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 +1 -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 +4 -4
- 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 +4 -4
- 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/extensions/cursor-cloud-agents/extension.d.ts +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- 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/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -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/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -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 +41 -0
- 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 +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- 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/reply.js +35 -0
- package/dist/extensions.d.ts +73 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +112 -0
- 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 +5 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +22 -18
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/internal/advertise-tools.d.ts +4 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +20 -1
- package/dist/internal/as-of.d.ts +18 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +131 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +64 -19
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +3 -1
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +13 -15
- package/dist/internal/cursor/backend-client.d.ts +8 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +25 -9
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +16 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +11 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +15 -0
- package/dist/internal/cursor-deployment-relay.d.ts +15 -1
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +46 -7
- package/dist/internal/deploy-client.d.ts +23 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +54 -12
- 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 +101 -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 +11 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +306 -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 +17 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +436 -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 +570 -0
- package/dist/internal/discovery/extensions.d.ts +19 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +238 -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 +48 -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 +141 -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 +101 -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 +36 -0
- package/dist/internal/discovery/project.d.ts +53 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +239 -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 +98 -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 +97 -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 +17 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +104 -0
- package/dist/internal/discovery/skills.d.ts +16 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +151 -0
- package/dist/internal/discovery/subagent.d.ts +13 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +19 -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 -62
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +8 -2210
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +5 -0
- package/dist/internal/framework-file-storage.d.ts +3 -3
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +38 -9
- 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/hosted-delivery.d.ts +3 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +19 -32
- package/dist/internal/hosted-execution-diag.d.ts +5 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +5 -0
- package/dist/internal/hosted-execution-flush.d.ts +46 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +81 -0
- package/dist/internal/mcp-endpoint.js +1 -0
- package/dist/internal/mcp-host.d.ts +2 -1
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +66 -29
- package/dist/internal/otel/collector.d.ts +13 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +84 -17
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +2 -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 +68 -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.map +1 -1
- package/dist/internal/otel/runtime.js +2 -0
- package/dist/internal/review-comments.d.ts +1 -1
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +4 -4
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +79 -104
- package/dist/internal/session-engine.d.ts +14 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +113 -66
- package/dist/internal/session-run-log.d.ts +3 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -14
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- 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/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/tool-policy.d.ts +8 -0
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +19 -7
- 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/otel.d.ts +16 -0
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +26 -0
- package/dist/playground/assets/index-B6C9S9nG.css +1 -0
- package/dist/playground/assets/{index-DVs98vPL.js → index-ZqNoT8Ie.js} +45 -45
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +47 -22
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +90 -54
- 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 +154 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -1
- package/docs/README.md +5 -1
- package/docs/concepts.md +3 -3
- package/docs/guides/cloud-agents.md +98 -0
- package/docs/guides/cloud-runtime.md +2 -0
- package/docs/reference/connections.md +31 -0
- package/docs/reference/extensions.md +205 -0
- package/docs/reference/http-api.md +1 -1
- package/docs/reference/project-layout.md +3 -0
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +2 -0
- package/package.json +18 -4
- package/skills/framework-map/SKILL.md +1 -0
- package/src/bin/agent-serve.ts +11 -2
- package/src/channels/deployments/deployments-channel.ts +117 -8
- package/src/channels/deployments/types.ts +4 -3
- package/src/channels/origin/defaults.ts +143 -0
- package/src/channels/origin/index.ts +2 -0
- package/src/channels/origin/origin-channel.ts +37 -1
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +24 -0
- package/src/channels/slack/api.ts +6 -3
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/code-fences.ts +183 -0
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/live-delivery.ts +16 -13
- package/src/channels/slack/manifest.ts +2 -1
- package/src/connections.ts +18 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +120 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- 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 +64 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +141 -0
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +43 -34
- package/src/index.ts +11 -0
- package/src/internal/advertise-tools.ts +37 -12
- package/src/internal/as-of.ts +163 -0
- package/src/internal/cli-deploy.ts +86 -23
- package/src/internal/continuation-identity.ts +3 -1
- package/src/internal/conversation-mirror.ts +23 -18
- package/src/internal/cursor/backend-client.ts +32 -10
- package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
- package/src/internal/cursor/hosted-store-secrets.ts +27 -0
- package/src/internal/cursor-deployment-relay.ts +65 -8
- package/src/internal/deploy-client.ts +73 -18
- package/src/internal/discovery/ab.ts +111 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +360 -0
- package/src/internal/discovery/channels.ts +103 -0
- package/src/internal/discovery/connections.ts +540 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +708 -0
- package/src/internal/discovery/extensions.ts +348 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +45 -0
- package/src/internal/discovery/info.ts +179 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +44 -0
- package/src/internal/discovery/project.ts +270 -0
- package/src/internal/discovery/runtime.ts +159 -0
- package/src/internal/discovery/schedules.ts +94 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +124 -0
- package/src/internal/discovery/skills.ts +176 -0
- package/src/internal/discovery/subagent.ts +29 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +20 -2724
- package/src/internal/distribution.ts +5 -0
- package/src/internal/framework-file-storage.ts +43 -9
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/hosted-delivery.ts +38 -63
- package/src/internal/hosted-execution-diag.ts +6 -0
- package/src/internal/hosted-execution-flush.ts +142 -0
- package/src/internal/mcp-endpoint.ts +1 -0
- package/src/internal/mcp-host.ts +116 -37
- package/src/internal/otel/collector.ts +125 -25
- package/src/internal/otel/http.ts +2 -12
- package/src/internal/otel/mcp.ts +69 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +2 -0
- package/src/internal/review-comments.ts +5 -2
- package/src/internal/server.ts +81 -100
- package/src/internal/session-engine.ts +152 -39
- package/src/internal/session-run-log.ts +18 -16
- package/src/internal/start-log-store.ts +174 -0
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/tool-policy.ts +39 -9
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/otel.ts +38 -0
- package/src/storage-protocol.ts +126 -79
- package/src/storage.ts +5 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +213 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.js +0 -1
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/playground/assets/index-BszoQDc6.css +0 -1
- /package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.rPzW2HZN.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.lean.js → guides_cloud-runtime.md.BRirbRAN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.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.B1up2r9W.lean.js} +0 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Cursor plugin directory read as an extension tree: skills, commands, agents, and MCP servers under the plugin's own names.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import { readFile } from "node:fs/promises";
|
|
14
|
+
import { basename, dirname, extname, isAbsolute, join } from "node:path";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { parseYamlFrontmatter } from "../frontmatter.js";
|
|
17
|
+
import { displayPath, errorMessage, isBlank, } from "./context.js";
|
|
18
|
+
import { isDirectory, isFile, sortedEntries, walkFiles } from "./fs.js";
|
|
19
|
+
import { skillDescription, skillFiles } from "./skills.js";
|
|
20
|
+
/** First match wins, as in Cursor. */
|
|
21
|
+
const MANIFEST_PATHS = [
|
|
22
|
+
".cursor-plugin/plugin.json",
|
|
23
|
+
".claude-plugin/plugin.json",
|
|
24
|
+
"plugin.json",
|
|
25
|
+
];
|
|
26
|
+
/** Probed in order; the first file to name a server defines it. */
|
|
27
|
+
const MCP_CONFIG_FILES = [".mcp.json", "mcp.json"];
|
|
28
|
+
const MARKDOWN_EXTENSIONS = new Set([".md", ".mdc", ".markdown"]);
|
|
29
|
+
const COMMAND_EXTENSIONS = new Set([...MARKDOWN_EXTENSIONS, ".txt"]);
|
|
30
|
+
/** `${NAME}`, `${NAME:-default}`, and the user-mcp.json spelling `${env:NAME}`. */
|
|
31
|
+
const PLACEHOLDER = /\$\{(?:env:([A-Za-z_][A-Za-z0-9_]*)|([^:}]+)(?::-([^}]*))?)\}/g;
|
|
32
|
+
const PLUGIN_ROOT_VARIABLES = new Set([
|
|
33
|
+
"CURSOR_PLUGIN_ROOT",
|
|
34
|
+
"CLAUDE_PLUGIN_ROOT",
|
|
35
|
+
]);
|
|
36
|
+
/** A component slot's declaration: one directory or a list of paths. */
|
|
37
|
+
const pathsSchema = z
|
|
38
|
+
.union([z.string(), z.array(z.string())])
|
|
39
|
+
.transform((value) => (typeof value === "string" ? [value] : value));
|
|
40
|
+
/** A blank or null value reads as absent, as a missing key would. */
|
|
41
|
+
const text = z
|
|
42
|
+
.string()
|
|
43
|
+
.nullish()
|
|
44
|
+
.transform((value) => value === undefined || value === null || value.trim() === ""
|
|
45
|
+
? undefined
|
|
46
|
+
: value);
|
|
47
|
+
const manifestSchema = z.object({
|
|
48
|
+
description: text.optional(),
|
|
49
|
+
skills: pathsSchema.optional(),
|
|
50
|
+
commands: pathsSchema.optional(),
|
|
51
|
+
agents: pathsSchema.optional(),
|
|
52
|
+
rules: z.unknown().optional(),
|
|
53
|
+
hooks: z.unknown().optional(),
|
|
54
|
+
mcpServers: z
|
|
55
|
+
.union([
|
|
56
|
+
z.string(),
|
|
57
|
+
z.record(z.unknown()),
|
|
58
|
+
z.array(z.union([z.string(), z.record(z.unknown())])),
|
|
59
|
+
])
|
|
60
|
+
.optional()
|
|
61
|
+
.transform((value) => {
|
|
62
|
+
const items = value === undefined || Array.isArray(value) ? (value !== null && value !== void 0 ? value : []) : [value];
|
|
63
|
+
return {
|
|
64
|
+
paths: items.filter((item) => typeof item === "string"),
|
|
65
|
+
inline: items.filter((item) => typeof item !== "string"),
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
const frontmatterSchema = z.object({
|
|
70
|
+
name: text.optional(),
|
|
71
|
+
description: text.optional(),
|
|
72
|
+
model: text.optional(),
|
|
73
|
+
});
|
|
74
|
+
/** One `mcpServers` entry after placeholder expansion. */
|
|
75
|
+
const mcpServerSchema = z.object({
|
|
76
|
+
type: z.string().optional(),
|
|
77
|
+
url: z.string().optional(),
|
|
78
|
+
headers: z.record(z.string()).optional(),
|
|
79
|
+
command: z.string().optional(),
|
|
80
|
+
args: z.array(z.string()).optional(),
|
|
81
|
+
env: z.record(z.string()).optional(),
|
|
82
|
+
cwd: z.string().optional(),
|
|
83
|
+
envFile: z.string().optional(),
|
|
84
|
+
/** Cursor's static OAuth client hint. */
|
|
85
|
+
auth: z.record(z.unknown()).optional(),
|
|
86
|
+
/** Claude's spelling of the same hint. */
|
|
87
|
+
oauth: z.record(z.unknown()).optional(),
|
|
88
|
+
/** Cursor disables unlisted tools; an empty list would disable them all. */
|
|
89
|
+
enabledTools: z.array(z.string()).nonempty().optional(),
|
|
90
|
+
});
|
|
91
|
+
export function readCursorPlugin(ctx, root, mountPath, variables, overlaid) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const manifest = yield readManifest(ctx, root, mountPath);
|
|
94
|
+
if (manifest === undefined) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
const plugin = {
|
|
98
|
+
ctx,
|
|
99
|
+
root,
|
|
100
|
+
manifestPath: manifest.path,
|
|
101
|
+
variables,
|
|
102
|
+
};
|
|
103
|
+
const skills = yield loadPluginSkills(plugin, manifest.data.skills);
|
|
104
|
+
for (const command of yield loadPluginCommands(plugin, manifest.data.commands)) {
|
|
105
|
+
if (skills.some((skill) => skill.name === command.name)) {
|
|
106
|
+
ctx.diagnostics.push({
|
|
107
|
+
severity: "warning",
|
|
108
|
+
path: displayPath(ctx, root),
|
|
109
|
+
message: `Plugin command "${command.name}" has the same name as a skill; the skill wins. Ignoring the command.`,
|
|
110
|
+
});
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
skills.push(command);
|
|
114
|
+
}
|
|
115
|
+
yield warnUnmountedSlots(plugin, manifest.data);
|
|
116
|
+
return Object.assign(Object.assign({ description: manifest.data.description, skills }, (yield loadPluginConnections(plugin, manifest.data.mcpServers, overlaid))), { agents: yield loadPluginAgents(plugin, manifest.data.agents) });
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function readManifest(ctx, root, mountPath) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
for (const rel of MANIFEST_PATHS) {
|
|
122
|
+
const path = join(root, rel);
|
|
123
|
+
if (!(yield isFile(path))) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const data = yield readJson(ctx, path);
|
|
127
|
+
if (data === undefined) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const parsed = manifestSchema.safeParse(data);
|
|
131
|
+
if (parsed.success) {
|
|
132
|
+
return { data: parsed.data, path };
|
|
133
|
+
}
|
|
134
|
+
ctx.diagnostics.push({
|
|
135
|
+
severity: "error",
|
|
136
|
+
path: displayPath(ctx, path),
|
|
137
|
+
message: `The plugin manifest is malformed: ${firstIssue(parsed.error)}.`,
|
|
138
|
+
});
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
ctx.diagnostics.push({
|
|
142
|
+
severity: "error",
|
|
143
|
+
path: displayPath(ctx, mountPath),
|
|
144
|
+
message: `${displayPath(ctx, root)} is not a Cursor plugin: it has no ${MANIFEST_PATHS.join(", ")}.`,
|
|
145
|
+
});
|
|
146
|
+
return undefined;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Slots Cursor applies through the IDE that have no agent-sdk mapping yet. */
|
|
150
|
+
function warnUnmountedSlots(plugin, manifest) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const unmounted = [];
|
|
153
|
+
if (manifest.rules !== undefined ||
|
|
154
|
+
(yield isDirectory(join(plugin.root, "rules")))) {
|
|
155
|
+
unmounted.push("rules");
|
|
156
|
+
}
|
|
157
|
+
if (manifest.hooks !== undefined ||
|
|
158
|
+
(yield isFile(join(plugin.root, "hooks", "hooks.json")))) {
|
|
159
|
+
unmounted.push("hooks");
|
|
160
|
+
}
|
|
161
|
+
if (unmounted.length === 0) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
plugin.ctx.diagnostics.push({
|
|
165
|
+
severity: "warning",
|
|
166
|
+
path: displayPath(plugin.ctx, plugin.root),
|
|
167
|
+
message: `Cursor plugin ${unmounted.join(" and ")} are not mounted yet; skills, commands, agents, and MCP servers are. Ignoring.`,
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function loadPluginSkills(plugin, declared) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const dirs = [];
|
|
174
|
+
if (declared === undefined) {
|
|
175
|
+
if (yield isFile(join(plugin.root, "SKILL.md"))) {
|
|
176
|
+
dirs.push(plugin.root);
|
|
177
|
+
}
|
|
178
|
+
dirs.push(...(yield skillDirsIn(join(plugin.root, "skills"))));
|
|
179
|
+
}
|
|
180
|
+
for (const path of declaredPaths(plugin, declared !== null && declared !== void 0 ? declared : [])) {
|
|
181
|
+
if (basename(path) === "SKILL.md" && (yield isFile(path))) {
|
|
182
|
+
dirs.push(dirname(path));
|
|
183
|
+
}
|
|
184
|
+
else if (yield isFile(join(path, "SKILL.md"))) {
|
|
185
|
+
dirs.push(path);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
dirs.push(...(yield skillDirsIn(path)));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const skills = [];
|
|
192
|
+
for (const dir of dirs) {
|
|
193
|
+
const skill = yield readSkillDir(plugin, dir);
|
|
194
|
+
if (skill !== undefined && !skills.some((s) => s.name === skill.name)) {
|
|
195
|
+
skills.push(skill);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return skills;
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/** Immediate subdirectories holding a SKILL.md. */
|
|
202
|
+
function skillDirsIn(dir) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
if (!(yield isDirectory(dir))) {
|
|
205
|
+
return [];
|
|
206
|
+
}
|
|
207
|
+
const dirs = [];
|
|
208
|
+
for (const entry of yield sortedEntries(dir)) {
|
|
209
|
+
const path = join(dir, entry.name);
|
|
210
|
+
if (entry.isDirectory() && (yield isFile(join(path, "SKILL.md")))) {
|
|
211
|
+
dirs.push(path);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return dirs;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function readSkillDir(plugin, dir) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
var _a;
|
|
220
|
+
const skillMdPath = join(dir, "SKILL.md");
|
|
221
|
+
const { data, body } = yield readMarkdown(plugin, skillMdPath);
|
|
222
|
+
const name = componentName(plugin, (_a = data.name) !== null && _a !== void 0 ? _a : basename(dir), skillMdPath);
|
|
223
|
+
if (name === undefined) {
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
name,
|
|
228
|
+
description: skillDescription(name, data.description, body),
|
|
229
|
+
markdown: body.trim(),
|
|
230
|
+
files: yield skillFiles(dir),
|
|
231
|
+
};
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function loadPluginCommands(plugin, declared) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
var _a;
|
|
237
|
+
const skills = [];
|
|
238
|
+
for (const path of yield componentFiles(plugin, declared, "commands", COMMAND_EXTENSIONS)) {
|
|
239
|
+
const { data, body } = yield readMarkdown(plugin, path);
|
|
240
|
+
const name = componentName(plugin, (_a = data.name) !== null && _a !== void 0 ? _a : fileStem(path), path);
|
|
241
|
+
if (name === undefined) {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
skills.push({
|
|
245
|
+
name,
|
|
246
|
+
description: skillDescription(name, data.description, body),
|
|
247
|
+
markdown: body.trim(),
|
|
248
|
+
files: {},
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
return skills;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function loadPluginAgents(plugin, declared) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
var _a;
|
|
257
|
+
const agents = [];
|
|
258
|
+
for (const path of yield componentFiles(plugin, declared, "agents", MARKDOWN_EXTENSIONS)) {
|
|
259
|
+
const { data, body } = yield readMarkdown(plugin, path);
|
|
260
|
+
const name = componentName(plugin, (_a = data.name) !== null && _a !== void 0 ? _a : fileStem(path), path);
|
|
261
|
+
if (name === undefined || agents.some((agent) => agent.name === name)) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (isBlank(body)) {
|
|
265
|
+
plugin.ctx.diagnostics.push({
|
|
266
|
+
severity: "warning",
|
|
267
|
+
path: displayPath(plugin.ctx, path),
|
|
268
|
+
message: "Plugin agent has no prompt body; ignoring.",
|
|
269
|
+
});
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
agents.push({
|
|
273
|
+
name,
|
|
274
|
+
description: data.description,
|
|
275
|
+
model: data.model === "inherit" ? undefined : data.model,
|
|
276
|
+
prompt: body.trim(),
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
return agents;
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* The plugin's MCP servers as connections. A server the mount overlays is
|
|
284
|
+
* reported by name and never compiled, so its placeholders need no values.
|
|
285
|
+
*/
|
|
286
|
+
function loadPluginConnections(plugin, declared, overlaid) {
|
|
287
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
288
|
+
const servers = new Map();
|
|
289
|
+
for (const file of MCP_CONFIG_FILES) {
|
|
290
|
+
const path = join(plugin.root, file);
|
|
291
|
+
if (!(yield isFile(path))) {
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
for (const [name, raw] of Object.entries(yield readMcpFile(plugin, path))) {
|
|
295
|
+
if (!servers.has(name)) {
|
|
296
|
+
servers.set(name, { raw, path });
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// The manifest's own `mcpServers` wins on a name both declare.
|
|
301
|
+
for (const path of declaredPaths(plugin, declared.paths)) {
|
|
302
|
+
for (const [name, raw] of Object.entries(yield readMcpFile(plugin, path))) {
|
|
303
|
+
servers.set(name, { raw, path });
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
for (const inline of declared.inline) {
|
|
307
|
+
for (const [name, raw] of Object.entries(mcpServersOf(inline))) {
|
|
308
|
+
servers.set(name, { raw, path: plugin.manifestPath });
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const connections = [];
|
|
312
|
+
const overlaidServers = [];
|
|
313
|
+
for (const [rawName, { raw, path }] of servers) {
|
|
314
|
+
const name = componentName(plugin, rawName, path);
|
|
315
|
+
if (name === undefined) {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
if (overlaid.has(name)) {
|
|
319
|
+
overlaidServers.push(name);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const connection = serverConnection(plugin, name, raw, path);
|
|
323
|
+
if (connection !== undefined) {
|
|
324
|
+
connections.push(connection);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return { connections, overlaidServers };
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function readMcpFile(plugin, path) {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
const data = yield readJson(plugin.ctx, path);
|
|
333
|
+
return isRecord(data) ? mcpServersOf(data) : {};
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
/** `{ mcpServers: { ... } }`, or a bare map of server-like entries. */
|
|
337
|
+
function mcpServersOf(data) {
|
|
338
|
+
if (isRecord(data.mcpServers)) {
|
|
339
|
+
return data.mcpServers;
|
|
340
|
+
}
|
|
341
|
+
const servers = {};
|
|
342
|
+
for (const [name, value] of Object.entries(data)) {
|
|
343
|
+
if (isRecord(value) && ("command" in value || "url" in value)) {
|
|
344
|
+
servers[name] = value;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return servers;
|
|
348
|
+
}
|
|
349
|
+
function serverConnection(plugin, name, raw, path) {
|
|
350
|
+
const unresolved = new Set();
|
|
351
|
+
const expanded = expandPlaceholders(raw, (key) => {
|
|
352
|
+
var _a;
|
|
353
|
+
if (PLUGIN_ROOT_VARIABLES.has(key)) {
|
|
354
|
+
return plugin.root;
|
|
355
|
+
}
|
|
356
|
+
return (_a = lookupVariable(plugin.variables, key)) !== null && _a !== void 0 ? _a : process.env[key];
|
|
357
|
+
}, unresolved);
|
|
358
|
+
if (unresolved.size > 0) {
|
|
359
|
+
plugin.ctx.diagnostics.push({
|
|
360
|
+
severity: "error",
|
|
361
|
+
path: displayPath(plugin.ctx, path),
|
|
362
|
+
message: `MCP server "${name}" needs ${[...unresolved].map((v) => `\${${v}}`).join(", ")}. Pass it in cursorPlugin({ variables }) or set it in the environment.`,
|
|
363
|
+
});
|
|
364
|
+
return undefined;
|
|
365
|
+
}
|
|
366
|
+
const parsed = mcpServerSchema.safeParse(expanded);
|
|
367
|
+
if (!parsed.success) {
|
|
368
|
+
plugin.ctx.diagnostics.push({
|
|
369
|
+
severity: "error",
|
|
370
|
+
path: displayPath(plugin.ctx, path),
|
|
371
|
+
message: `MCP server "${name}" is malformed: ${firstIssue(parsed.error)}.`,
|
|
372
|
+
});
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
const transport = serverTransport(plugin, name, parsed.data, path);
|
|
376
|
+
if (transport === undefined) {
|
|
377
|
+
return undefined;
|
|
378
|
+
}
|
|
379
|
+
const enabledTools = parsed.data.enabledTools;
|
|
380
|
+
return {
|
|
381
|
+
name,
|
|
382
|
+
transport,
|
|
383
|
+
// Cursor scopes the model to `enabledTools`; here that is an advertised allowlist.
|
|
384
|
+
advertiseTools: enabledTools === undefined ? undefined : true,
|
|
385
|
+
tools: enabledTools,
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
function serverTransport(plugin, name, server, path) {
|
|
389
|
+
if (server.url !== undefined) {
|
|
390
|
+
const type = server.type === "sse"
|
|
391
|
+
? "sse"
|
|
392
|
+
: server.type === "http"
|
|
393
|
+
? "http"
|
|
394
|
+
: undefined;
|
|
395
|
+
return {
|
|
396
|
+
type,
|
|
397
|
+
url: server.url,
|
|
398
|
+
headers: server.headers,
|
|
399
|
+
// Either client hint means the server speaks OAuth; the host PKCE flow
|
|
400
|
+
// (`mcp oauth`) owns it here.
|
|
401
|
+
oauth: server.auth !== undefined || server.oauth !== undefined
|
|
402
|
+
? true
|
|
403
|
+
: undefined,
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
if (server.command !== undefined) {
|
|
407
|
+
if (server.envFile !== undefined) {
|
|
408
|
+
plugin.ctx.diagnostics.push({
|
|
409
|
+
severity: "warning",
|
|
410
|
+
path: displayPath(plugin.ctx, path),
|
|
411
|
+
message: `MCP server "${name}" sets envFile, which is not supported; pass its variables in cursorPlugin({ variables }).`,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
type: server.type === "stdio" ? "stdio" : undefined,
|
|
416
|
+
command: server.command,
|
|
417
|
+
args: server.args,
|
|
418
|
+
env: server.env,
|
|
419
|
+
cwd: server.cwd,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
plugin.ctx.diagnostics.push({
|
|
423
|
+
severity: "error",
|
|
424
|
+
path: displayPath(plugin.ctx, path),
|
|
425
|
+
message: `MCP server "${name}" declares neither url nor command.`,
|
|
426
|
+
});
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
function expandPlaceholders(value, lookup, unresolved) {
|
|
430
|
+
if (typeof value === "string") {
|
|
431
|
+
return value.replace(PLACEHOLDER, (match, envKey, key, fallback) => {
|
|
432
|
+
var _a, _b;
|
|
433
|
+
const name = (_a = envKey !== null && envKey !== void 0 ? envKey : key) !== null && _a !== void 0 ? _a : "";
|
|
434
|
+
const resolved = (_b = lookup(name)) !== null && _b !== void 0 ? _b : fallback;
|
|
435
|
+
if (resolved === undefined) {
|
|
436
|
+
unresolved.add(name);
|
|
437
|
+
return match;
|
|
438
|
+
}
|
|
439
|
+
return resolved;
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
if (Array.isArray(value)) {
|
|
443
|
+
return value.map((item) => expandPlaceholders(item, lookup, unresolved));
|
|
444
|
+
}
|
|
445
|
+
if (isRecord(value)) {
|
|
446
|
+
const out = {};
|
|
447
|
+
for (const [key, item] of Object.entries(value)) {
|
|
448
|
+
out[key] = expandPlaceholders(item, lookup, unresolved);
|
|
449
|
+
}
|
|
450
|
+
return out;
|
|
451
|
+
}
|
|
452
|
+
return value;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Exact name first, then case-insensitive, as the Cursor loader resolves
|
|
456
|
+
* install variables: the Datadog plugin templates `${dd_site}` while its
|
|
457
|
+
* declared variable is `DD_SITE`.
|
|
458
|
+
*/
|
|
459
|
+
function lookupVariable(variables, key) {
|
|
460
|
+
var _a;
|
|
461
|
+
if (variables[key] !== undefined) {
|
|
462
|
+
return variables[key];
|
|
463
|
+
}
|
|
464
|
+
const lower = key.toLowerCase();
|
|
465
|
+
return (_a = Object.entries(variables).find(([name]) => name.toLowerCase() === lower)) === null || _a === void 0 ? void 0 : _a[1];
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Files a component slot resolves to: the manifest's declaration (files and
|
|
469
|
+
* directories, walked) or the conventional folder.
|
|
470
|
+
*/
|
|
471
|
+
function componentFiles(plugin, declared, folder, extensions) {
|
|
472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
473
|
+
const roots = declared === undefined
|
|
474
|
+
? [join(plugin.root, folder)]
|
|
475
|
+
: declaredPaths(plugin, declared);
|
|
476
|
+
const files = [];
|
|
477
|
+
for (const path of roots) {
|
|
478
|
+
if (yield isDirectory(path)) {
|
|
479
|
+
files.push(...(yield walkFiles(path)));
|
|
480
|
+
}
|
|
481
|
+
else if (yield isFile(path)) {
|
|
482
|
+
files.push(path);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return files.filter((file) => extensions.has(extname(file)));
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
/** Manifest paths resolve against the plugin root; escaping ones are refused, as in Cursor. */
|
|
489
|
+
function declaredPaths(plugin, declared) {
|
|
490
|
+
const paths = [];
|
|
491
|
+
for (const item of declared) {
|
|
492
|
+
const rel = item.replace(/^\.\//, "");
|
|
493
|
+
if (rel.includes("..") || isAbsolute(rel) || rel.includes("://")) {
|
|
494
|
+
plugin.ctx.diagnostics.push({
|
|
495
|
+
severity: "warning",
|
|
496
|
+
path: displayPath(plugin.ctx, plugin.manifestPath),
|
|
497
|
+
message: `Plugin manifest path "${item}" leaves the plugin directory; ignoring.`,
|
|
498
|
+
});
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
paths.push(join(plugin.root, rel));
|
|
502
|
+
}
|
|
503
|
+
return paths;
|
|
504
|
+
}
|
|
505
|
+
function readJson(ctx, path) {
|
|
506
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
507
|
+
try {
|
|
508
|
+
return JSON.parse(yield readFile(path, "utf8"));
|
|
509
|
+
}
|
|
510
|
+
catch (error) {
|
|
511
|
+
ctx.diagnostics.push({
|
|
512
|
+
severity: "error",
|
|
513
|
+
path: displayPath(ctx, path),
|
|
514
|
+
message: `Failed to parse ${basename(path)}: ${errorMessage(error)}`,
|
|
515
|
+
});
|
|
516
|
+
return undefined;
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
/** Frontmatter the reader understands; a malformed block warns and reads as empty. */
|
|
521
|
+
function readMarkdown(plugin, path) {
|
|
522
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
523
|
+
const { data, body, error } = parseYamlFrontmatter(yield readFile(path, "utf8"));
|
|
524
|
+
const parsed = frontmatterSchema.safeParse(data);
|
|
525
|
+
const problem = error !== null && error !== void 0 ? error : (parsed.success ? undefined : firstIssue(parsed.error));
|
|
526
|
+
if (problem !== undefined) {
|
|
527
|
+
plugin.ctx.diagnostics.push({
|
|
528
|
+
severity: "warning",
|
|
529
|
+
path: displayPath(plugin.ctx, path),
|
|
530
|
+
message: `Frontmatter is malformed (${problem}); using the file name and body.`,
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
return { data: parsed.success ? parsed.data : {}, body };
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Cursor lowercases and hyphenates component names; `_` and `.` fold to `-`
|
|
538
|
+
* as well so the name fits the tool-name rule and can never carry `__`.
|
|
539
|
+
*/
|
|
540
|
+
function componentName(plugin, raw, path) {
|
|
541
|
+
const name = raw
|
|
542
|
+
.trim()
|
|
543
|
+
.toLowerCase()
|
|
544
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
545
|
+
.replace(/^-+|-+$/g, "");
|
|
546
|
+
if (name !== "") {
|
|
547
|
+
return name;
|
|
548
|
+
}
|
|
549
|
+
plugin.ctx.diagnostics.push({
|
|
550
|
+
severity: "error",
|
|
551
|
+
path: displayPath(plugin.ctx, path),
|
|
552
|
+
message: `Plugin component name "${raw}" has no usable characters; ignoring.`,
|
|
553
|
+
});
|
|
554
|
+
return undefined;
|
|
555
|
+
}
|
|
556
|
+
/** `headers: Expected object, received array`; the path names the field. */
|
|
557
|
+
function firstIssue(error) {
|
|
558
|
+
const issue = error.issues[0];
|
|
559
|
+
if (issue === undefined) {
|
|
560
|
+
return "invalid";
|
|
561
|
+
}
|
|
562
|
+
const path = issue.path.join(".");
|
|
563
|
+
return path === "" ? issue.message : `${path}: ${issue.message}`;
|
|
564
|
+
}
|
|
565
|
+
function fileStem(path) {
|
|
566
|
+
return basename(path, extname(path));
|
|
567
|
+
}
|
|
568
|
+
function isRecord(value) {
|
|
569
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
570
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent/extensions/<ns>.ts` | `agent/extensions/<ns>/extension.ts`: agent-shaped trees and Cursor plugins mounted under a namespace.
|
|
3
|
+
*/
|
|
4
|
+
import type { DiscoveredConnection, DiscoveredExtension, DiscoveredSkill, DiscoveredTool, ResolvedAgent } from "../../types.js";
|
|
5
|
+
import { type DiscoveryContext } from "./context.js";
|
|
6
|
+
/** The agent's authored slot lists that mounted extensions append to. */
|
|
7
|
+
export interface ExtensionContributions {
|
|
8
|
+
tools: DiscoveredTool[];
|
|
9
|
+
skills: DiscoveredSkill[];
|
|
10
|
+
connections: DiscoveredConnection[];
|
|
11
|
+
subagents: ResolvedAgent[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Mount every extension under `agent/extensions/` and append what it
|
|
15
|
+
* contributes to the authored lists as `<ns>__<name>`, stamped with
|
|
16
|
+
* `extension`. The namespace is the mount's filename stem or directory name.
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendExtensions(ctx: DiscoveryContext, extensionsDir: string, into: ExtensionContributions): Promise<DiscoveredExtension[]>;
|
|
19
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/extensions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EAEd,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,cAAc,CAAC;AAgBlE,yEAAyE;AACzE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,gBAAgB,EACrB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,sBAAsB,GAC3B,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA4BhC"}
|