@cursor/july 0.1.96 → 0.1.99
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 +1 -1
- package/README.md +3 -2
- package/dist/bin/agent-serve.js +13 -3
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +16 -0
- package/dist/channels/origin/api.d.ts +15 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +19 -3
- package/dist/channels/origin/binding.d.ts +11 -0
- package/dist/channels/origin/binding.d.ts.map +1 -1
- package/dist/channels/origin/binding.js +41 -25
- package/dist/channels/origin/index.d.ts +1 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +1 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +40 -4
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +67 -0
- package/dist/channels/origin/types.d.ts +11 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/approvals.d.ts +16 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -1
- package/dist/channels/slack/approvals.js +86 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +234 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +142 -63
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +1 -1
- package/dist/channels/slack/init.d.ts +3 -2
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +5 -5
- package/dist/channels/slack/interactive.d.ts +2 -1
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +15 -4
- package/dist/channels/slack/live-delivery.d.ts +1 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +4 -2
- package/dist/channels/slack/manifest.d.ts +1 -1
- package/dist/channels/slack/manifest.js +1 -1
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +115 -0
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +10 -6
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +1 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
- package/dist/channels/slack/tool-approval-events.js +91 -1
- package/dist/channels/slack/types.d.ts +9 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.jXleCmOc.js → app.BplEAZ3S.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.CHXyv4wP.js} +1 -1
- package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.BTcsZmjQ.js} +2 -2
- package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
- package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.DfoeyvL0.js} +9 -6
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
- package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.BEJx9XVj.js} +2 -2
- package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.CvAHsdSp.js} +10 -2
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +7 -7
- package/dist/docs/deployment.md +5 -4
- package/dist/docs/design/runtime-abstraction.md +1757 -0
- package/dist/docs/evals.html +4 -4
- 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 +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +8 -8
- package/dist/docs/guides/mcp-oauth.md +26 -8
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +17 -33
- package/dist/docs/guides/slack.md +92 -201
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -3
- package/dist/docs/llms-full.txt +2065 -637
- package/dist/docs/llms.txt +3 -2
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +6 -6
- package/dist/docs/reference/agent-config.md +2 -2
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +13 -10
- package/dist/docs/reference/cli.md +32 -16
- package/dist/docs/reference/connections.html +9 -8
- package/dist/docs/reference/connections.md +6 -3
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/http-api.md +3 -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 +5 -5
- package/dist/docs/reference/sessions.md +4 -2
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +15 -7
- package/dist/docs/reference/tools.md +34 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +28 -0
- package/dist/docs/templates/agents-md.md +105 -0
- package/dist/docs/templates/code-wiki.html +5 -5
- 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 +5 -5
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/evals/run-facts.d.ts.map +1 -1
- package/dist/evals/run-facts.js +27 -0
- package/dist/files-backends/cursor-hosted.d.ts +3 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -9
- package/dist/internal/approval-gate.d.ts +12 -13
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +16 -21
- package/dist/internal/as-of.d.ts +19 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +82 -0
- package/dist/internal/chat-client.js +10 -0
- package/dist/internal/cli-deploy.d.ts +6 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +149 -21
- package/dist/internal/cli-mcp-oauth.js +8 -18
- package/dist/internal/cli-slack-manual.d.ts +24 -2
- package/dist/internal/cli-slack-manual.d.ts.map +1 -1
- package/dist/internal/cli-slack-manual.js +251 -20
- package/dist/internal/cli-slack.d.ts +9 -2
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +29 -82
- package/dist/internal/cursor/account-mcp.d.ts +1 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +17 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +5 -6
- package/dist/internal/deploy-client.d.ts +17 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +31 -10
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/framework-file-storage.d.ts +11 -17
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +17 -40
- package/dist/internal/framework-storage-selection.d.ts +13 -11
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +37 -26
- package/dist/internal/hosted-admission-adapter.d.ts +28 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +13 -1
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +8 -1
- package/dist/internal/hosted-delivery.d.ts +21 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +101 -34
- package/dist/internal/hosted-execution-diag.d.ts +59 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +187 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +85 -2
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/logs-client.d.ts +5 -0
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +5 -0
- package/dist/internal/mcp-endpoint.js +2 -3
- package/dist/internal/mcp-host.d.ts +10 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +57 -8
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +92 -0
- package/dist/internal/mcp-oauth.d.ts +1 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +10 -2
- package/dist/internal/null-kv-storage.d.ts +48 -0
- package/dist/internal/null-kv-storage.d.ts.map +1 -0
- package/dist/internal/null-kv-storage.js +58 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +22 -9
- package/dist/internal/server.d.ts +6 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +123 -33
- package/dist/internal/session-engine.d.ts +88 -3
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +538 -46
- package/dist/internal/session-run-log.d.ts +120 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +359 -0
- package/dist/internal/sessions-client.d.ts +9 -7
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +3 -1
- package/dist/internal/storage-coordinator.d.ts +13 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +37 -6
- package/dist/internal/storage-roles.d.ts +5 -0
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/stream-progress.d.ts.map +1 -1
- package/dist/internal/stream-progress.js +10 -0
- package/dist/internal/tool-policy.d.ts +29 -9
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +24 -0
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +10 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/playground/assets/index-D7rGZNjy.css +1 -0
- package/dist/playground/assets/index-jzNbJENa.js +69 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +1 -1
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +12 -0
- package/dist/storage-protocol.d.ts +8 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +8 -0
- package/dist/storage.d.ts +8 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/tools.d.ts +12 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +88 -7
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -3
- package/docs/deployment.md +5 -4
- package/docs/design/runtime-abstraction.md +1757 -0
- package/docs/guides/mcp-oauth.md +26 -8
- package/docs/guides/slack.md +93 -202
- package/docs/reference/agent-config.md +2 -2
- package/docs/reference/cli.md +32 -16
- package/docs/reference/connections.md +6 -3
- package/docs/reference/http-api.md +3 -1
- package/docs/reference/sessions.md +4 -2
- package/docs/reference/tools.md +34 -2
- package/docs/templates/agents-md.md +110 -0
- package/docs/troubleshooting.md +2 -2
- package/package.json +1 -1
- package/skills/create-agent/SKILL.md +2 -1
- package/skills/mcp-auth/SKILL.md +6 -3
- package/skills/setup-slack/SKILL.md +23 -13
- package/src/bin/agent-serve.ts +12 -1
- package/src/channels/github/github-channel.ts +17 -0
- package/src/channels/origin/api.ts +24 -5
- package/src/channels/origin/binding.ts +55 -26
- package/src/channels/origin/index.ts +1 -0
- package/src/channels/origin/origin-channel.ts +78 -10
- package/src/channels/origin/reactions.ts +82 -0
- package/src/channels/origin/types.ts +11 -0
- package/src/channels/slack/approvals.ts +105 -0
- package/src/channels/slack/cli-project.ts +267 -0
- package/src/channels/slack/defaults.ts +165 -74
- package/src/channels/slack/dispatch.ts +2 -0
- package/src/channels/slack/init.ts +10 -5
- package/src/channels/slack/interactive.ts +35 -9
- package/src/channels/slack/live-delivery.ts +5 -3
- package/src/channels/slack/manifest.ts +1 -1
- package/src/channels/slack/progress-delivery.ts +133 -0
- package/src/channels/slack/setup.ts +10 -6
- package/src/channels/slack/slack-channel.ts +1 -0
- package/src/channels/slack/tool-approval-events.ts +93 -0
- package/src/channels/slack/types.ts +9 -1
- package/src/evals/run-facts.ts +32 -0
- package/src/files-backends/cursor-hosted.ts +3 -2
- package/src/index.ts +4 -0
- package/src/internal/advertise-tools.ts +31 -10
- package/src/internal/approval-gate.ts +20 -29
- package/src/internal/as-of.ts +107 -0
- package/src/internal/chat-client.ts +19 -0
- package/src/internal/cli-deploy.ts +203 -13
- package/src/internal/cli-mcp-oauth.ts +7 -21
- package/src/internal/cli-slack-manual.ts +350 -18
- package/src/internal/cli-slack.ts +40 -84
- package/src/internal/cursor/account-mcp.ts +21 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/cursor-event-relay.ts +5 -6
- package/src/internal/deploy-client.ts +43 -0
- package/src/internal/env-file.ts +84 -0
- package/src/internal/framework-file-storage.ts +18 -46
- package/src/internal/framework-storage-selection.ts +41 -25
- package/src/internal/hosted-admission-adapter.ts +42 -0
- package/src/internal/hosted-delivery-protocol.ts +14 -2
- package/src/internal/hosted-delivery.ts +169 -44
- package/src/internal/hosted-execution-diag.ts +252 -0
- package/src/internal/http-channel.ts +107 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/logs-client.ts +5 -0
- package/src/internal/mcp-endpoint.ts +13 -4
- package/src/internal/mcp-host.ts +77 -11
- package/src/internal/mcp-oauth-on-demand.ts +352 -0
- package/src/internal/mcp-oauth-persist.ts +127 -0
- package/src/internal/mcp-oauth.ts +17 -1
- package/src/internal/null-kv-storage.ts +74 -0
- package/src/internal/otel/collector.ts +30 -0
- package/src/internal/server.ts +159 -11
- package/src/internal/session-engine.ts +691 -57
- package/src/internal/session-run-log.ts +584 -0
- package/src/internal/sessions-client.ts +17 -8
- package/src/internal/storage-coordinator.ts +49 -9
- package/src/internal/storage-roles.ts +7 -0
- package/src/internal/stream-progress.ts +19 -0
- package/src/internal/tool-policy.ts +49 -9
- package/src/internal/trajectory.ts +10 -0
- package/src/internal/turn-outbox.ts +85 -0
- package/src/storage-backends/cursor-hosted.ts +13 -1
- package/src/storage-protocol.ts +10 -0
- package/src/storage.ts +12 -0
- package/src/tools.ts +12 -2
- package/src/types.ts +93 -8
- package/templates/agents-md/README.md +39 -0
- package/templates/agents-md/agent/agent.ts +8 -0
- package/templates/agents-md/agent/channels/github.ts +10 -0
- package/templates/agents-md/agent/channels/queue.ts +28 -0
- package/templates/agents-md/agent/channels/slack.ts +9 -0
- package/templates/agents-md/agent/instructions.md +39 -0
- package/templates/agents-md/agent/lib/collect.ts +439 -0
- package/templates/agents-md/agent/lib/config.ts +8 -0
- package/templates/agents-md/agent/lib/paths.ts +51 -0
- package/templates/agents-md/agent/schedules/weekly.ts +17 -0
- package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
- package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
- package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
- package/dist/docs/design/agsh.md +0 -406
- package/dist/playground/assets/index-B1DDvBeC.css +0 -1
- package/dist/playground/assets/index-Cx9CclK_.js +0 -88
- package/docs/design/agsh.md +0 -406
- /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
|
@@ -66,6 +66,8 @@ import { stderrPalette } from "./terminal-style.js";
|
|
|
66
66
|
|
|
67
67
|
const DEFAULT_POLL_INTERVAL_MS = 3_000;
|
|
68
68
|
const DEFAULT_DEPLOY_TIMEOUT_MS = 10 * 60 * 1000;
|
|
69
|
+
/** `--multi-tenant` HTTP deploy is Anysphere-only (team id 1). */
|
|
70
|
+
const MULTI_TENANT_HTTP_DEPLOY_TEAM_ID = 1;
|
|
69
71
|
|
|
70
72
|
/** One agent directory selected for deploy (single or multi-agent parent). */
|
|
71
73
|
export type DeployTarget = ChildAgentDir;
|
|
@@ -112,6 +114,12 @@ export interface DeployCliOptions {
|
|
|
112
114
|
cursorEventsRepos?: string[];
|
|
113
115
|
/** deploy `--allow-domain <domain>` (repeatable; unioned with the manifest). */
|
|
114
116
|
allowDomains?: string[];
|
|
117
|
+
/**
|
|
118
|
+
* deploy `--multi-tenant`: add a release to an existing Cursor-managed
|
|
119
|
+
* (multi-tenant) product. Hidden Anysphere-only flag. Cannot create a
|
|
120
|
+
* new multi-tenant application.
|
|
121
|
+
*/
|
|
122
|
+
multiTenant?: boolean;
|
|
115
123
|
/** Test seams. */
|
|
116
124
|
fetchImpl?: typeof fetch;
|
|
117
125
|
/** Inject the connector-auth browser opener (tests; also forces interactive). */
|
|
@@ -292,6 +300,14 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
|
|
|
292
300
|
return ctx;
|
|
293
301
|
}
|
|
294
302
|
|
|
303
|
+
if (
|
|
304
|
+
options.multiTenant === true &&
|
|
305
|
+
ctx.teamId !== MULTI_TENANT_HTTP_DEPLOY_TEAM_ID
|
|
306
|
+
) {
|
|
307
|
+
ctx.err("--multi-tenant is not available for this team.\n");
|
|
308
|
+
return 1;
|
|
309
|
+
}
|
|
310
|
+
|
|
295
311
|
const targets = await resolveDeployTargets(options, ctx);
|
|
296
312
|
if (typeof targets === "number") {
|
|
297
313
|
return targets;
|
|
@@ -311,7 +327,9 @@ export async function cmdDeploy(options: DeployCliOptions): Promise<number> {
|
|
|
311
327
|
manifests.push(await readDeployManifest(target.dir));
|
|
312
328
|
}
|
|
313
329
|
if (manifests.every((manifest) => manifest.architecture === "v2")) {
|
|
314
|
-
return deployAgentsdkApplication(ctx, options, targets
|
|
330
|
+
return deployAgentsdkApplication(ctx, options, targets, {
|
|
331
|
+
hasScmChannels: manifests.some((manifest) => manifest.hasScmChannels),
|
|
332
|
+
});
|
|
315
333
|
}
|
|
316
334
|
if (
|
|
317
335
|
!ctx.json &&
|
|
@@ -722,9 +740,18 @@ async function deployOne(
|
|
|
722
740
|
gitRef,
|
|
723
741
|
agentPath,
|
|
724
742
|
repositories: options.cursorEventsRepos,
|
|
743
|
+
hasScmChannels: manifest.hasScmChannels,
|
|
744
|
+
multiTenant: options.multiTenant === true,
|
|
725
745
|
});
|
|
726
746
|
}
|
|
727
747
|
|
|
748
|
+
if (options.multiTenant === true) {
|
|
749
|
+
ctx.err(
|
|
750
|
+
"--multi-tenant is only valid for architecture: v2 deploys (Cursor-managed products).\n"
|
|
751
|
+
);
|
|
752
|
+
return 1;
|
|
753
|
+
}
|
|
754
|
+
|
|
728
755
|
// Today's only source shape: the control plane builds from a git ref.
|
|
729
756
|
// See DeploySource for the artifact seam.
|
|
730
757
|
const source: DeploySource = {
|
|
@@ -804,11 +831,9 @@ async function deployOne(
|
|
|
804
831
|
}
|
|
805
832
|
|
|
806
833
|
if (detail.status !== "running") {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
: `: ${sanitizeCustomerError(detail.lastError)}`;
|
|
811
|
-
ctx.err(`Deployment ${slug} ended ${detail.status}${errorDetail}\n`);
|
|
834
|
+
ctx.err(
|
|
835
|
+
`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`
|
|
836
|
+
);
|
|
812
837
|
return 1;
|
|
813
838
|
}
|
|
814
839
|
const deployedPublicRoutes = detail.publicRoutePaths ?? [];
|
|
@@ -845,7 +870,8 @@ async function deployOne(
|
|
|
845
870
|
async function deployAgentsdkApplication(
|
|
846
871
|
ctx: DeployCliContext,
|
|
847
872
|
options: DeployCliOptions,
|
|
848
|
-
targets: readonly DeployTarget[]
|
|
873
|
+
targets: readonly DeployTarget[],
|
|
874
|
+
declarations: { hasScmChannels: boolean }
|
|
849
875
|
): Promise<number> {
|
|
850
876
|
const parentDir = resolve(options.dir ?? ".");
|
|
851
877
|
const slug = slugFromDirectoryName(basename(parentDir));
|
|
@@ -926,6 +952,8 @@ async function deployAgentsdkApplication(
|
|
|
926
952
|
agentPath: undefined,
|
|
927
953
|
components,
|
|
928
954
|
repositories: options.cursorEventsRepos,
|
|
955
|
+
hasScmChannels: declarations.hasScmChannels,
|
|
956
|
+
multiTenant: options.multiTenant === true,
|
|
929
957
|
});
|
|
930
958
|
}
|
|
931
959
|
|
|
@@ -944,6 +972,10 @@ async function deployOneAgentsdk(
|
|
|
944
972
|
agentPath: string | undefined;
|
|
945
973
|
components?: AgentkitDeployComponent[];
|
|
946
974
|
repositories: string[] | undefined;
|
|
975
|
+
/** Any component declares a GitHub/Origin channel. */
|
|
976
|
+
hasScmChannels: boolean;
|
|
977
|
+
/** Redeploy an existing Cursor-managed product. */
|
|
978
|
+
multiTenant: boolean;
|
|
947
979
|
}
|
|
948
980
|
): Promise<number> {
|
|
949
981
|
const { slug } = args;
|
|
@@ -953,6 +985,9 @@ async function deployOneAgentsdk(
|
|
|
953
985
|
: ` components: ${args.components
|
|
954
986
|
.map((component) => component.componentKey)
|
|
955
987
|
.join(", ")}\n`;
|
|
988
|
+
if (args.multiTenant && !ctx.json) {
|
|
989
|
+
ctx.err(" multi-tenant: existing product\n");
|
|
990
|
+
}
|
|
956
991
|
let accepted: AgentkitDeployAccepted;
|
|
957
992
|
try {
|
|
958
993
|
accepted = await ctx.client.deployAgentkit({
|
|
@@ -963,9 +998,13 @@ async function deployOneAgentsdk(
|
|
|
963
998
|
agentPath: args.agentPath,
|
|
964
999
|
components: args.components,
|
|
965
1000
|
repositories: args.repositories,
|
|
1001
|
+
...(args.multiTenant ? { multiTenant: true } : {}),
|
|
966
1002
|
});
|
|
967
1003
|
} catch (error) {
|
|
968
|
-
return renderApiError(error, ctx.err
|
|
1004
|
+
return renderApiError(error, ctx.err, {
|
|
1005
|
+
multiTenant: args.multiTenant,
|
|
1006
|
+
teamId: ctx.teamId,
|
|
1007
|
+
});
|
|
969
1008
|
}
|
|
970
1009
|
|
|
971
1010
|
if (ctx.noWait) {
|
|
@@ -1004,7 +1043,9 @@ async function deployOneAgentsdk(
|
|
|
1004
1043
|
}
|
|
1005
1044
|
|
|
1006
1045
|
if (detail.status !== "running") {
|
|
1007
|
-
ctx.err(
|
|
1046
|
+
ctx.err(
|
|
1047
|
+
`Deployment ${slug} ended ${detail.status}${deployFailureDetail(detail.lastError)}\n`
|
|
1048
|
+
);
|
|
1008
1049
|
return 1;
|
|
1009
1050
|
}
|
|
1010
1051
|
ctx.out(
|
|
@@ -1017,8 +1058,19 @@ async function deployOneAgentsdk(
|
|
|
1017
1058
|
? ""
|
|
1018
1059
|
: ` components: ${args.components
|
|
1019
1060
|
.map((component) => component.componentKey)
|
|
1020
|
-
.join(", ")}\n`)
|
|
1061
|
+
.join(", ")}\n`) +
|
|
1062
|
+
(detail.repositories === undefined || !args.hasScmChannels
|
|
1063
|
+
? ""
|
|
1064
|
+
: ` watching: ${detail.repositories.length === 0 ? "(nothing)" : detail.repositories.join(", ")}\n`)
|
|
1021
1065
|
);
|
|
1066
|
+
// An agent with GitHub/Origin channels bound to no repository scope gets
|
|
1067
|
+
// no deliveries at all, which is otherwise invisible in this output.
|
|
1068
|
+
if (args.hasScmChannels && detail.repositories?.length === 0) {
|
|
1069
|
+
ctx.err(
|
|
1070
|
+
`warning: ${slug} watches no repositories, so its GitHub/Origin channels receive no events.\n` +
|
|
1071
|
+
` Redeploy with --cursor-events-repo <owner>/<name> to set the scope.\n`
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1022
1074
|
return 0;
|
|
1023
1075
|
}
|
|
1024
1076
|
|
|
@@ -1128,6 +1180,11 @@ interface DeployManifest {
|
|
|
1128
1180
|
* (only `/v1/channels/…` subtrees can be public); surfaced as a warning.
|
|
1129
1181
|
*/
|
|
1130
1182
|
httpChannelPublicEndpoint: boolean;
|
|
1183
|
+
/**
|
|
1184
|
+
* The agent has GitHub/Origin channels, so it only receives deliveries
|
|
1185
|
+
* while the deployment is bound to at least one `owner/name` scope.
|
|
1186
|
+
*/
|
|
1187
|
+
hasScmChannels: boolean;
|
|
1131
1188
|
}
|
|
1132
1189
|
|
|
1133
1190
|
/**
|
|
@@ -1163,6 +1220,10 @@ async function readDeployManifest(dir: string): Promise<DeployManifest> {
|
|
|
1163
1220
|
httpChannelPublicEndpoint: (project.httpChannel.auth ?? []).some(
|
|
1164
1221
|
isPublicEndpointPolicy
|
|
1165
1222
|
),
|
|
1223
|
+
hasScmChannels: project.channels.some((channel) => {
|
|
1224
|
+
const kind = channel.definition.meta?.kind;
|
|
1225
|
+
return kind === "github" || kind === "origin";
|
|
1226
|
+
}),
|
|
1166
1227
|
};
|
|
1167
1228
|
}
|
|
1168
1229
|
|
|
@@ -1254,6 +1315,21 @@ export async function cmdDeploymentStatus(
|
|
|
1254
1315
|
if (typeof ctx === "number") {
|
|
1255
1316
|
return ctx;
|
|
1256
1317
|
}
|
|
1318
|
+
// Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
|
|
1319
|
+
// GET goes first. A v2 404 (missing slug, or an older backend) falls
|
|
1320
|
+
// through to the v1 agent-serve detail.
|
|
1321
|
+
try {
|
|
1322
|
+
const detail = await ctx.client.getAgentkitDeploy({
|
|
1323
|
+
teamId: ctx.teamId,
|
|
1324
|
+
slug,
|
|
1325
|
+
});
|
|
1326
|
+
renderAgentkitDeploymentStatus(ctx, detail);
|
|
1327
|
+
return 0;
|
|
1328
|
+
} catch (error) {
|
|
1329
|
+
if (!(error instanceof DeployApiError) || error.status !== 404) {
|
|
1330
|
+
return renderApiError(error, ctx.err);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1257
1333
|
let detail: DeploymentDetail;
|
|
1258
1334
|
try {
|
|
1259
1335
|
detail = await ctx.client.getDeployment({ teamId: ctx.teamId, slug });
|
|
@@ -1346,6 +1422,40 @@ export async function cmdDeploymentStatus(
|
|
|
1346
1422
|
return 0;
|
|
1347
1423
|
}
|
|
1348
1424
|
|
|
1425
|
+
function renderAgentkitDeploymentStatus(
|
|
1426
|
+
ctx: DeployCliContext,
|
|
1427
|
+
detail: AgentkitDeployStatus
|
|
1428
|
+
): void {
|
|
1429
|
+
if (ctx.json) {
|
|
1430
|
+
ctx.out(`${JSON.stringify(detail, null, 2)}\n`);
|
|
1431
|
+
return;
|
|
1432
|
+
}
|
|
1433
|
+
const lines = [
|
|
1434
|
+
`${detail.slug} (team ${detail.teamId})`,
|
|
1435
|
+
` status: ${detail.status}`,
|
|
1436
|
+
` architecture: v2`,
|
|
1437
|
+
` application: ${detail.applicationId}`,
|
|
1438
|
+
` release: ${detail.releaseId}`,
|
|
1439
|
+
` progress: ${detail.progress}`,
|
|
1440
|
+
];
|
|
1441
|
+
if (detail.statusMessage !== null && detail.statusMessage.trim() !== "") {
|
|
1442
|
+
lines.push(` step: ${detail.statusMessage}`);
|
|
1443
|
+
}
|
|
1444
|
+
if (detail.repositories !== undefined) {
|
|
1445
|
+
lines.push(
|
|
1446
|
+
` watching: ${
|
|
1447
|
+
detail.repositories.length === 0
|
|
1448
|
+
? "(nothing)"
|
|
1449
|
+
: detail.repositories.join(", ")
|
|
1450
|
+
}`
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
if (detail.lastError !== null && detail.lastError !== undefined) {
|
|
1454
|
+
lines.push(` last error: ${sanitizeCustomerError(detail.lastError)}`);
|
|
1455
|
+
}
|
|
1456
|
+
ctx.out(`${lines.join("\n")}\n`);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1349
1459
|
// ============================================================================
|
|
1350
1460
|
// stop <slug>
|
|
1351
1461
|
// ============================================================================
|
|
@@ -1854,10 +1964,35 @@ async function pollUntil<
|
|
|
1854
1964
|
};
|
|
1855
1965
|
|
|
1856
1966
|
for (;;) {
|
|
1857
|
-
|
|
1967
|
+
let detail: T;
|
|
1968
|
+
try {
|
|
1969
|
+
detail = await fetchDetail();
|
|
1970
|
+
} catch (error: unknown) {
|
|
1971
|
+
// Capacity / rate-limit on GET is not a bake failure. The v2 accept
|
|
1972
|
+
// already started freeze; keep polling until the wait budget expires.
|
|
1973
|
+
if (
|
|
1974
|
+
isTransientDeployStatusError(error) &&
|
|
1975
|
+
Date.now() - startedAt < ctx.timeoutMs
|
|
1976
|
+
) {
|
|
1977
|
+
if (!ctx.json) {
|
|
1978
|
+
const elapsed = Math.round((Date.now() - startedAt) / 1000);
|
|
1979
|
+
const label = "Waiting for status (server busy)";
|
|
1980
|
+
if (tty) {
|
|
1981
|
+
ctx.err(`\r\x1b[2K${slug}: ${label} (${elapsed}s)`);
|
|
1982
|
+
sawProgress = true;
|
|
1983
|
+
} else if (label !== lastLabel) {
|
|
1984
|
+
ctx.err(`${slug}: ${label}\n`);
|
|
1985
|
+
}
|
|
1986
|
+
lastLabel = label;
|
|
1987
|
+
}
|
|
1988
|
+
const waitMs = transientDeployStatusWaitMs(error, ctx.pollIntervalMs);
|
|
1989
|
+
const remaining = ctx.timeoutMs - (Date.now() - startedAt);
|
|
1990
|
+
await sleep(Math.max(0, Math.min(waitMs, remaining)));
|
|
1991
|
+
continue;
|
|
1992
|
+
}
|
|
1858
1993
|
finishProgressLine();
|
|
1859
1994
|
throw error;
|
|
1860
|
-
}
|
|
1995
|
+
}
|
|
1861
1996
|
report(detail);
|
|
1862
1997
|
if (terminal.has(detail.status)) {
|
|
1863
1998
|
finishProgressLine();
|
|
@@ -1875,6 +2010,28 @@ async function pollUntil<
|
|
|
1875
2010
|
}
|
|
1876
2011
|
}
|
|
1877
2012
|
|
|
2013
|
+
/** Load-shed / rate-limit on status GET — the deploy itself may still be baking. */
|
|
2014
|
+
function isTransientDeployStatusError(error: unknown): error is DeployApiError {
|
|
2015
|
+
return (
|
|
2016
|
+
error instanceof DeployApiError &&
|
|
2017
|
+
(error.status === 503 || error.status === 429)
|
|
2018
|
+
);
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
function transientDeployStatusWaitMs(
|
|
2022
|
+
error: DeployApiError,
|
|
2023
|
+
pollIntervalMs: number
|
|
2024
|
+
): number {
|
|
2025
|
+
if (
|
|
2026
|
+
error.status === 429 &&
|
|
2027
|
+
error.retryAfterSeconds !== undefined &&
|
|
2028
|
+
error.retryAfterSeconds > 0
|
|
2029
|
+
) {
|
|
2030
|
+
return Math.max(pollIntervalMs, error.retryAfterSeconds * 1000);
|
|
2031
|
+
}
|
|
2032
|
+
return pollIntervalMs;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
1878
2035
|
/**
|
|
1879
2036
|
* Wait until GET 404s (the delete reconciler purged the record). Treats
|
|
1880
2037
|
* other errors as failures. Throws DeployApiError on timeout.
|
|
@@ -1938,9 +2095,42 @@ function aliasTokenBlock(aliasToken: string): string {
|
|
|
1938
2095
|
);
|
|
1939
2096
|
}
|
|
1940
2097
|
|
|
1941
|
-
|
|
2098
|
+
/**
|
|
2099
|
+
* `: <reason>` suffix for a deploy that ended in a non-running state, or
|
|
2100
|
+
* empty when the control plane recorded no reason.
|
|
2101
|
+
*/
|
|
2102
|
+
function deployFailureDetail(lastError: string | null | undefined): string {
|
|
2103
|
+
if (
|
|
2104
|
+
lastError === null ||
|
|
2105
|
+
lastError === undefined ||
|
|
2106
|
+
lastError.trim() === ""
|
|
2107
|
+
) {
|
|
2108
|
+
return "";
|
|
2109
|
+
}
|
|
2110
|
+
return `: ${sanitizeCustomerError(lastError.trim())}`;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
function renderApiError(
|
|
2114
|
+
error: unknown,
|
|
2115
|
+
err: (text: string) => void,
|
|
2116
|
+
context?: { multiTenant?: boolean; teamId?: number }
|
|
2117
|
+
): number {
|
|
1942
2118
|
if (error instanceof DeployApiError) {
|
|
1943
2119
|
err(`${error.message}\n`);
|
|
2120
|
+
if (
|
|
2121
|
+
error.status === 409 &&
|
|
2122
|
+
error.message.includes("application multiTenant does not match")
|
|
2123
|
+
) {
|
|
2124
|
+
if (context?.multiTenant === true) {
|
|
2125
|
+
err(
|
|
2126
|
+
"This slug is a single-tenant application. Redeploy it without --multi-tenant.\n"
|
|
2127
|
+
);
|
|
2128
|
+
} else if (context?.teamId === MULTI_TENANT_HTTP_DEPLOY_TEAM_ID) {
|
|
2129
|
+
err(
|
|
2130
|
+
"This slug is a Cursor-managed (multi-tenant) product. Redeploy it with --multi-tenant.\n"
|
|
2131
|
+
);
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
1944
2134
|
return 1;
|
|
1945
2135
|
}
|
|
1946
2136
|
throw error;
|
|
@@ -23,10 +23,10 @@ import { CLI_COMMAND_NAME as CLI, LOG_PREFIX } from "./distribution.js";
|
|
|
23
23
|
import {
|
|
24
24
|
createHostMcpOAuthProvider,
|
|
25
25
|
MCP_OAUTH_CALLBACK_URL,
|
|
26
|
-
mcpOauthSecretNames,
|
|
27
26
|
openBrowser,
|
|
28
27
|
waitForMcpOAuthCallback,
|
|
29
28
|
} from "./mcp-oauth.js";
|
|
29
|
+
import { upsertHostMcpOauthSecrets } from "./mcp-oauth-persist.js";
|
|
30
30
|
import { resolveProdSlug } from "./resolve-prod-target.js";
|
|
31
31
|
|
|
32
32
|
export type McpOauthCliOptions = {
|
|
@@ -381,29 +381,15 @@ async function storeOauthSecrets(args: {
|
|
|
381
381
|
return auth;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
const names = mcpOauthSecretNames(args.connection);
|
|
385
|
-
const secrets: Array<{ name: string; value: string }> = [
|
|
386
|
-
{ name: names.accessToken, value: tokens.access_token },
|
|
387
|
-
];
|
|
388
|
-
if (
|
|
389
|
-
tokens.refresh_token !== undefined &&
|
|
390
|
-
tokens.refresh_token.trim() !== ""
|
|
391
|
-
) {
|
|
392
|
-
secrets.push({ name: names.refreshToken, value: tokens.refresh_token });
|
|
393
|
-
}
|
|
394
|
-
if (args.clientId !== undefined && args.clientId.trim() !== "") {
|
|
395
|
-
secrets.push({ name: names.clientId, value: args.clientId });
|
|
396
|
-
}
|
|
397
|
-
|
|
398
384
|
try {
|
|
399
|
-
const secretNames = await
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
385
|
+
const secretNames = await upsertHostMcpOauthSecrets({
|
|
386
|
+
connection: args.connection,
|
|
387
|
+
tokens,
|
|
388
|
+
clientId: args.clientId,
|
|
389
|
+
target: { client: auth.client, teamId: auth.teamId, slug },
|
|
403
390
|
});
|
|
404
391
|
args.out(
|
|
405
|
-
`${LOG_PREFIX} Stored on ${slug}: ${
|
|
406
|
-
`${LOG_PREFIX} Secrets now: ${secretNames.join(", ")}. Next deploy picks them up.\n`
|
|
392
|
+
`${LOG_PREFIX} Stored on ${slug}. Secrets now: ${secretNames.join(", ")}. Next deploy picks them up.\n`
|
|
407
393
|
);
|
|
408
394
|
return 0;
|
|
409
395
|
} catch (error) {
|