@cursor/july 0.1.105 → 0.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/bin/agent-serve.js +31 -16
- package/dist/channels/bitbucket/types.d.ts +2 -4
- package/dist/channels/bitbucket/types.d.ts.map +1 -1
- package/dist/channels/deployments/types.d.ts +5 -8
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +8 -5
- package/dist/channels/github/types.d.ts +7 -5
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/types.d.ts +2 -5
- package/dist/channels/gitlab/types.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +27 -13
- package/dist/channels/origin/types.d.ts +7 -4
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +3 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +1 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +48 -11
- package/dist/channels/slack/types.d.ts +4 -3
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +45 -0
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js +106 -7
- package/dist/connections.d.ts +2 -1
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +2 -1
- package/dist/docs/404.html +3 -3
- package/dist/docs/ab.html +6 -6
- package/dist/docs/assets/{app.BVwaffdK.js → app.BASKM3M4.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.WuWTZ1x8.js → VPLocalSearchBox.BOKxlYGP.js} +2 -2
- package/dist/docs/assets/chunks/{theme.BYdI_6sF.js → theme.DbDZW-zb.js} +2 -2
- package/dist/docs/assets/{deployment.md.MFPKqsqI.js → deployment.md.JenwuCCB.js} +4 -4
- package/dist/docs/assets/{deployment.md.MFPKqsqI.lean.js → deployment.md.JenwuCCB.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CbMoebP1.js → evals.md.C1ekS3k2.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.BsloyHdY.js +9 -0
- package/dist/docs/assets/{guides_cloud-agents.md.DS8RIjwx.lean.js → guides_cloud-agents.md.BsloyHdY.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.c0gdGJ-D.js → guides_github.md.BH33UEBJ.js} +1 -1
- package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.js → guides_grokbot-agents.md.DyV-WArv.js} +1 -1
- package/dist/docs/assets/guides_improve.md.BGVk32bK.js +14 -0
- package/dist/docs/assets/guides_improve.md.BGVk32bK.lean.js +1 -0
- package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.js → guides_opentelemetry.md.SCRMskno.js} +3 -3
- package/dist/docs/assets/{guides_opentelemetry.md.COh9jFVg.lean.js → guides_opentelemetry.md.SCRMskno.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.9oHPye9o.js → guides_slack.md.D4RVMM4G.js} +3 -3
- package/dist/docs/assets/{guides_slack.md.9oHPye9o.lean.js → guides_slack.md.D4RVMM4G.lean.js} +1 -1
- package/dist/docs/assets/index.md.BjH1w2ZW.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.js → reference_agent-config.md.CvoL6pof.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.DBGcaB7m.js → reference_channels.md.D-qTqwcq.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.DBGcaB7m.lean.js → reference_channels.md.D-qTqwcq.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.js → reference_cli.md.Ca26u0Es.js} +6 -6
- package/dist/docs/assets/{reference_cli.md.C6Lo8SEd.lean.js → reference_cli.md.Ca26u0Es.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Di6jJAXF.js → reference_connections.md.BojkC6c5.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.CGmMLblt.js → reference_extensions.md.CPWt00ds.js} +1 -1
- package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.js → scaffolding-agents.md.Kctn3OVb.js} +1 -1
- package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.js → skills_create-agent.md.Q3h6Je-e.js} +1 -1
- package/dist/docs/assets/{skills_debug.md.CDbPhHfg.js → skills_debug.md.CVjCXMFF.js} +1 -1
- package/dist/docs/assets/{skills_debug.md.CDbPhHfg.lean.js → skills_debug.md.CVjCXMFF.lean.js} +1 -1
- package/dist/docs/assets/{skills_evals.md.723kpUmA.js → skills_evals.md.BhovOvrl.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.D-tFZhFS.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.haibFyoB.lean.js → skills_framework-map.md.D-tFZhFS.lean.js} +1 -1
- package/dist/docs/assets/{skills_github.md.D0JahM8c.js → skills_github.md.hgFX_oKY.js} +1 -1
- package/dist/docs/assets/{skills_otel.md.CqhobH3B.js → skills_otel.md.B5Ddv1xH.js} +1 -1
- package/dist/docs/assets/{style.BRuM8477.css → style.DCD_zyg3.css} +1 -1
- package/dist/docs/assets/troubleshooting.md.CYEAO9bM.js +1 -0
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/deployment.html +9 -9
- package/dist/docs/deployment.md +7 -2
- package/dist/docs/evals.html +8 -8
- package/dist/docs/evals.md +3 -2
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/cloud-agents.html +7 -7
- package/dist/docs/guides/cloud-agents.md +4 -3
- package/dist/docs/guides/convert-automation.html +6 -6
- package/dist/docs/guides/github.html +7 -7
- package/dist/docs/guides/github.md +2 -1
- package/dist/docs/guides/grokbot-agents.html +7 -7
- package/dist/docs/guides/grokbot-agents.md +2 -2
- package/dist/docs/guides/human-in-the-loop.html +6 -6
- package/dist/docs/guides/improve.html +40 -0
- package/dist/docs/guides/improve.md +91 -0
- package/dist/docs/guides/mcp-oauth.html +6 -6
- package/dist/docs/guides/opentelemetry.html +8 -8
- package/dist/docs/guides/opentelemetry.md +3 -4
- package/dist/docs/guides/slack.html +8 -8
- package/dist/docs/guides/slack.md +2 -1
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/index.html +8 -8
- package/dist/docs/index.md +4 -0
- package/dist/docs/llms-full.txt +180 -61
- package/dist/docs/llms.txt +1 -0
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/reference/agent-config.html +7 -7
- package/dist/docs/reference/agent-config.md +5 -2
- package/dist/docs/reference/artifacts.html +6 -6
- package/dist/docs/reference/channels.html +7 -7
- package/dist/docs/reference/channels.md +11 -19
- package/dist/docs/reference/cli.html +11 -11
- package/dist/docs/reference/cli.md +23 -13
- package/dist/docs/reference/connections.html +8 -8
- package/dist/docs/reference/connections.md +2 -1
- package/dist/docs/reference/extensions.html +7 -7
- package/dist/docs/reference/extensions.md +2 -0
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/instructions.html +6 -6
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/prompt.html +6 -6
- package/dist/docs/reference/result.html +6 -6
- package/dist/docs/reference/schedules.html +6 -6
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/scaffolding-agents.html +6 -6
- package/dist/docs/scaffolding-agents.md +2 -1
- package/dist/docs/skills/ab.html +6 -6
- package/dist/docs/skills/create-agent.html +8 -8
- package/dist/docs/skills/create-agent.md +1 -1
- package/dist/docs/skills/debug.html +6 -6
- package/dist/docs/skills/debug.md +1 -1
- package/dist/docs/skills/evals.html +8 -8
- package/dist/docs/skills/evals.md +1 -1
- package/dist/docs/skills/framework-map.html +6 -6
- package/dist/docs/skills/framework-map.md +4 -2
- package/dist/docs/skills/github.html +8 -8
- package/dist/docs/skills/github.md +1 -1
- package/dist/docs/skills/hillclimb.html +6 -6
- package/dist/docs/skills/index.html +5 -5
- package/dist/docs/skills/mcp-auth.html +6 -6
- package/dist/docs/skills/otel.html +8 -8
- package/dist/docs/skills/otel.md +3 -3
- package/dist/docs/skills/setup-slack.html +6 -6
- package/dist/docs/storage.html +6 -6
- package/dist/docs/templates/agentic-owners.html +6 -6
- package/dist/docs/templates/agents-md.html +6 -6
- package/dist/docs/templates/code-wiki.html +6 -6
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/grokbot-agents.html +6 -6
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/security-help.html +6 -6
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/triage.html +6 -6
- package/dist/docs/troubleshooting.html +6 -6
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/extensions/improve/extension.d.ts +46 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +41 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -1
- package/dist/internal/builtin-tools/artifacts.js +2 -3
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +62 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +78 -0
- package/dist/internal/cli-ax.d.ts +7 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +99 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +61 -25
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +15 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +12 -0
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +8 -2
- package/dist/internal/cursor/backend-client.d.ts +25 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +57 -2
- package/dist/internal/cursor/credentials.d.ts +8 -2
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +27 -5
- package/dist/internal/deploy-client.d.ts +35 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +46 -0
- package/dist/internal/deploy-manifest.d.ts +26 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +99 -13
- package/dist/internal/describe-error.d.ts +1 -0
- package/dist/internal/describe-error.d.ts.map +1 -1
- package/dist/internal/describe-error.js +25 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +1 -0
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +7 -3
- package/dist/internal/discovery/modules.d.ts +1 -1
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +1 -0
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +3 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +65 -0
- package/dist/internal/discovery/subagent.js +1 -0
- package/dist/internal/distribution.d.ts +5 -0
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +17 -0
- package/dist/internal/framework-storage-selection.d.ts +14 -3
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +36 -6
- package/dist/internal/guest-network.d.ts +4 -10
- package/dist/internal/guest-network.d.ts.map +1 -1
- package/dist/internal/guest-network.js +44 -26
- package/dist/internal/hosted-admission-adapter.d.ts +2 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-catch-protocol.d.ts +51 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +103 -0
- package/dist/internal/hosted-catch.d.ts +40 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +149 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +89 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +309 -0
- package/dist/internal/hosted-delivery.d.ts +20 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +179 -36
- package/dist/internal/hosted-execution-diag.d.ts +4 -1
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +13 -4
- package/dist/internal/hosted-execution-flush.d.ts +3 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
- package/dist/internal/hosted-execution-flush.js +2 -4
- package/dist/internal/http-control-plane-session.d.ts +30 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +83 -0
- package/dist/internal/legacy-command-guard.d.ts +22 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +51 -0
- package/dist/internal/local-control-plane.d.ts +18 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +199 -17
- package/dist/internal/platform-timers.d.ts +7 -0
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +139 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +251 -0
- package/dist/internal/reminder-runner.d.ts +56 -6
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +372 -57
- package/dist/internal/reminder-schedule.d.ts +5 -2
- package/dist/internal/reminder-schedule.d.ts.map +1 -1
- package/dist/internal/reminder-schedule.js +8 -6
- package/dist/internal/reminder-store.d.ts +24 -7
- package/dist/internal/reminder-store.d.ts.map +1 -1
- package/dist/internal/reminder-store.js +6 -5
- package/dist/internal/request-error-status.d.ts +2 -0
- package/dist/internal/request-error-status.d.ts.map +1 -1
- package/dist/internal/request-error-status.js +22 -3
- package/dist/internal/resolve-prod-target.d.ts +2 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +13 -0
- package/dist/internal/scm/pr-url.d.ts +40 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -1
- package/dist/internal/scm/pr-url.js +93 -14
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +4 -3
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +118 -77
- package/dist/internal/session-engine.d.ts +6 -6
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +100 -67
- package/dist/playground/assets/{index-BaQzjaNK.js → index-BMDqAeXu.js} +34 -34
- package/dist/playground/assets/index-LUgJoWdL.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/reminders.d.ts +24 -5
- package/dist/reminders.d.ts.map +1 -1
- package/dist/reminders.js +28 -5
- 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 +29 -1
- package/dist/types.d.ts +122 -25
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +4 -0
- package/docs/deployment.md +7 -2
- package/docs/evals.md +3 -2
- package/docs/guides/cloud-agents.md +4 -3
- package/docs/guides/github.md +2 -1
- package/docs/guides/grokbot-agents.md +2 -2
- package/docs/guides/improve.md +96 -0
- package/docs/guides/opentelemetry.md +3 -4
- package/docs/guides/slack.md +2 -1
- package/docs/reference/agent-config.md +5 -2
- package/docs/reference/channels.md +11 -19
- package/docs/reference/cli.md +23 -13
- package/docs/reference/connections.md +2 -1
- package/docs/reference/extensions.md +2 -0
- package/docs/scaffolding-agents.md +2 -1
- package/docs/troubleshooting.md +1 -1
- package/package.json +10 -3
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +4 -2
- package/skills/github/SKILL.md +1 -1
- package/skills/otel/SKILL.md +3 -3
- package/src/bin/agent-serve.ts +28 -11
- package/src/channels/bitbucket/types.ts +2 -4
- package/src/channels/deployments/types.ts +5 -8
- package/src/channels/github/github-channel.ts +8 -8
- package/src/channels/github/types.ts +7 -4
- package/src/channels/gitlab/types.ts +2 -5
- package/src/channels/origin/origin-channel.ts +29 -13
- package/src/channels/origin/types.ts +7 -3
- package/src/channels/slack/defaults.ts +3 -0
- package/src/channels/slack/dispatch.ts +1 -0
- package/src/channels/slack/live-delivery.ts +53 -12
- package/src/channels/slack/types.ts +4 -3
- package/src/channels.ts +157 -10
- package/src/connections.ts +2 -1
- package/src/extensions/improve/extension.ts +70 -0
- package/src/extensions/improve/skills/yourself.ts +50 -0
- package/src/index.ts +6 -3
- package/src/internal/builtin-tools/artifacts.ts +2 -3
- package/src/internal/channel-route-dispatch.ts +66 -0
- package/src/internal/channel-state.ts +96 -0
- package/src/internal/cli-ax.ts +110 -1
- package/src/internal/cli-cursor.ts +4 -1
- package/src/internal/cli-deploy.ts +80 -22
- package/src/internal/cli-mcp-oauth.ts +18 -0
- package/src/internal/cli-mcp.ts +11 -0
- package/src/internal/cli-slack.ts +15 -2
- package/src/internal/cursor/backend-client.ts +90 -2
- package/src/internal/cursor/credentials.ts +35 -7
- package/src/internal/deploy-client.ts +70 -0
- package/src/internal/deploy-manifest.ts +131 -12
- package/src/internal/describe-error.ts +28 -0
- package/src/internal/discovery/agent.ts +1 -0
- package/src/internal/discovery/info.ts +6 -0
- package/src/internal/discovery/modules.ts +2 -4
- package/src/internal/discovery/project.ts +3 -0
- package/src/internal/discovery/reminders.ts +65 -0
- package/src/internal/discovery/subagent.ts +1 -0
- package/src/internal/distribution.ts +20 -0
- package/src/internal/framework-storage-selection.ts +43 -6
- package/src/internal/guest-network.ts +46 -29
- package/src/internal/hosted-admission-adapter.ts +2 -0
- package/src/internal/hosted-catch-protocol.ts +130 -0
- package/src/internal/hosted-catch.ts +192 -0
- package/src/internal/hosted-delivery-protocol.ts +483 -0
- package/src/internal/hosted-delivery.ts +303 -43
- package/src/internal/hosted-execution-diag.ts +21 -3
- package/src/internal/hosted-execution-flush.ts +6 -3
- package/src/internal/http-control-plane-session.ts +104 -0
- package/src/internal/legacy-command-guard.ts +59 -0
- package/src/internal/local-control-plane.ts +281 -22
- package/src/internal/platform-timers.ts +191 -0
- package/src/internal/reminder-control-plane-protocol.ts +512 -0
- package/src/internal/reminder-runner.ts +481 -57
- package/src/internal/reminder-schedule.ts +11 -6
- package/src/internal/reminder-store.ts +27 -7
- package/src/internal/request-error-status.ts +27 -3
- package/src/internal/resolve-prod-target.ts +15 -0
- package/src/internal/scm/pr-url.ts +167 -20
- package/src/internal/sdk-runner.ts +2 -1
- package/src/internal/server.ts +151 -88
- package/src/internal/session-engine.ts +146 -83
- package/src/reminders.ts +35 -4
- package/src/storage-backends/cursor-hosted.ts +40 -1
- package/src/types.ts +134 -26
- package/dist/docs/assets/chunks/@localSearchIndexroot.CJxMklAy.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +0 -9
- package/dist/docs/assets/index.md.BW_6tOgR.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Cus_YZga.js +0 -1
- package/dist/playground/assets/index-CceqnLTX.css +0 -1
- /package/dist/docs/assets/{evals.md.CbMoebP1.lean.js → evals.md.C1ekS3k2.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.c0gdGJ-D.lean.js → guides_github.md.BH33UEBJ.lean.js} +0 -0
- /package/dist/docs/assets/{guides_grokbot-agents.md.DVqdhBKb.lean.js → guides_grokbot-agents.md.DyV-WArv.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.BW_6tOgR.lean.js → index.md.BjH1w2ZW.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.CHNpiyp4.lean.js → reference_agent-config.md.CvoL6pof.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.Di6jJAXF.lean.js → reference_connections.md.BojkC6c5.lean.js} +0 -0
- /package/dist/docs/assets/{reference_extensions.md.CGmMLblt.lean.js → reference_extensions.md.CPWt00ds.lean.js} +0 -0
- /package/dist/docs/assets/{scaffolding-agents.md.em43xlY1.lean.js → scaffolding-agents.md.Kctn3OVb.lean.js} +0 -0
- /package/dist/docs/assets/{skills_create-agent.md.BVoWPcan.lean.js → skills_create-agent.md.Q3h6Je-e.lean.js} +0 -0
- /package/dist/docs/assets/{skills_evals.md.723kpUmA.lean.js → skills_evals.md.BhovOvrl.lean.js} +0 -0
- /package/dist/docs/assets/{skills_github.md.D0JahM8c.lean.js → skills_github.md.hgFX_oKY.lean.js} +0 -0
- /package/dist/docs/assets/{skills_otel.md.CqhobH3B.lean.js → skills_otel.md.B5Ddv1xH.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Cus_YZga.lean.js → troubleshooting.md.CYEAO9bM.lean.js} +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import type { JsonValue } from "../types.js";
|
|
3
|
+
|
|
4
|
+
type JsonRecord = Record<string, JsonValue>;
|
|
5
|
+
|
|
6
|
+
function asRecord(value: JsonValue | undefined): JsonRecord | undefined {
|
|
7
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return value as JsonRecord;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Shallow-merge a wake patch into durable channel state. Null / undefined
|
|
15
|
+
* patch values leave the existing key alone so sticky fields survive.
|
|
16
|
+
*/
|
|
17
|
+
export function mergeChannelStateSkipNull(
|
|
18
|
+
current: JsonValue | undefined,
|
|
19
|
+
patch: JsonValue | undefined
|
|
20
|
+
): JsonValue | undefined {
|
|
21
|
+
if (patch === undefined) {
|
|
22
|
+
return current;
|
|
23
|
+
}
|
|
24
|
+
const currentRecord = asRecord(current);
|
|
25
|
+
const patchRecord = asRecord(patch);
|
|
26
|
+
if (currentRecord === undefined || patchRecord === undefined) {
|
|
27
|
+
return structuredClone(patch);
|
|
28
|
+
}
|
|
29
|
+
const merged = { ...currentRecord };
|
|
30
|
+
for (const [key, value] of Object.entries(patchRecord)) {
|
|
31
|
+
if (value !== null && value !== undefined) {
|
|
32
|
+
merged[key] = value;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return merged;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Apply handler mutations made against a turn snapshot without reverting
|
|
40
|
+
* unchanged fields refreshed by a later delivery. At a changed path, objects
|
|
41
|
+
* merge recursively, arrays and scalars replace, and deletions win.
|
|
42
|
+
*/
|
|
43
|
+
export function mergeChannelStateMutation(args: {
|
|
44
|
+
current: JsonValue | undefined;
|
|
45
|
+
before: JsonValue;
|
|
46
|
+
after: JsonValue;
|
|
47
|
+
}): JsonValue | undefined {
|
|
48
|
+
const { current, before, after } = args;
|
|
49
|
+
if (isDeepStrictEqual(before, after)) {
|
|
50
|
+
return current;
|
|
51
|
+
}
|
|
52
|
+
const currentRecord = asRecord(current);
|
|
53
|
+
const beforeRecord = asRecord(before);
|
|
54
|
+
const afterRecord = asRecord(after);
|
|
55
|
+
if (
|
|
56
|
+
currentRecord === undefined ||
|
|
57
|
+
beforeRecord === undefined ||
|
|
58
|
+
afterRecord === undefined
|
|
59
|
+
) {
|
|
60
|
+
return structuredClone(after);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const merged = structuredClone(currentRecord);
|
|
64
|
+
const keys = new Set([
|
|
65
|
+
...Object.keys(beforeRecord),
|
|
66
|
+
...Object.keys(afterRecord),
|
|
67
|
+
]);
|
|
68
|
+
for (const key of keys) {
|
|
69
|
+
const hadBefore = Object.hasOwn(beforeRecord, key);
|
|
70
|
+
const hasAfter = Object.hasOwn(afterRecord, key);
|
|
71
|
+
if (
|
|
72
|
+
hadBefore &&
|
|
73
|
+
hasAfter &&
|
|
74
|
+
isDeepStrictEqual(beforeRecord[key], afterRecord[key])
|
|
75
|
+
) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (!hasAfter) {
|
|
79
|
+
delete merged[key];
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const currentValue = merged[key];
|
|
83
|
+
const afterValue = afterRecord[key]!;
|
|
84
|
+
merged[key] =
|
|
85
|
+
hadBefore ||
|
|
86
|
+
(asRecord(currentValue) !== undefined &&
|
|
87
|
+
asRecord(afterValue) !== undefined)
|
|
88
|
+
? (mergeChannelStateMutation({
|
|
89
|
+
current: currentValue,
|
|
90
|
+
before: hadBefore ? beforeRecord[key]! : {},
|
|
91
|
+
after: afterValue,
|
|
92
|
+
}) as JsonValue)
|
|
93
|
+
: structuredClone(afterValue);
|
|
94
|
+
}
|
|
95
|
+
return merged;
|
|
96
|
+
}
|
package/src/internal/cli-ax.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { lookupSessionContinuation, runChat } from "./chat-client.js";
|
|
|
23
23
|
import { ensureCursorLogin } from "./cli-cursor.js";
|
|
24
24
|
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
25
25
|
import { resolveApiKey } from "./cursor/credentials.js";
|
|
26
|
+
import { DeployApiError } from "./deploy-client.js";
|
|
26
27
|
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "./distribution.js";
|
|
27
28
|
import {
|
|
28
29
|
discoverEvals,
|
|
@@ -53,6 +54,7 @@ import {
|
|
|
53
54
|
resolveTemplate,
|
|
54
55
|
} from "./init-project.js";
|
|
55
56
|
import { offerInstallCursorSkills } from "./install-cursor-skills.js";
|
|
57
|
+
import { rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
|
|
56
58
|
import { runLogsTail, sanitizeCustomerError } from "./logs-client.js";
|
|
57
59
|
import { mapPool } from "./map-pool.js";
|
|
58
60
|
import { openBrowser } from "./open-browser.js";
|
|
@@ -189,6 +191,13 @@ export interface AxCliOptions {
|
|
|
189
191
|
resume?: boolean;
|
|
190
192
|
/** Abort signal (tests / programmatic stop of `playground` proxy). */
|
|
191
193
|
signal?: AbortSignal;
|
|
194
|
+
/**
|
|
195
|
+
* `run --prod` / `session --prod --message`: hosted v2 session start on
|
|
196
|
+
* the agentsdk control plane. `--dry-run` marks the turn non-mutating;
|
|
197
|
+
* `--as-of` freezes the session clock at a timezone-bearing instant.
|
|
198
|
+
*/
|
|
199
|
+
dryRun?: boolean;
|
|
200
|
+
asOf?: string;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
export interface ResolvedAgentTarget {
|
|
@@ -594,6 +603,15 @@ export async function cmdChat(options: AxCliOptions): Promise<number> {
|
|
|
594
603
|
}
|
|
595
604
|
|
|
596
605
|
export async function cmdRun(options: AxCliOptions): Promise<number> {
|
|
606
|
+
// Only a v2-shaped request tries the control plane; every v1 `run --prod`
|
|
607
|
+
// form (multi-turn, continuation token, local session id, --url) keeps its
|
|
608
|
+
// engine-alias path untouched.
|
|
609
|
+
if (options.prod === true && hostedSessionRejection(options) === undefined) {
|
|
610
|
+
const started = await cmdHostedSession(options);
|
|
611
|
+
if (started !== "fallback") {
|
|
612
|
+
return started;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
597
615
|
const messages = options.messages ?? [];
|
|
598
616
|
if (messages.length === 0) {
|
|
599
617
|
die("Provide --message (repeatable) or --messages-file");
|
|
@@ -703,6 +721,74 @@ export async function cmdRun(options: AxCliOptions): Promise<number> {
|
|
|
703
721
|
}
|
|
704
722
|
}
|
|
705
723
|
|
|
724
|
+
const HOSTED_SESSION_ID_RE = /^ses_[a-f0-9]{24}$/;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Hosted v2 session start: POST the agentsdk control plane, which hands the
|
|
728
|
+
* wake to Temporal (no resident engine, no `/engine/*` alias). `--session
|
|
729
|
+
* ses_…` resumes that exact session; there is no continuation token on
|
|
730
|
+
* this path. A 404 means the slug is not a v2 control-plane deployment, so
|
|
731
|
+
* `run --prod` falls back to the v1 engine alias.
|
|
732
|
+
*/
|
|
733
|
+
/** Why these options cannot be a hosted v2 session start, if they cannot. */
|
|
734
|
+
function hostedSessionRejection(options: AxCliOptions): string | undefined {
|
|
735
|
+
if (options.url !== undefined) {
|
|
736
|
+
return "--prod session start talks to the agentsdk control plane; do not pass --url";
|
|
737
|
+
}
|
|
738
|
+
const messages = options.messages ?? [];
|
|
739
|
+
if (messages.length !== 1 || messages[0]?.trim() === "") {
|
|
740
|
+
return "Provide exactly one --message (the wake). Multi-turn runs are local-only.";
|
|
741
|
+
}
|
|
742
|
+
if (trimNonEmpty(options.continuationToken) !== undefined) {
|
|
743
|
+
return "--continuation-token is not a hosted v2 identity; pass --session ses_… to resume a session";
|
|
744
|
+
}
|
|
745
|
+
const sessionId = trimNonEmpty(options.sessionId);
|
|
746
|
+
if (sessionId !== undefined && !HOSTED_SESSION_ID_RE.test(sessionId)) {
|
|
747
|
+
return `--session must be a hosted session id (ses_…), got ${sessionId}`;
|
|
748
|
+
}
|
|
749
|
+
return undefined;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
async function cmdHostedSession(
|
|
753
|
+
options: AxCliOptions
|
|
754
|
+
): Promise<number | "fallback"> {
|
|
755
|
+
const rejection = hostedSessionRejection(options);
|
|
756
|
+
if (rejection !== undefined) {
|
|
757
|
+
die(rejection);
|
|
758
|
+
}
|
|
759
|
+
const messages = options.messages ?? [];
|
|
760
|
+
const sessionId = trimNonEmpty(options.sessionId);
|
|
761
|
+
const auth = await resolveDeployAuth({
|
|
762
|
+
team: options.team,
|
|
763
|
+
apiKey: options.apiKey,
|
|
764
|
+
fetchImpl: options.fetchImpl,
|
|
765
|
+
});
|
|
766
|
+
if (typeof auth === "number") {
|
|
767
|
+
return auth;
|
|
768
|
+
}
|
|
769
|
+
const slug = resolveProdSlug(options);
|
|
770
|
+
try {
|
|
771
|
+
const accepted = await auth.client.startSession({
|
|
772
|
+
teamId: auth.teamId,
|
|
773
|
+
slug,
|
|
774
|
+
message: messages[0]!.trim(),
|
|
775
|
+
sessionId,
|
|
776
|
+
dryRun: options.dryRun,
|
|
777
|
+
asOf: options.asOf,
|
|
778
|
+
});
|
|
779
|
+
console.log(JSON.stringify(accepted, null, 2));
|
|
780
|
+
return 0;
|
|
781
|
+
} catch (error) {
|
|
782
|
+
if (error instanceof DeployApiError && error.status === 404) {
|
|
783
|
+
return "fallback";
|
|
784
|
+
}
|
|
785
|
+
process.stderr.write(
|
|
786
|
+
`${error instanceof Error ? error.message : String(error)}\n`
|
|
787
|
+
);
|
|
788
|
+
return 1;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
|
|
706
792
|
/**
|
|
707
793
|
* `agent-sdk call <tool>` — deterministic tool invocation over
|
|
708
794
|
* `POST /v1/tools/:toolName` (ephemeral local server unless --url).
|
|
@@ -1727,6 +1813,11 @@ export async function cmdLogs(options: AxCliOptions): Promise<number> {
|
|
|
1727
1813
|
if (typeof auth === "number") {
|
|
1728
1814
|
return auth;
|
|
1729
1815
|
}
|
|
1816
|
+
await rejectV2ForLegacyCommand({
|
|
1817
|
+
client: auth.client,
|
|
1818
|
+
teamId: auth.teamId,
|
|
1819
|
+
slug,
|
|
1820
|
+
});
|
|
1730
1821
|
await runLogsTail({
|
|
1731
1822
|
prod: true,
|
|
1732
1823
|
dir: options.dir,
|
|
@@ -1750,6 +1841,7 @@ export async function cmdLogs(options: AxCliOptions): Promise<number> {
|
|
|
1750
1841
|
apiKey: options.apiKey,
|
|
1751
1842
|
fetchImpl: options.fetchImpl,
|
|
1752
1843
|
err: () => {},
|
|
1844
|
+
skipLegacyArchitectureCheck: true,
|
|
1753
1845
|
});
|
|
1754
1846
|
return { agentUrl: target.agentUrl, headers: target.headers };
|
|
1755
1847
|
},
|
|
@@ -1864,9 +1956,26 @@ export async function cmdSession(
|
|
|
1864
1956
|
sessionId: string | undefined,
|
|
1865
1957
|
options: AxCliOptions
|
|
1866
1958
|
): Promise<number> {
|
|
1959
|
+
if (options.prod === true && (options.messages?.length ?? 0) > 0) {
|
|
1960
|
+
// `session --prod [ses_…] --message` is the same hosted start as
|
|
1961
|
+
// `run --prod`, with the positional id as the session to resume. Unlike
|
|
1962
|
+
// `run`, a 404 is an error here: this form is explicitly v2.
|
|
1963
|
+
const started = await cmdHostedSession({
|
|
1964
|
+
...options,
|
|
1965
|
+
sessionId: trimNonEmpty(sessionId) ?? options.sessionId,
|
|
1966
|
+
});
|
|
1967
|
+
if (started === "fallback") {
|
|
1968
|
+
process.stderr.write(
|
|
1969
|
+
`Hosted session start returned 404 for slug ${resolveProdSlug(options)}: deploy a running AgentSDK v2 agent, or use \`${CLI_COMMAND_NAME} run --prod\` (falls back to the v1 engine).\n`
|
|
1970
|
+
);
|
|
1971
|
+
return 1;
|
|
1972
|
+
}
|
|
1973
|
+
return started;
|
|
1974
|
+
}
|
|
1867
1975
|
if (sessionId === undefined || sessionId.trim() === "") {
|
|
1868
1976
|
process.stderr.write(
|
|
1869
|
-
`Usage: ${CLI_COMMAND_NAME} session <sessionId> [--url | --prod] [--json | --text | --events] [--out <file.ndjson>]\n`
|
|
1977
|
+
`Usage: ${CLI_COMMAND_NAME} session <sessionId> [--url | --prod] [--json | --text | --events] [--out <file.ndjson>]\n` +
|
|
1978
|
+
` or: ${CLI_COMMAND_NAME} session --prod [<sessionId>] --slug <slug> --message "…" [--dry-run] [--as-of <instant>]\n`
|
|
1870
1979
|
);
|
|
1871
1980
|
return 2;
|
|
1872
1981
|
}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
revokeMintedUserApiKey,
|
|
18
18
|
} from "./cursor/backend-client.js";
|
|
19
19
|
import {
|
|
20
|
+
type ApiKeySource,
|
|
20
21
|
clearStoredCredentials,
|
|
21
22
|
credentialsFilePath,
|
|
22
23
|
cursorBackendUrl,
|
|
@@ -255,7 +256,7 @@ function formatIdentity(identity: CursorIdentity): string {
|
|
|
255
256
|
return name === "" ? `${email}${team}` : `${name} <${email}>${team}`;
|
|
256
257
|
}
|
|
257
258
|
|
|
258
|
-
function describeSource(source:
|
|
259
|
+
function describeSource(source: ApiKeySource): string {
|
|
259
260
|
switch (source) {
|
|
260
261
|
case "option":
|
|
261
262
|
return "explicit --api-key / serve({ apiKey })";
|
|
@@ -263,6 +264,8 @@ function describeSource(source: "option" | "env" | "file" | "login"): string {
|
|
|
263
264
|
return "CURSOR_API_KEY environment variable";
|
|
264
265
|
case "file":
|
|
265
266
|
return "CURSOR_API_KEY_FILE (task bind)";
|
|
267
|
+
case "service-account":
|
|
268
|
+
return "CURSOR_SERVICE_ACCOUNT_KEY environment variable";
|
|
266
269
|
case "login":
|
|
267
270
|
return `stored login (${credentialsFilePath()})`;
|
|
268
271
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { basename, resolve } from "node:path";
|
|
14
|
-
import { isPublicEndpointPolicy } from "../channels.js";
|
|
14
|
+
import { catchAuthDeclaration, isPublicEndpointPolicy } from "../channels.js";
|
|
15
15
|
import {
|
|
16
16
|
type AgentArchitecture,
|
|
17
17
|
type AgentHostingOptions,
|
|
@@ -62,6 +62,10 @@ import {
|
|
|
62
62
|
isValidCursorEventRepo,
|
|
63
63
|
validateSettableSecretName,
|
|
64
64
|
} from "./hosting.js";
|
|
65
|
+
import {
|
|
66
|
+
deploymentArchitecture,
|
|
67
|
+
rejectV2ForLegacyCommand,
|
|
68
|
+
} from "./legacy-command-guard.js";
|
|
65
69
|
import { deployProgressLabel, sanitizeCustomerError } from "./logs-client.js";
|
|
66
70
|
import { sleep } from "./sleep.js";
|
|
67
71
|
import { stderrPalette } from "./terminal-style.js";
|
|
@@ -739,6 +743,17 @@ async function deployOne(
|
|
|
739
743
|
` public: ${publicRoutePaths.join(", ")} (served WITHOUT the alias token — these channels authenticate requests themselves)\n`
|
|
740
744
|
);
|
|
741
745
|
}
|
|
746
|
+
const deadSecretChannels =
|
|
747
|
+
manifest?.publicChannelIdsWithDeadSecretPolicies ?? [];
|
|
748
|
+
if (!ctx.json && deadSecretChannels.length > 0) {
|
|
749
|
+
ctx.err(
|
|
750
|
+
`warning: ${deadSecretChannels
|
|
751
|
+
.map((channelId) => `/v1/channels/${channelId}`)
|
|
752
|
+
.join(
|
|
753
|
+
", "
|
|
754
|
+
)}: publicEndpoint() sits beside sharedSecretAuth()/hmacSignatureAuth() — auth chains are any-of, so every request is admitted and those secret policies never run. Drop publicEndpoint() to enforce them, or drop them to make the intent explicit.\n`
|
|
755
|
+
);
|
|
756
|
+
}
|
|
742
757
|
|
|
743
758
|
if (manifest?.architecture === "v2") {
|
|
744
759
|
if (!ctx.json) {
|
|
@@ -1192,6 +1207,13 @@ interface DeployManifest {
|
|
|
1192
1207
|
* `X-Agent-Alias-Token` (the channel authenticates deliveries itself).
|
|
1193
1208
|
*/
|
|
1194
1209
|
publicChannelIds: string[];
|
|
1210
|
+
/**
|
|
1211
|
+
* Public channels whose auth chain also carries `sharedSecretAuth` /
|
|
1212
|
+
* `hmacSignatureAuth`. Chains are any-of, so `publicEndpoint()` admits
|
|
1213
|
+
* every request and those secret policies never gate anything — locally
|
|
1214
|
+
* or on the control plane; surfaced as a warning.
|
|
1215
|
+
*/
|
|
1216
|
+
publicChannelIdsWithDeadSecretPolicies: string[];
|
|
1195
1217
|
/**
|
|
1196
1218
|
* `publicEndpoint()` on the built-in HTTP channel — a no-op on hosting
|
|
1197
1219
|
* (only `/v1/channels/…` subtrees can be public); surfaced as a warning.
|
|
@@ -1240,6 +1262,18 @@ async function readDeployManifest(dir: string): Promise<DeployManifest> {
|
|
|
1240
1262
|
(channel.definition.auth ?? []).some(isPublicEndpointPolicy)
|
|
1241
1263
|
)
|
|
1242
1264
|
.map((channel) => channel.id),
|
|
1265
|
+
publicChannelIdsWithDeadSecretPolicies: project.channels
|
|
1266
|
+
.filter((channel) => {
|
|
1267
|
+
const auth = channel.definition.auth ?? [];
|
|
1268
|
+
return (
|
|
1269
|
+
auth.some(isPublicEndpointPolicy) &&
|
|
1270
|
+
auth.some((policy) => {
|
|
1271
|
+
const kind = catchAuthDeclaration(policy)?.kind;
|
|
1272
|
+
return kind !== undefined && kind !== "public";
|
|
1273
|
+
})
|
|
1274
|
+
);
|
|
1275
|
+
})
|
|
1276
|
+
.map((channel) => channel.id),
|
|
1243
1277
|
httpChannelPublicEndpoint: (project.httpChannel.auth ?? []).some(
|
|
1244
1278
|
isPublicEndpointPolicy
|
|
1245
1279
|
),
|
|
@@ -1570,14 +1604,26 @@ export async function cmdDelete(
|
|
|
1570
1604
|
if (typeof ctx === "number") {
|
|
1571
1605
|
return ctx;
|
|
1572
1606
|
}
|
|
1573
|
-
|
|
1607
|
+
// Same dispatch as `stop`: v1 409s architecture-v2 slugs, so the v2
|
|
1608
|
+
// DELETE goes first. A v2 404 (missing slug, or an older backend)
|
|
1609
|
+
// falls through to the v1 agent-serve delete.
|
|
1610
|
+
let architecture: "v1" | "v2" = "v2";
|
|
1611
|
+
let accepted: DeleteAccepted | AgentkitStopAccepted;
|
|
1574
1612
|
try {
|
|
1575
|
-
accepted = await ctx.client.
|
|
1576
|
-
teamId: ctx.teamId,
|
|
1577
|
-
slug,
|
|
1578
|
-
});
|
|
1613
|
+
accepted = await ctx.client.deleteAgentkit({ teamId: ctx.teamId, slug });
|
|
1579
1614
|
} catch (error) {
|
|
1580
|
-
|
|
1615
|
+
if (!(error instanceof DeployApiError) || error.status !== 404) {
|
|
1616
|
+
return renderApiError(error, ctx.err);
|
|
1617
|
+
}
|
|
1618
|
+
try {
|
|
1619
|
+
accepted = await ctx.client.deleteDeployment({
|
|
1620
|
+
teamId: ctx.teamId,
|
|
1621
|
+
slug,
|
|
1622
|
+
});
|
|
1623
|
+
architecture = "v1";
|
|
1624
|
+
} catch (v1Error) {
|
|
1625
|
+
return renderApiError(v1Error, ctx.err);
|
|
1626
|
+
}
|
|
1581
1627
|
}
|
|
1582
1628
|
if (ctx.noWait) {
|
|
1583
1629
|
if (ctx.json) {
|
|
@@ -1588,7 +1634,11 @@ export async function cmdDelete(
|
|
|
1588
1634
|
return 0;
|
|
1589
1635
|
}
|
|
1590
1636
|
try {
|
|
1591
|
-
await pollUntilGone(ctx, slug)
|
|
1637
|
+
await pollUntilGone(ctx, slug, () =>
|
|
1638
|
+
architecture === "v2"
|
|
1639
|
+
? ctx.client.getAgentkitDeploy({ teamId: ctx.teamId, slug })
|
|
1640
|
+
: ctx.client.getDeployment({ teamId: ctx.teamId, slug })
|
|
1641
|
+
);
|
|
1592
1642
|
} catch (error) {
|
|
1593
1643
|
return renderApiError(error, ctx.err);
|
|
1594
1644
|
}
|
|
@@ -1620,6 +1670,11 @@ export async function cmdRotateToken(
|
|
|
1620
1670
|
}
|
|
1621
1671
|
let aliasToken: string;
|
|
1622
1672
|
try {
|
|
1673
|
+
await rejectV2ForLegacyCommand({
|
|
1674
|
+
client: ctx.client,
|
|
1675
|
+
teamId: ctx.teamId,
|
|
1676
|
+
slug,
|
|
1677
|
+
});
|
|
1623
1678
|
aliasToken = await ctx.client.rotateAliasToken({
|
|
1624
1679
|
teamId: ctx.teamId,
|
|
1625
1680
|
slug,
|
|
@@ -1657,6 +1712,11 @@ export async function cmdRotatePodCredential(
|
|
|
1657
1712
|
}
|
|
1658
1713
|
let podCredentialMaskedKey: string;
|
|
1659
1714
|
try {
|
|
1715
|
+
await rejectV2ForLegacyCommand({
|
|
1716
|
+
client: ctx.client,
|
|
1717
|
+
teamId: ctx.teamId,
|
|
1718
|
+
slug,
|
|
1719
|
+
});
|
|
1660
1720
|
podCredentialMaskedKey = await ctx.client.rotatePodCredential({
|
|
1661
1721
|
teamId: ctx.teamId,
|
|
1662
1722
|
slug,
|
|
@@ -1683,15 +1743,11 @@ async function secretDeploymentArchitecture(
|
|
|
1683
1743
|
ctx: DeployCliContext,
|
|
1684
1744
|
slug: string
|
|
1685
1745
|
): Promise<"v1" | "v2"> {
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
return "v1";
|
|
1692
|
-
}
|
|
1693
|
-
throw error;
|
|
1694
|
-
}
|
|
1746
|
+
return deploymentArchitecture({
|
|
1747
|
+
client: ctx.client,
|
|
1748
|
+
teamId: ctx.teamId,
|
|
1749
|
+
slug,
|
|
1750
|
+
});
|
|
1695
1751
|
}
|
|
1696
1752
|
|
|
1697
1753
|
export async function cmdSecretsSet(
|
|
@@ -2103,7 +2159,12 @@ function transientDeployStatusWaitMs(
|
|
|
2103
2159
|
*/
|
|
2104
2160
|
async function pollUntilGone(
|
|
2105
2161
|
ctx: DeployCliContext,
|
|
2106
|
-
slug: string
|
|
2162
|
+
slug: string,
|
|
2163
|
+
getDetail: () => Promise<{
|
|
2164
|
+
status: string;
|
|
2165
|
+
progress?: DeploymentProgress;
|
|
2166
|
+
statusMessage?: string | null;
|
|
2167
|
+
}>
|
|
2107
2168
|
): Promise<void> {
|
|
2108
2169
|
const startedAt = Date.now();
|
|
2109
2170
|
const tty = process.stderr.isTTY === true;
|
|
@@ -2126,10 +2187,7 @@ async function pollUntilGone(
|
|
|
2126
2187
|
|
|
2127
2188
|
for (;;) {
|
|
2128
2189
|
try {
|
|
2129
|
-
const detail = await
|
|
2130
|
-
teamId: ctx.teamId,
|
|
2131
|
-
slug,
|
|
2132
|
-
});
|
|
2190
|
+
const detail = await getDetail();
|
|
2133
2191
|
report(deployProgressLabel(detail));
|
|
2134
2192
|
} catch (error: unknown) {
|
|
2135
2193
|
if (error instanceof DeployApiError && error.status === 404) {
|
|
@@ -20,6 +20,10 @@ import { authorizeCursorAccountConnectors } from "./cursor-account-mcp-auth.js";
|
|
|
20
20
|
import { deploymentServiceAccountId } from "./deploy-client.js";
|
|
21
21
|
import { loadAgentProject } from "./discovery.js";
|
|
22
22
|
import { CLI_COMMAND_NAME as CLI, LOG_PREFIX } from "./distribution.js";
|
|
23
|
+
import {
|
|
24
|
+
isUnsupportedV2LegacyCommandError,
|
|
25
|
+
rejectV2ForLegacyCommand,
|
|
26
|
+
} from "./legacy-command-guard.js";
|
|
23
27
|
import {
|
|
24
28
|
createHostMcpOAuthProvider,
|
|
25
29
|
MCP_OAUTH_CALLBACK_URL,
|
|
@@ -290,12 +294,21 @@ async function cmdMcpOauthCursorAccount(
|
|
|
290
294
|
|
|
291
295
|
let serviceAccountId: string | undefined;
|
|
292
296
|
try {
|
|
297
|
+
await rejectV2ForLegacyCommand({
|
|
298
|
+
client: auth.client,
|
|
299
|
+
teamId: auth.teamId,
|
|
300
|
+
slug,
|
|
301
|
+
});
|
|
293
302
|
const detail = await auth.client.getDeployment({
|
|
294
303
|
teamId: auth.teamId,
|
|
295
304
|
slug,
|
|
296
305
|
});
|
|
297
306
|
serviceAccountId = deploymentServiceAccountId(detail);
|
|
298
307
|
} catch (error) {
|
|
308
|
+
if (isUnsupportedV2LegacyCommandError(error)) {
|
|
309
|
+
err(`${LOG_PREFIX} ${error.message}\n`);
|
|
310
|
+
return 1;
|
|
311
|
+
}
|
|
299
312
|
err(
|
|
300
313
|
`${LOG_PREFIX} Could not load deployment "${slug}" (team ${auth.teamId}): ${describe(error)}\n` +
|
|
301
314
|
`${LOG_PREFIX} Deploy first with \`${CLI} deploy\`.\n`
|
|
@@ -382,6 +395,11 @@ async function storeOauthSecrets(args: {
|
|
|
382
395
|
}
|
|
383
396
|
|
|
384
397
|
try {
|
|
398
|
+
await rejectV2ForLegacyCommand({
|
|
399
|
+
client: auth.client,
|
|
400
|
+
teamId: auth.teamId,
|
|
401
|
+
slug,
|
|
402
|
+
});
|
|
385
403
|
const secretNames = await upsertHostMcpOauthSecrets({
|
|
386
404
|
connection: args.connection,
|
|
387
405
|
tokens,
|
package/src/internal/cli-mcp.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { dirname, join } from "node:path";
|
|
|
32
32
|
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
33
33
|
import { DeployApiError } from "./deploy-client.js";
|
|
34
34
|
import { CLI_COMMAND_NAME as CLI, LOG_PREFIX } from "./distribution.js";
|
|
35
|
+
import { rejectV2ForLegacyCommand } from "./legacy-command-guard.js";
|
|
35
36
|
import {
|
|
36
37
|
ProdTargetError,
|
|
37
38
|
resolveProdSlug,
|
|
@@ -653,6 +654,16 @@ async function cmdMcpInstallRemote(options: McpCliOptions): Promise<number> {
|
|
|
653
654
|
if (typeof auth === "number") {
|
|
654
655
|
return auth;
|
|
655
656
|
}
|
|
657
|
+
try {
|
|
658
|
+
await rejectV2ForLegacyCommand({
|
|
659
|
+
client: auth.client,
|
|
660
|
+
teamId: auth.teamId,
|
|
661
|
+
slug,
|
|
662
|
+
});
|
|
663
|
+
} catch (error) {
|
|
664
|
+
err(`${describeError(error)}\n`);
|
|
665
|
+
return 1;
|
|
666
|
+
}
|
|
656
667
|
|
|
657
668
|
// Verify the deployment resolves before writing config that cannot work.
|
|
658
669
|
// A 403 here is team membership or cloud-agent entitlement, not an
|
|
@@ -20,7 +20,10 @@ import {
|
|
|
20
20
|
runSlackManifest,
|
|
21
21
|
type SlackCliExec,
|
|
22
22
|
} from "./cli-slack-manual.js";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
cursorExternalApiUrl,
|
|
25
|
+
resolveApiKeySync,
|
|
26
|
+
} from "./cursor/credentials.js";
|
|
24
27
|
import { slugFromDirectoryName } from "./deploy-client.js";
|
|
25
28
|
import { inferDeployGitSource } from "./deploy-source.js";
|
|
26
29
|
import { describeError } from "./describe-error.js";
|
|
@@ -113,7 +116,8 @@ create/destroy/icon — dedicated Socket Mode app via the Cursor dashboard:
|
|
|
113
116
|
create Opens the signed-in dashboard wizard. Finish name, workspace,
|
|
114
117
|
and Slack consent there. The CLI writes the token pair into
|
|
115
118
|
<dir>/.env.local and runs doctor. Requires \`${CLI} login\`
|
|
116
|
-
(or CURSOR_API_KEY).
|
|
119
|
+
(or CURSOR_API_KEY). A team service-account key cannot
|
|
120
|
+
provision Slack apps. --prod provisions the prod app (default
|
|
117
121
|
dev). --name / --icon / --channel-posts prefill the wizard.
|
|
118
122
|
destroy Delete the provisioned Slack app for this agent (+env). Tokens
|
|
119
123
|
already in .env.local are left in place (they just stop working).
|
|
@@ -397,6 +401,15 @@ async function prepareProvision(
|
|
|
397
401
|
const out =
|
|
398
402
|
options.out ?? ((text: string) => void process.stdout.write(text));
|
|
399
403
|
const err = errStream(options);
|
|
404
|
+
const credential = resolveApiKeySync(
|
|
405
|
+
options.apiKey === undefined ? undefined : { apiKey: options.apiKey }
|
|
406
|
+
);
|
|
407
|
+
if (credential?.source === "service-account") {
|
|
408
|
+
err(
|
|
409
|
+
`A team service-account key cannot provision Slack apps. Sign in with \`${CLI} login\` or set CURSOR_API_KEY.\n`
|
|
410
|
+
);
|
|
411
|
+
return 1;
|
|
412
|
+
}
|
|
400
413
|
const auth = await resolveDeployAuth({
|
|
401
414
|
team: options.team,
|
|
402
415
|
apiKey: options.apiKey,
|