@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
|
@@ -27,21 +27,25 @@
|
|
|
27
27
|
* `defineConnection({ effects })` filters the listing before names are
|
|
28
28
|
* assigned: only tools whose MCP annotations classify as an intended
|
|
29
29
|
* effect are advertised. Unclassified tools are omitted, not guessed.
|
|
30
|
+
* `defineConnection({ tools: [...] })` keeps only the named tools.
|
|
31
|
+
* `disallowedTools` drops names. A name filter that matches nothing on
|
|
32
|
+
* the server fails the turn.
|
|
30
33
|
* Tools whose `annotations.title` is `do-not-call` are dropped as well
|
|
31
34
|
* (vendor host-UI / MCP Apps helpers that still carry `readOnlyHint`).
|
|
32
35
|
*/
|
|
33
36
|
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
import {
|
|
38
|
+
connectionAllowsTool,
|
|
39
|
+
type DiscoveredConnection,
|
|
40
|
+
type DiscoveredTool,
|
|
41
|
+
type HostMcpCallResult,
|
|
42
|
+
type HostMcpToolInfo,
|
|
43
|
+
type JsonSchemaObject,
|
|
44
|
+
type McpToolAnnotations,
|
|
45
|
+
type ResolvedAgent,
|
|
46
|
+
type SessionInfo,
|
|
47
|
+
type ToolDefinition,
|
|
48
|
+
type ToolEffect,
|
|
45
49
|
} from "../types.js";
|
|
46
50
|
import { brandDefinition } from "./brand.js";
|
|
47
51
|
import type { HostMcpOneOff } from "./mcp-host.js";
|
|
@@ -136,7 +140,14 @@ export async function resolveAdvertisedTools(args: {
|
|
|
136
140
|
try {
|
|
137
141
|
const source = await sourceFor(connection, args.session, args.hostMcp);
|
|
138
142
|
const listed = await source.listTools();
|
|
139
|
-
return {
|
|
143
|
+
return {
|
|
144
|
+
connection,
|
|
145
|
+
ok: true,
|
|
146
|
+
source,
|
|
147
|
+
listed: listed.filter((info) =>
|
|
148
|
+
connectionAllowsTool(connection, info.name)
|
|
149
|
+
),
|
|
150
|
+
};
|
|
140
151
|
} catch (error) {
|
|
141
152
|
return { connection, ok: false, error };
|
|
142
153
|
}
|
|
@@ -157,6 +168,20 @@ export async function resolveAdvertisedTools(args: {
|
|
|
157
168
|
);
|
|
158
169
|
}
|
|
159
170
|
const { source, listed } = listing;
|
|
171
|
+
if (
|
|
172
|
+
(connection.tools !== undefined ||
|
|
173
|
+
connection.disallowedTools !== undefined) &&
|
|
174
|
+
listed.length === 0
|
|
175
|
+
) {
|
|
176
|
+
const error = new Error(
|
|
177
|
+
`Advertised connection "${connection.name}" tool filter matched no tools on the server.`
|
|
178
|
+
);
|
|
179
|
+
if (args.onConnectionError !== undefined) {
|
|
180
|
+
args.onConnectionError(connection.name, error);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
160
185
|
const intended = listed.filter(
|
|
161
186
|
(info) =>
|
|
162
187
|
!isDoNotCallTool(info.annotations) &&
|
package/src/internal/as-of.ts
CHANGED
|
@@ -105,3 +105,166 @@ export function timeArgViolation(
|
|
|
105
105
|
}
|
|
106
106
|
return undefined;
|
|
107
107
|
}
|
|
108
|
+
|
|
109
|
+
// Whole-string only: a query that merely contains "now" is not a bound.
|
|
110
|
+
// Duration-only strings (`30m`, `2h`) and last/this plus a non-window word
|
|
111
|
+
// (`last modified`) are not time bounds. Calendar-aligned `now/d` is.
|
|
112
|
+
const TIME_UNIT =
|
|
113
|
+
"(?:s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|w|week|weeks|mo|month|months|y|yr|yrs|year|years)";
|
|
114
|
+
const WINDOW_WORD =
|
|
115
|
+
"(?:second|seconds|minute|minutes|hour|hours|day|days|week|weeks|month|months|year|years|quarter|quarters|weekend|monday|tuesday|wednesday|thursday|friday|saturday|sunday|morning|afternoon|evening|night)";
|
|
116
|
+
const RELATIVE_TIME_EXPRESSION = new RegExp(
|
|
117
|
+
`^(?:now(?:\\s*[+-]\\s*\\d+\\s*${TIME_UNIT}\\b.*|/[a-zA-Z]+.*)?|[+-]\\d+\\s*${TIME_UNIT}|today|yesterday|tomorrow|(?:last|this)\\s+${WINDOW_WORD})$`,
|
|
118
|
+
"i"
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
function forwardTimeReason(
|
|
122
|
+
value: unknown,
|
|
123
|
+
asOf: string,
|
|
124
|
+
frozenMs: number
|
|
125
|
+
): string | undefined {
|
|
126
|
+
if (typeof value !== "string") {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
const trimmed = value.trim();
|
|
130
|
+
if (trimmed === "") {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
if (RELATIVE_TIME_EXPRESSION.test(trimmed)) {
|
|
134
|
+
return (
|
|
135
|
+
`Argument ${JSON.stringify(value)} is a relative time expression, ` +
|
|
136
|
+
`which reads against the real present. This session reads the world ` +
|
|
137
|
+
`as of ${asOf}; supply an absolute ISO-8601 instant with a timezone ` +
|
|
138
|
+
`at or before that instant and retry.`
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
const instant = parseInstant(trimmed);
|
|
142
|
+
if (instant !== undefined && instant.getTime() > frozenMs) {
|
|
143
|
+
return (
|
|
144
|
+
`Argument ${JSON.stringify(value)} is later than the instant this ` +
|
|
145
|
+
`session reads the world as of (${asOf}). Supply a bound at or before ` +
|
|
146
|
+
`that instant and retry.`
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Relative expressions or instants after `asOf`. Numeric epochs need `timeArgs`. */
|
|
153
|
+
export function forwardTimeArgument(
|
|
154
|
+
input: unknown,
|
|
155
|
+
asOf: string
|
|
156
|
+
): string | undefined {
|
|
157
|
+
const frozenMs = new Date(asOf).getTime();
|
|
158
|
+
const seen = new Set<unknown>();
|
|
159
|
+
const walk = (value: unknown, depth: number): string | undefined => {
|
|
160
|
+
if (depth > 8) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
const reason = forwardTimeReason(value, asOf, frozenMs);
|
|
164
|
+
if (reason !== undefined) {
|
|
165
|
+
return reason;
|
|
166
|
+
}
|
|
167
|
+
if (Array.isArray(value)) {
|
|
168
|
+
for (const item of value) {
|
|
169
|
+
const found = walk(item, depth + 1);
|
|
170
|
+
if (found !== undefined) {
|
|
171
|
+
return found;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
if (typeof value === "object" && value !== null) {
|
|
177
|
+
if (seen.has(value)) {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
seen.add(value);
|
|
181
|
+
for (const item of Object.values(value as Record<string, unknown>)) {
|
|
182
|
+
const found = walk(item, depth + 1);
|
|
183
|
+
if (found !== undefined) {
|
|
184
|
+
return found;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return undefined;
|
|
189
|
+
};
|
|
190
|
+
return walk(input, 0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Property names that carry a query's time window when a vendor schema
|
|
195
|
+
* declares them. Deliberately narrower than the embedded-filter key list:
|
|
196
|
+
* these must be safe to *require*, so only unambiguous window names — never
|
|
197
|
+
* `timestamp`/`date`, which name data fields more often than bounds.
|
|
198
|
+
*/
|
|
199
|
+
const TIME_WINDOW_KEYS = new Set([
|
|
200
|
+
"from",
|
|
201
|
+
"to",
|
|
202
|
+
"since",
|
|
203
|
+
"until",
|
|
204
|
+
"start",
|
|
205
|
+
"end",
|
|
206
|
+
"start_time",
|
|
207
|
+
"end_time",
|
|
208
|
+
"starttime",
|
|
209
|
+
"endtime",
|
|
210
|
+
]);
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The string-typed time-window properties a tool's input schema declares.
|
|
214
|
+
* String-typed only: a numeric `from` is a pagination offset more often than
|
|
215
|
+
* an instant, and requiring an ISO value there would break the call.
|
|
216
|
+
*/
|
|
217
|
+
export function schemaTimeWindowKeys(
|
|
218
|
+
inputSchema: { properties?: Record<string, unknown> } | undefined
|
|
219
|
+
): string[] {
|
|
220
|
+
const properties = inputSchema?.properties;
|
|
221
|
+
if (properties === undefined) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
const keys: string[] = [];
|
|
225
|
+
for (const [name, spec] of Object.entries(properties)) {
|
|
226
|
+
if (!TIME_WINDOW_KEYS.has(name.toLowerCase())) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
const type =
|
|
230
|
+
typeof spec === "object" && spec !== null
|
|
231
|
+
? (spec as { type?: unknown }).type
|
|
232
|
+
: undefined;
|
|
233
|
+
const types = Array.isArray(type) ? type : [type];
|
|
234
|
+
if (types.includes("string")) {
|
|
235
|
+
keys.push(name);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return keys;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* An omitted time window on a vendor tool is not "no window" — the vendor
|
|
243
|
+
* fills it with a live default (Datadog: `now-1h`..`now`), which the walker
|
|
244
|
+
* cannot see because the value is never present. In a frozen session a call
|
|
245
|
+
* that omits a schema-declared window key is refused so the model supplies
|
|
246
|
+
* the bound explicitly, where {@link forwardTimeArgument} then checks it.
|
|
247
|
+
*/
|
|
248
|
+
export function missingTimeWindow(
|
|
249
|
+
input: unknown,
|
|
250
|
+
windowKeys: readonly string[],
|
|
251
|
+
asOf: string
|
|
252
|
+
): string | undefined {
|
|
253
|
+
if (windowKeys.length === 0) {
|
|
254
|
+
return undefined;
|
|
255
|
+
}
|
|
256
|
+
const record =
|
|
257
|
+
typeof input === "object" && input !== null
|
|
258
|
+
? (input as Record<string, unknown>)
|
|
259
|
+
: {};
|
|
260
|
+
const missing = windowKeys.filter((key) => record[key] === undefined);
|
|
261
|
+
if (missing.length === 0) {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
return (
|
|
265
|
+
`This tool fills omitted time bounds (${missing.join(", ")}) with a ` +
|
|
266
|
+
`live default window, which reads the real present. This session reads ` +
|
|
267
|
+
`the world as of ${asOf}; supply each bound explicitly as an absolute ` +
|
|
268
|
+
`ISO-8601 instant with a timezone at or before that instant and retry.`
|
|
269
|
+
);
|
|
270
|
+
}
|
|
@@ -329,6 +329,14 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
|
|
|
329
329
|
if (manifests.every((manifest) => manifest.architecture === "v2")) {
|
|
330
330
|
return deployAgentsdkApplication(ctx, options, targets, {
|
|
331
331
|
hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
|
|
332
|
+
declaredSecretNames: [
|
|
333
|
+
...new Set(
|
|
334
|
+
manifests.flatMap((manifest) => manifest.hosting?.secretNames ?? [])
|
|
335
|
+
),
|
|
336
|
+
],
|
|
337
|
+
hasDeploymentsChannels: manifests.some(
|
|
338
|
+
(manifest) => manifest.hasDeploymentsChannels
|
|
339
|
+
),
|
|
332
340
|
});
|
|
333
341
|
}
|
|
334
342
|
if (
|
|
@@ -741,6 +749,8 @@ async function deployOne(
|
|
|
741
749
|
agentPath,
|
|
742
750
|
repositories: options.cursorEventsRepos,
|
|
743
751
|
hasScmChannels: manifest.hasScmChannels,
|
|
752
|
+
declaredSecretNames: hosting?.secretNames,
|
|
753
|
+
hasDeploymentsChannels: manifest.hasDeploymentsChannels,
|
|
744
754
|
multiTenant: options.multiTenant === true,
|
|
745
755
|
});
|
|
746
756
|
}
|
|
@@ -871,7 +881,11 @@ async function deployAgentsdkApplication(
|
|
|
871
881
|
ctx: DeployCliContext,
|
|
872
882
|
options: DeployCliOptions,
|
|
873
883
|
targets: readonly DeployTarget[],
|
|
874
|
-
declarations: {
|
|
884
|
+
declarations: {
|
|
885
|
+
hasScmChannels: boolean;
|
|
886
|
+
declaredSecretNames: string[];
|
|
887
|
+
hasDeploymentsChannels: boolean;
|
|
888
|
+
}
|
|
875
889
|
): Promise<number> {
|
|
876
890
|
const parentDir = resolve(options.dir ?? ".");
|
|
877
891
|
const slug = slugFromDirectoryName(basename(parentDir));
|
|
@@ -936,16 +950,7 @@ async function deployAgentsdkApplication(
|
|
|
936
950
|
);
|
|
937
951
|
}
|
|
938
952
|
|
|
939
|
-
|
|
940
|
-
// budget is per component; otherwise a 2+ component deploy routinely hits
|
|
941
|
-
// the client-side timeout while the server-side deploy is still fine. An
|
|
942
|
-
// explicitly passed timeout always wins.
|
|
943
|
-
const waitCtx =
|
|
944
|
-
options.timeoutMs === undefined
|
|
945
|
-
? { ...ctx, timeoutMs: ctx.timeoutMs * targets.length }
|
|
946
|
-
: ctx;
|
|
947
|
-
|
|
948
|
-
return deployOneAgentsdk(waitCtx, undefined, {
|
|
953
|
+
return deployOneAgentsdk(ctx, undefined, {
|
|
949
954
|
slug,
|
|
950
955
|
gitRepoUrl,
|
|
951
956
|
gitRef,
|
|
@@ -953,12 +958,14 @@ async function deployAgentsdkApplication(
|
|
|
953
958
|
components,
|
|
954
959
|
repositories: options.cursorEventsRepos,
|
|
955
960
|
hasScmChannels: declarations.hasScmChannels,
|
|
961
|
+
declaredSecretNames: declarations.declaredSecretNames,
|
|
962
|
+
hasDeploymentsChannels: declarations.hasDeploymentsChannels,
|
|
956
963
|
multiTenant: options.multiTenant === true,
|
|
957
964
|
});
|
|
958
965
|
}
|
|
959
966
|
|
|
960
967
|
/**
|
|
961
|
-
* `architecture: "v2"` deploy: POST `/internal/
|
|
968
|
+
* `architecture: "v2"` deploy: POST `/internal/agentsdk/deployments` and
|
|
962
969
|
* poll the matching GET. The v2 accept path starts freeze bake; it does
|
|
963
970
|
* not mint an engine alias or alias token.
|
|
964
971
|
*/
|
|
@@ -974,6 +981,10 @@ async function deployOneAgentsdk(
|
|
|
974
981
|
repositories: string[] | undefined;
|
|
975
982
|
/** Any component declares a GitHub/Origin channel. */
|
|
976
983
|
hasScmChannels: boolean;
|
|
984
|
+
/** Union of application component secret declarations. */
|
|
985
|
+
declaredSecretNames?: string[];
|
|
986
|
+
/** Any component declares a deployments channel (same repo scope). */
|
|
987
|
+
hasDeploymentsChannels?: boolean;
|
|
977
988
|
/** Redeploy an existing Cursor-managed product. */
|
|
978
989
|
multiTenant: boolean;
|
|
979
990
|
}
|
|
@@ -1048,6 +1059,9 @@ async function deployOneAgentsdk(
|
|
|
1048
1059
|
);
|
|
1049
1060
|
return 1;
|
|
1050
1061
|
}
|
|
1062
|
+
warnMissingSecrets(ctx, slug, args.declaredSecretNames, detail.secretNames);
|
|
1063
|
+
const watchesRepositories =
|
|
1064
|
+
args.hasScmChannels || args.hasDeploymentsChannels === true;
|
|
1051
1065
|
ctx.out(
|
|
1052
1066
|
`Deployed ${slug} (team ${ctx.teamId})\n` +
|
|
1053
1067
|
` status: running\n` +
|
|
@@ -1059,15 +1073,16 @@ async function deployOneAgentsdk(
|
|
|
1059
1073
|
: ` components: ${args.components
|
|
1060
1074
|
.map((component) => component.componentKey)
|
|
1061
1075
|
.join(", ")}\n`) +
|
|
1062
|
-
(detail.repositories === undefined || !
|
|
1076
|
+
(detail.repositories === undefined || !watchesRepositories
|
|
1063
1077
|
? ""
|
|
1064
1078
|
: ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`)
|
|
1065
1079
|
);
|
|
1066
|
-
// An agent with GitHub/Origin channels bound to no repository
|
|
1067
|
-
// no deliveries at all
|
|
1068
|
-
|
|
1080
|
+
// An agent with GitHub/Origin/deployments channels bound to no repository
|
|
1081
|
+
// scope gets no deliveries at all (deployments channels receive the
|
|
1082
|
+
// watched repos' deployment events), which is otherwise invisible here.
|
|
1083
|
+
if (watchesRepositories && detail.repositories?.length === 0) {
|
|
1069
1084
|
ctx.err(
|
|
1070
|
-
`warning: ${slug} watches no repositories, so its GitHub/Origin channels receive no events.\n` +
|
|
1085
|
+
`warning: ${slug} watches no repositories, so its GitHub/Origin/deployments channels receive no events.\n` +
|
|
1071
1086
|
` Redeploy with --cursor-events-repo <owner>/<name> to set the scope.\n`
|
|
1072
1087
|
);
|
|
1073
1088
|
}
|
|
@@ -1185,6 +1200,12 @@ interface DeployManifest {
|
|
|
1185
1200
|
* while the deployment is bound to at least one `owner/name` scope.
|
|
1186
1201
|
*/
|
|
1187
1202
|
hasScmChannels: boolean;
|
|
1203
|
+
/**
|
|
1204
|
+
* The agent has deployments channels; deploy-source edges derive from
|
|
1205
|
+
* the same watched-repo set as GitHub/Origin, so it too receives
|
|
1206
|
+
* nothing while the deployment watches no repositories.
|
|
1207
|
+
*/
|
|
1208
|
+
hasDeploymentsChannels: boolean;
|
|
1188
1209
|
}
|
|
1189
1210
|
|
|
1190
1211
|
/**
|
|
@@ -1224,6 +1245,9 @@ async function readDeployManifest(dir: string): Promise<DeployManifest> {
|
|
|
1224
1245
|
const kind = channel.definition.meta?.kind;
|
|
1225
1246
|
return kind === "github" || kind === "origin";
|
|
1226
1247
|
}),
|
|
1248
|
+
hasDeploymentsChannels: project.channels.some(
|
|
1249
|
+
(channel) => channel.definition.meta?.kind === "deployments"
|
|
1250
|
+
),
|
|
1227
1251
|
};
|
|
1228
1252
|
}
|
|
1229
1253
|
|
|
@@ -1450,6 +1474,9 @@ function renderAgentkitDeploymentStatus(
|
|
|
1450
1474
|
}`
|
|
1451
1475
|
);
|
|
1452
1476
|
}
|
|
1477
|
+
if (detail.secretNames !== undefined && detail.secretNames.length > 0) {
|
|
1478
|
+
lines.push(` secrets: ${detail.secretNames.join(", ")}`);
|
|
1479
|
+
}
|
|
1453
1480
|
if (detail.lastError !== null && detail.lastError !== undefined) {
|
|
1454
1481
|
lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
|
|
1455
1482
|
}
|
|
@@ -1478,7 +1505,7 @@ export async function cmdStop(
|
|
|
1478
1505
|
// deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
|
|
1479
1506
|
// `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
|
|
1480
1507
|
// could not fall through. A v2 404 (including an older backend without
|
|
1481
|
-
// the `/internal/
|
|
1508
|
+
// the `/internal/agentsdk` mount) falls back to the v1 stop.
|
|
1482
1509
|
let architecture: "v1" | "v2" = "v2";
|
|
1483
1510
|
let accepted: StopAccepted | AgentkitStopAccepted;
|
|
1484
1511
|
try {
|
|
@@ -1650,6 +1677,21 @@ export async function cmdRotatePodCredential(
|
|
|
1650
1677
|
// secrets set|list|unset
|
|
1651
1678
|
// ============================================================================
|
|
1652
1679
|
|
|
1680
|
+
async function secretDeploymentArchitecture(
|
|
1681
|
+
ctx: DeployCliContext,
|
|
1682
|
+
slug: string
|
|
1683
|
+
): Promise<"v1" | "v2"> {
|
|
1684
|
+
try {
|
|
1685
|
+
await ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug });
|
|
1686
|
+
return "v2";
|
|
1687
|
+
} catch (error) {
|
|
1688
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
1689
|
+
return "v1";
|
|
1690
|
+
}
|
|
1691
|
+
throw error;
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1653
1695
|
export async function cmdSecretsSet(
|
|
1654
1696
|
slug: string | undefined,
|
|
1655
1697
|
specs: string[],
|
|
@@ -1712,11 +1754,19 @@ export async function cmdSecretsSet(
|
|
|
1712
1754
|
|
|
1713
1755
|
let secretNames: string[];
|
|
1714
1756
|
try {
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1757
|
+
const architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1758
|
+
secretNames =
|
|
1759
|
+
architecture === "v2"
|
|
1760
|
+
? await ctx.client.setAgentkitSecrets({
|
|
1761
|
+
teamId: ctx.teamId,
|
|
1762
|
+
slug,
|
|
1763
|
+
secrets,
|
|
1764
|
+
})
|
|
1765
|
+
: await ctx.client.setSecrets({
|
|
1766
|
+
teamId: ctx.teamId,
|
|
1767
|
+
slug,
|
|
1768
|
+
secrets,
|
|
1769
|
+
});
|
|
1720
1770
|
} catch (error) {
|
|
1721
1771
|
return renderApiError(error, ctx.err);
|
|
1722
1772
|
}
|
|
@@ -1748,7 +1798,11 @@ export async function cmdSecretsList(
|
|
|
1748
1798
|
}
|
|
1749
1799
|
let secrets: SecretInfo[];
|
|
1750
1800
|
try {
|
|
1751
|
-
|
|
1801
|
+
const architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1802
|
+
secrets =
|
|
1803
|
+
architecture === "v2"
|
|
1804
|
+
? await ctx.client.listAgentkitSecrets({ teamId: ctx.teamId, slug })
|
|
1805
|
+
: await ctx.client.listSecrets({ teamId: ctx.teamId, slug });
|
|
1752
1806
|
} catch (error) {
|
|
1753
1807
|
return renderApiError(error, ctx.err);
|
|
1754
1808
|
}
|
|
@@ -1787,7 +1841,16 @@ export async function cmdSecretsUnset(
|
|
|
1787
1841
|
return ctx;
|
|
1788
1842
|
}
|
|
1789
1843
|
try {
|
|
1790
|
-
await
|
|
1844
|
+
const architecture = await secretDeploymentArchitecture(ctx, slug);
|
|
1845
|
+
if (architecture === "v2") {
|
|
1846
|
+
await ctx.client.deleteAgentkitSecret({
|
|
1847
|
+
teamId: ctx.teamId,
|
|
1848
|
+
slug,
|
|
1849
|
+
name,
|
|
1850
|
+
});
|
|
1851
|
+
} else {
|
|
1852
|
+
await ctx.client.deleteSecret({ teamId: ctx.teamId, slug, name });
|
|
1853
|
+
}
|
|
1791
1854
|
} catch (error) {
|
|
1792
1855
|
if (error instanceof DeployApiError && error.status === 404) {
|
|
1793
1856
|
ctx.err(
|
|
@@ -119,7 +119,9 @@ export const BUILTINS: readonly ContinuationBuiltin[] = [
|
|
|
119
119
|
{
|
|
120
120
|
type: "deployment",
|
|
121
121
|
kind: "deployments",
|
|
122
|
-
events
|
|
122
|
+
// All three factory stream events carry `deploymentId`; keep in
|
|
123
|
+
// lockstep with the control plane's `conversation/deployments.ts`.
|
|
124
|
+
events: ["deployment.created", "deployment.succeeded", "deployment.failed"],
|
|
123
125
|
format: "deployments:{deploymentId}",
|
|
124
126
|
},
|
|
125
127
|
] as const;
|
|
@@ -383,18 +383,13 @@ export function selectConversationMirror(input: {
|
|
|
383
383
|
return undefined;
|
|
384
384
|
}
|
|
385
385
|
const env = input.env ?? process.env;
|
|
386
|
-
|
|
387
|
-
env as NodeJS.ProcessEnv
|
|
388
|
-
);
|
|
389
|
-
if (
|
|
390
|
-
env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined ||
|
|
391
|
-
frameworkStoreId === undefined
|
|
392
|
-
) {
|
|
386
|
+
if (env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined) {
|
|
393
387
|
return undefined;
|
|
394
388
|
}
|
|
389
|
+
const envSnapshot = env as NodeJS.ProcessEnv;
|
|
395
390
|
return createConversationMirror({
|
|
396
391
|
sink: cursorHostedFiles({
|
|
397
|
-
|
|
392
|
+
resolveStoreSourceId: () => cursorFrameworkStoreSourceId(envSnapshot),
|
|
398
393
|
// Full chain (env → key file → stored login): frozen engines listen
|
|
399
394
|
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this sink
|
|
400
395
|
// is constructed.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-time application secrets for hosted v2 freeze restores.
|
|
3
|
+
*
|
|
4
|
+
* The deployment host rewrites this tmpfs document before each admission and
|
|
5
|
+
* execution request. July reloads it synchronously because the process was
|
|
6
|
+
* already running in the frozen snapshot when the task-specific values
|
|
7
|
+
* arrived.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE =
|
|
13
|
+
"/run/cursor/secrets/AGENT_SERVE_DEPLOYMENT_SECRETS.json";
|
|
14
|
+
|
|
15
|
+
const SECRET_NAME_PATTERN = /^[A-Z][A-Z0-9_]{0,63}$/;
|
|
16
|
+
const appliedSecretNames = new Set<string>();
|
|
17
|
+
|
|
18
|
+
function parseBoundSecrets(path: string): Record<string, string> | undefined {
|
|
19
|
+
let parsed: unknown;
|
|
20
|
+
try {
|
|
21
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
22
|
+
} catch {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const envelope = parsed as { v?: unknown; secrets?: unknown };
|
|
29
|
+
if (
|
|
30
|
+
envelope.v !== 1 ||
|
|
31
|
+
envelope.secrets === null ||
|
|
32
|
+
typeof envelope.secrets !== "object" ||
|
|
33
|
+
Array.isArray(envelope.secrets)
|
|
34
|
+
) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const secrets: Record<string, string> = {};
|
|
38
|
+
for (const [name, value] of Object.entries(envelope.secrets)) {
|
|
39
|
+
if (
|
|
40
|
+
SECRET_NAME_PATTERN.test(name) &&
|
|
41
|
+
!name.startsWith("CURSOR_") &&
|
|
42
|
+
typeof value === "string"
|
|
43
|
+
) {
|
|
44
|
+
secrets[name] = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return secrets;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Refresh `process.env` from the latest bound document. A missing or malformed
|
|
52
|
+
* file is a no-op; an empty valid document removes values loaded by an earlier
|
|
53
|
+
* bind after the deployment secret was unset.
|
|
54
|
+
*/
|
|
55
|
+
export function refreshBoundDeploymentSecrets(
|
|
56
|
+
path: string = DEFAULT_AGENT_SERVE_DEPLOYMENT_SECRETS_FILE
|
|
57
|
+
): void {
|
|
58
|
+
const secrets = parseBoundSecrets(path);
|
|
59
|
+
if (secrets === undefined) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (const name of appliedSecretNames) {
|
|
63
|
+
if (!(name in secrets)) {
|
|
64
|
+
delete process.env[name];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
appliedSecretNames.clear();
|
|
68
|
+
for (const [name, value] of Object.entries(secrets)) {
|
|
69
|
+
process.env[name] = value;
|
|
70
|
+
appliedSecretNames.add(name);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-time bind paths for hosted deployment file-store source ids.
|
|
3
|
+
*
|
|
4
|
+
* Freeze v2 snapshots start `agent-serve serve` at bake time without a service
|
|
5
|
+
* account, so neither store id is in process env. Execute-from-freeze binds
|
|
6
|
+
* the deployment credential and store ids into `/run/cursor/secrets/` without
|
|
7
|
+
* restarting July — the same pattern as {@link DEFAULT_CURSOR_API_KEY_FILE}.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync } from "node:fs";
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_AGENT_SERVE_STORE_SOURCE_ID_FILE =
|
|
13
|
+
"/run/cursor/secrets/AGENT_SERVE_STORE_SOURCE_ID";
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE =
|
|
16
|
+
"/run/cursor/secrets/AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
|
|
17
|
+
|
|
18
|
+
const STORE_SOURCE_ID_ENV = "AGENT_SERVE_STORE_SOURCE_ID";
|
|
19
|
+
const FRAMEWORK_STORE_SOURCE_ID_ENV = "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
|
|
20
|
+
const STORE_SOURCE_ID_FILE_ENV = "AGENT_SERVE_STORE_SOURCE_ID_FILE";
|
|
21
|
+
const FRAMEWORK_STORE_SOURCE_ID_FILE_ENV =
|
|
22
|
+
"AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE";
|
|
23
|
+
|
|
24
|
+
function readTrimmedFile(path: string): string | undefined {
|
|
25
|
+
try {
|
|
26
|
+
const raw = readFileSync(path, "utf8").trim();
|
|
27
|
+
return raw === "" ? undefined : raw;
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function readBoundSecretFile(
|
|
34
|
+
fileEnvVar: string,
|
|
35
|
+
defaultPath: string,
|
|
36
|
+
env: NodeJS.ProcessEnv
|
|
37
|
+
): string | undefined {
|
|
38
|
+
const configured = env[fileEnvVar]?.trim();
|
|
39
|
+
const path =
|
|
40
|
+
configured !== undefined && configured !== "" ? configured : defaultPath;
|
|
41
|
+
return readTrimmedFile(path);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Deployment user-land store: env, then task-bind file. */
|
|
45
|
+
export function resolveDeploymentStoreSourceIdSync(
|
|
46
|
+
env: NodeJS.ProcessEnv = process.env
|
|
47
|
+
): string | undefined {
|
|
48
|
+
const fromEnv = env[STORE_SOURCE_ID_ENV]?.trim();
|
|
49
|
+
if (fromEnv !== undefined && fromEnv !== "") {
|
|
50
|
+
return fromEnv;
|
|
51
|
+
}
|
|
52
|
+
return readBoundSecretFile(
|
|
53
|
+
STORE_SOURCE_ID_FILE_ENV,
|
|
54
|
+
DEFAULT_AGENT_SERVE_STORE_SOURCE_ID_FILE,
|
|
55
|
+
env
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Engine framework store: env, then task-bind file. */
|
|
60
|
+
export function resolveFrameworkStoreSourceIdSync(
|
|
61
|
+
env: NodeJS.ProcessEnv = process.env
|
|
62
|
+
): string | undefined {
|
|
63
|
+
const fromEnv = env[FRAMEWORK_STORE_SOURCE_ID_ENV]?.trim();
|
|
64
|
+
if (fromEnv !== undefined && fromEnv !== "") {
|
|
65
|
+
return fromEnv;
|
|
66
|
+
}
|
|
67
|
+
return readBoundSecretFile(
|
|
68
|
+
FRAMEWORK_STORE_SOURCE_ID_FILE_ENV,
|
|
69
|
+
DEFAULT_AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_FILE,
|
|
70
|
+
env
|
|
71
|
+
);
|
|
72
|
+
}
|