@cursor/july 0.1.92 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -20
- package/README.md +115 -182
- package/dist/channels/deployments/deployments-channel.d.ts +7 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +26 -2
- package/dist/channels/deployments/types.d.ts +8 -0
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/github-channel.d.ts +3 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +28 -56
- package/dist/channels/slack/attachments.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +0 -7
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +4 -7
- package/dist/channels/slack/eval-directive.d.ts +5 -12
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +8 -19
- package/dist/channels/slack/index.d.ts +0 -6
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +0 -6
- package/dist/channels/slack/setup.d.ts +4 -4
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +8 -15
- package/dist/channels/slack/slack-channel.d.ts +6 -13
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +15 -101
- package/dist/channels/slack/types.d.ts +12 -79
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/types.js +1 -15
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +12 -0
- package/dist/connections.d.ts +18 -9
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -8
- package/dist/continuation.d.ts +1 -1
- package/dist/continuation.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +8 -8
- package/dist/docs/ab.md +7 -13
- package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
- package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
- package/dist/docs/assets/{app.Bci6CM9E.js → app.CFDEas4I.js} +1 -1
- package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
- package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Ct4NSiLm.js} +2 -2
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
- package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.lwAgBIMI.lean.js} +1 -1
- package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.D9msOFOW.js} +9 -14
- package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
- package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.BDb0t1QV.js} +2 -2
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
- package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.B4sjlodG.js} +2 -2
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.Cnh2mL4a.js} +5 -5
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.Cnh2mL4a.lean.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.C32HsdKk.js} +7 -13
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
- package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
- package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.DRakGHFe.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.Nj_LjW_a.js} +2 -2
- package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.Cw6_ICYG.js} +10 -11
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.BH8Oc0D0.js} +7 -7
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +14 -0
- package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
- package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.8son6Hjm.js} +4 -4
- package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.BHeXn2id.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
- package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +7 -7
- package/dist/docs/building-with-agents.md +5 -11
- package/dist/docs/concepts.html +5 -8
- package/dist/docs/concepts.md +13 -17
- package/dist/docs/deployment.html +13 -18
- package/dist/docs/deployment.md +9 -30
- package/dist/docs/design/agsh.md +406 -0
- package/dist/docs/evals.html +10 -10
- package/dist/docs/evals.md +16 -37
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.md +3 -3
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +9 -25
- package/dist/docs/guides/convert-automation.html +7 -7
- package/dist/docs/guides/convert-automation.md +4 -4
- package/dist/docs/guides/github.html +9 -9
- package/dist/docs/guides/github.md +16 -28
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +11 -13
- package/dist/docs/guides/mcp-oauth.md +14 -22
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +11 -17
- package/dist/docs/guides/slack.md +13 -50
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/guides/webhooks.md +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +1 -1
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +0 -36
- package/dist/docs/llms-full.txt +965 -3633
- package/dist/docs/llms.txt +3 -18
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/quickstart.md +3 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +10 -15
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +20 -31
- package/dist/docs/reference/cli.html +14 -15
- package/dist/docs/reference/cli.md +29 -38
- package/dist/docs/reference/connections.html +11 -11
- package/dist/docs/reference/connections.md +24 -25
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/hooks.md +12 -17
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/http-api.md +25 -37
- package/dist/docs/reference/instructions.html +6 -6
- package/dist/docs/reference/instructions.md +1 -1
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +14 -19
- package/dist/docs/reference/project-layout.html +9 -7
- package/dist/docs/reference/project-layout.md +7 -3
- package/dist/docs/reference/prompt.html +6 -6
- package/dist/docs/reference/prompt.md +1 -1
- package/dist/docs/reference/schedules.html +6 -6
- package/dist/docs/reference/schedules.md +1 -2
- package/dist/docs/reference/sessions.html +5 -12
- package/dist/docs/reference/sessions.md +8 -19
- package/dist/docs/reference/skills.html +8 -8
- package/dist/docs/reference/skills.md +3 -3
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/subagents.md +2 -2
- package/dist/docs/reference/tools.html +8 -8
- package/dist/docs/reference/tools.md +30 -19
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +4 -5
- package/dist/docs/storage.html +9 -9
- package/dist/docs/storage.md +37 -80
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +2 -2
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -9
- package/dist/docs/templates/security-reviewer.html +5 -5
- package/dist/docs/templates/security-reviewer.md +2 -3
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +11 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +47 -9
- package/dist/internal/authored-alias-hooks.d.ts +14 -11
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +14 -11
- package/dist/internal/authored-loaders.d.ts +7 -6
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +14 -10
- package/dist/internal/cli-deploy.d.ts +1 -1
- package/dist/internal/cli-deploy.js +5 -5
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- package/dist/internal/continuation-channel.d.ts +6 -3
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +44 -40
- package/dist/internal/continuation-identity.d.ts +17 -16
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +109 -36
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +26 -15
- package/dist/internal/convert-automation/slug.d.ts +0 -2
- package/dist/internal/convert-automation/slug.d.ts.map +1 -1
- package/dist/internal/convert-automation/slug.js +0 -8
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +5 -1
- package/dist/internal/deploy-manifest.d.ts +2 -2
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +4 -9
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +91 -13
- package/dist/internal/distribution.d.ts +4 -3
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +4 -3
- package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +70 -0
- package/dist/internal/hosted-delivery.d.ts +35 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +239 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -1
- package/dist/internal/mcp-endpoint.js +3 -3
- package/dist/internal/mcp-host.d.ts +8 -7
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +8 -7
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +5 -1
- package/dist/internal/playground/static.d.ts +0 -3
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +5 -7
- package/dist/internal/review-comments.d.ts +186 -63
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +350 -168
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +134 -175
- package/dist/internal/session-engine.d.ts +50 -10
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +221 -68
- package/dist/internal/shallow-clone.d.ts +8 -2
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +17 -10
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +67 -0
- package/dist/playground/assets/{index-DDvyC2z6.js → index-B3JCyigB.js} +2 -2
- package/dist/playground/index.html +1 -1
- package/dist/types.d.ts +81 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/docs/README.md +0 -36
- package/docs/ab.md +7 -13
- package/docs/building-with-agents.md +5 -11
- package/docs/concepts.md +13 -17
- package/docs/deployment.md +9 -30
- package/docs/design/agsh.md +406 -0
- package/docs/evals.md +16 -37
- package/docs/guides/agent-to-agent.md +3 -3
- package/docs/guides/cloud-runtime.md +9 -25
- package/docs/guides/convert-automation.md +4 -4
- package/docs/guides/github.md +16 -28
- package/docs/guides/mcp-oauth.md +14 -22
- package/docs/guides/slack.md +14 -51
- package/docs/guides/webhooks.md +3 -3
- package/docs/hillclimbing.md +1 -1
- package/docs/quickstart.md +3 -4
- package/docs/reference/agent-config.md +10 -15
- package/docs/reference/channels.md +20 -31
- package/docs/reference/cli.md +29 -38
- package/docs/reference/connections.md +24 -25
- package/docs/reference/hooks.md +12 -17
- package/docs/reference/http-api.md +26 -38
- package/docs/reference/instructions.md +1 -1
- package/docs/reference/playground.md +14 -19
- package/docs/reference/project-layout.md +7 -3
- package/docs/reference/prompt.md +1 -1
- package/docs/reference/schedules.md +1 -2
- package/docs/reference/sessions.md +8 -19
- package/docs/reference/skills.md +3 -3
- package/docs/reference/subagents.md +2 -2
- package/docs/reference/tools.md +30 -19
- package/docs/scaffolding-agents.md +4 -5
- package/docs/storage.md +37 -80
- package/docs/templates/agentic-owners.md +2 -2
- package/docs/templates/pr-autofixer.md +7 -9
- package/docs/templates/security-reviewer.md +2 -3
- package/docs/troubleshooting.md +8 -8
- package/package.json +16 -2
- package/skills/create-agent/SKILL.md +6 -13
- package/skills/debug/SKILL.md +2 -4
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +3 -2
- package/skills/mcp-auth/SKILL.md +10 -13
- package/skills/setup-slack/SKILL.md +21 -137
- package/src/channels/deployments/deployments-channel.ts +32 -2
- package/src/channels/deployments/types.ts +8 -0
- package/src/channels/github/github-channel.ts +71 -21
- package/src/channels/slack/attachments.ts +2 -2
- package/src/channels/slack/dispatch.ts +2 -16
- package/src/channels/slack/eval-directive.ts +8 -27
- package/src/channels/slack/index.ts +0 -6
- package/src/channels/slack/setup.ts +8 -15
- package/src/channels/slack/slack-channel.ts +14 -125
- package/src/channels/slack/types.ts +12 -96
- package/src/client.ts +23 -0
- package/src/connections.ts +20 -7
- package/src/continuation.ts +1 -1
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/authored-alias-hooks.ts +14 -11
- package/src/internal/authored-loaders.ts +14 -10
- package/src/internal/cli-deploy.ts +5 -5
- package/src/internal/cli-mcp-oauth.ts +6 -4
- package/src/internal/continuation-channel.ts +62 -45
- package/src/internal/continuation-identity.ts +123 -38
- package/src/internal/convert-automation/convert-workflow.ts +29 -17
- package/src/internal/convert-automation/slug.ts +0 -9
- package/src/internal/cursor/account-mcp.ts +4 -1
- package/src/internal/deploy-manifest.ts +5 -9
- package/src/internal/discovery.ts +107 -13
- package/src/internal/distribution.ts +4 -3
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/hosted-delivery-protocol.ts +114 -0
- package/src/internal/hosted-delivery.ts +359 -0
- package/src/internal/http-channel.ts +0 -2
- package/src/internal/mcp-endpoint.ts +3 -3
- package/src/internal/mcp-host.ts +8 -7
- package/src/internal/peer-connections.ts +4 -1
- package/src/internal/playground/static.ts +1 -3
- package/src/internal/resolved-connections.ts +8 -10
- package/src/internal/review-comments.ts +542 -229
- package/src/internal/server.ts +180 -253
- package/src/internal/session-engine.ts +279 -70
- package/src/internal/shallow-clone.ts +30 -16
- package/src/internal/tool-catalog.ts +106 -0
- package/src/types.ts +99 -40
- package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
- package/templates/triage/README.md +2 -1
- package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
- package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
- package/dist/channels/slack/cursor-account.d.ts +0 -87
- package/dist/channels/slack/cursor-account.d.ts.map +0 -1
- package/dist/channels/slack/cursor-account.js +0 -100
- package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
- package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
- package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.js +0 -10
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.js +0 -7
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.lean.js +0 -1
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.js +0 -8
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.lean.js +0 -1
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.js +0 -23
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.lean.js +0 -1
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.js +0 -11
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.lean.js +0 -1
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.js +0 -19
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.lean.js +0 -1
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.js +0 -25
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.DiUmk_Oi.lean.js +0 -1
- package/dist/docs/assets/index.md.BAaMXLFd.js +0 -5
- package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.js +0 -17
- package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
- package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
- package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
- package/dist/docs/example-agents/approval-buddy.html +0 -36
- package/dist/docs/example-agents/approval-buddy.md +0 -266
- package/dist/docs/example-agents/benny.html +0 -33
- package/dist/docs/example-agents/benny.md +0 -182
- package/dist/docs/example-agents/bugbot.html +0 -37
- package/dist/docs/example-agents/bugbot.md +0 -229
- package/dist/docs/example-agents/codebase-wiki.html +0 -34
- package/dist/docs/example-agents/codebase-wiki.md +0 -170
- package/dist/docs/example-agents/codeowners-review.html +0 -34
- package/dist/docs/example-agents/codeowners-review.md +0 -192
- package/dist/docs/example-agents/concierge.html +0 -49
- package/dist/docs/example-agents/concierge.md +0 -201
- package/dist/docs/example-agents/fsd.html +0 -41
- package/dist/docs/example-agents/fsd.md +0 -329
- package/dist/docs/example-agents/index.html +0 -28
- package/dist/docs/example-agents/index.md +0 -102
- package/dist/docs/example-agents/knowledge-base.html +0 -37
- package/dist/docs/example-agents/knowledge-base.md +0 -168
- package/dist/docs/example-agents/oncall.html +0 -36
- package/dist/docs/example-agents/oncall.md +0 -212
- package/dist/docs/example-agents/security-reviewer.html +0 -45
- package/dist/docs/example-agents/security-reviewer.md +0 -265
- package/dist/docs/example-agents/slack-agent.html +0 -31
- package/dist/docs/example-agents/slack-agent.md +0 -142
- package/dist/docs/example-agents/weather-agent.html +0 -51
- package/dist/docs/example-agents/weather-agent.md +0 -296
- package/dist/internal/cursor-slack-relay.d.ts +0 -96
- package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
- package/dist/internal/cursor-slack-relay.js +0 -176
- package/docs/example-agents/approval-buddy.md +0 -271
- package/docs/example-agents/benny.md +0 -187
- package/docs/example-agents/bugbot.md +0 -234
- package/docs/example-agents/codebase-wiki.md +0 -175
- package/docs/example-agents/codeowners-review.md +0 -197
- package/docs/example-agents/concierge.md +0 -206
- package/docs/example-agents/fsd.md +0 -334
- package/docs/example-agents/index.md +0 -107
- package/docs/example-agents/knowledge-base.md +0 -173
- package/docs/example-agents/oncall.md +0 -217
- package/docs/example-agents/security-reviewer.md +0 -270
- package/docs/example-agents/slack-agent.md +0 -147
- package/docs/example-agents/weather-agent.md +0 -301
- package/src/channels/slack/cursor-account.ts +0 -202
- package/src/internal/cursor-slack-relay.ts +0 -249
- /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
- /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import {
|
|
3
|
+
dispatchGitHubWebhook,
|
|
4
|
+
getGitHubChannelOptions,
|
|
5
|
+
getGitHubDispatchOutcome,
|
|
6
|
+
withPropagatingGitHubBackgroundErrors,
|
|
7
|
+
} from "../channels/github/github-channel.js";
|
|
8
|
+
import type {
|
|
9
|
+
AuthPolicy,
|
|
10
|
+
ChannelHandlerArgs,
|
|
11
|
+
SendMessageOptions,
|
|
12
|
+
} from "../types.js";
|
|
13
|
+
import {
|
|
14
|
+
HOSTED_ADMISSION_PATH,
|
|
15
|
+
HOSTED_DELIVERY_HEADER,
|
|
16
|
+
HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
17
|
+
HOSTED_EXECUTION_PATH,
|
|
18
|
+
type HostedAdmission,
|
|
19
|
+
parseHostedAdmission,
|
|
20
|
+
parseHostedExecution,
|
|
21
|
+
} from "./hosted-delivery-protocol.js";
|
|
22
|
+
import { errorResponse, readJsonObject } from "./http-channel.js";
|
|
23
|
+
import type { Router } from "./router.js";
|
|
24
|
+
|
|
25
|
+
type DispatchInput = {
|
|
26
|
+
delivery: HostedAdmission;
|
|
27
|
+
definition: object;
|
|
28
|
+
args: ChannelHandlerArgs;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type PendingSend = {
|
|
32
|
+
channelId: string;
|
|
33
|
+
message: string;
|
|
34
|
+
options: SendMessageOptions;
|
|
35
|
+
mailboxContinuationKey: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type AdmissionDispatch = {
|
|
39
|
+
response: Response;
|
|
40
|
+
pendingSend?: PendingSend;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type ExecutionReply = {
|
|
44
|
+
status: number;
|
|
45
|
+
body: Record<string, unknown>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
class HostedSendAdmitted extends Error {
|
|
49
|
+
constructor(
|
|
50
|
+
readonly prompt: string,
|
|
51
|
+
readonly options: SendMessageOptions
|
|
52
|
+
) {
|
|
53
|
+
super("hosted channel admitted a send");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Run authored admission without creating a framework session. V1 GitHub
|
|
59
|
+
* `task` callbacks execute as sessionless work; `send` is captured and
|
|
60
|
+
* resumed only after the control plane allocates `ses_…`.
|
|
61
|
+
*/
|
|
62
|
+
export async function dispatchHostedAdmission(
|
|
63
|
+
input: DispatchInput
|
|
64
|
+
): Promise<AdmissionDispatch> {
|
|
65
|
+
const github = getGitHubChannelOptions(input.definition);
|
|
66
|
+
if (github === undefined) {
|
|
67
|
+
return {
|
|
68
|
+
response: Response.json(
|
|
69
|
+
{ ok: false, error: "channel_kind_mismatch" },
|
|
70
|
+
{ status: 422 }
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const background: Promise<unknown>[] = [];
|
|
76
|
+
let deferredSend: HostedSendAdmitted | undefined;
|
|
77
|
+
const args = withPropagatingGitHubBackgroundErrors({
|
|
78
|
+
...input.args,
|
|
79
|
+
send: async (message, options = {}) => {
|
|
80
|
+
throw new HostedSendAdmitted(message, options);
|
|
81
|
+
},
|
|
82
|
+
waitUntil: (promise) => {
|
|
83
|
+
background.push(
|
|
84
|
+
promise.catch((error: unknown) => {
|
|
85
|
+
if (error instanceof HostedSendAdmitted) {
|
|
86
|
+
deferredSend = error;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
let dispatched: Response;
|
|
95
|
+
try {
|
|
96
|
+
dispatched = await dispatchGitHubWebhook({
|
|
97
|
+
options: github,
|
|
98
|
+
eventName: input.delivery.eventType,
|
|
99
|
+
payload: input.delivery.payload,
|
|
100
|
+
deliveryId: input.delivery.deliveryId,
|
|
101
|
+
args,
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
if (error instanceof HostedSendAdmitted) {
|
|
105
|
+
return {
|
|
106
|
+
response: Response.json({
|
|
107
|
+
ok: true,
|
|
108
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
109
|
+
outcome: "send",
|
|
110
|
+
}),
|
|
111
|
+
pendingSend: {
|
|
112
|
+
channelId: input.delivery.channelId,
|
|
113
|
+
message: error.prompt,
|
|
114
|
+
options: error.options,
|
|
115
|
+
mailboxContinuationKey: input.delivery.mailboxContinuationKey,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
if (!dispatched.ok) {
|
|
122
|
+
return {
|
|
123
|
+
response: Response.json(
|
|
124
|
+
{ ok: false, error: "channel_dispatch_failed" },
|
|
125
|
+
{ status: dispatched.status >= 400 ? dispatched.status : 502 }
|
|
126
|
+
),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
await Promise.all(background);
|
|
132
|
+
} catch {
|
|
133
|
+
return {
|
|
134
|
+
response: Response.json(
|
|
135
|
+
{ ok: false, error: "background_dispatch_failed" },
|
|
136
|
+
{ status: 503 }
|
|
137
|
+
),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (deferredSend !== undefined) {
|
|
141
|
+
return {
|
|
142
|
+
response: Response.json({
|
|
143
|
+
ok: true,
|
|
144
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
145
|
+
outcome: "send",
|
|
146
|
+
}),
|
|
147
|
+
pendingSend: {
|
|
148
|
+
channelId: input.delivery.channelId,
|
|
149
|
+
message: deferredSend.prompt,
|
|
150
|
+
options: deferredSend.options,
|
|
151
|
+
mailboxContinuationKey: input.delivery.mailboxContinuationKey,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const outcome = getGitHubDispatchOutcome(dispatched);
|
|
156
|
+
if (outcome === undefined) {
|
|
157
|
+
return {
|
|
158
|
+
response: Response.json(
|
|
159
|
+
{ ok: false, error: "channel_outcome_missing" },
|
|
160
|
+
{ status: 502 }
|
|
161
|
+
),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
response: Response.json({
|
|
166
|
+
ok: true,
|
|
167
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
168
|
+
outcome,
|
|
169
|
+
}),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
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
|
+
|
|
186
|
+
export function registerHostedDeliveryRoute(input: {
|
|
187
|
+
router: Router;
|
|
188
|
+
base: string;
|
|
189
|
+
channels: Array<{ id: string; definition: object }>;
|
|
190
|
+
buildHandlerArgs(
|
|
191
|
+
channelId: string,
|
|
192
|
+
sessionPublicId?: string
|
|
193
|
+
): ChannelHandlerArgs;
|
|
194
|
+
}): void {
|
|
195
|
+
const pending = new Map<
|
|
196
|
+
string,
|
|
197
|
+
{
|
|
198
|
+
send: PendingSend;
|
|
199
|
+
expiresAt: number;
|
|
200
|
+
sessionPublicId?: string;
|
|
201
|
+
execution?: Promise<ExecutionReply>;
|
|
202
|
+
}
|
|
203
|
+
>();
|
|
204
|
+
const pendingTtlMs = 10 * 60_000;
|
|
205
|
+
const pruneExpired = () => {
|
|
206
|
+
const now = Date.now();
|
|
207
|
+
for (const [token, item] of pending) {
|
|
208
|
+
if (item.expiresAt <= now) {
|
|
209
|
+
pending.delete(token);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// Hosted callers reach this only through AnyRun's signed pod-port URL.
|
|
215
|
+
// The marker is a second, route-specific fence distinct from channel auth.
|
|
216
|
+
const auth: AuthPolicy = (request) => {
|
|
217
|
+
if (request.headers.get(HOSTED_DELIVERY_HEADER) !== "1") {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
authenticator: "app",
|
|
222
|
+
principalId: "agent-sdk:hosted-delivery",
|
|
223
|
+
principalType: "runtime",
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
input.router.add({
|
|
227
|
+
method: "POST",
|
|
228
|
+
pattern: `${input.base}${HOSTED_ADMISSION_PATH}`,
|
|
229
|
+
auth: [auth],
|
|
230
|
+
handler: async (request) => {
|
|
231
|
+
const startedAt = performance.now();
|
|
232
|
+
const finish = (response: Response) =>
|
|
233
|
+
withServerTiming(response, performance.now() - startedAt);
|
|
234
|
+
const delivery = parseHostedAdmission(await readJsonObject(request));
|
|
235
|
+
if (delivery === undefined) {
|
|
236
|
+
return finish(
|
|
237
|
+
errorResponse(
|
|
238
|
+
400,
|
|
239
|
+
"invalid_hosted_admission",
|
|
240
|
+
"Expected a supported Agent SDK hosted-admission envelope."
|
|
241
|
+
)
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
const channel = input.channels.find(
|
|
245
|
+
(candidate) => candidate.id === delivery.channelId
|
|
246
|
+
);
|
|
247
|
+
if (channel === undefined) {
|
|
248
|
+
return finish(
|
|
249
|
+
errorResponse(
|
|
250
|
+
404,
|
|
251
|
+
"channel_not_found",
|
|
252
|
+
`No channel named "${delivery.channelId}" is mounted.`
|
|
253
|
+
)
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
const admitted = await dispatchHostedAdmission({
|
|
257
|
+
delivery,
|
|
258
|
+
definition: channel.definition,
|
|
259
|
+
args: input.buildHandlerArgs(delivery.channelId),
|
|
260
|
+
});
|
|
261
|
+
if (admitted.pendingSend === undefined) {
|
|
262
|
+
return finish(admitted.response);
|
|
263
|
+
}
|
|
264
|
+
pruneExpired();
|
|
265
|
+
const admissionToken = randomBytes(24).toString("hex");
|
|
266
|
+
pending.set(admissionToken, {
|
|
267
|
+
send: admitted.pendingSend,
|
|
268
|
+
expiresAt: Date.now() + pendingTtlMs,
|
|
269
|
+
});
|
|
270
|
+
return finish(
|
|
271
|
+
Response.json({
|
|
272
|
+
ok: true,
|
|
273
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
274
|
+
outcome: "send",
|
|
275
|
+
admissionToken,
|
|
276
|
+
})
|
|
277
|
+
);
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
input.router.add({
|
|
281
|
+
method: "POST",
|
|
282
|
+
pattern: `${input.base}${HOSTED_EXECUTION_PATH}`,
|
|
283
|
+
auth: [auth],
|
|
284
|
+
handler: async (request) => {
|
|
285
|
+
const startedAt = performance.now();
|
|
286
|
+
const finish = (response: Response) =>
|
|
287
|
+
withServerTiming(response, performance.now() - startedAt);
|
|
288
|
+
|
|
289
|
+
const execution = parseHostedExecution(await readJsonObject(request));
|
|
290
|
+
if (execution === undefined) {
|
|
291
|
+
return finish(
|
|
292
|
+
errorResponse(
|
|
293
|
+
400,
|
|
294
|
+
"invalid_hosted_execution",
|
|
295
|
+
"Expected a supported Agent SDK hosted-execution envelope."
|
|
296
|
+
)
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
pruneExpired();
|
|
300
|
+
const admitted = pending.get(execution.admissionToken);
|
|
301
|
+
if (admitted === undefined) {
|
|
302
|
+
return finish(
|
|
303
|
+
errorResponse(
|
|
304
|
+
409,
|
|
305
|
+
"hosted_admission_unavailable",
|
|
306
|
+
"The hosted admission token is missing or expired."
|
|
307
|
+
)
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
if (
|
|
311
|
+
admitted.sessionPublicId !== undefined &&
|
|
312
|
+
admitted.sessionPublicId !== execution.sessionPublicId
|
|
313
|
+
) {
|
|
314
|
+
return finish(
|
|
315
|
+
errorResponse(
|
|
316
|
+
409,
|
|
317
|
+
"hosted_admission_session_mismatch",
|
|
318
|
+
"The hosted admission token is already bound to another session."
|
|
319
|
+
)
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
admitted.sessionPublicId = execution.sessionPublicId;
|
|
323
|
+
admitted.execution ??= (async (): Promise<ExecutionReply> => {
|
|
324
|
+
const args = input.buildHandlerArgs(
|
|
325
|
+
admitted.send.channelId,
|
|
326
|
+
execution.sessionPublicId
|
|
327
|
+
);
|
|
328
|
+
const session = await args.send(admitted.send.message, {
|
|
329
|
+
...admitted.send.options,
|
|
330
|
+
mailboxContinuation: {
|
|
331
|
+
key: admitted.send.mailboxContinuationKey,
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
const outcome = await session.waitForCompletion();
|
|
335
|
+
if (outcome.status !== "finished") {
|
|
336
|
+
return {
|
|
337
|
+
status: 503,
|
|
338
|
+
body: {
|
|
339
|
+
ok: false,
|
|
340
|
+
error: "turn_failed",
|
|
341
|
+
turnStatus: outcome.status,
|
|
342
|
+
message: outcome.errorMessage,
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
status: 200,
|
|
348
|
+
body: {
|
|
349
|
+
ok: true,
|
|
350
|
+
v: HOSTED_DELIVERY_PROTOCOL_VERSION,
|
|
351
|
+
outcome: "send",
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
})();
|
|
355
|
+
const reply = await admitted.execution;
|
|
356
|
+
return finish(Response.json(reply.body, { status: reply.status }));
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
}
|
|
@@ -16,7 +16,6 @@ import type {
|
|
|
16
16
|
AuthContext,
|
|
17
17
|
AuthPolicy,
|
|
18
18
|
HttpChannelDefinition,
|
|
19
|
-
JsonValue,
|
|
20
19
|
SessionRecord,
|
|
21
20
|
} from "../types.js";
|
|
22
21
|
import { samePrincipal } from "./auth.js";
|
|
@@ -101,7 +100,6 @@ export function buildHttpChannelRoutes(args: {
|
|
|
101
100
|
const cloud = readCloudOptions(body.cloud);
|
|
102
101
|
const session = await engine.send(HTTP_CHANNEL_ID, message, {
|
|
103
102
|
auth: ctx.auth,
|
|
104
|
-
...(body.state === undefined ? {} : { state: body.state as JsonValue }),
|
|
105
103
|
...(typeof body.title === "string" ? { title: body.title } : {}),
|
|
106
104
|
...(body.purpose === "eval" ? { purpose: "eval" as const } : {}),
|
|
107
105
|
...(body.dryRun === true ? { dryRun: true } : {}),
|
|
@@ -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
|
}
|