@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
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
# Explore the full Agent SDK surface with a weather agent
|
|
2
|
-
|
|
3
|
-
The weather agent is the broadest small example in the repository. It fetches
|
|
4
|
-
live conditions and forecasts, converts units through MCP, writes notes in a
|
|
5
|
-
session workspace, and runs from HTTP, Slack, a schedule, and the MCP endpoint.
|
|
6
|
-
|
|
7
|
-
Use this project when you want to see how the Agent SDK's filesystem pieces fit
|
|
8
|
-
together before you design a larger agent.
|
|
9
|
-
|
|
10
|
-
[Browse the weather agent source.](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/weather-agent/)
|
|
11
|
-
|
|
12
|
-
## See the runtime features together
|
|
13
|
-
|
|
14
|
-
Most examples focus on one feature. Weather agent puts the major runtime
|
|
15
|
-
features side by side:
|
|
16
|
-
|
|
17
|
-
| Capability | Source | Role |
|
|
18
|
-
| --- | --- | --- |
|
|
19
|
-
| Root config and instructions | [`agent/agent.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/agent.ts), [`agent/instructions.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/instructions.md) | Select the cloud runtime and route each request. |
|
|
20
|
-
| Server tools | [`agent/tools/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/weather-agent/agent/tools/) | Fetch Open-Meteo data and call MCP from the serve host. |
|
|
21
|
-
| Agent tool | [`save_weather_note.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/tools/save_weather_note.ts) | Run a Python script inside the session workspace. |
|
|
22
|
-
| Stdio MCP | [`units.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/mcp-connections/units.ts), [`probe.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/mcp-connections/probe.ts) | Expose conversion tools to the model, host tools, and channel handlers. Author VM-side probe tools as TypeScript `execute` functions. |
|
|
23
|
-
| Custom HTTP | [`webhook.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/channels/webhook.ts) | Start a turn or call MCP without a model turn. |
|
|
24
|
-
| Slack | [`slack.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/channels/slack.ts), [`slack-app.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/channels/slack-app.ts) | Compare account-linked chat with a dedicated app. |
|
|
25
|
-
| Skill and subagent | [`forecast.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/skills/forecast.md), [`researcher/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/weather-agent/agent/subagents/researcher/) | Load a procedure on demand or delegate broad research. |
|
|
26
|
-
| Schedule and hooks | [`heartbeat.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/schedules/heartbeat.md), [`audit.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/hooks/audit.ts), [`journal.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/hooks/journal.ts) | Start recurring tasks, log usage, and save turn summaries. |
|
|
27
|
-
| A/B and evals | [`agent/ab.ts`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/examples/weather-agent/agent/ab.ts), [`evals/`](https://github.com/cursor/cursor/tree/main/packages/agent-serve/examples/weather-agent/evals/) | Compare a sticky variant and protect tool routing with regression cases. |
|
|
28
|
-
|
|
29
|
-
## Follow one request
|
|
30
|
-
|
|
31
|
-
A current-weather question takes this path:
|
|
32
|
-
|
|
33
|
-
1. The built-in HTTP channel, Slack, or the custom `/report` route creates a
|
|
34
|
-
durable session.
|
|
35
|
-
2. `instructions.md` tells the model to call `get_weather` instead of
|
|
36
|
-
guessing.
|
|
37
|
-
3. The server tool geocodes the city, fetches Open-Meteo, validates the
|
|
38
|
-
response, and returns normalized fields.
|
|
39
|
-
4. The agent writes a short answer. The Agent SDK records every event in the
|
|
40
|
-
session stream.
|
|
41
|
-
5. The audit hook observes `turn.completed`. If the session joined the A/B
|
|
42
|
-
experiment, the collector updates its metrics too.
|
|
43
|
-
|
|
44
|
-
Forecasts route to `get_forecast`. Unit conversions route to
|
|
45
|
-
`convert_temperature`, which calls the `units` MCP server through
|
|
46
|
-
`ctx.host.mcp`. Climate history and broad comparisons route to the
|
|
47
|
-
`researcher` subagent.
|
|
48
|
-
|
|
49
|
-
## Prepare the example
|
|
50
|
-
|
|
51
|
-
You need:
|
|
52
|
-
|
|
53
|
-
- Node 22.13 or newer.
|
|
54
|
-
- An agent-runtime credential.
|
|
55
|
-
- Network access to Open-Meteo.
|
|
56
|
-
- Python 3 for `save_weather_note`.
|
|
57
|
-
|
|
58
|
-
The project mounts an account-linked Slack channel. The Agent SDK checks the
|
|
59
|
-
connection at startup, so sign in even when you plan to call a deterministic
|
|
60
|
-
tool.
|
|
61
|
-
|
|
62
|
-
The optional dedicated Slack app also needs a token pair.
|
|
63
|
-
`agent-sdk slack create --dir examples/weather-agent` provisions the
|
|
64
|
-
app and writes the tokens for you (see the
|
|
65
|
-
[Slack guide](/docs/guides/slack.md#set-it-up)); with hand-minted tokens,
|
|
66
|
-
export them instead:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
export WEATHER_AGENT_SLACK_BOT_TOKEN=xoxb-...
|
|
70
|
-
export WEATHER_AGENT_SLACK_APP_TOKEN=xapp-...
|
|
71
|
-
agent-sdk slack doctor --prefix WEATHER_AGENT
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Without those two tokens, the dedicated channel stays idle. The
|
|
75
|
-
account-linked channel still works.
|
|
76
|
-
|
|
77
|
-
## Inspect before running
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
agent-sdk validate --dir examples/weather-agent
|
|
81
|
-
agent-sdk info --dir examples/weather-agent --json
|
|
82
|
-
agent-sdk eval --dir examples/weather-agent --list
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
`validate` should pass. `info` and `eval --list` should match the capabilities
|
|
86
|
-
described above.
|
|
87
|
-
|
|
88
|
-
## Call the typed tools
|
|
89
|
-
|
|
90
|
-
Start with the current-weather server tool:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
agent-sdk call get_weather \
|
|
94
|
-
--dir examples/weather-agent \
|
|
95
|
-
--input '{"city":"New York City"}'
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
`defineTool` gives the input a Zod schema. The Agent SDK validates the JSON before
|
|
99
|
-
`execute` runs. The result includes the matched place, condition,
|
|
100
|
-
temperature, humidity, wind, gusts, and precipitation.
|
|
101
|
-
|
|
102
|
-
Try the forecast:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
agent-sdk call get_forecast \
|
|
106
|
-
--dir examples/weather-agent \
|
|
107
|
-
--input '{"city":"Lisbon","days":5}'
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
The tool accepts one to seven days. Shared Open-Meteo code lives under
|
|
111
|
-
`agent/lib/`, so the Agent SDK imports it without discovering another tool.
|
|
112
|
-
|
|
113
|
-
## Compare server and agent execution
|
|
114
|
-
|
|
115
|
-
Most weather tools use the default `execution: "server"`. Their TypeScript
|
|
116
|
-
runs inside the serve host and can reach `ctx.host` services.
|
|
117
|
-
|
|
118
|
-
`save_weather_note` uses `execution: "agent"` instead. The Agent SDK materializes
|
|
119
|
-
its script into the agent environment. The script reads JSON from stdin and
|
|
120
|
-
appends to `weather-notes.md` in that session's workspace:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
agent-sdk run --dir examples/weather-agent \
|
|
124
|
-
--message "Save a note that Boston is cold and windy."
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Each session gets its own workspace. Saving a note doesn't edit the authored
|
|
128
|
-
example.
|
|
129
|
-
|
|
130
|
-
This split matters on cloud. Server tools stay on the Agent SDK host.
|
|
131
|
-
Agent tools run inside the cloud workspace.
|
|
132
|
-
|
|
133
|
-
## Verify tool execution on the agent VM
|
|
134
|
-
|
|
135
|
-
Ask the agent to call `probe_cloud_tool` on the `probe` MCP server.
|
|
136
|
-
`agent/mcp-connections/probe.ts` authors that tool as TypeScript. The Agent
|
|
137
|
-
SDK packages it as stdio MCP so a cloud VM with no checkout of this example
|
|
138
|
-
can still run it. The model lists the server and calls the tool; it does
|
|
139
|
-
not write a `.sh`.
|
|
140
|
-
|
|
141
|
-
A real call writes `vm-tool-observations/<id>.json` in the agent cwd and
|
|
142
|
-
returns hostname, cwd, and pid. Stream events show `probe:probe_cloud_tool`,
|
|
143
|
-
not `shell`.
|
|
144
|
-
|
|
145
|
-
A local `.agent-serve/tools/probe_cloud_tool.sh` or a marker under `probes/`
|
|
146
|
-
means the model invented a substitute.
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
agent-sdk run --dir examples/weather-agent \
|
|
150
|
-
--message "Test custom tool execution from this cloud agent. Call probe_cloud_tool."
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## Use MCP connections in three places
|
|
154
|
-
|
|
155
|
-
`agent/mcp-connections/units.ts` starts a local stdio server. The filename
|
|
156
|
-
makes its server name `units`. The Agent SDK exposes it to:
|
|
157
|
-
|
|
158
|
-
- the model as MCP tools,
|
|
159
|
-
- server tools through `ctx.host.mcp`, and
|
|
160
|
-
- channel handlers through `host.mcp`.
|
|
161
|
-
|
|
162
|
-
`probe` is a second stdio connection. Its tools are TypeScript `execute`
|
|
163
|
-
functions; the Agent SDK packages them so a cloud VM can spawn the server
|
|
164
|
-
without this checkout. The model calls `probe_cloud_tool` directly; no host
|
|
165
|
-
tool wraps it.
|
|
166
|
-
|
|
167
|
-
`convert_temperature` demonstrates the server-tool path:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
agent-sdk call convert_temperature \
|
|
171
|
-
--dir examples/weather-agent \
|
|
172
|
-
--input '{"value":72,"from":"F"}'
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
The custom channel demonstrates the handler path. Start the dev server:
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
agent-sdk dev examples/weather-agent
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Then call MCP deterministically through `/convert`:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
curl -s -X POST \
|
|
185
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/convert \
|
|
186
|
-
-H 'content-type: application/json' \
|
|
187
|
-
-d '{"value":20,"from":"C"}'
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
No model chooses a tool in this route. The handler calls the MCP server and
|
|
191
|
-
returns its result.
|
|
192
|
-
|
|
193
|
-
## Keep conversation state in a custom channel
|
|
194
|
-
|
|
195
|
-
`POST /report` starts a model turn and waits for it:
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
curl -s -X POST \
|
|
199
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
200
|
-
-H 'content-type: application/json' \
|
|
201
|
-
-d '{"message":"What is the weather in Paris?"}'
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
The response includes a `key`. Send it back on the next request to continue
|
|
205
|
-
the same session:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
curl -s -X POST \
|
|
209
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
210
|
-
-H 'content-type: application/json' \
|
|
211
|
-
-d '{"message":"How about tomorrow?","key":"<key>"}'
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
This is the custom-channel version of a continuation token. See
|
|
215
|
-
[webhooks and custom channels](/docs/guides/webhooks.md) for route schemas,
|
|
216
|
-
authentication, and asynchronous handlers.
|
|
217
|
-
|
|
218
|
-
## Load procedures and delegate research
|
|
219
|
-
|
|
220
|
-
The forecast skill gives the root agent an on-demand procedure. The Agent SDK
|
|
221
|
-
advertises the skill's description, then the harness loads its content when
|
|
222
|
-
the request matches.
|
|
223
|
-
|
|
224
|
-
The `researcher` directory is an SDK subagent. Its description tells the
|
|
225
|
-
parent when to delegate. It inherits the parent's execution surface, but
|
|
226
|
-
gets its own instructions:
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
agent-sdk run --dir examples/weather-agent \
|
|
230
|
-
--message "Compare record summer temperatures across Paris, London, and Rome."
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
Use a skill when the same agent needs a procedure. Use a subagent when the
|
|
234
|
-
parent should hand a bounded task to a specialist. The
|
|
235
|
-
[subagents reference](/docs/reference/subagents.md) explains the current
|
|
236
|
-
inheritance limits.
|
|
237
|
-
|
|
238
|
-
## Trigger the schedule and inspect the hook
|
|
239
|
-
|
|
240
|
-
The heartbeat schedule runs at 09:00 UTC on weekdays. Automatic schedule
|
|
241
|
-
timers stay off under `--dev`, so dispatch it manually:
|
|
242
|
-
|
|
243
|
-
```bash
|
|
244
|
-
curl -s -X POST \
|
|
245
|
-
http://127.0.0.1:3000/weather-agent/v1/dev/schedules/heartbeat
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
It creates a task session to check San Francisco, New York, and London.
|
|
249
|
-
The audit hook logs usage after each completed turn. Hooks observe recorded
|
|
250
|
-
events; their failures don't fail the turn.
|
|
251
|
-
|
|
252
|
-
## Measure variants and regressions
|
|
253
|
-
|
|
254
|
-
The `weather-tool-efficiency` A/B experiment assigns sessions by a sticky
|
|
255
|
-
hash:
|
|
256
|
-
|
|
257
|
-
- `control` returns current conditions in Fahrenheit.
|
|
258
|
-
- `treatment` adds a brief Celsius instruction and changes `get_weather` to
|
|
259
|
-
return Celsius fields.
|
|
260
|
-
|
|
261
|
-
Samples and aggregate snapshots persist under `.agent-serve/`. The treatment
|
|
262
|
-
only changes current conditions; `get_forecast` still returns Fahrenheit.
|
|
263
|
-
Treat the branch as an example of `ctx.session.abs`, not a complete unit
|
|
264
|
-
policy.
|
|
265
|
-
|
|
266
|
-
List and run the evals:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
agent-sdk eval --dir examples/weather-agent --list
|
|
270
|
-
agent-sdk eval --dir examples/weather-agent --json
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
The suite covers weather and forecast routing, the local converter, workspace
|
|
274
|
-
notes, and the VM-side probe.
|
|
275
|
-
|
|
276
|
-
## Turn the weather tour into your own agent
|
|
277
|
-
|
|
278
|
-
Keep the shape and replace the domain:
|
|
279
|
-
|
|
280
|
-
- Swap Open-Meteo tools for your typed service clients.
|
|
281
|
-
- Keep deterministic transforms behind direct server tools or MCP.
|
|
282
|
-
- Use an agent tool only when code must run in the agent workspace.
|
|
283
|
-
- Put reusable procedures in skills and narrow specialist work into
|
|
284
|
-
subagents.
|
|
285
|
-
- Add a channel only when the external surface needs its own identity,
|
|
286
|
-
continuation key, or delivery behavior.
|
|
287
|
-
|
|
288
|
-
## Where to go next
|
|
289
|
-
|
|
290
|
-
- [Tools](/docs/reference/tools.md)
|
|
291
|
-
- [MCP connections](/docs/reference/connections.md)
|
|
292
|
-
- [Human-in-the-loop approvals](/docs/guides/human-in-the-loop.md)
|
|
293
|
-
- [Slack](/docs/guides/slack.md)
|
|
294
|
-
- [Schedules and reminders](/docs/reference/schedules.md)
|
|
295
|
-
- [Evals](/docs/evals.md)
|
|
296
|
-
- [Live A/B metrics](/docs/ab.md)
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pulls `/v0/slack-events` into agent-serve: register the mounted
|
|
3
|
-
* cursor-account Slack agents (name + icon) with the Cursor backend, then
|
|
4
|
-
* long-poll routed events with a durable offset under
|
|
5
|
-
* `<stateDir>/offset.json` and dispatch each to the agent it addresses.
|
|
6
|
-
* Outbound Slack Web API calls are proxied through `POST /v0/slack-events/api`
|
|
7
|
-
* via a per-agent {@link SlackApiTransport} binding.
|
|
8
|
-
*
|
|
9
|
-
* Same lifecycle rules as the SCM relay (`cursor-event-relay.ts`):
|
|
10
|
-
* registration-gated consumption, heartbeat re-registration, durable
|
|
11
|
-
* consumer id, at-least-once dispatch with client-owned offsets.
|
|
12
|
-
*/
|
|
13
|
-
import type { CursorSlackEnvelope } from "../channels/slack/cursor-account.js";
|
|
14
|
-
/** One agent this host registers over the Cursor Slack connection. */
|
|
15
|
-
export interface CursorSlackAgentRegistration {
|
|
16
|
-
name: string;
|
|
17
|
-
iconUrl?: string;
|
|
18
|
-
iconEmoji?: string;
|
|
19
|
-
/** Opt out of the default external-sender block. */
|
|
20
|
-
blockExternals?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/** One relayed event as delivered to {@link CursorSlackRelayOptions.dispatch}. */
|
|
23
|
-
export type CursorSlackRelayEvent = CursorSlackEnvelope & {
|
|
24
|
-
offset: string;
|
|
25
|
-
};
|
|
26
|
-
export interface CursorSlackRelayOptions {
|
|
27
|
-
baseUrl: string;
|
|
28
|
-
apiKey: string;
|
|
29
|
-
agents: readonly CursorSlackAgentRegistration[];
|
|
30
|
-
stateDir: string;
|
|
31
|
-
/**
|
|
32
|
-
* Called for each event addressed to this consumer's agents; failures
|
|
33
|
-
* retry a bounded number of times, then log and skip.
|
|
34
|
-
*/
|
|
35
|
-
dispatch: (envelope: CursorSlackRelayEvent) => Promise<void>;
|
|
36
|
-
logger: (line: string) => void;
|
|
37
|
-
/** Test seam. Defaults to global fetch. */
|
|
38
|
-
fetchImpl?: typeof fetch;
|
|
39
|
-
/** Test seam: override long-poll wait (default 25s). */
|
|
40
|
-
pollWaitMs?: number;
|
|
41
|
-
}
|
|
42
|
-
/** Human-readable log fragment for one relayed Slack event. */
|
|
43
|
-
export declare function formatCursorSlackEventLog(envelope: {
|
|
44
|
-
eventName: string;
|
|
45
|
-
agentName: string;
|
|
46
|
-
matchedBy: string;
|
|
47
|
-
channelId: string;
|
|
48
|
-
threadTs: string;
|
|
49
|
-
receivedAtMs: number;
|
|
50
|
-
eventId?: string;
|
|
51
|
-
}): string;
|
|
52
|
-
/**
|
|
53
|
-
* Build the backend proxy caller one agent's {@link SlackApiTransport}
|
|
54
|
-
* binds to. Returns Slack-shaped `{ ok: false, error }` bodies on transport
|
|
55
|
-
* failures so channel soft-fail paths behave exactly like direct Web API
|
|
56
|
-
* callers.
|
|
57
|
-
*/
|
|
58
|
-
export declare function createCursorSlackApiCaller(args: {
|
|
59
|
-
baseUrl: string;
|
|
60
|
-
apiKey: string;
|
|
61
|
-
agentName: string;
|
|
62
|
-
consumerId: string;
|
|
63
|
-
fetchImpl?: typeof fetch;
|
|
64
|
-
logger?: (line: string) => void;
|
|
65
|
-
}): (method: string, callArgs: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
66
|
-
/**
|
|
67
|
-
* Cursor Slack relay: a thin {@link CursorRelayCore} adapter. Keeps the same
|
|
68
|
-
* `new CursorSlackRelay(options)` surface with `.resolveConsumerId()`,
|
|
69
|
-
* `.start()`, and `.stop()` (the server binds outbound transports with the
|
|
70
|
-
* resolved consumer id before starting).
|
|
71
|
-
*/
|
|
72
|
-
export declare class CursorSlackRelay {
|
|
73
|
-
private readonly options;
|
|
74
|
-
private readonly core;
|
|
75
|
-
/**
|
|
76
|
-
* Agent names (lowercased) the server confirmed for THIS consumer. The
|
|
77
|
-
* stream is shared with sibling consumers of the same principal, so only
|
|
78
|
-
* events for these agents (and this consumer id) may dispatch.
|
|
79
|
-
*/
|
|
80
|
-
private subscribedAgents;
|
|
81
|
-
private consumerId;
|
|
82
|
-
constructor(options: CursorSlackRelayOptions);
|
|
83
|
-
/**
|
|
84
|
-
* Resolve the durable consumer id before starting, so transports can bind
|
|
85
|
-
* with it. Also used by tests.
|
|
86
|
-
*/
|
|
87
|
-
resolveConsumerId(): Promise<string>;
|
|
88
|
-
/**
|
|
89
|
-
* Whether a relayed event belongs to THIS consumer: the backend stamps
|
|
90
|
-
* each envelope with the registering consumer id and agent.
|
|
91
|
-
*/
|
|
92
|
-
private shouldDispatch;
|
|
93
|
-
start(): void;
|
|
94
|
-
stop(): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=cursor-slack-relay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-slack-relay.d.ts","sourceRoot":"","sources":["../../src/internal/cursor-slack-relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAO/E,sEAAsE;AACtE,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAYD,kFAAkF;AAClF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,+DAA+D;AAC/D,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAGT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GAAG,CACF,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA0CpC;AAED;;;;;GAKG;AACH,qBAAa,gBAAgB;IAUf,OAAO,CAAC,QAAQ,CAAC,OAAO;IATpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;IAC9D;;;;OAIG;IACH,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,UAAU,CAAM;IAExB,YAA6B,OAAO,EAAE,uBAAuB,EAsE5D;IAED;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAGzC;IAED;;;OAGG;IACH,OAAO,CAAC,cAAc;IAOtB,KAAK,IAAI,IAAI,CAEZ;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;CACF"}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pulls `/v0/slack-events` into agent-serve: register the mounted
|
|
3
|
-
* cursor-account Slack agents (name + icon) with the Cursor backend, then
|
|
4
|
-
* long-poll routed events with a durable offset under
|
|
5
|
-
* `<stateDir>/offset.json` and dispatch each to the agent it addresses.
|
|
6
|
-
* Outbound Slack Web API calls are proxied through `POST /v0/slack-events/api`
|
|
7
|
-
* via a per-agent {@link SlackApiTransport} binding.
|
|
8
|
-
*
|
|
9
|
-
* Same lifecycle rules as the SCM relay (`cursor-event-relay.ts`):
|
|
10
|
-
* registration-gated consumption, heartbeat re-registration, durable
|
|
11
|
-
* consumer id, at-least-once dispatch with client-owned offsets.
|
|
12
|
-
*/
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
import { CursorRelayCore, describeRelayError, } from "./cursor-relay-core.js";
|
|
23
|
-
/** Human-readable log fragment for one relayed Slack event. */
|
|
24
|
-
export function formatCursorSlackEventLog(envelope) {
|
|
25
|
-
var _a;
|
|
26
|
-
const received = new Date(envelope.receivedAtMs).toISOString();
|
|
27
|
-
return `${envelope.eventName} → ${envelope.agentName} (${envelope.matchedBy}) in ${envelope.channelId}/${envelope.threadTs} received=${received} (${(_a = envelope.eventId) !== null && _a !== void 0 ? _a : "no event id"})`;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Build the backend proxy caller one agent's {@link SlackApiTransport}
|
|
31
|
-
* binds to. Returns Slack-shaped `{ ok: false, error }` bodies on transport
|
|
32
|
-
* failures so channel soft-fail paths behave exactly like direct Web API
|
|
33
|
-
* callers.
|
|
34
|
-
*/
|
|
35
|
-
export function createCursorSlackApiCaller(args) {
|
|
36
|
-
var _a;
|
|
37
|
-
const fetchImpl = (_a = args.fetchImpl) !== null && _a !== void 0 ? _a : fetch;
|
|
38
|
-
const url = `${args.baseUrl.replace(/\/+$/, "")}/v0/slack-events/api`;
|
|
39
|
-
return (method, callArgs) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
var _a;
|
|
41
|
-
try {
|
|
42
|
-
const response = yield fetchImpl(url, {
|
|
43
|
-
method: "POST",
|
|
44
|
-
headers: {
|
|
45
|
-
authorization: `Bearer ${args.apiKey}`,
|
|
46
|
-
"content-type": "application/json",
|
|
47
|
-
},
|
|
48
|
-
body: JSON.stringify({
|
|
49
|
-
method,
|
|
50
|
-
arguments: callArgs,
|
|
51
|
-
agentName: args.agentName,
|
|
52
|
-
consumerId: args.consumerId,
|
|
53
|
-
}),
|
|
54
|
-
});
|
|
55
|
-
const body = (yield response.json().catch(() => undefined));
|
|
56
|
-
if (body !== undefined && typeof body === "object") {
|
|
57
|
-
if (!response.ok && body.ok === undefined) {
|
|
58
|
-
const error = typeof body.error === "string"
|
|
59
|
-
? body.error
|
|
60
|
-
: `cursor_backend_http_${response.status}`;
|
|
61
|
-
return { ok: false, error };
|
|
62
|
-
}
|
|
63
|
-
return body;
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
ok: false,
|
|
67
|
-
error: `cursor_backend_http_${response.status}`,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
(_a = args.logger) === null || _a === void 0 ? void 0 : _a.call(args, `[agent-sdk] cursor-slack: ${method} proxy call failed: ${describeRelayError(error)}`);
|
|
72
|
-
return { ok: false, error: "cursor_backend_unreachable" };
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Cursor Slack relay: a thin {@link CursorRelayCore} adapter. Keeps the same
|
|
78
|
-
* `new CursorSlackRelay(options)` surface with `.resolveConsumerId()`,
|
|
79
|
-
* `.start()`, and `.stop()` (the server binds outbound transports with the
|
|
80
|
-
* resolved consumer id before starting).
|
|
81
|
-
*/
|
|
82
|
-
export class CursorSlackRelay {
|
|
83
|
-
constructor(options) {
|
|
84
|
-
this.options = options;
|
|
85
|
-
/**
|
|
86
|
-
* Agent names (lowercased) the server confirmed for THIS consumer. The
|
|
87
|
-
* stream is shared with sibling consumers of the same principal, so only
|
|
88
|
-
* events for these agents (and this consumer id) may dispatch.
|
|
89
|
-
*/
|
|
90
|
-
this.subscribedAgents = new Set();
|
|
91
|
-
this.consumerId = "";
|
|
92
|
-
const adapter = {
|
|
93
|
-
logPrefix: "cursor-slack",
|
|
94
|
-
subscribePath: "/v0/slack-events/subscriptions",
|
|
95
|
-
pollPath: "/v0/slack-events",
|
|
96
|
-
buildRegistrationBody: (consumerId) => {
|
|
97
|
-
this.consumerId = consumerId;
|
|
98
|
-
return {
|
|
99
|
-
consumerId,
|
|
100
|
-
// Optional fields may be undefined — JSON.stringify drops them
|
|
101
|
-
// from the registration body.
|
|
102
|
-
agents: this.options.agents.map((agent) => ({
|
|
103
|
-
name: agent.name,
|
|
104
|
-
iconUrl: agent.iconUrl,
|
|
105
|
-
iconEmoji: agent.iconEmoji,
|
|
106
|
-
blockExternals: agent.blockExternals === false ? false : undefined,
|
|
107
|
-
})),
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
// Empty agents drop this consumer's registration on clean stop, so a
|
|
111
|
-
// redeployed sibling's identical agent names never tie with this
|
|
112
|
-
// host's ghost until the server-side TTL lapses.
|
|
113
|
-
buildDeregistrationBody: (consumerId) => ({ consumerId, agents: [] }),
|
|
114
|
-
applyRegistrationResponse: (json) => {
|
|
115
|
-
var _a, _b, _c;
|
|
116
|
-
const result = json;
|
|
117
|
-
const agentStatuses = (_a = result.agents) !== null && _a !== void 0 ? _a : [];
|
|
118
|
-
this.subscribedAgents = new Set(agentStatuses
|
|
119
|
-
.filter((status) => status.isSubscribed)
|
|
120
|
-
.map((status) => status.name.toLowerCase()));
|
|
121
|
-
const failures = [
|
|
122
|
-
...((_b = result.workspaces) !== null && _b !== void 0 ? _b : [])
|
|
123
|
-
.filter((workspace) => !workspace.isSubscribed)
|
|
124
|
-
.map((workspace) => { var _a; return `workspace ${workspace.slackTeamId}: ${(_a = workspace.detail) !== null && _a !== void 0 ? _a : "not subscribed"}`; }),
|
|
125
|
-
...agentStatuses
|
|
126
|
-
.filter((status) => !status.isSubscribed)
|
|
127
|
-
.map((status) => { var _a; return `agent ${status.name}: ${(_a = status.detail) !== null && _a !== void 0 ? _a : "rejected"}`; }),
|
|
128
|
-
];
|
|
129
|
-
if (failures.length > 0) {
|
|
130
|
-
return failures;
|
|
131
|
-
}
|
|
132
|
-
const workspaceIds = ((_c = result.workspaces) !== null && _c !== void 0 ? _c : [])
|
|
133
|
-
.filter((workspace) => workspace.isSubscribed)
|
|
134
|
-
.map((workspace) => workspace.slackTeamId);
|
|
135
|
-
return [
|
|
136
|
-
`registered ${[...this.subscribedAgents].join(", ")} on Slack workspace ${workspaceIds.join(", ")}`,
|
|
137
|
-
];
|
|
138
|
-
},
|
|
139
|
-
shouldDispatch: (event) => this.shouldDispatch(event),
|
|
140
|
-
dispatch: (event) => this.options.dispatch(event),
|
|
141
|
-
};
|
|
142
|
-
this.core = new CursorRelayCore(Object.assign(Object.assign({ baseUrl: options.baseUrl, apiKey: options.apiKey, stateDir: options.stateDir, adapter, logger: options.logger }, (options.fetchImpl === undefined
|
|
143
|
-
? {}
|
|
144
|
-
: { fetchImpl: options.fetchImpl })), (options.pollWaitMs === undefined
|
|
145
|
-
? {}
|
|
146
|
-
: { pollWaitMs: options.pollWaitMs })));
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Resolve the durable consumer id before starting, so transports can bind
|
|
150
|
-
* with it. Also used by tests.
|
|
151
|
-
*/
|
|
152
|
-
resolveConsumerId() {
|
|
153
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
this.consumerId = yield this.core.resolveConsumerId();
|
|
155
|
-
return this.consumerId;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Whether a relayed event belongs to THIS consumer: the backend stamps
|
|
160
|
-
* each envelope with the registering consumer id and agent.
|
|
161
|
-
*/
|
|
162
|
-
shouldDispatch(event) {
|
|
163
|
-
if (event.consumerId !== this.consumerId) {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
return this.subscribedAgents.has(event.agentName.toLowerCase());
|
|
167
|
-
}
|
|
168
|
-
start() {
|
|
169
|
-
this.core.start();
|
|
170
|
-
}
|
|
171
|
-
stop() {
|
|
172
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
-
yield this.core.stop();
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}
|