@cursor/july 0.1.99 → 0.1.101
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 +4 -2
- 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/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +28 -3
- package/dist/channels/github/progress.d.ts +7 -0
- package/dist/channels/github/progress.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 +16 -7
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +31 -14
- 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/constants.d.ts +6 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +6 -0
- package/dist/channels/slack/defaults.d.ts +9 -4
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +154 -76
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -3
- package/dist/channels/slack/inbound.d.ts +9 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +14 -0
- package/dist/channels/slack/index.d.ts +2 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +2 -0
- package/dist/channels/slack/live-delivery.d.ts +5 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +116 -21
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +104 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +40 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +150 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +8 -4
- package/dist/channels/slack/stream.d.ts +22 -10
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/stream.js +9 -16
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +178 -0
- package/dist/channels/slack/types.d.ts +145 -6
- package/dist/channels/slack/types.d.ts.map +1 -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 +6 -6
- package/dist/docs/ab.md +1 -1
- package/dist/docs/assets/{ab.md.DJo5r4R-.js → ab.md.mlVgqvSk.js} +1 -1
- package/dist/docs/assets/{app.BplEAZ3S.js → app.BASO9Kih.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.js → building-with-agents.md.CUSWxlP_.js} +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CHXyv4wP.js → VPLocalSearchBox.DwkqxoE0.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BTcsZmjQ.js → theme.CCil_13e.js} +2 -2
- package/dist/docs/assets/{evals.md.lfJoEVc8.js → evals.md.CPzDAwoH.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cnh2mL4a.js → guides_github.md.BtPr9GaP.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.js → guides_mcp-oauth.md.Dp6cDP7f.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.js → guides_opentelemetry.md.BVTXDCRg.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.js → guides_slack.md.9oHPye9o.js} +19 -3
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.lean.js → guides_slack.md.9oHPye9o.lean.js} +1 -1
- package/dist/docs/assets/hillclimbing.md.CpTGTCle.js +4 -0
- package/dist/docs/assets/{index.md.CVeRUOeZ.js → index.md.Bb4k8kUm.js} +1 -1
- package/dist/docs/assets/{quickstart.md.Nj_LjW_a.js → quickstart.md.DdQOF7Y8.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.js → reference_connections.md.Di6jJAXF.js} +13 -3
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.em43xlY1.js +1 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.js +26 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +1 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.js +8 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.lean.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.lean.js +1 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.js +25 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.lean.js +1 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.js +16 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.lean.js +1 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +7 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +1 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +18 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +1 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.js +8 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.lean.js +1 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +20 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.js → troubleshooting.md.Cus_YZga.js} +1 -1
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/building-with-agents.md +14 -11
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +1 -1
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +5 -5
- package/dist/docs/guides/github.md +1 -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/mcp-oauth.md +1 -1
- package/dist/docs/guides/opentelemetry.html +7 -7
- package/dist/docs/guides/opentelemetry.md +2 -2
- package/dist/docs/guides/slack.html +22 -6
- package/dist/docs/guides/slack.md +80 -1
- package/dist/docs/guides/webhooks.html +5 -5
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +5 -5
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +1 -1
- package/dist/docs/llms-full.txt +1073 -31
- package/dist/docs/llms.txt +14 -0
- package/dist/docs/quickstart.html +5 -5
- package/dist/docs/quickstart.md +1 -1
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +17 -7
- package/dist/docs/reference/connections.md +32 -1
- 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 +4 -4
- 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 +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +3 -3
- package/dist/docs/skills/ab.html +52 -0
- package/dist/docs/skills/ab.md +50 -0
- package/dist/docs/skills/create-agent.html +34 -0
- package/dist/docs/skills/create-agent.md +160 -0
- package/dist/docs/skills/debug.html +27 -0
- package/dist/docs/skills/debug.md +36 -0
- package/dist/docs/skills/evals.html +51 -0
- package/dist/docs/skills/evals.md +99 -0
- package/dist/docs/skills/framework-map.html +27 -0
- package/dist/docs/skills/framework-map.md +95 -0
- package/dist/docs/skills/github.html +42 -0
- package/dist/docs/skills/github.md +93 -0
- package/dist/docs/skills/hillclimb.html +33 -0
- package/dist/docs/skills/hillclimb.md +55 -0
- package/dist/docs/skills/index.html +27 -0
- package/dist/docs/skills/index.md +21 -0
- package/dist/docs/skills/mcp-auth.html +44 -0
- package/dist/docs/skills/mcp-auth.md +76 -0
- package/dist/docs/skills/otel.html +34 -0
- package/dist/docs/skills/otel.md +48 -0
- package/dist/docs/skills/setup-slack.html +46 -0
- package/dist/docs/skills/setup-slack.md +141 -0
- 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 +5 -5
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +55 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +64 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +30 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +45 -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/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/skills/handoff.md +27 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.js +37 -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 +83 -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/status.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/status.js +41 -0
- package/dist/extensions.d.ts +49 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +75 -0
- package/dist/files-backends/cursor-hosted.d.ts +6 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +6 -9
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- 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 +66 -21
- 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 +3 -4
- 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 +15 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +48 -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 +29 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +61 -19
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +426 -121
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +5 -0
- package/dist/internal/framework-file-storage.d.ts +15 -8
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +70 -10
- package/dist/internal/framework-storage-selection.d.ts +12 -12
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +33 -39
- 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 +35 -15
- 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 +9 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +45 -34
- package/dist/internal/session-run-log.d.ts +5 -4
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +8 -8
- 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 +151 -0
- package/dist/internal/storage-coordinator.d.ts +0 -6
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +1 -9
- 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/playground/assets/{index-jzNbJENa.js → index-BnNN1-EK.js} +45 -45
- package/dist/playground/assets/index-DBQCwFp0.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +83 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +164 -0
- package/dist/storage-backends/cursor-hosted.d.ts +6 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +6 -1
- package/dist/storage-protocol.d.ts +24 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +33 -0
- package/dist/storage.d.ts +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/types.d.ts +123 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -1
- package/docs/README.md +1 -1
- package/docs/ab.md +1 -1
- package/docs/building-with-agents.md +14 -11
- package/docs/evals.md +1 -1
- package/docs/guides/github.md +1 -1
- package/docs/guides/mcp-oauth.md +1 -1
- package/docs/guides/opentelemetry.md +2 -2
- package/docs/guides/slack.md +80 -1
- package/docs/hillclimbing.md +5 -5
- package/docs/quickstart.md +1 -1
- package/docs/reference/connections.md +32 -1
- package/docs/reference/http-api.md +1 -1
- package/docs/scaffolding-agents.md +3 -3
- package/docs/skills/index.md +26 -0
- package/docs/troubleshooting.md +1 -1
- package/package.json +18 -4
- 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/github/defaults.ts +36 -3
- package/src/channels/github/progress.ts +7 -0
- 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 +37 -18
- package/src/channels/slack/code-fences.ts +183 -0
- package/src/channels/slack/constants.ts +6 -0
- package/src/channels/slack/defaults.ts +173 -92
- package/src/channels/slack/dispatch.ts +8 -1
- package/src/channels/slack/inbound.ts +17 -0
- package/src/channels/slack/index.ts +2 -0
- package/src/channels/slack/live-delivery.ts +142 -28
- package/src/channels/slack/reasoning-card.ts +140 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +229 -0
- package/src/channels/slack/slack-channel.ts +7 -2
- package/src/channels/slack/stream.ts +31 -24
- package/src/channels/slack/tool-cards.ts +221 -0
- package/src/channels/slack/types.ts +159 -6
- package/src/connections.ts +18 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +118 -0
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +79 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +29 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +84 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/status.ts +39 -0
- package/src/extensions.ts +98 -0
- package/src/files-backends/cursor-hosted.ts +15 -5
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +37 -12
- package/src/internal/as-of.ts +163 -0
- package/src/internal/cli-deploy.ts +88 -25
- package/src/internal/continuation-identity.ts +3 -1
- package/src/internal/conversation-mirror.ts +3 -8
- package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
- package/src/internal/cursor/hosted-store-secrets.ts +72 -0
- package/src/internal/cursor-deployment-relay.ts +65 -8
- package/src/internal/deploy-client.ts +83 -28
- package/src/internal/discovery.ts +479 -114
- package/src/internal/distribution.ts +5 -0
- package/src/internal/framework-file-storage.ts +80 -10
- package/src/internal/framework-storage-selection.ts +31 -44
- 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 +40 -14
- package/src/internal/review-comments.ts +5 -2
- package/src/internal/server.ts +81 -100
- package/src/internal/session-engine.ts +56 -28
- package/src/internal/session-run-log.ts +8 -12
- package/src/internal/start-log-store.ts +177 -0
- package/src/internal/storage-coordinator.ts +1 -11
- package/src/internal/tool-policy.ts +39 -9
- package/src/storage-backends/cursor-hosted-v2.ts +219 -0
- package/src/storage-backends/cursor-hosted.ts +6 -1
- package/src/storage-protocol.ts +37 -0
- package/src/storage.ts +1 -0
- package/src/types.ts +177 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +0 -1
- package/dist/docs/assets/hillclimbing.md.DhESf3OO.js +0 -4
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +0 -1
- package/dist/internal/null-kv-storage.d.ts +0 -48
- package/dist/internal/null-kv-storage.d.ts.map +0 -1
- package/dist/internal/null-kv-storage.js +0 -58
- package/dist/playground/assets/index-D7rGZNjy.css +0 -1
- package/src/internal/null-kv-storage.ts +0 -74
- /package/dist/docs/assets/{ab.md.DJo5r4R-.lean.js → ab.md.mlVgqvSk.lean.js} +0 -0
- /package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.lean.js → building-with-agents.md.CUSWxlP_.lean.js} +0 -0
- /package/dist/docs/assets/{evals.md.lfJoEVc8.lean.js → evals.md.CPzDAwoH.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.Cnh2mL4a.lean.js → guides_github.md.BtPr9GaP.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.lean.js → guides_mcp-oauth.md.Dp6cDP7f.lean.js} +0 -0
- /package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.lean.js → guides_opentelemetry.md.BVTXDCRg.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.DhESf3OO.lean.js → hillclimbing.md.CpTGTCle.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CVeRUOeZ.lean.js → index.md.Bb4k8kUm.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.Nj_LjW_a.lean.js → quickstart.md.DdQOF7Y8.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/{scaffolding-agents.md.D7UUkWw0.lean.js → scaffolding-agents.md.em43xlY1.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.lean.js → troubleshooting.md.Cus_YZga.lean.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** The Cursor SDK surface the tools share: auth, model, result views. */
|
|
2
|
+
|
|
3
|
+
import type { ModelSelection, Run, RunStatus, SDKAgentInfo } from "@cursor/sdk";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import {
|
|
6
|
+
cursorWebsiteUrl,
|
|
7
|
+
resolveApiKeySync,
|
|
8
|
+
SIGN_IN_HINT,
|
|
9
|
+
} from "../../../internal/cursor/credentials.js";
|
|
10
|
+
import { toModelSelection } from "../../../internal/sdk-runner.js";
|
|
11
|
+
import extension from "../extension.js";
|
|
12
|
+
|
|
13
|
+
export const agentRef: z.ZodObject<{ agentId: z.ZodString }> = z.object({
|
|
14
|
+
agentId: z.string().describe("Agent id (`bc-...`) returned by a launch."),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export function apiKey(): string {
|
|
18
|
+
const key = resolveApiKeySync({ apiKey: extension.config.apiKey });
|
|
19
|
+
if (key === undefined) {
|
|
20
|
+
throw new Error(`Cloud agents need a Cursor API key. ${SIGN_IN_HINT}`);
|
|
21
|
+
}
|
|
22
|
+
return key.apiKey;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function modelSelection(): ModelSelection | undefined {
|
|
26
|
+
const { model } = extension.config;
|
|
27
|
+
return model === undefined ? undefined : toModelSelection(model);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function agentUrl(agentId: string): string {
|
|
31
|
+
return `${cursorWebsiteUrl()}/agents/${agentId}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Type aliases, not interfaces: views flow into tool results.
|
|
35
|
+
export type AgentView = {
|
|
36
|
+
agentId: string;
|
|
37
|
+
name: string;
|
|
38
|
+
archived: boolean | undefined;
|
|
39
|
+
url: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type RunView = {
|
|
43
|
+
id: string;
|
|
44
|
+
status: RunStatus;
|
|
45
|
+
result: string | undefined;
|
|
46
|
+
error: string | undefined;
|
|
47
|
+
durationMs: number | undefined;
|
|
48
|
+
branches:
|
|
49
|
+
| Array<{
|
|
50
|
+
repoUrl: string;
|
|
51
|
+
branch: string | undefined;
|
|
52
|
+
prUrl: string | undefined;
|
|
53
|
+
}>
|
|
54
|
+
| undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export function agentView(info: SDKAgentInfo): AgentView {
|
|
58
|
+
return {
|
|
59
|
+
agentId: info.agentId,
|
|
60
|
+
name: info.name,
|
|
61
|
+
archived: info.archived,
|
|
62
|
+
url: agentUrl(info.agentId),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function runView(run: Run): RunView {
|
|
67
|
+
return {
|
|
68
|
+
id: run.id,
|
|
69
|
+
status: run.status,
|
|
70
|
+
result: run.result,
|
|
71
|
+
error: run.error?.message,
|
|
72
|
+
durationMs: run.durationMs,
|
|
73
|
+
branches: run.git?.branches.map((branch) => ({
|
|
74
|
+
repoUrl: branch.repoUrl,
|
|
75
|
+
branch: branch.branch,
|
|
76
|
+
prUrl: branch.prUrl,
|
|
77
|
+
})),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who launched which cloud agent. The tools authenticate with the serve
|
|
3
|
+
* host's one Cursor API key, so the host itself must keep every session's
|
|
4
|
+
* cloud agents bound to the principal that launched them: status and
|
|
5
|
+
* follow-ups only reach agents recorded here for the same principal, and
|
|
6
|
+
* the fleet listing is that principal's records, by default narrowed to the
|
|
7
|
+
* session that launched them.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import type { ToolContext } from "../../../types.js";
|
|
12
|
+
|
|
13
|
+
const PREFIX = "cloud-agents";
|
|
14
|
+
|
|
15
|
+
// Type alias, not an interface: fleet entries flow into tool results.
|
|
16
|
+
export type FleetEntry = {
|
|
17
|
+
agentId: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
launchedAt: string;
|
|
20
|
+
/** The session whose turn launched the agent; absent on records older than this field. */
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type FleetScope = "session" | "all";
|
|
25
|
+
|
|
26
|
+
const fleetSchema: z.ZodType<FleetEntry[]> = z.array(
|
|
27
|
+
z.object({
|
|
28
|
+
agentId: z.string(),
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
launchedAt: z.string(),
|
|
31
|
+
sessionId: z.string().optional(),
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
const ownerSchema = z.object({ principal: z.string() });
|
|
35
|
+
|
|
36
|
+
// `host.kv` has no compare-and-swap, and a model that launches two agents in
|
|
37
|
+
// one turn calls this tool in parallel. Chain the index read-modify-write per
|
|
38
|
+
// principal so neither launch overwrites the other's entry.
|
|
39
|
+
const indexWrites = new Map<string, Promise<void>>();
|
|
40
|
+
|
|
41
|
+
function withIndexLock(key: string, task: () => Promise<void>): Promise<void> {
|
|
42
|
+
const run = (indexWrites.get(key) ?? Promise.resolve()).then(task, task);
|
|
43
|
+
indexWrites.set(key, run);
|
|
44
|
+
return run.finally(() => {
|
|
45
|
+
if (indexWrites.get(key) === run) {
|
|
46
|
+
indexWrites.delete(key);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Unauthenticated sessions (local dev, direct calls) share one principal. */
|
|
52
|
+
export function principalOf(ctx: ToolContext): string {
|
|
53
|
+
const auth = ctx.session.auth;
|
|
54
|
+
return auth === null
|
|
55
|
+
? "anonymous"
|
|
56
|
+
: `${auth.principalType}:${auth.principalId}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function recordLaunch(
|
|
60
|
+
ctx: ToolContext,
|
|
61
|
+
agentId: string,
|
|
62
|
+
name: string | undefined
|
|
63
|
+
): Promise<void> {
|
|
64
|
+
const principal = principalOf(ctx);
|
|
65
|
+
const entry: FleetEntry = {
|
|
66
|
+
agentId,
|
|
67
|
+
name,
|
|
68
|
+
launchedAt: new Date().toISOString(),
|
|
69
|
+
sessionId: ctx.session.id,
|
|
70
|
+
};
|
|
71
|
+
await ctx.host.kv.put(`${PREFIX}/agents/${agentId}`, { principal });
|
|
72
|
+
await withIndexLock(fleetKey(principal), async () => {
|
|
73
|
+
const fleet = await listFleet(ctx);
|
|
74
|
+
await ctx.host.kv.put(fleetKey(principal), [entry, ...fleet]);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Refuse agents launched by another principal, or not through the extension. */
|
|
79
|
+
export async function assertOwned(
|
|
80
|
+
ctx: ToolContext,
|
|
81
|
+
agentId: string
|
|
82
|
+
): Promise<void> {
|
|
83
|
+
const owner = ownerSchema.safeParse(
|
|
84
|
+
await ctx.host.kv.get(`${PREFIX}/agents/${agentId}`)
|
|
85
|
+
);
|
|
86
|
+
if (!owner.success || owner.data.principal !== principalOf(ctx)) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Agent ${agentId} was not launched through this extension by this principal; only your own launches can be read or steered.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The caller's launches, newest first: this session's, or every session's. */
|
|
94
|
+
export async function listFleet(
|
|
95
|
+
ctx: ToolContext,
|
|
96
|
+
scope: FleetScope = "all"
|
|
97
|
+
): Promise<FleetEntry[]> {
|
|
98
|
+
const fleet = fleetSchema.safeParse(
|
|
99
|
+
await ctx.host.kv.get(fleetKey(principalOf(ctx)))
|
|
100
|
+
);
|
|
101
|
+
const entries = fleet.success ? fleet.data : [];
|
|
102
|
+
return scope === "all"
|
|
103
|
+
? entries
|
|
104
|
+
: entries.filter((entry) => entry.sessionId === ctx.session.id);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function fleetKey(principal: string): string {
|
|
108
|
+
return `${PREFIX}/principals/${encodeURIComponent(principal)}`;
|
|
109
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which repositories a launch may target. The model picks `repo` / `ref` /
|
|
3
|
+
* `prUrl` per call, but the author's `cloud.repos` are the allowlist.
|
|
4
|
+
* Model-chosen targets always require that allowlist: an unbound mount
|
|
5
|
+
* (no `cloud.repos`) must not accept an arbitrary URL under the host API
|
|
6
|
+
* key, with or without `envVars`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { parsePrUrl } from "../../../internal/scm/pr-url.js";
|
|
10
|
+
import type { AgentCloudOptions } from "../../../types.js";
|
|
11
|
+
|
|
12
|
+
export interface LaunchTarget {
|
|
13
|
+
repo?: string;
|
|
14
|
+
ref?: string;
|
|
15
|
+
prUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function launchRepos(
|
|
19
|
+
target: LaunchTarget,
|
|
20
|
+
cloud: AgentCloudOptions
|
|
21
|
+
): AgentCloudOptions["repos"] {
|
|
22
|
+
if (
|
|
23
|
+
target.repo === undefined &&
|
|
24
|
+
target.ref === undefined &&
|
|
25
|
+
target.prUrl === undefined
|
|
26
|
+
) {
|
|
27
|
+
return cloud.repos;
|
|
28
|
+
}
|
|
29
|
+
const pr = target.prUrl === undefined ? undefined : parsePrUrl(target.prUrl);
|
|
30
|
+
if (target.prUrl !== undefined && pr?.provider !== "github") {
|
|
31
|
+
throw new Error(`prUrl must be a GitHub pull request URL: ${target.prUrl}`);
|
|
32
|
+
}
|
|
33
|
+
const prRepo =
|
|
34
|
+
pr === undefined ? undefined : `https://github.com/${pr.owner}/${pr.repo}`;
|
|
35
|
+
// A lone `ref` needs exactly one configured repository to apply to.
|
|
36
|
+
const configured = cloud.repos ?? [];
|
|
37
|
+
const url =
|
|
38
|
+
target.repo ??
|
|
39
|
+
prRepo ??
|
|
40
|
+
(configured.length === 1 ? configured[0]?.url : undefined);
|
|
41
|
+
if (url === undefined) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
configured.length > 1
|
|
44
|
+
? "`repo` is required: this extension configures several repositories."
|
|
45
|
+
: "`repo` is required: this extension has no configured default repository."
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
if (prRepo !== undefined && repoKey(prRepo) !== repoKey(url)) {
|
|
49
|
+
throw new Error(`prUrl ${target.prUrl} is not a pull request of ${url}.`);
|
|
50
|
+
}
|
|
51
|
+
const allowlisted = cloud.repos?.some(
|
|
52
|
+
(configured) => repoKey(configured.url) === repoKey(url)
|
|
53
|
+
);
|
|
54
|
+
if (allowlisted !== true) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
cloud.repos === undefined
|
|
57
|
+
? `Configure cloud.repos before launching against a model-chosen repository (${url}).`
|
|
58
|
+
: `${url} is not one of this extension's configured repositories.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
// Keep the matching allowlist entry's branch / PR defaults when the model
|
|
62
|
+
// only names the repository (handoff always passes `repo`). An explicit
|
|
63
|
+
// `ref` clears an inherited `prUrl` so branch and PR targets do not mix.
|
|
64
|
+
const match = configured.find(
|
|
65
|
+
(configuredRepo) => repoKey(configuredRepo.url) === repoKey(url)
|
|
66
|
+
);
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
url,
|
|
70
|
+
startingRef: target.ref ?? match?.startingRef,
|
|
71
|
+
prUrl:
|
|
72
|
+
target.prUrl ?? (target.ref !== undefined ? undefined : match?.prUrl),
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function repoKey(url: string): string {
|
|
78
|
+
const parsed = new URL(url);
|
|
79
|
+
const path = parsed.pathname.replace(/\.git$/, "").replace(/\/+$/, "");
|
|
80
|
+
return `${parsed.hostname}${path}`.toLowerCase();
|
|
81
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to follow up and check status."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Cloud agent handoff
|
|
6
|
+
|
|
7
|
+
Hand work to a Cursor cloud agent when it needs a repository checkout, a long run, or an isolated machine: implementing a change, running a test suite, opening a pull request. Answer questions and small reads yourself.
|
|
8
|
+
|
|
9
|
+
The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on.
|
|
10
|
+
|
|
11
|
+
## Launch
|
|
12
|
+
|
|
13
|
+
Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `ref` or `prUrl` to pick a branch or pull request; `repo` must be one of the configured repositories.
|
|
14
|
+
|
|
15
|
+
The result carries `agentId` (`bc-...`) and a `url`. Report both in full. Never truncate the id.
|
|
16
|
+
|
|
17
|
+
## Follow up
|
|
18
|
+
|
|
19
|
+
Call `follow_up` with the `agentId` to steer an agent you launched or ask for changes on its branch. A busy agent rejects the follow-up: check status and retry once its run has finished. Do not launch a second agent for follow-up work on the same branch.
|
|
20
|
+
|
|
21
|
+
## Check status
|
|
22
|
+
|
|
23
|
+
Call `status` with the `agentId`. The latest run carries `status` (`running`, `finished`, `error`, or `cancelled`), the final `result` text, an `error` message, and any pushed `branches` or pull requests; the agent itself reports `archived`. A run takes minutes: check when asked or when you need the result, not in a tight loop.
|
|
24
|
+
|
|
25
|
+
## Fleet
|
|
26
|
+
|
|
27
|
+
`list` returns the agents launched in this session, newest first; pass `scope: "all"` to include your launches from other sessions. Launch one agent per independent task and give each a descriptive `name`. Agents launched by others are out of reach.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Agent } from "@cursor/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineTool } from "../../../tools.js";
|
|
4
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
+
import extension from "../extension.js";
|
|
6
|
+
import { agentRef, apiKey } from "../lib/cloud.js";
|
|
7
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
8
|
+
|
|
9
|
+
const follow_up: ToolDefinition = defineTool({
|
|
10
|
+
description:
|
|
11
|
+
"Send a follow-up prompt to a cloud agent you launched. The agent must be idle; a busy agent rejects the follow-up.",
|
|
12
|
+
effect: "write",
|
|
13
|
+
needsApproval: () => extension.config.needsApproval,
|
|
14
|
+
inputSchema: agentRef.extend({
|
|
15
|
+
prompt: z.string().min(1).describe("The follow-up instruction."),
|
|
16
|
+
}),
|
|
17
|
+
async execute(input, ctx) {
|
|
18
|
+
await assertOwned(ctx, input.agentId);
|
|
19
|
+
const agent = await Agent.resume(input.agentId, { apiKey: apiKey() });
|
|
20
|
+
try {
|
|
21
|
+
const run = await agent.send(input.prompt);
|
|
22
|
+
return { agentId: input.agentId, runId: run.id, status: run.status };
|
|
23
|
+
} finally {
|
|
24
|
+
agent.close();
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export default follow_up;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Agent } from "@cursor/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineTool } from "../../../tools.js";
|
|
4
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
+
import extension from "../extension.js";
|
|
6
|
+
import { agentUrl, agentView, apiKey, modelSelection } from "../lib/cloud.js";
|
|
7
|
+
import { recordLaunch } from "../lib/fleet.js";
|
|
8
|
+
import { launchRepos } from "../lib/repos.js";
|
|
9
|
+
|
|
10
|
+
const launch: ToolDefinition = defineTool({
|
|
11
|
+
description:
|
|
12
|
+
"Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check progress with the status tool.",
|
|
13
|
+
effect: "write",
|
|
14
|
+
needsApproval: () => extension.config.needsApproval,
|
|
15
|
+
inputSchema: z.object({
|
|
16
|
+
prompt: z
|
|
17
|
+
.string()
|
|
18
|
+
.min(1)
|
|
19
|
+
.describe(
|
|
20
|
+
"Self-contained task: goal, constraints, and what done looks like."
|
|
21
|
+
),
|
|
22
|
+
repo: z
|
|
23
|
+
.string()
|
|
24
|
+
.url()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(
|
|
27
|
+
"GitHub repository URL, one of the configured repositories. Defaults to the configured repository."
|
|
28
|
+
),
|
|
29
|
+
ref: z.string().optional().describe("Starting branch or commit."),
|
|
30
|
+
prUrl: z
|
|
31
|
+
.string()
|
|
32
|
+
.url()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Work on this pull request's branch instead of a new one."),
|
|
35
|
+
name: z
|
|
36
|
+
.string()
|
|
37
|
+
.max(100)
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Display name; derived from the prompt when omitted."),
|
|
40
|
+
}),
|
|
41
|
+
async execute(input, ctx) {
|
|
42
|
+
const { cloud } = extension.config;
|
|
43
|
+
const key = apiKey();
|
|
44
|
+
const agent = await Agent.create({
|
|
45
|
+
apiKey: key,
|
|
46
|
+
model: modelSelection(),
|
|
47
|
+
name: input.name,
|
|
48
|
+
cloud: { ...cloud, repos: launchRepos(input, cloud) },
|
|
49
|
+
});
|
|
50
|
+
try {
|
|
51
|
+
const run = await agent.send(input.prompt);
|
|
52
|
+
await recordLaunch(ctx, agent.agentId, input.name);
|
|
53
|
+
return {
|
|
54
|
+
agentId: agent.agentId,
|
|
55
|
+
runId: run.id,
|
|
56
|
+
status: run.status,
|
|
57
|
+
url: agentUrl(agent.agentId),
|
|
58
|
+
};
|
|
59
|
+
} catch (error) {
|
|
60
|
+
// The API can fail after the agent exists (slow admission,
|
|
61
|
+
// post-create checks). The SDK seeded the id unless envVars made
|
|
62
|
+
// the server mint it, so read the agent back and keep the handle;
|
|
63
|
+
// envVars launches have no id to read back and surface the error.
|
|
64
|
+
const info =
|
|
65
|
+
cloud.envVars === undefined
|
|
66
|
+
? await Agent.get(agent.agentId, { apiKey: key }).catch(
|
|
67
|
+
() => undefined
|
|
68
|
+
)
|
|
69
|
+
: undefined;
|
|
70
|
+
if (info === undefined) {
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
await recordLaunch(ctx, info.agentId, input.name);
|
|
74
|
+
return {
|
|
75
|
+
...agentView(info),
|
|
76
|
+
launchError: error instanceof Error ? error.message : String(error),
|
|
77
|
+
};
|
|
78
|
+
} finally {
|
|
79
|
+
agent.close();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export default launch;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import { agentUrl } from "../lib/cloud.js";
|
|
5
|
+
import { listFleet } from "../lib/fleet.js";
|
|
6
|
+
|
|
7
|
+
const list: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
'List the cloud agents launched in this session, newest first. Pass scope "all" for every agent you launched, in any session.',
|
|
10
|
+
effect: "read",
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
scope: z
|
|
13
|
+
.enum(["session", "all"])
|
|
14
|
+
.default("session")
|
|
15
|
+
.describe(
|
|
16
|
+
"session: agents this session launched; all: every agent launched by you, in any session."
|
|
17
|
+
),
|
|
18
|
+
limit: z.number().int().min(1).max(100).default(20),
|
|
19
|
+
}),
|
|
20
|
+
async execute(input, ctx) {
|
|
21
|
+
const fleet = await listFleet(ctx, input.scope);
|
|
22
|
+
return {
|
|
23
|
+
sessionId: ctx.session.id,
|
|
24
|
+
agents: fleet
|
|
25
|
+
.slice(0, input.limit)
|
|
26
|
+
.map((entry) => ({ ...entry, url: agentUrl(entry.agentId) })),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default list;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Agent } from "@cursor/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { defineTool } from "../../../tools.js";
|
|
4
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
+
import { agentRef, agentView, apiKey, runView } from "../lib/cloud.js";
|
|
6
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
7
|
+
|
|
8
|
+
const status: ToolDefinition = defineTool({
|
|
9
|
+
description:
|
|
10
|
+
"Read a cloud agent you launched and its latest run: state, final result text, error, and pushed branches or pull requests.",
|
|
11
|
+
effect: "read",
|
|
12
|
+
inputSchema: agentRef.extend({
|
|
13
|
+
runId: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("A specific run; defaults to the latest."),
|
|
17
|
+
}),
|
|
18
|
+
async execute(input, ctx) {
|
|
19
|
+
await assertOwned(ctx, input.agentId);
|
|
20
|
+
const key = apiKey();
|
|
21
|
+
const cloud = { runtime: "cloud", apiKey: key } as const;
|
|
22
|
+
const info = await Agent.get(input.agentId, { apiKey: key });
|
|
23
|
+
// The run list carries no result text; fetch the run itself.
|
|
24
|
+
const runId =
|
|
25
|
+
input.runId ??
|
|
26
|
+
(await Agent.listRuns(input.agentId, { ...cloud, limit: 1 })).items[0]
|
|
27
|
+
?.id;
|
|
28
|
+
const run =
|
|
29
|
+
runId === undefined
|
|
30
|
+
? undefined
|
|
31
|
+
: await Agent.getRun(runId, { ...cloud, agentId: input.agentId });
|
|
32
|
+
return {
|
|
33
|
+
...agentView(info),
|
|
34
|
+
run: run === undefined ? undefined : runView(run),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export default status;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extensions — agent-shaped trees an agent mounts under a namespace.
|
|
3
|
+
*
|
|
4
|
+
* An extension is a directory laid out like `agent/`: `extension.ts`
|
|
5
|
+
* declares it, `tools/<name>.ts` and `skills/<name>.md|ts` are its
|
|
6
|
+
* contributions, `lib/` holds shared code.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* // extension.ts
|
|
10
|
+
* import { defineExtension } from "@cursor/july/extensions";
|
|
11
|
+
* import { z } from "zod";
|
|
12
|
+
*
|
|
13
|
+
* export default defineExtension({
|
|
14
|
+
* root: import.meta.dirname,
|
|
15
|
+
* description: "CRM lookups.",
|
|
16
|
+
* config: z.object({ apiKey: z.string() }),
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // tools/search.ts
|
|
20
|
+
* import extension from "../extension.js";
|
|
21
|
+
*
|
|
22
|
+
* export default defineTool({
|
|
23
|
+
* description: "Search the CRM.",
|
|
24
|
+
* execute: (input) => search(extension.config.apiKey, input),
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* A consumer mounts it from `agent/extensions/<ns>.ts`; the filename is the
|
|
29
|
+
* namespace, and every contribution is exposed as `<ns>__<name>`
|
|
30
|
+
* (`crm__search`). `__` is reserved for that: an authored `agent/tools/` or
|
|
31
|
+
* `agent/skills/` name may not contain it.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* // agent/extensions/crm.ts
|
|
35
|
+
* import crm from "@acme/crm";
|
|
36
|
+
*
|
|
37
|
+
* export default crm({ apiKey: process.env.CRM_API_KEY! });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* To adjust a contribution, mount as a directory instead and overlay the
|
|
41
|
+
* slot: `agent/extensions/crm/extension.ts` holds the mount, and
|
|
42
|
+
* `agent/extensions/crm/tools/search.ts` replaces `crm__search` — or removes
|
|
43
|
+
* it with `export default disableTool()`.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
import { brandDefinition } from "./internal/brand.js";
|
|
47
|
+
import type {
|
|
48
|
+
DisabledToolDefinition,
|
|
49
|
+
Extension,
|
|
50
|
+
ExtensionMount,
|
|
51
|
+
ExtensionOptions,
|
|
52
|
+
} from "./types.js";
|
|
53
|
+
|
|
54
|
+
export type {
|
|
55
|
+
DisabledToolDefinition,
|
|
56
|
+
DiscoveredExtension,
|
|
57
|
+
Extension,
|
|
58
|
+
ExtensionDeclaration,
|
|
59
|
+
ExtensionMount,
|
|
60
|
+
ExtensionOptions,
|
|
61
|
+
} from "./types.js";
|
|
62
|
+
|
|
63
|
+
export function defineExtension<TConfig = undefined, TInput = TConfig>(
|
|
64
|
+
options: ExtensionOptions<TConfig, TInput>
|
|
65
|
+
): Extension<TConfig, TInput> {
|
|
66
|
+
let mounted: { config: TConfig } | undefined;
|
|
67
|
+
const mount = (config?: TInput): ExtensionMount => {
|
|
68
|
+
const parsed =
|
|
69
|
+
options.config === undefined
|
|
70
|
+
? (config as unknown as TConfig)
|
|
71
|
+
: options.config.parse(config);
|
|
72
|
+
mounted = { config: parsed };
|
|
73
|
+
return brandDefinition("extension", {
|
|
74
|
+
extension: handle,
|
|
75
|
+
config: parsed,
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
const handle = Object.defineProperties(mount, {
|
|
79
|
+
root: { value: options.root, enumerable: true },
|
|
80
|
+
description: { value: options.description, enumerable: true },
|
|
81
|
+
config: {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get(): TConfig {
|
|
84
|
+
if (mounted === undefined) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Extension at ${options.root} read its config before an agent mounted it. Mount it from agent/extensions/<ns>.ts; the mount runs before the tree loads.`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return mounted.config;
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}) as unknown as Extension<TConfig, TInput>;
|
|
93
|
+
return handle;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function disableTool(): DisabledToolDefinition {
|
|
97
|
+
return brandDefinition("disabled-tool", {});
|
|
98
|
+
}
|
|
@@ -51,6 +51,10 @@ import {
|
|
|
51
51
|
type FileSinkEntry,
|
|
52
52
|
type FileSinkPutResult,
|
|
53
53
|
} from "../files.js";
|
|
54
|
+
import {
|
|
55
|
+
resolveDeploymentStoreSourceIdSync,
|
|
56
|
+
resolveFrameworkStoreSourceIdSync,
|
|
57
|
+
} from "../internal/cursor/hosted-store-secrets.js";
|
|
54
58
|
import { createAgentStorePresignedUrlValidatorForBackend } from "./agent-store-presigned-url.js";
|
|
55
59
|
|
|
56
60
|
/**
|
|
@@ -111,8 +115,7 @@ const MAX_LIST_WALK_PAGES = 1_000;
|
|
|
111
115
|
export function isCursorHostedFilesAvailable(
|
|
112
116
|
env: NodeJS.ProcessEnv = process.env
|
|
113
117
|
): boolean {
|
|
114
|
-
|
|
115
|
-
return sourceId !== undefined && sourceId !== "";
|
|
118
|
+
return resolveDeploymentStoreSourceIdSync(env) !== undefined;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/**
|
|
@@ -125,8 +128,7 @@ export function isCursorHostedFilesAvailable(
|
|
|
125
128
|
export function cursorFrameworkStoreSourceId(
|
|
126
129
|
env: NodeJS.ProcessEnv = process.env
|
|
127
130
|
): string | undefined {
|
|
128
|
-
|
|
129
|
-
return sourceId === undefined || sourceId === "" ? undefined : sourceId;
|
|
131
|
+
return resolveFrameworkStoreSourceIdSync(env);
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
/**
|
|
@@ -164,6 +166,12 @@ export interface CursorHostedFilesOptions {
|
|
|
164
166
|
resolveApiKey?: () => string | undefined;
|
|
165
167
|
/** File store to address (default: `AGENT_SERVE_STORE_SOURCE_ID`). */
|
|
166
168
|
storeSourceId?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Lazy store source id, re-resolved on every call and preferred over
|
|
171
|
+
* {@link storeSourceId} — freeze bind drops ids into `/run/cursor/secrets`
|
|
172
|
+
* after serve start without restarting July.
|
|
173
|
+
*/
|
|
174
|
+
resolveStoreSourceId?: () => string | undefined;
|
|
167
175
|
/** Test seam; defaults to global fetch. */
|
|
168
176
|
fetch?: typeof fetch;
|
|
169
177
|
}
|
|
@@ -650,7 +658,9 @@ function fetchImpl(options: CursorHostedFilesOptions): typeof fetch {
|
|
|
650
658
|
*/
|
|
651
659
|
function resolveStoreSourceId(options: CursorHostedFilesOptions): string {
|
|
652
660
|
const id = (
|
|
653
|
-
options.
|
|
661
|
+
options.resolveStoreSourceId?.() ??
|
|
662
|
+
options.storeSourceId ??
|
|
663
|
+
resolveDeploymentStoreSourceIdSync(process.env)
|
|
654
664
|
)?.trim();
|
|
655
665
|
if (id === undefined || id === "") {
|
|
656
666
|
throw new Error(
|
package/src/index.ts
CHANGED
|
@@ -78,6 +78,7 @@ export {
|
|
|
78
78
|
stampMailboxContinuation,
|
|
79
79
|
V2EngineError,
|
|
80
80
|
} from "./continuation.js";
|
|
81
|
+
export { defineExtension, disableTool } from "./extensions.js";
|
|
81
82
|
export { defineHook } from "./hooks.js";
|
|
82
83
|
export {
|
|
83
84
|
InvalidAsOfError,
|
|
@@ -189,6 +190,7 @@ export {
|
|
|
189
190
|
isToolEffect,
|
|
190
191
|
MAX_RUNNING_TURNS_LIMIT,
|
|
191
192
|
normalizeConnectionEffects,
|
|
193
|
+
normalizeConnectionTools,
|
|
192
194
|
normalizeCursorAccountServers,
|
|
193
195
|
supportsKvCas,
|
|
194
196
|
} from "./types.js";
|