@cursor/july 0.1.92 → 0.1.94
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 +8 -20
- package/README.md +115 -182
- package/dist/channels/deployments/deployments-channel.d.ts +7 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +26 -2
- package/dist/channels/deployments/types.d.ts +8 -0
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/github-channel.d.ts +3 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +28 -56
- package/dist/channels/slack/attachments.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +0 -7
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +4 -7
- package/dist/channels/slack/eval-directive.d.ts +5 -12
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +8 -19
- package/dist/channels/slack/index.d.ts +0 -6
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +0 -6
- package/dist/channels/slack/setup.d.ts +4 -4
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +8 -15
- package/dist/channels/slack/slack-channel.d.ts +6 -13
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +15 -101
- package/dist/channels/slack/types.d.ts +12 -79
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/types.js +1 -15
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +12 -0
- package/dist/connections.d.ts +18 -9
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -8
- package/dist/continuation.d.ts +1 -1
- package/dist/continuation.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +8 -8
- package/dist/docs/ab.md +7 -13
- package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
- package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
- package/dist/docs/assets/{app.Bci6CM9E.js → app.CFDEas4I.js} +1 -1
- package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
- package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Ct4NSiLm.js} +2 -2
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
- package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.lwAgBIMI.lean.js} +1 -1
- package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.D9msOFOW.js} +9 -14
- package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
- package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.BDb0t1QV.js} +2 -2
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
- package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.B4sjlodG.js} +2 -2
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.Cnh2mL4a.js} +5 -5
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.Cnh2mL4a.lean.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.C32HsdKk.js} +7 -13
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
- package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
- package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.DRakGHFe.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.Nj_LjW_a.js} +2 -2
- package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.Cw6_ICYG.js} +10 -11
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.BH8Oc0D0.js} +7 -7
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +14 -0
- package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
- package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.8son6Hjm.js} +4 -4
- package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.BHeXn2id.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
- package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +7 -7
- package/dist/docs/building-with-agents.md +5 -11
- package/dist/docs/concepts.html +5 -8
- package/dist/docs/concepts.md +13 -17
- package/dist/docs/deployment.html +13 -18
- package/dist/docs/deployment.md +9 -30
- package/dist/docs/design/agsh.md +406 -0
- package/dist/docs/evals.html +10 -10
- package/dist/docs/evals.md +16 -37
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.md +3 -3
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +9 -25
- package/dist/docs/guides/convert-automation.html +7 -7
- package/dist/docs/guides/convert-automation.md +4 -4
- package/dist/docs/guides/github.html +9 -9
- package/dist/docs/guides/github.md +16 -28
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +11 -13
- package/dist/docs/guides/mcp-oauth.md +14 -22
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +11 -17
- package/dist/docs/guides/slack.md +13 -50
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/guides/webhooks.md +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +1 -1
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +0 -36
- package/dist/docs/llms-full.txt +965 -3633
- package/dist/docs/llms.txt +3 -18
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/quickstart.md +3 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +10 -15
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +20 -31
- package/dist/docs/reference/cli.html +14 -15
- package/dist/docs/reference/cli.md +29 -38
- package/dist/docs/reference/connections.html +11 -11
- package/dist/docs/reference/connections.md +24 -25
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/hooks.md +12 -17
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/http-api.md +25 -37
- package/dist/docs/reference/instructions.html +6 -6
- package/dist/docs/reference/instructions.md +1 -1
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +14 -19
- package/dist/docs/reference/project-layout.html +9 -7
- package/dist/docs/reference/project-layout.md +7 -3
- package/dist/docs/reference/prompt.html +6 -6
- package/dist/docs/reference/prompt.md +1 -1
- package/dist/docs/reference/schedules.html +6 -6
- package/dist/docs/reference/schedules.md +1 -2
- package/dist/docs/reference/sessions.html +5 -12
- package/dist/docs/reference/sessions.md +8 -19
- package/dist/docs/reference/skills.html +8 -8
- package/dist/docs/reference/skills.md +3 -3
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/subagents.md +2 -2
- package/dist/docs/reference/tools.html +8 -8
- package/dist/docs/reference/tools.md +30 -19
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +4 -5
- package/dist/docs/storage.html +9 -9
- package/dist/docs/storage.md +37 -80
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +2 -2
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -9
- package/dist/docs/templates/security-reviewer.html +5 -5
- package/dist/docs/templates/security-reviewer.md +2 -3
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +11 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +47 -9
- package/dist/internal/authored-alias-hooks.d.ts +14 -11
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +14 -11
- package/dist/internal/authored-loaders.d.ts +7 -6
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +14 -10
- package/dist/internal/cli-deploy.d.ts +1 -1
- package/dist/internal/cli-deploy.js +5 -5
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- package/dist/internal/continuation-channel.d.ts +6 -3
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +44 -40
- package/dist/internal/continuation-identity.d.ts +17 -16
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +109 -36
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +26 -15
- package/dist/internal/convert-automation/slug.d.ts +0 -2
- package/dist/internal/convert-automation/slug.d.ts.map +1 -1
- package/dist/internal/convert-automation/slug.js +0 -8
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +5 -1
- package/dist/internal/deploy-manifest.d.ts +2 -2
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +4 -9
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +91 -13
- package/dist/internal/distribution.d.ts +4 -3
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +4 -3
- package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +70 -0
- package/dist/internal/hosted-delivery.d.ts +35 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +239 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -1
- package/dist/internal/mcp-endpoint.js +3 -3
- package/dist/internal/mcp-host.d.ts +8 -7
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +8 -7
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +5 -1
- package/dist/internal/playground/static.d.ts +0 -3
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +5 -7
- package/dist/internal/review-comments.d.ts +186 -63
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +350 -168
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +134 -175
- package/dist/internal/session-engine.d.ts +50 -10
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +221 -68
- package/dist/internal/shallow-clone.d.ts +8 -2
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +17 -10
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +67 -0
- package/dist/playground/assets/{index-DDvyC2z6.js → index-B3JCyigB.js} +2 -2
- package/dist/playground/index.html +1 -1
- package/dist/types.d.ts +81 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/docs/README.md +0 -36
- package/docs/ab.md +7 -13
- package/docs/building-with-agents.md +5 -11
- package/docs/concepts.md +13 -17
- package/docs/deployment.md +9 -30
- package/docs/design/agsh.md +406 -0
- package/docs/evals.md +16 -37
- package/docs/guides/agent-to-agent.md +3 -3
- package/docs/guides/cloud-runtime.md +9 -25
- package/docs/guides/convert-automation.md +4 -4
- package/docs/guides/github.md +16 -28
- package/docs/guides/mcp-oauth.md +14 -22
- package/docs/guides/slack.md +14 -51
- package/docs/guides/webhooks.md +3 -3
- package/docs/hillclimbing.md +1 -1
- package/docs/quickstart.md +3 -4
- package/docs/reference/agent-config.md +10 -15
- package/docs/reference/channels.md +20 -31
- package/docs/reference/cli.md +29 -38
- package/docs/reference/connections.md +24 -25
- package/docs/reference/hooks.md +12 -17
- package/docs/reference/http-api.md +26 -38
- package/docs/reference/instructions.md +1 -1
- package/docs/reference/playground.md +14 -19
- package/docs/reference/project-layout.md +7 -3
- package/docs/reference/prompt.md +1 -1
- package/docs/reference/schedules.md +1 -2
- package/docs/reference/sessions.md +8 -19
- package/docs/reference/skills.md +3 -3
- package/docs/reference/subagents.md +2 -2
- package/docs/reference/tools.md +30 -19
- package/docs/scaffolding-agents.md +4 -5
- package/docs/storage.md +37 -80
- package/docs/templates/agentic-owners.md +2 -2
- package/docs/templates/pr-autofixer.md +7 -9
- package/docs/templates/security-reviewer.md +2 -3
- package/docs/troubleshooting.md +8 -8
- package/package.json +16 -2
- package/skills/create-agent/SKILL.md +6 -13
- package/skills/debug/SKILL.md +2 -4
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +3 -2
- package/skills/mcp-auth/SKILL.md +10 -13
- package/skills/setup-slack/SKILL.md +21 -137
- package/src/channels/deployments/deployments-channel.ts +32 -2
- package/src/channels/deployments/types.ts +8 -0
- package/src/channels/github/github-channel.ts +71 -21
- package/src/channels/slack/attachments.ts +2 -2
- package/src/channels/slack/dispatch.ts +2 -16
- package/src/channels/slack/eval-directive.ts +8 -27
- package/src/channels/slack/index.ts +0 -6
- package/src/channels/slack/setup.ts +8 -15
- package/src/channels/slack/slack-channel.ts +14 -125
- package/src/channels/slack/types.ts +12 -96
- package/src/client.ts +23 -0
- package/src/connections.ts +20 -7
- package/src/continuation.ts +1 -1
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/authored-alias-hooks.ts +14 -11
- package/src/internal/authored-loaders.ts +14 -10
- package/src/internal/cli-deploy.ts +5 -5
- package/src/internal/cli-mcp-oauth.ts +6 -4
- package/src/internal/continuation-channel.ts +62 -45
- package/src/internal/continuation-identity.ts +123 -38
- package/src/internal/convert-automation/convert-workflow.ts +29 -17
- package/src/internal/convert-automation/slug.ts +0 -9
- package/src/internal/cursor/account-mcp.ts +4 -1
- package/src/internal/deploy-manifest.ts +5 -9
- package/src/internal/discovery.ts +107 -13
- package/src/internal/distribution.ts +4 -3
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/hosted-delivery-protocol.ts +114 -0
- package/src/internal/hosted-delivery.ts +359 -0
- package/src/internal/http-channel.ts +0 -2
- package/src/internal/mcp-endpoint.ts +3 -3
- package/src/internal/mcp-host.ts +8 -7
- package/src/internal/peer-connections.ts +4 -1
- package/src/internal/playground/static.ts +1 -3
- package/src/internal/resolved-connections.ts +8 -10
- package/src/internal/review-comments.ts +542 -229
- package/src/internal/server.ts +180 -253
- package/src/internal/session-engine.ts +279 -70
- package/src/internal/shallow-clone.ts +30 -16
- package/src/internal/tool-catalog.ts +106 -0
- package/src/types.ts +99 -40
- package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
- package/templates/triage/README.md +2 -1
- package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
- package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
- package/dist/channels/slack/cursor-account.d.ts +0 -87
- package/dist/channels/slack/cursor-account.d.ts.map +0 -1
- package/dist/channels/slack/cursor-account.js +0 -100
- package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
- package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
- package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.js +0 -10
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.js +0 -7
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.lean.js +0 -1
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.js +0 -8
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.lean.js +0 -1
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.js +0 -23
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.lean.js +0 -1
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.js +0 -11
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.lean.js +0 -1
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.js +0 -19
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.lean.js +0 -1
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.js +0 -25
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.DiUmk_Oi.lean.js +0 -1
- package/dist/docs/assets/index.md.BAaMXLFd.js +0 -5
- package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.js +0 -17
- package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
- package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
- package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
- package/dist/docs/example-agents/approval-buddy.html +0 -36
- package/dist/docs/example-agents/approval-buddy.md +0 -266
- package/dist/docs/example-agents/benny.html +0 -33
- package/dist/docs/example-agents/benny.md +0 -182
- package/dist/docs/example-agents/bugbot.html +0 -37
- package/dist/docs/example-agents/bugbot.md +0 -229
- package/dist/docs/example-agents/codebase-wiki.html +0 -34
- package/dist/docs/example-agents/codebase-wiki.md +0 -170
- package/dist/docs/example-agents/codeowners-review.html +0 -34
- package/dist/docs/example-agents/codeowners-review.md +0 -192
- package/dist/docs/example-agents/concierge.html +0 -49
- package/dist/docs/example-agents/concierge.md +0 -201
- package/dist/docs/example-agents/fsd.html +0 -41
- package/dist/docs/example-agents/fsd.md +0 -329
- package/dist/docs/example-agents/index.html +0 -28
- package/dist/docs/example-agents/index.md +0 -102
- package/dist/docs/example-agents/knowledge-base.html +0 -37
- package/dist/docs/example-agents/knowledge-base.md +0 -168
- package/dist/docs/example-agents/oncall.html +0 -36
- package/dist/docs/example-agents/oncall.md +0 -212
- package/dist/docs/example-agents/security-reviewer.html +0 -45
- package/dist/docs/example-agents/security-reviewer.md +0 -265
- package/dist/docs/example-agents/slack-agent.html +0 -31
- package/dist/docs/example-agents/slack-agent.md +0 -142
- package/dist/docs/example-agents/weather-agent.html +0 -51
- package/dist/docs/example-agents/weather-agent.md +0 -296
- package/dist/internal/cursor-slack-relay.d.ts +0 -96
- package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
- package/dist/internal/cursor-slack-relay.js +0 -176
- package/docs/example-agents/approval-buddy.md +0 -271
- package/docs/example-agents/benny.md +0 -187
- package/docs/example-agents/bugbot.md +0 -234
- package/docs/example-agents/codebase-wiki.md +0 -175
- package/docs/example-agents/codeowners-review.md +0 -197
- package/docs/example-agents/concierge.md +0 -206
- package/docs/example-agents/fsd.md +0 -334
- package/docs/example-agents/index.md +0 -107
- package/docs/example-agents/knowledge-base.md +0 -173
- package/docs/example-agents/oncall.md +0 -217
- package/docs/example-agents/security-reviewer.md +0 -270
- package/docs/example-agents/slack-agent.md +0 -147
- package/docs/example-agents/weather-agent.md +0 -301
- package/src/channels/slack/cursor-account.ts +0 -202
- package/src/internal/cursor-slack-relay.ts +0 -249
- /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
- /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
package/src/internal/server.ts
CHANGED
|
@@ -38,12 +38,6 @@ import {
|
|
|
38
38
|
parseCursorOriginRepoScope,
|
|
39
39
|
} from "../channels/origin/cursor-account.js";
|
|
40
40
|
import { findOriginChannelTargets } from "../channels/origin/origin-channel.js";
|
|
41
|
-
import {
|
|
42
|
-
dispatchCursorSlackEnvelope,
|
|
43
|
-
getSlackCursorAccountRuntime,
|
|
44
|
-
type SlackCursorAccountRuntime,
|
|
45
|
-
} from "../channels/slack/cursor-account.js";
|
|
46
|
-
import { assertSlackCursorAgentName } from "../channels/slack/types.js";
|
|
47
41
|
import { allowAll, bearerAuth, localDevStrict } from "../channels.js";
|
|
48
42
|
import type {
|
|
49
43
|
AgentProject,
|
|
@@ -56,6 +50,7 @@ import type {
|
|
|
56
50
|
ReminderInfo,
|
|
57
51
|
ServeOptions,
|
|
58
52
|
} from "../types.js";
|
|
53
|
+
import { V2EngineError } from "./continuation-identity.js";
|
|
59
54
|
import {
|
|
60
55
|
type CursorAccountConnectionRef,
|
|
61
56
|
CursorAccountMcpBridge,
|
|
@@ -87,12 +82,6 @@ import {
|
|
|
87
82
|
scmMetadataToOriginPayload,
|
|
88
83
|
} from "./cursor-event-relay.js";
|
|
89
84
|
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
90
|
-
import {
|
|
91
|
-
type CursorSlackAgentRegistration,
|
|
92
|
-
CursorSlackRelay,
|
|
93
|
-
createCursorSlackApiCaller,
|
|
94
|
-
formatCursorSlackEventLog,
|
|
95
|
-
} from "./cursor-slack-relay.js";
|
|
96
85
|
import { buildAgentDeployManifest } from "./deploy-manifest.js";
|
|
97
86
|
import {
|
|
98
87
|
formatDiagnostics,
|
|
@@ -118,6 +107,7 @@ import {
|
|
|
118
107
|
handleAgentServeTrigger,
|
|
119
108
|
} from "./handleAgentServeTrigger.js";
|
|
120
109
|
import { createHostPlatforms, warmupHostGitHubAuth } from "./host-platforms.js";
|
|
110
|
+
import { registerHostedDeliveryRoute } from "./hosted-delivery.js";
|
|
121
111
|
import {
|
|
122
112
|
buildHttpChannelRoutes,
|
|
123
113
|
errorResponse,
|
|
@@ -176,19 +166,22 @@ import {
|
|
|
176
166
|
resolveMountConnections,
|
|
177
167
|
validateMountConnectionsConfig,
|
|
178
168
|
} from "./resolved-connections.js";
|
|
179
|
-
import { Router } from "./router.js";
|
|
169
|
+
import { Router, type ServerRouteContext } from "./router.js";
|
|
180
170
|
import { RuntimeDispatchingRunner } from "./runtime-dispatch-runner.js";
|
|
181
171
|
import { ScheduleRunner, UnknownScheduleError } from "./schedule-runner.js";
|
|
182
172
|
import { type AgentRunner, CursorSdkRunner } from "./sdk-runner.js";
|
|
183
173
|
import {
|
|
174
|
+
InvalidContinuationTokenError,
|
|
184
175
|
SessionAuthError,
|
|
185
176
|
SessionBusyError,
|
|
186
177
|
SessionEngine,
|
|
187
178
|
ToolInputError,
|
|
188
179
|
ToolNotDirectlyCallableError,
|
|
189
180
|
UnknownToolError,
|
|
181
|
+
WorkspaceUnavailableError,
|
|
190
182
|
} from "./session-engine.js";
|
|
191
183
|
import { sessionUrlsForRequest } from "./session-urls.js";
|
|
184
|
+
import { catalogDetailEntry, catalogListEntry } from "./tool-catalog.js";
|
|
192
185
|
|
|
193
186
|
function memoryHealthFields(engines: readonly SessionEngine[]) {
|
|
194
187
|
return collectMemoryHealthFields({
|
|
@@ -279,7 +272,11 @@ export async function startServer(
|
|
|
279
272
|
);
|
|
280
273
|
const dev = options.dev ?? false;
|
|
281
274
|
const playground = options.playground ?? true;
|
|
282
|
-
const
|
|
275
|
+
const hosted = options as {
|
|
276
|
+
noControlPlane?: boolean;
|
|
277
|
+
cursorGithubProxy?: boolean;
|
|
278
|
+
};
|
|
279
|
+
const noControlPlane = hosted.noControlPlane === true;
|
|
283
280
|
const runSchedules = options.schedules ?? !dev;
|
|
284
281
|
const runReminders = options.reminders ?? !dev;
|
|
285
282
|
|
|
@@ -371,7 +368,7 @@ export async function startServer(
|
|
|
371
368
|
// through github-proxy exactly like channel Octokit calls.
|
|
372
369
|
let hostGithubProxyResolver: CursorAccountGithubTokenResolver | undefined;
|
|
373
370
|
if (cursorGithubTargets.length > 0) {
|
|
374
|
-
const githubProxyRequested =
|
|
371
|
+
const githubProxyRequested = hosted.cursorGithubProxy === true;
|
|
375
372
|
const needsGithubAuth =
|
|
376
373
|
cursorGithubConfig.scope !== undefined || githubProxyRequested;
|
|
377
374
|
if (needsGithubAuth) {
|
|
@@ -923,22 +920,7 @@ export async function startServer(
|
|
|
923
920
|
});
|
|
924
921
|
}
|
|
925
922
|
|
|
926
|
-
|
|
927
|
-
// `slackChannel({ cursorAccount: true })`. Inbound rides the account's
|
|
928
|
-
// Slack connection (`/v0/slack-events`); the classic Socket-Mode path is
|
|
929
|
-
// untouched for channels with their own Slack app tokens.
|
|
930
|
-
const cursorSlackRelay = await startCursorSlackRelay({
|
|
931
|
-
options,
|
|
932
|
-
runtimes,
|
|
933
|
-
accountKey,
|
|
934
|
-
logger,
|
|
935
|
-
});
|
|
936
|
-
try {
|
|
937
|
-
await cursorGithubCredentials?.start();
|
|
938
|
-
} catch (error) {
|
|
939
|
-
await cursorSlackRelay?.stop();
|
|
940
|
-
throw error;
|
|
941
|
-
}
|
|
923
|
+
await cursorGithubCredentials?.start();
|
|
942
924
|
|
|
943
925
|
// Cursor SCM events: v1 stays on the engine poll. v2 ingest is local-CP
|
|
944
926
|
// only — hosted `--no-control-plane` skips the July poll (hosted CP wakes).
|
|
@@ -1014,7 +996,6 @@ export async function startServer(
|
|
|
1014
996
|
await cursorDeploymentRelay?.stop();
|
|
1015
997
|
await cursorEventRelay?.stop();
|
|
1016
998
|
await controlPlaneScmRelay?.stop();
|
|
1017
|
-
await cursorSlackRelay?.stop();
|
|
1018
999
|
cursorGithubCredentials?.stop();
|
|
1019
1000
|
await shutdownOtelRuntime(otelRuntime);
|
|
1020
1001
|
throw error;
|
|
@@ -1181,7 +1162,6 @@ export async function startServer(
|
|
|
1181
1162
|
await cursorDeploymentRelay?.stop();
|
|
1182
1163
|
await cursorEventRelay?.stop();
|
|
1183
1164
|
await controlPlaneScmRelay?.stop();
|
|
1184
|
-
await cursorSlackRelay?.stop();
|
|
1185
1165
|
for (const runtime of runtimes) {
|
|
1186
1166
|
runtime.controlPlane?.stop();
|
|
1187
1167
|
runtime.scheduleRunner.stop();
|
|
@@ -1285,6 +1265,19 @@ function mountAgentRoutes(
|
|
|
1285
1265
|
}
|
|
1286
1266
|
return null;
|
|
1287
1267
|
};
|
|
1268
|
+
if (noControlPlane === true && isV2Project(project)) {
|
|
1269
|
+
registerHostedDeliveryRoute({
|
|
1270
|
+
router,
|
|
1271
|
+
base,
|
|
1272
|
+
channels: project.channels,
|
|
1273
|
+
buildHandlerArgs: (channelId, hostedSessionId) =>
|
|
1274
|
+
buildChannelHandlerArgs({
|
|
1275
|
+
runtime,
|
|
1276
|
+
channelId,
|
|
1277
|
+
hostedSessionId,
|
|
1278
|
+
}),
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1288
1281
|
// Playground lists/opens Slack (and other channel) sessions across
|
|
1289
1282
|
// principals when `--dev` (loopback) or `--allow-anonymous` (trusted
|
|
1290
1283
|
// shared host, e.g. corp Okta ALB). Never when bearer / custom channel
|
|
@@ -1521,6 +1514,123 @@ function mountAgentRoutes(
|
|
|
1521
1514
|
});
|
|
1522
1515
|
}
|
|
1523
1516
|
|
|
1517
|
+
// The live tool catalog: the session's tool namespace as a turn would
|
|
1518
|
+
// assemble it — authored server tools plus advertised MCP passthroughs —
|
|
1519
|
+
// under model-facing names. `/v1/info` stays the static authored
|
|
1520
|
+
// manifest; this is the runtime view only the running deployment can
|
|
1521
|
+
// answer. `session` / `continuationToken` query parameters bind the
|
|
1522
|
+
// listing to a session identity (advertised inventories can be
|
|
1523
|
+
// tenant-scoped and resolved per session).
|
|
1524
|
+
const resolveCatalogBinding = async (
|
|
1525
|
+
request: Request,
|
|
1526
|
+
ctx: Pick<ServerRouteContext, "auth" | "requestIp">
|
|
1527
|
+
): Promise<
|
|
1528
|
+
| { sessionId?: string; continuationToken?: string }
|
|
1529
|
+
| { errorResponse: Response }
|
|
1530
|
+
> => {
|
|
1531
|
+
const url = new URL(request.url);
|
|
1532
|
+
const sessionId = url.searchParams.get("session") ?? undefined;
|
|
1533
|
+
const continuationToken =
|
|
1534
|
+
url.searchParams.get("continuationToken") ?? undefined;
|
|
1535
|
+
if (sessionId !== undefined) {
|
|
1536
|
+
const record = await engine.sessions.get(sessionId);
|
|
1537
|
+
if (record === undefined) {
|
|
1538
|
+
return {
|
|
1539
|
+
errorResponse: errorResponse(
|
|
1540
|
+
404,
|
|
1541
|
+
"session_not_found",
|
|
1542
|
+
`Unknown session ${sessionId}.`
|
|
1543
|
+
),
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
const ownership = requireSessionOwner(record, ctx.auth, {
|
|
1547
|
+
relax: relaxSessionReadAuth,
|
|
1548
|
+
beyondLoopback: relaxSessionReadAuthBeyondLoopback,
|
|
1549
|
+
requestIp: ctx.requestIp,
|
|
1550
|
+
});
|
|
1551
|
+
if (ownership !== undefined) {
|
|
1552
|
+
return { errorResponse: ownership };
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
return { sessionId, continuationToken };
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
router.add({
|
|
1559
|
+
method: "GET",
|
|
1560
|
+
pattern: `${base}/v1/tools`,
|
|
1561
|
+
auth: httpAuth,
|
|
1562
|
+
handler: async (request, ctx) => {
|
|
1563
|
+
const binding = await resolveCatalogBinding(request, ctx);
|
|
1564
|
+
if ("errorResponse" in binding) {
|
|
1565
|
+
return binding.errorResponse;
|
|
1566
|
+
}
|
|
1567
|
+
try {
|
|
1568
|
+
const catalog = await engine.listCatalogTools({
|
|
1569
|
+
auth: ctx.auth,
|
|
1570
|
+
...binding,
|
|
1571
|
+
});
|
|
1572
|
+
return jsonResponse({
|
|
1573
|
+
tools: catalog.tools.map(catalogListEntry),
|
|
1574
|
+
// JSON.stringify drops the key when there is nothing to report.
|
|
1575
|
+
connectionErrors:
|
|
1576
|
+
catalog.connectionErrors.length === 0
|
|
1577
|
+
? undefined
|
|
1578
|
+
: catalog.connectionErrors,
|
|
1579
|
+
});
|
|
1580
|
+
} catch (error) {
|
|
1581
|
+
if (error instanceof InvalidContinuationTokenError) {
|
|
1582
|
+
return errorResponse(
|
|
1583
|
+
400,
|
|
1584
|
+
"invalid_continuation_token",
|
|
1585
|
+
error.message
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
throw error;
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
router.add({
|
|
1594
|
+
method: "GET",
|
|
1595
|
+
pattern: `${base}/v1/tools/:toolName`,
|
|
1596
|
+
auth: httpAuth,
|
|
1597
|
+
handler: async (request, ctx) => {
|
|
1598
|
+
const toolName = ctx.params.toolName ?? "";
|
|
1599
|
+
const binding = await resolveCatalogBinding(request, ctx);
|
|
1600
|
+
if ("errorResponse" in binding) {
|
|
1601
|
+
return binding.errorResponse;
|
|
1602
|
+
}
|
|
1603
|
+
try {
|
|
1604
|
+
const catalog = await engine.listCatalogTools({
|
|
1605
|
+
auth: ctx.auth,
|
|
1606
|
+
...binding,
|
|
1607
|
+
});
|
|
1608
|
+
const tool = catalog.tools.find((t) => t.name === toolName);
|
|
1609
|
+
if (tool === undefined) {
|
|
1610
|
+
return jsonResponse(
|
|
1611
|
+
{
|
|
1612
|
+
ok: false,
|
|
1613
|
+
error: "unknown_tool",
|
|
1614
|
+
message: `Unknown tool "${toolName}".`,
|
|
1615
|
+
availableTools: catalog.tools.map((t) => t.name),
|
|
1616
|
+
},
|
|
1617
|
+
{ status: 404 }
|
|
1618
|
+
);
|
|
1619
|
+
}
|
|
1620
|
+
return jsonResponse(catalogDetailEntry(tool));
|
|
1621
|
+
} catch (error) {
|
|
1622
|
+
if (error instanceof InvalidContinuationTokenError) {
|
|
1623
|
+
return errorResponse(
|
|
1624
|
+
400,
|
|
1625
|
+
"invalid_continuation_token",
|
|
1626
|
+
error.message
|
|
1627
|
+
);
|
|
1628
|
+
}
|
|
1629
|
+
throw error;
|
|
1630
|
+
}
|
|
1631
|
+
},
|
|
1632
|
+
});
|
|
1633
|
+
|
|
1524
1634
|
// Deterministic tool invocation: run an authored server tool directly,
|
|
1525
1635
|
// without a model turn deciding to call it.
|
|
1526
1636
|
router.add({
|
|
@@ -1544,6 +1654,17 @@ function mountAgentRoutes(
|
|
|
1544
1654
|
"`sessionId` must be a string when provided."
|
|
1545
1655
|
);
|
|
1546
1656
|
}
|
|
1657
|
+
if (
|
|
1658
|
+
body.continuationToken !== undefined &&
|
|
1659
|
+
typeof body.continuationToken !== "string"
|
|
1660
|
+
) {
|
|
1661
|
+
return errorResponse(
|
|
1662
|
+
400,
|
|
1663
|
+
"invalid_request",
|
|
1664
|
+
"`continuationToken` must be a string when provided."
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
const continuationToken = body.continuationToken;
|
|
1547
1668
|
const sessionId = body.sessionId;
|
|
1548
1669
|
if (sessionId !== undefined) {
|
|
1549
1670
|
const record = await engine.sessions.get(sessionId);
|
|
@@ -1566,7 +1687,8 @@ function mountAgentRoutes(
|
|
|
1566
1687
|
try {
|
|
1567
1688
|
const outcome = await engine.callTool(toolName, body.input ?? {}, {
|
|
1568
1689
|
auth: ctx.auth,
|
|
1569
|
-
|
|
1690
|
+
sessionId,
|
|
1691
|
+
continuationToken,
|
|
1570
1692
|
});
|
|
1571
1693
|
return jsonResponse({ ok: !outcome.isError, ...outcome });
|
|
1572
1694
|
} catch (error) {
|
|
@@ -1587,6 +1709,16 @@ function mountAgentRoutes(
|
|
|
1587
1709
|
if (error instanceof ToolInputError) {
|
|
1588
1710
|
return errorResponse(400, "invalid_tool_input", error.message);
|
|
1589
1711
|
}
|
|
1712
|
+
if (error instanceof InvalidContinuationTokenError) {
|
|
1713
|
+
return errorResponse(
|
|
1714
|
+
400,
|
|
1715
|
+
"invalid_continuation_token",
|
|
1716
|
+
error.message
|
|
1717
|
+
);
|
|
1718
|
+
}
|
|
1719
|
+
if (error instanceof WorkspaceUnavailableError) {
|
|
1720
|
+
return errorResponse(500, "workspace_unavailable", error.message);
|
|
1721
|
+
}
|
|
1590
1722
|
throw error;
|
|
1591
1723
|
}
|
|
1592
1724
|
},
|
|
@@ -2391,54 +2523,11 @@ function resolveCursorOriginRepoScope(input: {
|
|
|
2391
2523
|
return parseCursorOriginRepoScope(repos);
|
|
2392
2524
|
}
|
|
2393
2525
|
|
|
2394
|
-
interface CursorSlackTarget {
|
|
2395
|
-
runtime: MountedRuntime;
|
|
2396
|
-
channelId: string;
|
|
2397
|
-
agentName: string;
|
|
2398
|
-
accountRuntime: SlackCursorAccountRuntime;
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
/**
|
|
2402
|
-
* `weather-agent` → `WeatherAgent` (single-token Cursor Slack handle).
|
|
2403
|
-
* Must not contain whitespace — see {@link assertSlackCursorAgentName}.
|
|
2404
|
-
*/
|
|
2405
|
-
function slackAgentNameFromSlug(slug: string): string {
|
|
2406
|
-
return slug
|
|
2407
|
-
.split(/[-_\s]+/)
|
|
2408
|
-
.filter((word) => word.length > 0)
|
|
2409
|
-
.map((word) => word[0].toUpperCase() + word.slice(1))
|
|
2410
|
-
.join("");
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
/**
|
|
2414
|
-
* Mounted Slack channels riding the Cursor account connection
|
|
2415
|
-
* (`slackChannel({ cursorAccount: true })`), with their registered names
|
|
2416
|
-
* resolved. Duplicate names are a startup error — the backend routes
|
|
2417
|
-
* `@Cursor <name> …` by name, so two mounts cannot share one.
|
|
2418
|
-
*/
|
|
2419
2526
|
function buildAgentIndexEntries(runtimes: MountedRuntime[]): AgentIndexEntry[] {
|
|
2420
|
-
const cursorSlackBySlug = new Map(
|
|
2421
|
-
collectCursorSlackTargets(runtimes).map((target) => [
|
|
2422
|
-
target.runtime.slug,
|
|
2423
|
-
target.agentName,
|
|
2424
|
-
])
|
|
2425
|
-
);
|
|
2426
2527
|
return runtimes.map(({ slug, project }) => {
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2429
|
-
(channel) =>
|
|
2430
|
-
channel.definition.meta?.kind === "slack" &&
|
|
2431
|
-
channel.definition.meta?.slackCursorAccount !== true
|
|
2528
|
+
const hasSlack = project.channels.some(
|
|
2529
|
+
(channel) => channel.definition.meta?.kind === "slack"
|
|
2432
2530
|
);
|
|
2433
|
-
const slack =
|
|
2434
|
-
cursorName !== undefined
|
|
2435
|
-
? {
|
|
2436
|
-
kind: "cursor-account" as const,
|
|
2437
|
-
handle: `@Cursor ${cursorName}`,
|
|
2438
|
-
}
|
|
2439
|
-
: hasSocketSlack
|
|
2440
|
-
? { kind: "socket" as const }
|
|
2441
|
-
: undefined;
|
|
2442
2531
|
return {
|
|
2443
2532
|
slug,
|
|
2444
2533
|
name: project.name,
|
|
@@ -2448,60 +2537,11 @@ function buildAgentIndexEntries(runtimes: MountedRuntime[]): AgentIndexEntry[] {
|
|
|
2448
2537
|
: (project.agent.model?.id ?? ""),
|
|
2449
2538
|
tools: project.agent.tools.length,
|
|
2450
2539
|
channels: project.channels.length + 1,
|
|
2451
|
-
slack,
|
|
2540
|
+
slack: hasSlack ? { kind: "socket" as const } : undefined,
|
|
2452
2541
|
};
|
|
2453
2542
|
});
|
|
2454
2543
|
}
|
|
2455
2544
|
|
|
2456
|
-
function collectCursorSlackTargets(
|
|
2457
|
-
runtimes: MountedRuntime[]
|
|
2458
|
-
): CursorSlackTarget[] {
|
|
2459
|
-
const targets: CursorSlackTarget[] = [];
|
|
2460
|
-
const byName = new Map<string, string>();
|
|
2461
|
-
for (const runtime of runtimes) {
|
|
2462
|
-
for (const channel of runtime.project.channels) {
|
|
2463
|
-
const accountRuntime = getSlackCursorAccountRuntime(channel.definition);
|
|
2464
|
-
if (accountRuntime === undefined) {
|
|
2465
|
-
continue;
|
|
2466
|
-
}
|
|
2467
|
-
const agentName = (
|
|
2468
|
-
accountRuntime.options.agentName ??
|
|
2469
|
-
slackAgentNameFromSlug(
|
|
2470
|
-
runtime.slug === "" ? runtime.project.name : runtime.slug
|
|
2471
|
-
)
|
|
2472
|
-
).trim();
|
|
2473
|
-
if (agentName === "") {
|
|
2474
|
-
throw new Error(
|
|
2475
|
-
`slackChannel({ cursorAccount: true }) on agent "${runtime.slug || runtime.project.name}" resolved an empty agent name; set agentName.`
|
|
2476
|
-
);
|
|
2477
|
-
}
|
|
2478
|
-
assertSlackCursorAgentName(agentName);
|
|
2479
|
-
const nameKey = agentName.toLowerCase();
|
|
2480
|
-
const existing = byName.get(nameKey);
|
|
2481
|
-
if (existing !== undefined) {
|
|
2482
|
-
throw new Error(
|
|
2483
|
-
`Two agents register the Slack name "${agentName}" (${existing} and ${runtime.slug || runtime.project.name}); set agentName to disambiguate.`
|
|
2484
|
-
);
|
|
2485
|
-
}
|
|
2486
|
-
byName.set(nameKey, runtime.slug || runtime.project.name);
|
|
2487
|
-
targets.push({
|
|
2488
|
-
runtime,
|
|
2489
|
-
channelId: channel.id,
|
|
2490
|
-
agentName,
|
|
2491
|
-
accountRuntime,
|
|
2492
|
-
});
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
return targets;
|
|
2496
|
-
}
|
|
2497
|
-
|
|
2498
|
-
/**
|
|
2499
|
-
* Automatic Cursor Slack relay for cursor-account Slack channels: registers
|
|
2500
|
-
* the mounted agents with `/v0/slack-events`, binds each channel's outbound
|
|
2501
|
-
* API transport to the backend proxy, and dispatches relayed envelopes into
|
|
2502
|
-
* the pack's normal inbound path. Requires a signed-in host — fail serve
|
|
2503
|
-
* fast rather than mounting channels that can never hear or speak.
|
|
2504
|
-
*/
|
|
2505
2545
|
interface CursorDeploymentTarget {
|
|
2506
2546
|
runtime: MountedRuntime;
|
|
2507
2547
|
channelId: string;
|
|
@@ -2539,7 +2579,7 @@ function collectCursorDeploymentTargets(
|
|
|
2539
2579
|
* `deploymentsChannel({ ... })`. One relay per process reads
|
|
2540
2580
|
* `/v0/deployment-events` for the union of every channel's deploy sources, and
|
|
2541
2581
|
* each event is routed to the channels that asked for it — the same ownership
|
|
2542
|
-
* `
|
|
2582
|
+
* `startCursorEventRelay` has.
|
|
2543
2583
|
*/
|
|
2544
2584
|
function startCursorDeploymentRelay(input: {
|
|
2545
2585
|
options: ServeOptions;
|
|
@@ -2598,8 +2638,8 @@ function startCursorDeploymentRelay(input: {
|
|
|
2598
2638
|
];
|
|
2599
2639
|
}
|
|
2600
2640
|
}
|
|
2601
|
-
// Same host split as scm-events
|
|
2602
|
-
//
|
|
2641
|
+
// Same host split as scm-events: `/v0/deployment-events/*` is on
|
|
2642
|
+
// api.cursor.com, not api2.
|
|
2603
2643
|
const baseStateRoot =
|
|
2604
2644
|
options.stateRoot ??
|
|
2605
2645
|
join(targets[0].runtime.project.rootDir, ".agent-serve");
|
|
@@ -2635,133 +2675,13 @@ function startCursorDeploymentRelay(input: {
|
|
|
2635
2675
|
return relay;
|
|
2636
2676
|
}
|
|
2637
2677
|
|
|
2638
|
-
async function startCursorSlackRelay(input: {
|
|
2639
|
-
options: ServeOptions;
|
|
2640
|
-
runtimes: MountedRuntime[];
|
|
2641
|
-
accountKey: ResolvedApiKey | undefined;
|
|
2642
|
-
logger: (line: string) => void;
|
|
2643
|
-
}): Promise<CursorSlackRelay | undefined> {
|
|
2644
|
-
const { options, runtimes, accountKey, logger } = input;
|
|
2645
|
-
const targets = collectCursorSlackTargets(runtimes);
|
|
2646
|
-
if (targets.length === 0) {
|
|
2647
|
-
return undefined;
|
|
2648
|
-
}
|
|
2649
|
-
if (accountKey === undefined) {
|
|
2650
|
-
if (options.allowAnonymous === true) {
|
|
2651
|
-
logger(
|
|
2652
|
-
"[agent-sdk] cursor-slack: skipped while unsigned; long-poll relays need a key at start"
|
|
2653
|
-
);
|
|
2654
|
-
return undefined;
|
|
2655
|
-
}
|
|
2656
|
-
throw new Error(
|
|
2657
|
-
`This project has Slack channels using the Cursor account connection (slackChannel({ cursorAccount: true })) but the host is not signed in to Cursor. ${SIGN_IN_HINT}`
|
|
2658
|
-
);
|
|
2659
|
-
}
|
|
2660
|
-
// Same host split as scm-events: `/v0/slack-events/*` is on api.cursor.com,
|
|
2661
|
-
// not api2 (accountKey.backendUrl 404s these routes).
|
|
2662
|
-
const baseUrl = cursorExternalApiUrl();
|
|
2663
|
-
const baseStateRoot =
|
|
2664
|
-
options.stateRoot ??
|
|
2665
|
-
join(targets[0].runtime.project.rootDir, ".agent-serve");
|
|
2666
|
-
const stateDir = join(baseStateRoot, "cursor-slack");
|
|
2667
|
-
|
|
2668
|
-
// Optional fields may be undefined — the relay JSON-serializes the
|
|
2669
|
-
// registration body, which drops them.
|
|
2670
|
-
const agents: CursorSlackAgentRegistration[] = targets.map((target) => {
|
|
2671
|
-
const policy = target.accountRuntime.options.policy;
|
|
2672
|
-
return {
|
|
2673
|
-
name: target.agentName,
|
|
2674
|
-
iconUrl: target.accountRuntime.options.agentIcon?.url,
|
|
2675
|
-
iconEmoji: target.accountRuntime.options.agentIcon?.emoji,
|
|
2676
|
-
blockExternals: policy?.blockExternals === false ? false : undefined,
|
|
2677
|
-
};
|
|
2678
|
-
});
|
|
2679
|
-
|
|
2680
|
-
const targetByName = new Map(
|
|
2681
|
-
targets.map((target) => [target.agentName.toLowerCase(), target])
|
|
2682
|
-
);
|
|
2683
|
-
const relay = new CursorSlackRelay({
|
|
2684
|
-
baseUrl,
|
|
2685
|
-
apiKey: accountKey.apiKey,
|
|
2686
|
-
agents,
|
|
2687
|
-
stateDir,
|
|
2688
|
-
logger,
|
|
2689
|
-
dispatch: async (envelope) => {
|
|
2690
|
-
const target = targetByName.get(envelope.agentName.toLowerCase());
|
|
2691
|
-
if (target === undefined) {
|
|
2692
|
-
return;
|
|
2693
|
-
}
|
|
2694
|
-
const args = buildChannelHandlerArgs({
|
|
2695
|
-
runtime: target.runtime,
|
|
2696
|
-
channelId: target.channelId,
|
|
2697
|
-
});
|
|
2698
|
-
logger(
|
|
2699
|
-
`[agent-sdk] cursor-slack: dispatching ${formatCursorSlackEventLog(envelope)} → ${target.runtime.slug || "default"}`
|
|
2700
|
-
);
|
|
2701
|
-
await dispatchCursorSlackEnvelope({
|
|
2702
|
-
runtime: target.accountRuntime,
|
|
2703
|
-
envelope,
|
|
2704
|
-
send: args.send,
|
|
2705
|
-
host: args.host,
|
|
2706
|
-
artifacts: args.artifacts,
|
|
2707
|
-
hasContinuationSession: (continuationToken) =>
|
|
2708
|
-
target.runtime.engine.hasContinuationSession(
|
|
2709
|
-
target.channelId,
|
|
2710
|
-
continuationToken
|
|
2711
|
-
),
|
|
2712
|
-
isContinuationBusy: (continuationToken) =>
|
|
2713
|
-
target.runtime.engine.isContinuationBusy(
|
|
2714
|
-
target.channelId,
|
|
2715
|
-
continuationToken
|
|
2716
|
-
),
|
|
2717
|
-
getContinuationLastBotMessageTs: (continuationToken) =>
|
|
2718
|
-
target.runtime.engine.getContinuationLastBotMessageTs(
|
|
2719
|
-
target.channelId,
|
|
2720
|
-
continuationToken
|
|
2721
|
-
),
|
|
2722
|
-
interruptContinuation: (continuationToken) =>
|
|
2723
|
-
target.runtime.engine.interruptContinuation(
|
|
2724
|
-
target.channelId,
|
|
2725
|
-
continuationToken
|
|
2726
|
-
),
|
|
2727
|
-
});
|
|
2728
|
-
},
|
|
2729
|
-
});
|
|
2730
|
-
|
|
2731
|
-
// Bind each channel's outbound transport before consumption starts so the
|
|
2732
|
-
// first reply can post. The consumer id keys thread claims server-side.
|
|
2733
|
-
const consumerId = await relay.resolveConsumerId();
|
|
2734
|
-
for (const target of targets) {
|
|
2735
|
-
target.accountRuntime.transport.bind(
|
|
2736
|
-
createCursorSlackApiCaller({
|
|
2737
|
-
baseUrl,
|
|
2738
|
-
apiKey: accountKey.apiKey,
|
|
2739
|
-
agentName: target.agentName,
|
|
2740
|
-
consumerId,
|
|
2741
|
-
logger,
|
|
2742
|
-
})
|
|
2743
|
-
);
|
|
2744
|
-
}
|
|
2745
|
-
|
|
2746
|
-
relay.start();
|
|
2747
|
-
logger(
|
|
2748
|
-
`[agent-sdk] cursor-slack: relaying Slack for ${targets
|
|
2749
|
-
.map(
|
|
2750
|
-
(target) => `${target.agentName} (${target.runtime.slug || "default"})`
|
|
2751
|
-
)
|
|
2752
|
-
.join(
|
|
2753
|
-
", "
|
|
2754
|
-
)} from ${baseUrl} — mention "@Cursor <agent name> …" in the linked workspace`
|
|
2755
|
-
);
|
|
2756
|
-
return relay;
|
|
2757
|
-
}
|
|
2758
|
-
|
|
2759
2678
|
function buildChannelHandlerArgs(input: {
|
|
2760
2679
|
runtime: MountedRuntime;
|
|
2761
2680
|
channelId: string;
|
|
2762
2681
|
params?: Record<string, string>;
|
|
2763
2682
|
requestIp?: string | null;
|
|
2764
2683
|
auth?: AuthContext | null;
|
|
2684
|
+
hostedSessionId?: string;
|
|
2765
2685
|
}): ChannelHandlerArgs {
|
|
2766
2686
|
const { runtime, channelId } = input;
|
|
2767
2687
|
const base = runtime.slug === "" ? "" : `/${runtime.slug}`;
|
|
@@ -2776,6 +2696,7 @@ function buildChannelHandlerArgs(input: {
|
|
|
2776
2696
|
runtime.engine.send(channelId, message, {
|
|
2777
2697
|
...sendOptions,
|
|
2778
2698
|
auth: sendOptions.auth !== undefined ? sendOptions.auth : auth,
|
|
2699
|
+
hostedSessionId: input.hostedSessionId,
|
|
2779
2700
|
}),
|
|
2780
2701
|
getSession: (sessionId) =>
|
|
2781
2702
|
runtime.engine.getChannelSession(channelId, sessionId),
|
|
@@ -2838,6 +2759,12 @@ async function handleRequest(
|
|
|
2838
2759
|
} catch (error) {
|
|
2839
2760
|
if (error instanceof SessionBusyError) {
|
|
2840
2761
|
response = errorResponse(409, "session_busy", error.message);
|
|
2762
|
+
} else if (error instanceof V2EngineError) {
|
|
2763
|
+
response = errorResponse(
|
|
2764
|
+
409,
|
|
2765
|
+
"v2_identity_conflict",
|
|
2766
|
+
"Control-plane session identity conflicts with existing state."
|
|
2767
|
+
);
|
|
2841
2768
|
} else if (error instanceof SessionAuthError) {
|
|
2842
2769
|
response = errorResponse(403, "forbidden", error.message);
|
|
2843
2770
|
} else {
|