@cursor/july 0.1.93 → 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 +4 -26
- 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/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CjWU-x0z.js → app.CFDEas4I.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Cxy8ySFQ.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Dvq1Bktu.js → theme.Ct4NSiLm.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.DRakGHFe.js +5 -0
- package/dist/docs/assets/{index.md.B-lVR4wT.lean.js → index.md.DRakGHFe.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.Cw6_ICYG.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_skills.md.BFW9retM.js → reference_skills.md.8son6Hjm.js} +3 -3
- 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_pr-autofixer.md.R4K_qytS.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.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/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 +0 -28
- package/dist/docs/llms-full.txt +712 -2830
- package/dist/docs/llms.txt +2 -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 +6 -6
- package/dist/docs/reference/cli.md +2 -1
- 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 +7 -7
- 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 +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +4 -3
- 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 +2 -2
- 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-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- 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/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +88 -13
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +22 -9
- 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/server.d.ts.map +1 -1
- package/dist/internal/server.js +113 -172
- 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 +208 -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-D9MFzhNE.js → index-B3JCyigB.js} +1 -1
- package/dist/playground/index.html +1 -1
- 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 +0 -28
- 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 +2 -1
- 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/pr-autofixer.md +4 -3
- package/docs/templates/security-reviewer.md +2 -3
- 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/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/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/cli-mcp-oauth.ts +6 -4
- 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/discovery.ts +104 -13
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/hosted-delivery.ts +60 -28
- 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/server.ts +151 -251
- package/src/internal/session-engine.ts +254 -69
- package/src/internal/tool-catalog.ts +106 -0
- package/src/types.ts +90 -23
- 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/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/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/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_cli.md.D9KESDsD.lean.js → reference_cli.md.Cw6_ICYG.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_skills.md.BFW9retM.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/{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,
|
|
@@ -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) {
|
|
@@ -2256,6 +2345,7 @@ export function projectInfo(project: AgentProject): AgentProjectInfo {
|
|
|
2256
2345
|
description: tool.description,
|
|
2257
2346
|
execution: tool.execution,
|
|
2258
2347
|
needsApproval: tool.needsApproval,
|
|
2348
|
+
effect: tool.effect,
|
|
2259
2349
|
inputSchema: tool.inputSchema,
|
|
2260
2350
|
})),
|
|
2261
2351
|
skills: agent.skills.map((skill) => ({
|
|
@@ -2265,8 +2355,8 @@ export function projectInfo(project: AgentProject): AgentProjectInfo {
|
|
|
2265
2355
|
connections: agent.connections.map((connection) => ({
|
|
2266
2356
|
name: connection.name,
|
|
2267
2357
|
transport: connectionTransportLabel(connection.transport),
|
|
2268
|
-
hostOnly: connection.hostOnly,
|
|
2269
2358
|
advertiseTools: connection.advertiseTools,
|
|
2359
|
+
effects: connection.effects,
|
|
2270
2360
|
cursorAccountServers:
|
|
2271
2361
|
"cursorAccount" in connection.transport
|
|
2272
2362
|
? (connection.transport.servers ?? "*")
|
|
@@ -2448,6 +2538,7 @@ async function warnUnknownSlots(
|
|
|
2448
2538
|
"tools",
|
|
2449
2539
|
"skills",
|
|
2450
2540
|
"mcp-connections",
|
|
2541
|
+
"host-connections",
|
|
2451
2542
|
// Legacy slot name; resolveMcpConnectionsDir warns and still loads it.
|
|
2452
2543
|
"connections",
|
|
2453
2544
|
"subagents",
|
|
@@ -2457,7 +2548,7 @@ async function warnUnknownSlots(
|
|
|
2457
2548
|
"ab",
|
|
2458
2549
|
"sandbox",
|
|
2459
2550
|
"lib",
|
|
2460
|
-
// Vite playground custom tool chips (
|
|
2551
|
+
// Vite playground custom tool chips (agent/playground/tools).
|
|
2461
2552
|
"playground",
|
|
2462
2553
|
]);
|
|
2463
2554
|
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);
|
|
@@ -170,6 +170,19 @@ export async function dispatchHostedAdmission(
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
function withServerTiming(response: Response, durationMs: number): Response {
|
|
174
|
+
const headers = new Headers(response.headers);
|
|
175
|
+
headers.set(
|
|
176
|
+
"Server-Timing",
|
|
177
|
+
`agent_sdk;desc="hosted";dur=${Math.max(0, durationMs).toFixed(1)}`
|
|
178
|
+
);
|
|
179
|
+
return new Response(response.body, {
|
|
180
|
+
status: response.status,
|
|
181
|
+
statusText: response.statusText,
|
|
182
|
+
headers,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
173
186
|
export function registerHostedDeliveryRoute(input: {
|
|
174
187
|
router: Router;
|
|
175
188
|
base: string;
|
|
@@ -215,22 +228,29 @@ export function registerHostedDeliveryRoute(input: {
|
|
|
215
228
|
pattern: `${input.base}${HOSTED_ADMISSION_PATH}`,
|
|
216
229
|
auth: [auth],
|
|
217
230
|
handler: async (request) => {
|
|
231
|
+
const startedAt = performance.now();
|
|
232
|
+
const finish = (response: Response) =>
|
|
233
|
+
withServerTiming(response, performance.now() - startedAt);
|
|
218
234
|
const delivery = parseHostedAdmission(await readJsonObject(request));
|
|
219
235
|
if (delivery === undefined) {
|
|
220
|
-
return
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
236
|
+
return finish(
|
|
237
|
+
errorResponse(
|
|
238
|
+
400,
|
|
239
|
+
"invalid_hosted_admission",
|
|
240
|
+
"Expected a supported Agent SDK hosted-admission envelope."
|
|
241
|
+
)
|
|
224
242
|
);
|
|
225
243
|
}
|
|
226
244
|
const channel = input.channels.find(
|
|
227
245
|
(candidate) => candidate.id === delivery.channelId
|
|
228
246
|
);
|
|
229
247
|
if (channel === undefined) {
|
|
230
|
-
return
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
248
|
+
return finish(
|
|
249
|
+
errorResponse(
|
|
250
|
+
404,
|
|
251
|
+
"channel_not_found",
|
|
252
|
+
`No channel named "${delivery.channelId}" is mounted.`
|
|
253
|
+
)
|
|
234
254
|
);
|
|
235
255
|
}
|
|
236
256
|
const admitted = await dispatchHostedAdmission({
|
|
@@ -239,7 +259,7 @@ export function registerHostedDeliveryRoute(input: {
|
|
|
239
259
|
args: input.buildHandlerArgs(delivery.channelId),
|
|
240
260
|
});
|
|
241
261
|
if (admitted.pendingSend === undefined) {
|
|
242
|
-
return admitted.response;
|
|
262
|
+
return finish(admitted.response);
|
|
243
263
|
}
|
|
244
264
|
pruneExpired();
|
|
245
265
|
const admissionToken = randomBytes(24).toString("hex");
|
|
@@ -247,12 +267,14 @@ export function registerHostedDeliveryRoute(input: {
|
|
|
247
267
|
send: admitted.pendingSend,
|
|
248
268
|
expiresAt: Date.now() + pendingTtlMs,
|
|
249
269
|
});
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
return finish(
|
|
271
|
+
Response.json({
|
|
272
|
+
ok: true,
|
|
273
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
274
|
+
outcome: "send",
|
|
275
|
+
admissionToken,
|
|
276
|
+
})
|
|
277
|
+
);
|
|
256
278
|
},
|
|
257
279
|
});
|
|
258
280
|
input.router.add({
|
|
@@ -260,31 +282,41 @@ export function registerHostedDeliveryRoute(input: {
|
|
|
260
282
|
pattern: `${input.base}${HOSTED_EXECUTION_PATH}`,
|
|
261
283
|
auth: [auth],
|
|
262
284
|
handler: async (request) => {
|
|
285
|
+
const startedAt = performance.now();
|
|
286
|
+
const finish = (response: Response) =>
|
|
287
|
+
withServerTiming(response, performance.now() - startedAt);
|
|
288
|
+
|
|
263
289
|
const execution = parseHostedExecution(await readJsonObject(request));
|
|
264
290
|
if (execution === undefined) {
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
291
|
+
return finish(
|
|
292
|
+
errorResponse(
|
|
293
|
+
400,
|
|
294
|
+
"invalid_hosted_execution",
|
|
295
|
+
"Expected a supported Agent SDK hosted-execution envelope."
|
|
296
|
+
)
|
|
269
297
|
);
|
|
270
298
|
}
|
|
271
299
|
pruneExpired();
|
|
272
300
|
const admitted = pending.get(execution.admissionToken);
|
|
273
301
|
if (admitted === undefined) {
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
302
|
+
return finish(
|
|
303
|
+
errorResponse(
|
|
304
|
+
409,
|
|
305
|
+
"hosted_admission_unavailable",
|
|
306
|
+
"The hosted admission token is missing or expired."
|
|
307
|
+
)
|
|
278
308
|
);
|
|
279
309
|
}
|
|
280
310
|
if (
|
|
281
311
|
admitted.sessionPublicId !== undefined &&
|
|
282
312
|
admitted.sessionPublicId !== execution.sessionPublicId
|
|
283
313
|
) {
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
314
|
+
return finish(
|
|
315
|
+
errorResponse(
|
|
316
|
+
409,
|
|
317
|
+
"hosted_admission_session_mismatch",
|
|
318
|
+
"The hosted admission token is already bound to another session."
|
|
319
|
+
)
|
|
288
320
|
);
|
|
289
321
|
}
|
|
290
322
|
admitted.sessionPublicId = execution.sessionPublicId;
|
|
@@ -321,7 +353,7 @@ export function registerHostedDeliveryRoute(input: {
|
|
|
321
353
|
};
|
|
322
354
|
})();
|
|
323
355
|
const reply = await admitted.execution;
|
|
324
|
-
return Response.json(reply.body, { status: reply.status });
|
|
356
|
+
return finish(Response.json(reply.body, { status: reply.status }));
|
|
325
357
|
},
|
|
326
358
|
});
|
|
327
359
|
}
|
|
@@ -252,9 +252,9 @@ function buildToolMcpServer(
|
|
|
252
252
|
* travels in the turn's MCP config or lands on the VM.
|
|
253
253
|
*
|
|
254
254
|
* The engine gates access twice, mirroring the authored server-tool path:
|
|
255
|
-
* only bridgeable names (`isCloudBridgedConnection`) —
|
|
256
|
-
*
|
|
257
|
-
*
|
|
255
|
+
* only bridgeable names (`isCloudBridgedConnection`) — unknown names
|
|
256
|
+
* stay unreachable from a VM even with a valid endpoint credential —
|
|
257
|
+
* and only while the bound session has a turn
|
|
258
258
|
* in flight (`hasActiveTurn`), so a credential that persists on a VM after
|
|
259
259
|
* its turn cannot keep calling host connectors. Listing forwards per
|
|
260
260
|
* request, so a server that adds tools mid-session (`tools/list_changed`,
|
package/src/internal/mcp-host.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Host-side MCP clients for authored `agent/mcp-connections
|
|
2
|
+
* Host-side MCP clients for authored `agent/mcp-connections/*` and
|
|
3
|
+
* `agent/host-connections/*`.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Model-visible connections (`mcp-connections/`) are available in three
|
|
6
|
+
* places: SDK `mcpServers`, in-process server tools through
|
|
7
|
+
* {@link HostMcpRegistry} on {@link ToolContext.host}.mcp, and channel /
|
|
8
|
+
* webhook handlers through {@link HostMcpRegistry} on
|
|
9
|
+
* {@link ChannelHandlerArgs.host}.mcp. Host connections skip the model
|
|
10
|
+
* and stay on `host.mcp` plus `mcp oauth`.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -37,7 +37,10 @@ export function collectPeerConnections(
|
|
|
37
37
|
const bySlug = new Map<string, PeerConnectionRef[]>();
|
|
38
38
|
for (const { slug, project } of mounts) {
|
|
39
39
|
const refs: PeerConnectionRef[] = [];
|
|
40
|
-
for (const connection of
|
|
40
|
+
for (const connection of [
|
|
41
|
+
...project.agent.connections,
|
|
42
|
+
...(project.agent.hostConnections ?? []),
|
|
43
|
+
]) {
|
|
41
44
|
if (!isPeerConnectionTransport(connection.transport)) {
|
|
42
45
|
continue;
|
|
43
46
|
}
|
|
@@ -96,9 +96,7 @@ export function renderPlaygroundAsset(file: string): Response {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/** Slack surface summary for the host home / `GET /v1/agents`. */
|
|
99
|
-
export type AgentIndexSlack =
|
|
100
|
-
| { kind: "cursor-account"; handle: string }
|
|
101
|
-
| { kind: "socket" };
|
|
99
|
+
export type AgentIndexSlack = { kind: "socket" };
|
|
102
100
|
|
|
103
101
|
/** One row on the host home page and `GET /v1/agents`. */
|
|
104
102
|
export interface AgentIndexEntry {
|
|
@@ -46,13 +46,13 @@ export function validateMountConnectionsConfig(args: {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
const label = args.slug === "" ? args.project.name : args.slug;
|
|
49
|
-
const
|
|
50
|
-
agent.
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
const hostConnectionNames = new Set(
|
|
50
|
+
(args.project.agent.hostConnections ?? []).map(
|
|
51
|
+
(connection) => connection.name
|
|
52
|
+
)
|
|
53
53
|
);
|
|
54
54
|
const filteredRefs = args.accountRefs.filter(
|
|
55
|
-
(ref) => ref.servers !== undefined && !
|
|
55
|
+
(ref) => ref.servers !== undefined && !hostConnectionNames.has(ref.name)
|
|
56
56
|
);
|
|
57
57
|
if (filteredRefs.length === 0) {
|
|
58
58
|
return;
|
|
@@ -140,10 +140,8 @@ export function resolveMountConnections(args: {
|
|
|
140
140
|
|
|
141
141
|
if (cloudCapable) {
|
|
142
142
|
const hostOauthNames = agent.connections
|
|
143
|
-
.filter(
|
|
144
|
-
(connection)
|
|
145
|
-
connection.hostOnly !== true &&
|
|
146
|
-
isHostOauthConnectionTransport(connection.transport)
|
|
143
|
+
.filter((connection) =>
|
|
144
|
+
isHostOauthConnectionTransport(connection.transport)
|
|
147
145
|
)
|
|
148
146
|
.map((connection) => connection.name);
|
|
149
147
|
if (hostOauthNames.length > 0) {
|
|
@@ -154,7 +152,7 @@ export function resolveMountConnections(args: {
|
|
|
154
152
|
)}) reach cloud turns through the host connection bridge; their tokens stay on this serve host.`
|
|
155
153
|
: `[agent-sdk] warning: agent "${label}" has host-OAuth MCP connections (${hostOauthNames.join(
|
|
156
154
|
", "
|
|
157
|
-
)}) whose tokens live on this serve host; cloud-runtime turns omit them.
|
|
155
|
+
)}) whose tokens live on this serve host; cloud-runtime turns omit them. Serve with a cloud tools URL so they reach turns through the host connection bridge, or drop \`oauth\` and authorize the server another way.`
|
|
158
156
|
);
|
|
159
157
|
}
|
|
160
158
|
}
|