@cursor/july 0.1.93 → 0.1.95
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 +4 -26
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +14 -2
- package/dist/channels/github/types.d.ts +18 -3
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +11 -3
- package/dist/channels/origin/origin-webhook.d.ts +11 -1
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +23 -3
- package/dist/channels/origin/types.d.ts +8 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- 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/pr-ref.d.ts +7 -1
- package/dist/channels/slack/pr-ref.d.ts.map +1 -1
- package/dist/channels/slack/pr-ref.js +42 -23
- 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/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CjWU-x0z.js → app.BBj0klBO.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Cxy8ySFQ.js → VPLocalSearchBox.CUEXpL78.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Dvq1Bktu.js → theme.DabmQnia.js} +2 -2
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
- package/dist/docs/assets/{deployment.md.DoLFAzfm.js → deployment.md.D9msOFOW.js} +3 -8
- package/dist/docs/assets/{deployment.md.DoLFAzfm.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.js → guides_agent-to-agent.md.BDb0t1QV.js} +1 -1
- 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.Bboisykk.js → guides_convert-automation.md.B4sjlodG.js} +1 -1
- package/dist/docs/assets/{guides_github.md.DqJhuaN1.js → guides_github.md.Cnh2mL4a.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
- package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.mqeNKs84.js → guides_slack.md.C32HsdKk.js} +5 -11
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
- package/dist/docs/assets/index.md.BoHaMdeZ.js +5 -0
- package/dist/docs/assets/{index.md.B-lVR4wT.lean.js → index.md.BoHaMdeZ.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.BrmfrrIr.js → quickstart.md.Nj_LjW_a.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.D9KESDsD.js → reference_cli.md.BsMOxDvh.js} +4 -3
- package/dist/docs/assets/{reference_cli.md.D9KESDsD.lean.js → reference_cli.md.BsMOxDvh.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DB6SsN6U.js → reference_connections.md.BH8Oc0D0.js} +5 -5
- package/dist/docs/assets/{reference_connections.md.DB6SsN6U.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.BxN87gCw.js → reference_hooks.md.a8BJxMR5.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_project-layout.md.Bv4KOtlB.js +19 -0
- package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.DuKvkYWG.js → reference_tools.md.BHeXn2id.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.DuKvkYWG.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
- package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +1 -0
- package/dist/docs/deployment.html +7 -12
- package/dist/docs/deployment.md +1 -20
- package/dist/docs/design/agsh.md +406 -0
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.md +2 -2
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +1 -0
- package/dist/docs/guides/convert-automation.html +6 -6
- package/dist/docs/guides/convert-automation.md +1 -1
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +4 -4
- 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 +10 -18
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +9 -15
- package/dist/docs/guides/slack.md +9 -46
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +3 -29
- package/dist/docs/llms-full.txt +756 -2810
- package/dist/docs/llms.txt +3 -16
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/quickstart.md +2 -3
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +8 -7
- package/dist/docs/reference/cli.md +5 -2
- package/dist/docs/reference/connections.html +9 -9
- package/dist/docs/reference/connections.md +15 -11
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/hooks.md +2 -3
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +8 -0
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +8 -6
- package/dist/docs/reference/project-layout.md +5 -1
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/subagents.md +2 -2
- package/dist/docs/reference/tools.html +7 -7
- package/dist/docs/reference/tools.md +19 -3
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +1 -1
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/demo.md +3 -2
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +8 -13
- package/dist/docs/templates/security-help.html +30 -0
- package/dist/docs/templates/security-help.md +65 -0
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/security-reviewer.md +1 -3
- package/dist/docs/templates/triage.html +7 -7
- package/dist/docs/templates/triage.md +2 -6
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/files-backends/cursor-hosted.d.ts +6 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +2 -2
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +5 -0
- 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/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +135 -6
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- package/dist/internal/conversation-mirror.d.ts +82 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +251 -0
- 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/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +13 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +11 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +11 -5
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +110 -15
- package/dist/internal/framework-storage-selection.d.ts +32 -16
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +51 -17
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +33 -1
- package/dist/internal/hosted-delivery.d.ts +4 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +97 -44
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +58 -0
- 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.map +1 -1
- package/dist/internal/review-comments.js +10 -98
- package/dist/internal/scm/pr-url.d.ts +14 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +65 -0
- package/dist/internal/sdk-runner.d.ts +14 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +41 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +123 -174
- package/dist/internal/session-engine.d.ts +45 -10
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +217 -65
- 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-CF7hUDnQ.css +1 -0
- package/dist/playground/assets/{index-D9MFzhNE.js → index-CZA1uEWA.js} +48 -48
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +7 -2
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +2 -2
- package/dist/types.d.ts +72 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/docs/README.md +3 -29
- package/docs/concepts.md +1 -0
- package/docs/deployment.md +1 -20
- package/docs/design/agsh.md +406 -0
- package/docs/guides/agent-to-agent.md +2 -2
- package/docs/guides/cloud-runtime.md +1 -0
- package/docs/guides/convert-automation.md +1 -1
- package/docs/guides/github.md +4 -4
- package/docs/guides/mcp-oauth.md +10 -18
- package/docs/guides/slack.md +10 -47
- package/docs/quickstart.md +2 -3
- package/docs/reference/cli.md +5 -2
- package/docs/reference/connections.md +15 -11
- package/docs/reference/hooks.md +2 -3
- package/docs/reference/http-api.md +8 -0
- package/docs/reference/project-layout.md +5 -1
- package/docs/reference/subagents.md +2 -2
- package/docs/reference/tools.md +19 -3
- package/docs/templates/agentic-owners.md +1 -1
- package/docs/templates/demo.md +3 -2
- package/docs/templates/pr-autofixer.md +8 -13
- package/docs/templates/security-help.md +70 -0
- package/docs/templates/security-reviewer.md +1 -3
- package/docs/templates/triage.md +2 -6
- package/docs/troubleshooting.md +2 -2
- package/package.json +9 -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/github/github-channel.ts +23 -8
- package/src/channels/github/types.ts +19 -2
- package/src/channels/origin/origin-channel.ts +13 -1
- package/src/channels/origin/origin-webhook.ts +27 -3
- package/src/channels/origin/types.ts +8 -0
- 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/pr-ref.ts +56 -25
- 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/files-backends/cursor-hosted.ts +9 -3
- package/src/files.ts +11 -0
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/cli-deploy.ts +171 -7
- package/src/internal/cli-mcp-oauth.ts +6 -4
- package/src/internal/conversation-mirror.ts +330 -0
- 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/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +24 -1
- package/src/internal/deploy-manifest.ts +10 -5
- package/src/internal/discovery.ts +129 -15
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/framework-storage-selection.ts +61 -19
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-delivery-protocol.ts +44 -1
- package/src/internal/hosted-delivery.ts +155 -68
- package/src/internal/hosted-managed-automation.ts +72 -0
- 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 +10 -113
- package/src/internal/scm/pr-url.ts +95 -0
- package/src/internal/sdk-runner.ts +57 -2
- package/src/internal/server.ts +161 -251
- package/src/internal/session-engine.ts +266 -69
- package/src/internal/tool-catalog.ts +106 -0
- package/src/storage-backends/cursor-hosted.ts +10 -3
- package/src/types.ts +90 -23
- package/templates/agentic-owners/README.md +1 -1
- package/templates/agentic-owners/agent/agent.ts +0 -10
- package/templates/agentic-owners/agent/channels/github.ts +5 -14
- package/templates/agentic-owners/agent/lib/config.ts +0 -8
- package/templates/agentic-owners/agent/lib/review.ts +2 -15
- package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
- package/templates/demo/agent/agent.ts +0 -10
- package/templates/pr-autofixer/README.md +0 -2
- package/templates/pr-autofixer/agent/agent.ts +0 -11
- package/templates/pr-autofixer/agent/channels/slack.ts +1 -2
- package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
- package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
- package/templates/security-help/README.md +2 -2
- package/templates/security-help/agent/agent.ts +1 -2
- package/templates/security-help/agent/channels/slack.ts +0 -3
- package/templates/security-help/agent/instructions.md +9 -10
- package/templates/security-help/agent/skills/access-request.md +1 -1
- package/templates/security-help/agent/skills/faq.md +31 -0
- package/templates/security-help/agent/skills/security-playbooks.md +1 -1
- package/templates/security-help/package.json +1 -2
- package/templates/security-reviewer/agent/agent.ts +0 -10
- package/templates/triage/README.md +2 -1
- package/templates/triage/agent/agent.ts +0 -10
- package/templates/triage/agent/channels/queue.ts +1 -1
- package/templates/triage/agent/channels/webhook.ts +1 -3
- 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/chunks/@localSearchIndexroot.ChpIC3Zy.js +0 -1
- package/dist/docs/assets/concepts.md.F6AiPorA.js +0 -1
- package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.js +0 -10
- package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.js +0 -5
- package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.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.BBNw9Ekr.js +0 -8
- package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.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.BzB2b20R.js +0 -22
- package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.lean.js +0 -1
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +0 -2
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +0 -1
- package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.js +0 -11
- package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.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.74pPpWYj.js +0 -19
- package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.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.CaGpmw3Y.js +0 -25
- package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.mqeNKs84.lean.js +0 -1
- package/dist/docs/assets/index.md.B-lVR4wT.js +0 -5
- package/dist/docs/assets/reference_http-api.md.C68BERYr.js +0 -11
- package/dist/docs/assets/reference_http-api.md.C68BERYr.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.WN9nwJht.js +0 -17
- package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.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 -31
- package/dist/docs/example-agents/benny.md +0 -173
- 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 -167
- 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 -48
- package/dist/docs/example-agents/concierge.md +0 -200
- package/dist/docs/example-agents/index.html +0 -28
- package/dist/docs/example-agents/index.md +0 -99
- 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 -297
- 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/dist/playground/assets/index-D9N7-q97.css +0 -1
- package/docs/example-agents/approval-buddy.md +0 -271
- package/docs/example-agents/benny.md +0 -178
- package/docs/example-agents/bugbot.md +0 -234
- package/docs/example-agents/codebase-wiki.md +0 -172
- package/docs/example-agents/codeowners-review.md +0 -197
- package/docs/example-agents/concierge.md +0 -205
- package/docs/example-agents/index.md +0 -104
- 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 -302
- package/src/channels/slack/cursor-account.ts +0 -202
- package/src/internal/cursor-slack-relay.ts +0 -249
- package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
- package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
- package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
- package/templates/security-help/agent/skills/security-first-pass.md +0 -15
- /package/dist/docs/assets/{concepts.md.F6AiPorA.lean.js → concepts.md.lwAgBIMI.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.DqJhuaN1.lean.js → guides_github.md.Cnh2mL4a.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.BrmfrrIr.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
- /package/dist/docs/assets/{reference_hooks.md.BxN87gCw.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.WN9nwJht.lean.js → reference_project-layout.md.Bv4KOtlB.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.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
- /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.vCWwvqcJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +0 -0
|
@@ -50,8 +50,10 @@ import {
|
|
|
50
50
|
type InlineStdioConnectionConfig,
|
|
51
51
|
type InstructionsDefinition,
|
|
52
52
|
isInlineStdioConnection,
|
|
53
|
+
isToolEffect,
|
|
53
54
|
MAX_RUNNING_TURNS_LIMIT,
|
|
54
55
|
type ModelSetting,
|
|
56
|
+
normalizeConnectionEffects,
|
|
55
57
|
normalizeCursorAccountServers,
|
|
56
58
|
type ResolvedAgent,
|
|
57
59
|
type ScheduleDefinition,
|
|
@@ -305,7 +307,7 @@ export async function loadAgentProject(
|
|
|
305
307
|
const hooks = await loadHooks(ctx, join(agentDir, "hooks"));
|
|
306
308
|
const abs = await loadABs(ctx, agentDir);
|
|
307
309
|
const abConfig = await loadABConfig(ctx, agentDir);
|
|
308
|
-
const storage = await loadStorage(ctx, agentDir);
|
|
310
|
+
const storage = await loadStorage(ctx, agentDir, agent.architecture);
|
|
309
311
|
const artifacts = await loadArtifacts(ctx, agentDir);
|
|
310
312
|
const otel = await loadOtel(ctx, agentDir);
|
|
311
313
|
await appendArtifactTool(ctx, agentDir, agent, artifacts);
|
|
@@ -423,6 +425,7 @@ async function loadAgent(
|
|
|
423
425
|
tools: [],
|
|
424
426
|
skills: [],
|
|
425
427
|
connections: [],
|
|
428
|
+
hostConnections: [],
|
|
426
429
|
subagents: [],
|
|
427
430
|
seedFiles: [],
|
|
428
431
|
};
|
|
@@ -434,6 +437,7 @@ async function loadAgent(
|
|
|
434
437
|
ctx,
|
|
435
438
|
await resolveMcpConnectionsDir(ctx, agentDir)
|
|
436
439
|
);
|
|
440
|
+
const hostConnections = await loadHostConnections(ctx, agentDir, connections);
|
|
437
441
|
const seedFiles = await loadSeedFiles(ctx, agentDir);
|
|
438
442
|
const subagents = await loadSubagents(ctx, join(agentDir, "subagents"));
|
|
439
443
|
const runtime = resolveRuntime(ctx, agentDir, config?.runtime);
|
|
@@ -553,7 +557,7 @@ async function loadAgent(
|
|
|
553
557
|
agentTools: tools.filter((tool) => tool.execution === "agent").length,
|
|
554
558
|
skills: skills.length,
|
|
555
559
|
seedFiles: seedFiles.length,
|
|
556
|
-
connections: connections.length,
|
|
560
|
+
connections: connections.length + hostConnections.length,
|
|
557
561
|
subagents: subagents.length,
|
|
558
562
|
hasCloudOptions: cloud !== undefined,
|
|
559
563
|
hasLocalSandbox: localSandbox,
|
|
@@ -576,6 +580,7 @@ async function loadAgent(
|
|
|
576
580
|
tools,
|
|
577
581
|
skills,
|
|
578
582
|
connections,
|
|
583
|
+
hostConnections,
|
|
579
584
|
subagents,
|
|
580
585
|
seedFiles,
|
|
581
586
|
};
|
|
@@ -1143,6 +1148,26 @@ function hasAuthorizationHeader(
|
|
|
1143
1148
|
);
|
|
1144
1149
|
}
|
|
1145
1150
|
|
|
1151
|
+
function parseConnectionEffects(
|
|
1152
|
+
effects: unknown
|
|
1153
|
+
): { ok: true; value: ToolEffect[] | undefined } | { ok: false } {
|
|
1154
|
+
if (effects === undefined) {
|
|
1155
|
+
return { ok: true, value: undefined };
|
|
1156
|
+
}
|
|
1157
|
+
const raw = typeof effects === "string" ? [effects] : effects;
|
|
1158
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
1159
|
+
return { ok: false };
|
|
1160
|
+
}
|
|
1161
|
+
const parsed: ToolEffect[] = [];
|
|
1162
|
+
for (const value of raw) {
|
|
1163
|
+
if (!isToolEffect(value)) {
|
|
1164
|
+
return { ok: false };
|
|
1165
|
+
}
|
|
1166
|
+
parsed.push(value);
|
|
1167
|
+
}
|
|
1168
|
+
return { ok: true, value: normalizeConnectionEffects(parsed) };
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1146
1171
|
function connectionHasSpawnOrRemote(connection: ConnectionDefinition): boolean {
|
|
1147
1172
|
if ("cursorAccount" in connection && connection.cursorAccount === true) {
|
|
1148
1173
|
return true;
|
|
@@ -1265,6 +1290,49 @@ async function resolveMcpConnectionsDir(
|
|
|
1265
1290
|
return preferred;
|
|
1266
1291
|
}
|
|
1267
1292
|
|
|
1293
|
+
async function loadHostConnections(
|
|
1294
|
+
ctx: DiscoveryContext,
|
|
1295
|
+
agentDir: string,
|
|
1296
|
+
modelConnections: readonly DiscoveredConnection[]
|
|
1297
|
+
): Promise<DiscoveredConnection[]> {
|
|
1298
|
+
const hostDir = join(agentDir, "host-connections");
|
|
1299
|
+
const loaded = await loadConnections(ctx, hostDir);
|
|
1300
|
+
const modelNames = new Set(
|
|
1301
|
+
modelConnections.map((connection) => connection.name)
|
|
1302
|
+
);
|
|
1303
|
+
const hostConnections: DiscoveredConnection[] = [];
|
|
1304
|
+
for (const connection of loaded) {
|
|
1305
|
+
if (modelNames.has(connection.name)) {
|
|
1306
|
+
ctx.diagnostics.push({
|
|
1307
|
+
severity: "error",
|
|
1308
|
+
path: displayPath(ctx, join(hostDir, `${connection.name}.ts`)),
|
|
1309
|
+
message: `Host connection "${connection.name}" collides with agent/mcp-connections/${connection.name}. Rename one of them.`,
|
|
1310
|
+
});
|
|
1311
|
+
continue;
|
|
1312
|
+
}
|
|
1313
|
+
if (connection.advertiseTools === true) {
|
|
1314
|
+
ctx.diagnostics.push({
|
|
1315
|
+
severity: "error",
|
|
1316
|
+
path: displayPath(ctx, join(hostDir, `${connection.name}.ts`)),
|
|
1317
|
+
message:
|
|
1318
|
+
"Host connections are off the model. `advertiseTools` cannot apply. Drop it.",
|
|
1319
|
+
});
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
if (connection.auth !== undefined) {
|
|
1323
|
+
ctx.diagnostics.push({
|
|
1324
|
+
severity: "error",
|
|
1325
|
+
path: displayPath(ctx, join(hostDir, `${connection.name}.ts`)),
|
|
1326
|
+
message:
|
|
1327
|
+
"Host connections are off the model. `auth` cannot apply. Use static headers or `oauth: true`.",
|
|
1328
|
+
});
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
hostConnections.push(connection);
|
|
1332
|
+
}
|
|
1333
|
+
return hostConnections;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1268
1336
|
async function loadConnections(
|
|
1269
1337
|
ctx: DiscoveryContext,
|
|
1270
1338
|
connectionsDir: string
|
|
@@ -1292,6 +1360,15 @@ async function loadConnections(
|
|
|
1292
1360
|
continue;
|
|
1293
1361
|
}
|
|
1294
1362
|
const connection = definition as ConnectionDefinition;
|
|
1363
|
+
if (Object.hasOwn(connection, "hostOnly")) {
|
|
1364
|
+
ctx.diagnostics.push({
|
|
1365
|
+
severity: "error",
|
|
1366
|
+
path: displayPath(ctx, entryPath),
|
|
1367
|
+
message:
|
|
1368
|
+
"MCP connection `hostOnly` was removed. Files under `agent/mcp-connections/` are always visible to the model. Put privileged servers in `agent/host-connections/` so only host tools can call them.",
|
|
1369
|
+
});
|
|
1370
|
+
continue;
|
|
1371
|
+
}
|
|
1295
1372
|
if (
|
|
1296
1373
|
isInlineStdioConnection(connection) &&
|
|
1297
1374
|
connectionHasSpawnOrRemote(connection)
|
|
@@ -1336,24 +1413,37 @@ async function loadConnections(
|
|
|
1336
1413
|
});
|
|
1337
1414
|
continue;
|
|
1338
1415
|
}
|
|
1416
|
+
const parsedEffects = parseConnectionEffects(connection.effects);
|
|
1417
|
+
if (!parsedEffects.ok) {
|
|
1418
|
+
ctx.diagnostics.push({
|
|
1419
|
+
severity: "error",
|
|
1420
|
+
path: displayPath(ctx, entryPath),
|
|
1421
|
+
message:
|
|
1422
|
+
'MCP connection `effects` must be "read", "write", or a non-empty array of those.',
|
|
1423
|
+
});
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1339
1426
|
if (
|
|
1340
|
-
|
|
1341
|
-
|
|
1427
|
+
parsedEffects.value !== undefined &&
|
|
1428
|
+
connection.advertiseTools !== true
|
|
1342
1429
|
) {
|
|
1343
1430
|
ctx.diagnostics.push({
|
|
1344
1431
|
severity: "error",
|
|
1345
1432
|
path: displayPath(ctx, entryPath),
|
|
1346
1433
|
message:
|
|
1347
|
-
"MCP connection `
|
|
1434
|
+
"MCP connection `effects` filters advertised tools; set `advertiseTools: true` or drop `effects`.",
|
|
1348
1435
|
});
|
|
1349
1436
|
continue;
|
|
1350
1437
|
}
|
|
1351
|
-
if (
|
|
1438
|
+
if (
|
|
1439
|
+
connection.advertiseTools === true &&
|
|
1440
|
+
isInlineStdioConnection(connection)
|
|
1441
|
+
) {
|
|
1352
1442
|
ctx.diagnostics.push({
|
|
1353
1443
|
severity: "error",
|
|
1354
1444
|
path: displayPath(ctx, entryPath),
|
|
1355
1445
|
message:
|
|
1356
|
-
"MCP connection `advertiseTools`
|
|
1446
|
+
"MCP connection `advertiseTools` is not supported on inline `tools` connections — author those as agent/tools/ server tools instead.",
|
|
1357
1447
|
});
|
|
1358
1448
|
continue;
|
|
1359
1449
|
}
|
|
@@ -1445,9 +1535,9 @@ async function loadConnections(
|
|
|
1445
1535
|
name,
|
|
1446
1536
|
transport,
|
|
1447
1537
|
description: connection.description,
|
|
1448
|
-
hostOnly: connection.hostOnly,
|
|
1449
1538
|
auth: connection.auth,
|
|
1450
1539
|
advertiseTools: connection.advertiseTools,
|
|
1540
|
+
effects: parsedEffects.value,
|
|
1451
1541
|
});
|
|
1452
1542
|
}
|
|
1453
1543
|
return connections;
|
|
@@ -1459,7 +1549,6 @@ async function loadInlineStdioConnection(
|
|
|
1459
1549
|
entryPath: string,
|
|
1460
1550
|
connection: InlineStdioConnectionConfig & {
|
|
1461
1551
|
description?: string;
|
|
1462
|
-
hostOnly?: boolean;
|
|
1463
1552
|
}
|
|
1464
1553
|
): Promise<DiscoveredConnection | undefined> {
|
|
1465
1554
|
const tools = connection.tools;
|
|
@@ -1510,7 +1599,6 @@ async function loadInlineStdioConnection(
|
|
|
1510
1599
|
name,
|
|
1511
1600
|
transport,
|
|
1512
1601
|
description: connection.description,
|
|
1513
|
-
hostOnly: connection.hostOnly,
|
|
1514
1602
|
};
|
|
1515
1603
|
} catch (error) {
|
|
1516
1604
|
ctx.diagnostics.push({
|
|
@@ -1562,6 +1650,7 @@ async function warnUnsupportedSubagentSlots(
|
|
|
1562
1650
|
["tools", "tools"],
|
|
1563
1651
|
["skills", "skills"],
|
|
1564
1652
|
["mcp-connections", "MCP connections"],
|
|
1653
|
+
["host-connections", "host MCP connections"],
|
|
1565
1654
|
["connections", "MCP connections"],
|
|
1566
1655
|
["subagents", "nested subagents"],
|
|
1567
1656
|
["channels", "channels"],
|
|
@@ -1670,8 +1759,8 @@ function checkGrokBotRuntimeLimitations(
|
|
|
1670
1759
|
}
|
|
1671
1760
|
if (counts.connections > 0) {
|
|
1672
1761
|
error(
|
|
1673
|
-
displayPath(ctx,
|
|
1674
|
-
"MCP connections are not wired into grokbot turns yet. Remove them or run the agent on the local runtime."
|
|
1762
|
+
displayPath(ctx, agentDir),
|
|
1763
|
+
"MCP connections (agent/mcp-connections/ or agent/host-connections/) are not wired into grokbot turns yet. Remove them or run the agent on the local runtime."
|
|
1675
1764
|
);
|
|
1676
1765
|
}
|
|
1677
1766
|
if (counts.subagents > 0) {
|
|
@@ -2062,12 +2151,35 @@ async function loadABConfig(
|
|
|
2062
2151
|
|
|
2063
2152
|
async function loadStorage(
|
|
2064
2153
|
ctx: DiscoveryContext,
|
|
2065
|
-
agentDir: string
|
|
2154
|
+
agentDir: string,
|
|
2155
|
+
architecture: AgentArchitecture | undefined
|
|
2066
2156
|
): Promise<StorageDefinition | undefined> {
|
|
2067
2157
|
const path = await findModuleFile(agentDir, "storage");
|
|
2068
2158
|
if (path === undefined) {
|
|
2069
2159
|
return undefined;
|
|
2070
2160
|
}
|
|
2161
|
+
if (architecture === "v2") {
|
|
2162
|
+
// Storage is a hosting-mode decision on v2, made by
|
|
2163
|
+
// framework-storage-selection.ts: the state root when self-hosted,
|
|
2164
|
+
// Cursor-managed storage on Cursor hosting. Fail early (error
|
|
2165
|
+
// diagnostics refuse serve and deploy) rather than silently running
|
|
2166
|
+
// with storage the author believes they configured. Not imported.
|
|
2167
|
+
ctx.diagnostics.push({
|
|
2168
|
+
severity: "error",
|
|
2169
|
+
path: displayPath(ctx, path),
|
|
2170
|
+
message:
|
|
2171
|
+
'agent/storage.ts is not supported on architecture "v2": the platform selects storage (the local state root when self-hosted; Cursor-managed storage on Cursor hosting). Delete the file.',
|
|
2172
|
+
});
|
|
2173
|
+
return undefined;
|
|
2174
|
+
}
|
|
2175
|
+
// v1 keeps loading the authored sink, with notice: defineStorage is going
|
|
2176
|
+
// away with the v1 control plane.
|
|
2177
|
+
ctx.diagnostics.push({
|
|
2178
|
+
severity: "warning",
|
|
2179
|
+
path: displayPath(ctx, path),
|
|
2180
|
+
message:
|
|
2181
|
+
'agent/storage.ts (defineStorage) is deprecated and going away: architecture "v2" selects storage automatically (the local state root when self-hosted; Cursor-managed storage on Cursor hosting). Still honored on v1.',
|
|
2182
|
+
});
|
|
2071
2183
|
const definition = await importDefault(ctx, path, "storage");
|
|
2072
2184
|
return definition as StorageDefinition | undefined;
|
|
2073
2185
|
}
|
|
@@ -2256,6 +2368,7 @@ export function projectInfo(project: AgentProject): AgentProjectInfo {
|
|
|
2256
2368
|
description: tool.description,
|
|
2257
2369
|
execution: tool.execution,
|
|
2258
2370
|
needsApproval: tool.needsApproval,
|
|
2371
|
+
effect: tool.effect,
|
|
2259
2372
|
inputSchema: tool.inputSchema,
|
|
2260
2373
|
})),
|
|
2261
2374
|
skills: agent.skills.map((skill) => ({
|
|
@@ -2265,8 +2378,8 @@ export function projectInfo(project: AgentProject): AgentProjectInfo {
|
|
|
2265
2378
|
connections: agent.connections.map((connection) => ({
|
|
2266
2379
|
name: connection.name,
|
|
2267
2380
|
transport: connectionTransportLabel(connection.transport),
|
|
2268
|
-
hostOnly: connection.hostOnly,
|
|
2269
2381
|
advertiseTools: connection.advertiseTools,
|
|
2382
|
+
effects: connection.effects,
|
|
2270
2383
|
cursorAccountServers:
|
|
2271
2384
|
"cursorAccount" in connection.transport
|
|
2272
2385
|
? (connection.transport.servers ?? "*")
|
|
@@ -2448,6 +2561,7 @@ async function warnUnknownSlots(
|
|
|
2448
2561
|
"tools",
|
|
2449
2562
|
"skills",
|
|
2450
2563
|
"mcp-connections",
|
|
2564
|
+
"host-connections",
|
|
2451
2565
|
// Legacy slot name; resolveMcpConnectionsDir warns and still loads it.
|
|
2452
2566
|
"connections",
|
|
2453
2567
|
"subagents",
|
|
@@ -2457,7 +2571,7 @@ async function warnUnknownSlots(
|
|
|
2457
2571
|
"ab",
|
|
2458
2572
|
"sandbox",
|
|
2459
2573
|
"lib",
|
|
2460
|
-
// Vite playground custom tool chips (
|
|
2574
|
+
// Vite playground custom tool chips (agent/playground/tools).
|
|
2461
2575
|
"playground",
|
|
2462
2576
|
]);
|
|
2463
2577
|
for (const entry of await sortedEntries(agentDir)) {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tiny stdio MCP server used by mcp-host tests.
|
|
3
|
+
*
|
|
4
|
+
* Exposed as the `units` connection so the host can list and call tools
|
|
5
|
+
* over a real stdio transport.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
9
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
|
|
12
|
+
const server = new McpServer({
|
|
13
|
+
name: "weather-units",
|
|
14
|
+
version: "0.1.0",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
server.tool(
|
|
18
|
+
"celsius_to_fahrenheit",
|
|
19
|
+
"Convert a temperature from Celsius to Fahrenheit.",
|
|
20
|
+
{ value: z.number().describe("Temperature in °C") },
|
|
21
|
+
async ({ value }) => {
|
|
22
|
+
const fahrenheit = Math.round((value * 9) / 5 + 32);
|
|
23
|
+
return {
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: "text",
|
|
27
|
+
text: JSON.stringify({ celsius: value, fahrenheit }),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
server.tool(
|
|
35
|
+
"fahrenheit_to_celsius",
|
|
36
|
+
"Convert a temperature from Fahrenheit to Celsius.",
|
|
37
|
+
{ value: z.number().describe("Temperature in Fahrenheit") },
|
|
38
|
+
async ({ value }) => {
|
|
39
|
+
const celsius = Math.round(((value - 32) * 5) / 9);
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: "text",
|
|
44
|
+
text: JSON.stringify({ fahrenheit: value, celsius }),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const transport = new StdioServerTransport();
|
|
52
|
+
await server.connect(transport);
|
|
@@ -2,19 +2,31 @@
|
|
|
2
2
|
* Which backend framework session state is mirrored to.
|
|
3
3
|
*
|
|
4
4
|
* Framework state — session records, event chunks, the continuation index —
|
|
5
|
-
* is how a session outlives the process that served it.
|
|
6
|
-
* exists only when the agent author wrote `agent/storage.ts`,
|
|
7
|
-
* platform durability an agent-level decision: of the
|
|
8
|
-
* some choose `cursorHostedStorage()` and some choose
|
|
9
|
-
* disk, lost on pod replacement), and one selects
|
|
10
|
-
* reading the deployment-id environment variable
|
|
5
|
+
* is how a session outlives the process that served it. On architecture v1
|
|
6
|
+
* that mirror exists only when the agent author wrote `agent/storage.ts`,
|
|
7
|
+
* which makes platform durability an agent-level decision: of the
|
|
8
|
+
* first-party agents, some choose `cursorHostedStorage()` and some choose
|
|
9
|
+
* `fileKv()` (pod-local disk, lost on pod replacement), and one selects
|
|
10
|
+
* between them at runtime by reading the deployment-id environment variable
|
|
11
|
+
* itself.
|
|
11
12
|
*
|
|
12
|
-
* That selection is a hosting-mode question, not an authoring question
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* That selection is a hosting-mode question, not an authoring question.
|
|
14
|
+
* Architecture v2 moves it here: `agent/storage.ts` is rejected at
|
|
15
|
+
* discovery (error diagnostic, so serve and deploy fail early), and the
|
|
16
|
+
* platform picks the default —
|
|
17
|
+
*
|
|
18
|
+
* - **Cursor-managed hosting** (the deployment-generation environment
|
|
19
|
+
* variable is set, same signal that registers `GET /v1/manifest`):
|
|
20
|
+
* the Cursor-hosted backend, so session records, event chunks, `host.kv`,
|
|
21
|
+
* eval runs, and A/B samples land in the control plane and survive pod
|
|
22
|
+
* replacement. The API key resolves through the full credential chain on
|
|
23
|
+
* every call because hosted freeze snapshots listen unsigned and the
|
|
24
|
+
* binder drops the key file after restore.
|
|
25
|
+
* - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
|
|
26
|
+
* is correct when the operator owns the disk.
|
|
27
|
+
*
|
|
28
|
+
* v1 keeps the authored definition (or nothing) so existing deployments are
|
|
29
|
+
* untouched while they run.
|
|
18
30
|
*
|
|
19
31
|
* Local disk is not part of this decision. `<stateRoot>/sessions/<id>/`
|
|
20
32
|
* already holds `session.json` and `events.ndjson` unconditionally, through
|
|
@@ -22,24 +34,54 @@
|
|
|
22
34
|
* pod's filesystem.
|
|
23
35
|
*/
|
|
24
36
|
|
|
25
|
-
import type
|
|
37
|
+
import { defineStorage, type StorageDefinition } from "../storage.js";
|
|
38
|
+
import { cursorHostedStorage } from "../storage-backends/cursor-hosted.js";
|
|
39
|
+
import type { AgentArchitecture } from "../types.js";
|
|
40
|
+
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
41
|
+
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
26
42
|
|
|
27
43
|
export interface FrameworkStorageSelectionInput {
|
|
28
|
-
/** `agent/storage.ts`, when the author wrote one. */
|
|
44
|
+
/** `agent/storage.ts`, when the author wrote one (v1 only: discovery rejects it on v2). */
|
|
29
45
|
readonly authored: StorageDefinition | undefined;
|
|
46
|
+
/** {@link AgentConfig.architecture}; omitted means v1. */
|
|
47
|
+
readonly architecture?: AgentArchitecture | undefined;
|
|
48
|
+
/** Environment override for tests; defaults to `process.env`. */
|
|
49
|
+
readonly env?: Record<string, string | undefined>;
|
|
30
50
|
}
|
|
31
51
|
|
|
32
52
|
/**
|
|
33
53
|
* Pick the backend for framework session state.
|
|
34
54
|
*
|
|
35
55
|
* Returns `undefined` when there is no mirror, in which case the pod's local
|
|
36
|
-
* disk is the only copy
|
|
37
|
-
* deployments.
|
|
56
|
+
* disk is the only copy.
|
|
38
57
|
*/
|
|
39
58
|
export function selectFrameworkStorageDefinition(
|
|
40
59
|
input: FrameworkStorageSelectionInput
|
|
41
60
|
): StorageDefinition | undefined {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
61
|
+
if (input.architecture !== "v2") {
|
|
62
|
+
// v1: the author decides, or there is no mirror.
|
|
63
|
+
return input.authored;
|
|
64
|
+
}
|
|
65
|
+
if (input.authored !== undefined) {
|
|
66
|
+
// Discovery rejects agent/storage.ts on v2 before an engine is built;
|
|
67
|
+
// an authored definition reaching this point is a wiring bug. Raise
|
|
68
|
+
// rather than silently discard what the author believes is configured.
|
|
69
|
+
throw new Error(
|
|
70
|
+
'defineStorage (agent/storage.ts) is not supported on architecture "v2": storage is platform-selected. Delete the file.'
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const env = input.env ?? process.env;
|
|
74
|
+
if (env[AGENT_SERVE_GENERATION_ENV_VAR] === undefined) {
|
|
75
|
+
// Self-hosted v2: the state root is the durable copy.
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return defineStorage({
|
|
79
|
+
name: "cursor-hosted",
|
|
80
|
+
...cursorHostedStorage({
|
|
81
|
+
// Full chain (env → key file → stored login): frozen engines listen
|
|
82
|
+
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this
|
|
83
|
+
// definition is constructed.
|
|
84
|
+
apiKey: () => resolveApiKeySync()?.apiKey,
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
45
87
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A `send()` captured outside the delivery (typically at channel `onStart`,
|
|
5
|
+
* which binds directly to the engine) reached the engine during a hosted
|
|
6
|
+
* admission window. Running it would start a local July session on a
|
|
7
|
+
* sessionless pod — invisible to the control plane, destroyed with the pod —
|
|
8
|
+
* so it fails loudly instead. This is a deterministic authored bug and is
|
|
9
|
+
* surfaced as a non-retryable 422 by the admission route.
|
|
10
|
+
*/
|
|
11
|
+
export class HostedAdmissionLocalSendError extends Error {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(
|
|
14
|
+
"send() reached the local engine during hosted admission. A send " +
|
|
15
|
+
"captured at channel startup (onStart) bypasses hosted capture and " +
|
|
16
|
+
"would run an invisible local session on a sessionless pod. Use the " +
|
|
17
|
+
"per-delivery send passed to the task callback " +
|
|
18
|
+
"(task: (args) => args.send(…)) instead."
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const admissionWindow = new AsyncLocalStorage<true>();
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Run `work` inside the hosted admission window. The context follows the
|
|
27
|
+
* async graph, including `waitUntil` task bodies scheduled during dispatch,
|
|
28
|
+
* so the engine can refuse local sends that bypass the capture stub.
|
|
29
|
+
*/
|
|
30
|
+
export function runDuringHostedAdmission<T>(work: () => T): T {
|
|
31
|
+
return admissionWindow.run(true, work);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** True while executing inside a hosted admission window. */
|
|
35
|
+
export function isDuringHostedAdmission(): boolean {
|
|
36
|
+
return admissionWindow.getStore() === true;
|
|
37
|
+
}
|
|
@@ -3,6 +3,11 @@ export const HOSTED_DELIVERY_HEADER = "x-agent-sdk-hosted-delivery";
|
|
|
3
3
|
export const HOSTED_ADMISSION_PATH = "/v1/internal/hosted-admission";
|
|
4
4
|
export const HOSTED_EXECUTION_PATH = "/v1/internal/hosted-execution";
|
|
5
5
|
|
|
6
|
+
export type HostedAdmissionManagedAutomation = {
|
|
7
|
+
automationUuid: string;
|
|
8
|
+
mcpServerNames: string[];
|
|
9
|
+
};
|
|
10
|
+
|
|
6
11
|
export type HostedAdmission = {
|
|
7
12
|
v: 2;
|
|
8
13
|
channelId: string;
|
|
@@ -12,6 +17,7 @@ export type HostedAdmission = {
|
|
|
12
17
|
sessionMode: "event" | "continuation";
|
|
13
18
|
mailboxContinuationKey: string;
|
|
14
19
|
payload: unknown;
|
|
20
|
+
managedAutomation?: HostedAdmissionManagedAutomation;
|
|
15
21
|
};
|
|
16
22
|
|
|
17
23
|
export type HostedAdmissionOutcome =
|
|
@@ -39,13 +45,49 @@ const DELIVERY_KEYS = new Set([
|
|
|
39
45
|
"sessionMode",
|
|
40
46
|
"mailboxContinuationKey",
|
|
41
47
|
"payload",
|
|
48
|
+
"managedAutomation",
|
|
42
49
|
]);
|
|
50
|
+
const MANAGED_AUTOMATION_KEYS = new Set(["automationUuid", "mcpServerNames"]);
|
|
51
|
+
/** More names than any real automation configures is a malformed envelope. */
|
|
52
|
+
const MANAGED_AUTOMATION_MAX_SERVERS = 64;
|
|
43
53
|
const EXECUTION_KEYS = new Set(["v", "admissionToken", "sessionPublicId"]);
|
|
44
54
|
|
|
45
55
|
function boundedString(value: unknown, max: number): value is string {
|
|
46
56
|
return typeof value === "string" && value.length > 0 && value.length <= max;
|
|
47
57
|
}
|
|
48
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Parse the optional managed-automation slice. Absent → valid (undefined);
|
|
61
|
+
* present-but-malformed → invalid (the whole admission fails closed, the
|
|
62
|
+
* strict posture the rest of the envelope already takes).
|
|
63
|
+
*/
|
|
64
|
+
function parseManagedAutomation(
|
|
65
|
+
value: unknown
|
|
66
|
+
): { managedAutomation?: HostedAdmissionManagedAutomation } | undefined {
|
|
67
|
+
if (value === undefined) {
|
|
68
|
+
return {};
|
|
69
|
+
}
|
|
70
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const body = value as Record<string, unknown>;
|
|
74
|
+
if (
|
|
75
|
+
Object.keys(body).some((key) => !MANAGED_AUTOMATION_KEYS.has(key)) ||
|
|
76
|
+
!boundedString(body.automationUuid, 128) ||
|
|
77
|
+
!Array.isArray(body.mcpServerNames) ||
|
|
78
|
+
body.mcpServerNames.length > MANAGED_AUTOMATION_MAX_SERVERS ||
|
|
79
|
+
!body.mcpServerNames.every((name) => boundedString(name, 256))
|
|
80
|
+
) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
managedAutomation: {
|
|
85
|
+
automationUuid: body.automationUuid,
|
|
86
|
+
mcpServerNames: body.mcpServerNames,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
49
91
|
export function parseHostedAdmission(
|
|
50
92
|
value: unknown
|
|
51
93
|
): HostedAdmission | undefined {
|
|
@@ -62,7 +104,8 @@ export function parseHostedAdmission(
|
|
|
62
104
|
!boundedString(body.eventType, 128) ||
|
|
63
105
|
!boundedString(body.deliveryId, 256) ||
|
|
64
106
|
(body.sessionMode !== "event" && body.sessionMode !== "continuation") ||
|
|
65
|
-
!boundedString(body.mailboxContinuationKey, 512)
|
|
107
|
+
!boundedString(body.mailboxContinuationKey, 512) ||
|
|
108
|
+
parseManagedAutomation(body.managedAutomation) === undefined
|
|
66
109
|
) {
|
|
67
110
|
return undefined;
|
|
68
111
|
}
|