@cursor/july 0.1.93 → 0.1.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -20
- package/README.md +4 -26
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +14 -2
- package/dist/channels/github/types.d.ts +18 -3
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +11 -3
- package/dist/channels/origin/origin-webhook.d.ts +11 -1
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +23 -3
- package/dist/channels/origin/types.d.ts +8 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/attachments.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +0 -7
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +4 -7
- package/dist/channels/slack/eval-directive.d.ts +5 -12
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +8 -19
- package/dist/channels/slack/index.d.ts +0 -6
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +0 -6
- package/dist/channels/slack/pr-ref.d.ts +7 -1
- package/dist/channels/slack/pr-ref.d.ts.map +1 -1
- package/dist/channels/slack/pr-ref.js +42 -23
- package/dist/channels/slack/setup.d.ts +4 -4
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +8 -15
- package/dist/channels/slack/slack-channel.d.ts +6 -13
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +15 -101
- package/dist/channels/slack/types.d.ts +12 -79
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/types.js +1 -15
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +12 -0
- package/dist/connections.d.ts +18 -9
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -8
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CjWU-x0z.js → app.BBj0klBO.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Cxy8ySFQ.js → VPLocalSearchBox.CUEXpL78.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Dvq1Bktu.js → theme.DabmQnia.js} +2 -2
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
- package/dist/docs/assets/{deployment.md.DoLFAzfm.js → deployment.md.D9msOFOW.js} +3 -8
- package/dist/docs/assets/{deployment.md.DoLFAzfm.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.js → guides_agent-to-agent.md.BDb0t1QV.js} +1 -1
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
- package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.js → guides_convert-automation.md.B4sjlodG.js} +1 -1
- package/dist/docs/assets/{guides_github.md.DqJhuaN1.js → guides_github.md.Cnh2mL4a.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
- package/dist/docs/assets/{guides_mcp-oauth.md.CJvrXtkN.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.mqeNKs84.js → guides_slack.md.C32HsdKk.js} +5 -11
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
- package/dist/docs/assets/index.md.BoHaMdeZ.js +5 -0
- package/dist/docs/assets/{index.md.B-lVR4wT.lean.js → index.md.BoHaMdeZ.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.BrmfrrIr.js → quickstart.md.Nj_LjW_a.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.D9KESDsD.js → reference_cli.md.BsMOxDvh.js} +4 -3
- package/dist/docs/assets/{reference_cli.md.D9KESDsD.lean.js → reference_cli.md.BsMOxDvh.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DB6SsN6U.js → reference_connections.md.BH8Oc0D0.js} +5 -5
- package/dist/docs/assets/{reference_connections.md.DB6SsN6U.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.BxN87gCw.js → reference_hooks.md.a8BJxMR5.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
- package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.DuKvkYWG.js → reference_tools.md.BHeXn2id.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.DuKvkYWG.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
- package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.R4K_qytS.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +1 -0
- package/dist/docs/deployment.html +7 -12
- package/dist/docs/deployment.md +1 -20
- package/dist/docs/design/agsh.md +406 -0
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.md +2 -2
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +1 -0
- package/dist/docs/guides/convert-automation.html +6 -6
- package/dist/docs/guides/convert-automation.md +1 -1
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +11 -13
- package/dist/docs/guides/mcp-oauth.md +10 -18
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +9 -15
- package/dist/docs/guides/slack.md +9 -46
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +3 -29
- package/dist/docs/llms-full.txt +756 -2810
- package/dist/docs/llms.txt +3 -16
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/quickstart.md +2 -3
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +8 -7
- package/dist/docs/reference/cli.md +5 -2
- package/dist/docs/reference/connections.html +9 -9
- package/dist/docs/reference/connections.md +15 -11
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/hooks.md +2 -3
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +8 -0
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +8 -6
- package/dist/docs/reference/project-layout.md +5 -1
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/subagents.md +2 -2
- package/dist/docs/reference/tools.html +7 -7
- package/dist/docs/reference/tools.md +19 -3
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +1 -1
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/demo.md +3 -2
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +8 -13
- package/dist/docs/templates/security-help.html +30 -0
- package/dist/docs/templates/security-help.md +65 -0
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/security-reviewer.md +1 -3
- package/dist/docs/templates/triage.html +7 -7
- package/dist/docs/templates/triage.md +2 -6
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/files-backends/cursor-hosted.d.ts +6 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +2 -2
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +11 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +47 -9
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +135 -6
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- package/dist/internal/conversation-mirror.d.ts +82 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +251 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +26 -15
- package/dist/internal/convert-automation/slug.d.ts +0 -2
- package/dist/internal/convert-automation/slug.d.ts.map +1 -1
- package/dist/internal/convert-automation/slug.js +0 -8
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +5 -1
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +13 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +11 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +11 -5
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +110 -15
- package/dist/internal/framework-storage-selection.d.ts +32 -16
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +51 -17
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +33 -1
- package/dist/internal/hosted-delivery.d.ts +4 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +97 -44
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +58 -0
- package/dist/internal/mcp-endpoint.js +3 -3
- package/dist/internal/mcp-host.d.ts +8 -7
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +8 -7
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +5 -1
- package/dist/internal/playground/static.d.ts +0 -3
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +5 -7
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +10 -98
- package/dist/internal/scm/pr-url.d.ts +14 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +65 -0
- package/dist/internal/sdk-runner.d.ts +14 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +41 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +123 -174
- package/dist/internal/session-engine.d.ts +45 -10
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +217 -65
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +67 -0
- package/dist/playground/assets/index-CF7hUDnQ.css +1 -0
- package/dist/playground/assets/{index-D9MFzhNE.js → index-CZA1uEWA.js} +48 -48
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +7 -2
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +2 -2
- package/dist/types.d.ts +72 -23
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/docs/README.md +3 -29
- package/docs/concepts.md +1 -0
- package/docs/deployment.md +1 -20
- package/docs/design/agsh.md +406 -0
- package/docs/guides/agent-to-agent.md +2 -2
- package/docs/guides/cloud-runtime.md +1 -0
- package/docs/guides/convert-automation.md +1 -1
- package/docs/guides/github.md +4 -4
- package/docs/guides/mcp-oauth.md +10 -18
- package/docs/guides/slack.md +10 -47
- package/docs/quickstart.md +2 -3
- package/docs/reference/cli.md +5 -2
- package/docs/reference/connections.md +15 -11
- package/docs/reference/hooks.md +2 -3
- package/docs/reference/http-api.md +8 -0
- package/docs/reference/project-layout.md +5 -1
- package/docs/reference/subagents.md +2 -2
- package/docs/reference/tools.md +19 -3
- package/docs/templates/agentic-owners.md +1 -1
- package/docs/templates/demo.md +3 -2
- package/docs/templates/pr-autofixer.md +8 -13
- package/docs/templates/security-help.md +70 -0
- package/docs/templates/security-reviewer.md +1 -3
- package/docs/templates/triage.md +2 -6
- package/docs/troubleshooting.md +2 -2
- package/package.json +9 -2
- package/skills/create-agent/SKILL.md +6 -13
- package/skills/debug/SKILL.md +2 -4
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +3 -2
- package/skills/mcp-auth/SKILL.md +10 -13
- package/skills/setup-slack/SKILL.md +21 -137
- package/src/channels/github/github-channel.ts +23 -8
- package/src/channels/github/types.ts +19 -2
- package/src/channels/origin/origin-channel.ts +13 -1
- package/src/channels/origin/origin-webhook.ts +27 -3
- package/src/channels/origin/types.ts +8 -0
- package/src/channels/slack/attachments.ts +2 -2
- package/src/channels/slack/dispatch.ts +2 -16
- package/src/channels/slack/eval-directive.ts +8 -27
- package/src/channels/slack/index.ts +0 -6
- package/src/channels/slack/pr-ref.ts +56 -25
- package/src/channels/slack/setup.ts +8 -15
- package/src/channels/slack/slack-channel.ts +14 -125
- package/src/channels/slack/types.ts +12 -96
- package/src/client.ts +23 -0
- package/src/connections.ts +20 -7
- package/src/files-backends/cursor-hosted.ts +9 -3
- package/src/files.ts +11 -0
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/cli-deploy.ts +171 -7
- package/src/internal/cli-mcp-oauth.ts +6 -4
- package/src/internal/conversation-mirror.ts +330 -0
- package/src/internal/convert-automation/convert-workflow.ts +29 -17
- package/src/internal/convert-automation/slug.ts +0 -9
- package/src/internal/cursor/account-mcp.ts +4 -1
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +24 -1
- package/src/internal/deploy-manifest.ts +10 -5
- package/src/internal/discovery.ts +129 -15
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/framework-storage-selection.ts +61 -19
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-delivery-protocol.ts +44 -1
- package/src/internal/hosted-delivery.ts +155 -68
- package/src/internal/hosted-managed-automation.ts +72 -0
- package/src/internal/mcp-endpoint.ts +3 -3
- package/src/internal/mcp-host.ts +8 -7
- package/src/internal/peer-connections.ts +4 -1
- package/src/internal/playground/static.ts +1 -3
- package/src/internal/resolved-connections.ts +8 -10
- package/src/internal/review-comments.ts +10 -113
- package/src/internal/scm/pr-url.ts +95 -0
- package/src/internal/sdk-runner.ts +57 -2
- package/src/internal/server.ts +161 -251
- package/src/internal/session-engine.ts +266 -69
- package/src/internal/tool-catalog.ts +106 -0
- package/src/storage-backends/cursor-hosted.ts +10 -3
- package/src/types.ts +90 -23
- package/templates/agentic-owners/README.md +1 -1
- package/templates/agentic-owners/agent/agent.ts +0 -10
- package/templates/agentic-owners/agent/channels/github.ts +5 -14
- package/templates/agentic-owners/agent/lib/config.ts +0 -8
- package/templates/agentic-owners/agent/lib/review.ts +2 -15
- package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
- package/templates/demo/agent/agent.ts +0 -10
- package/templates/pr-autofixer/README.md +0 -2
- package/templates/pr-autofixer/agent/agent.ts +0 -11
- package/templates/pr-autofixer/agent/channels/slack.ts +1 -2
- package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
- package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
- package/templates/security-help/README.md +2 -2
- package/templates/security-help/agent/agent.ts +1 -2
- package/templates/security-help/agent/channels/slack.ts +0 -3
- package/templates/security-help/agent/instructions.md +9 -10
- package/templates/security-help/agent/skills/access-request.md +1 -1
- package/templates/security-help/agent/skills/faq.md +31 -0
- package/templates/security-help/agent/skills/security-playbooks.md +1 -1
- package/templates/security-help/package.json +1 -2
- package/templates/security-reviewer/agent/agent.ts +0 -10
- package/templates/triage/README.md +2 -1
- package/templates/triage/agent/agent.ts +0 -10
- package/templates/triage/agent/channels/queue.ts +1 -1
- package/templates/triage/agent/channels/webhook.ts +1 -3
- package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
- package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
- package/dist/channels/slack/cursor-account.d.ts +0 -87
- package/dist/channels/slack/cursor-account.d.ts.map +0 -1
- package/dist/channels/slack/cursor-account.js +0 -100
- package/dist/docs/assets/chunks/@localSearchIndexroot.ChpIC3Zy.js +0 -1
- package/dist/docs/assets/concepts.md.F6AiPorA.js +0 -1
- package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.js +0 -10
- package/dist/docs/assets/example-agents_approval-buddy.md.DmezILPg.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.js +0 -5
- package/dist/docs/assets/example-agents_benny.md.B0kwY7D_.lean.js +0 -1
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
- package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.js +0 -8
- package/dist/docs/assets/example-agents_codebase-wiki.md.BBNw9Ekr.lean.js +0 -1
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
- package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.js +0 -22
- package/dist/docs/assets/example-agents_concierge.md.BzB2b20R.lean.js +0 -1
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +0 -2
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +0 -1
- package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.js +0 -11
- package/dist/docs/assets/example-agents_knowledge-base.md.CrA85ig-.lean.js +0 -1
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
- package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.js +0 -19
- package/dist/docs/assets/example-agents_security-reviewer.md.74pPpWYj.lean.js +0 -1
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
- package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.js +0 -25
- package/dist/docs/assets/example-agents_weather-agent.md.CaGpmw3Y.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BnvjPiia.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.mqeNKs84.lean.js +0 -1
- package/dist/docs/assets/index.md.B-lVR4wT.js +0 -5
- package/dist/docs/assets/reference_http-api.md.C68BERYr.js +0 -11
- package/dist/docs/assets/reference_http-api.md.C68BERYr.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.WN9nwJht.js +0 -17
- package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.js +0 -1
- package/dist/docs/example-agents/approval-buddy.html +0 -36
- package/dist/docs/example-agents/approval-buddy.md +0 -266
- package/dist/docs/example-agents/benny.html +0 -31
- package/dist/docs/example-agents/benny.md +0 -173
- package/dist/docs/example-agents/bugbot.html +0 -37
- package/dist/docs/example-agents/bugbot.md +0 -229
- package/dist/docs/example-agents/codebase-wiki.html +0 -34
- package/dist/docs/example-agents/codebase-wiki.md +0 -167
- package/dist/docs/example-agents/codeowners-review.html +0 -34
- package/dist/docs/example-agents/codeowners-review.md +0 -192
- package/dist/docs/example-agents/concierge.html +0 -48
- package/dist/docs/example-agents/concierge.md +0 -200
- package/dist/docs/example-agents/index.html +0 -28
- package/dist/docs/example-agents/index.md +0 -99
- package/dist/docs/example-agents/knowledge-base.html +0 -37
- package/dist/docs/example-agents/knowledge-base.md +0 -168
- package/dist/docs/example-agents/oncall.html +0 -36
- package/dist/docs/example-agents/oncall.md +0 -212
- package/dist/docs/example-agents/security-reviewer.html +0 -45
- package/dist/docs/example-agents/security-reviewer.md +0 -265
- package/dist/docs/example-agents/slack-agent.html +0 -31
- package/dist/docs/example-agents/slack-agent.md +0 -142
- package/dist/docs/example-agents/weather-agent.html +0 -51
- package/dist/docs/example-agents/weather-agent.md +0 -297
- package/dist/internal/cursor-slack-relay.d.ts +0 -96
- package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
- package/dist/internal/cursor-slack-relay.js +0 -176
- package/dist/playground/assets/index-D9N7-q97.css +0 -1
- package/docs/example-agents/approval-buddy.md +0 -271
- package/docs/example-agents/benny.md +0 -178
- package/docs/example-agents/bugbot.md +0 -234
- package/docs/example-agents/codebase-wiki.md +0 -172
- package/docs/example-agents/codeowners-review.md +0 -197
- package/docs/example-agents/concierge.md +0 -205
- package/docs/example-agents/index.md +0 -104
- package/docs/example-agents/knowledge-base.md +0 -173
- package/docs/example-agents/oncall.md +0 -217
- package/docs/example-agents/security-reviewer.md +0 -270
- package/docs/example-agents/slack-agent.md +0 -147
- package/docs/example-agents/weather-agent.md +0 -302
- package/src/channels/slack/cursor-account.ts +0 -202
- package/src/internal/cursor-slack-relay.ts +0 -249
- package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
- package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
- package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
- package/templates/security-help/agent/skills/security-first-pass.md +0 -15
- /package/dist/docs/assets/{concepts.md.F6AiPorA.lean.js → concepts.md.lwAgBIMI.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.B3JIaAqz.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.Bboisykk.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.DqJhuaN1.lean.js → guides_github.md.Cnh2mL4a.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.BrmfrrIr.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
- /package/dist/docs/assets/{reference_hooks.md.BxN87gCw.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.WN9nwJht.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
- /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.vCWwvqcJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Put a minimal agent in Slack"
|
|
3
|
-
description: "Use account-linked Slack routing, thread continuity, identity, and suggested prompts with one small channel."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Put a minimal agent in Slack
|
|
7
|
-
|
|
8
|
-
Slack agent is the smallest channel example. It has one runtime config, one
|
|
9
|
-
instruction file, and one authored channel. A teammate mentions the agent,
|
|
10
|
-
the local runtime harness runs a turn, and the answer
|
|
11
|
-
returns to the same Slack thread.
|
|
12
|
-
|
|
13
|
-
Use it to learn the minimum needed for a Slack agent before adding tools,
|
|
14
|
-
workflows, or a dedicated app.
|
|
15
|
-
|
|
16
|
-
[Browse the Slack agent source.](../../examples/slack-agent/)
|
|
17
|
-
|
|
18
|
-
## Keep the Slack channel small
|
|
19
|
-
|
|
20
|
-
Slack agent delegates transport details to the host connection. The authored
|
|
21
|
-
file selects the account-linked transport, gives the agent a single-token
|
|
22
|
-
router name and icon, and supplies suggested prompts.
|
|
23
|
-
|
|
24
|
-
The complete channel lives in
|
|
25
|
-
[`agent/channels/slack.ts`](../../examples/slack-agent/agent/channels/slack.ts).
|
|
26
|
-
The framework supplies message intake, thread-scoped sessions, delivery,
|
|
27
|
-
status updates, and suggested prompts.
|
|
28
|
-
|
|
29
|
-
## Follow a Slack message
|
|
30
|
-
|
|
31
|
-
1. A user mentions the agent or sends the host app a direct message naming
|
|
32
|
-
it.
|
|
33
|
-
2. The Slack relay selects this channel by its single-token `agentName`.
|
|
34
|
-
3. The Agent SDK maps the Slack channel and thread timestamp to a continuation
|
|
35
|
-
key.
|
|
36
|
-
4. The local harness runs with
|
|
37
|
-
[`instructions.md`](../../examples/slack-agent/agent/instructions.md).
|
|
38
|
-
5. The response returns to the triggering thread.
|
|
39
|
-
6. A later message in the same thread resumes the durable session.
|
|
40
|
-
|
|
41
|
-
The prompt asks for concise threaded replies. It doesn't define domain policy
|
|
42
|
-
or tool routing.
|
|
43
|
-
|
|
44
|
-
## Map the Slack agent files
|
|
45
|
-
|
|
46
|
-
| File | Purpose |
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| [`package.json`](../../examples/slack-agent/package.json) | Declares the example package and Agent SDK dependency. |
|
|
49
|
-
| [`agent/agent.ts`](../../examples/slack-agent/agent/agent.ts) | Names the agent and selects the model. The omitted `runtime` defaults to local. |
|
|
50
|
-
| [`agent/instructions.md`](../../examples/slack-agent/agent/instructions.md) | Sets the always-on response style. |
|
|
51
|
-
| [`agent/channels/slack.ts`](../../examples/slack-agent/agent/channels/slack.ts) | Connects the signed-in host account to Slack. |
|
|
52
|
-
| [`agent/storage.ts`](../../examples/slack-agent/agent/storage.ts) | Persists sessions and events with `cursorHostedStorage`. |
|
|
53
|
-
|
|
54
|
-
There are no authored tools, skills, MCP connections, subagents, schedules,
|
|
55
|
-
hooks, A/B experiments, or evals. This small surface is the lesson.
|
|
56
|
-
|
|
57
|
-
## Connect the host
|
|
58
|
-
|
|
59
|
-
You need:
|
|
60
|
-
|
|
61
|
-
- Node 22.13 or newer.
|
|
62
|
-
- An agent-runtime credential.
|
|
63
|
-
- Slack connected through the selected channel transport.
|
|
64
|
-
|
|
65
|
-
Sign in and confirm the active account:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
agent-sdk login
|
|
69
|
-
agent-sdk whoami
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The selected transport owns Slack credential setup. See the
|
|
73
|
-
[Slack guide](../guides/slack.md) for account-linked and dedicated-app
|
|
74
|
-
options.
|
|
75
|
-
|
|
76
|
-
## Validate and start the server
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
agent-sdk validate --dir examples/slack-agent
|
|
80
|
-
agent-sdk info --dir examples/slack-agent --json
|
|
81
|
-
agent-sdk dev examples/slack-agent
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
The dev command prints the playground URL. It also mounts the Slack channel
|
|
85
|
-
and waits for relayed messages.
|
|
86
|
-
|
|
87
|
-
In Slack, address the configured host app and router name, then send:
|
|
88
|
-
|
|
89
|
-
> `<host-app mention> <router name>` Explain the Agent SDK in three bullets.
|
|
90
|
-
|
|
91
|
-
Reply in the generated thread:
|
|
92
|
-
|
|
93
|
-
> Make the second bullet simpler.
|
|
94
|
-
|
|
95
|
-
The second message reaches the same session. You can open that session in the
|
|
96
|
-
playground to inspect the received message, model events, final reply, and
|
|
97
|
-
usage.
|
|
98
|
-
|
|
99
|
-
## Test without Slack
|
|
100
|
-
|
|
101
|
-
Every project gets the built-in HTTP channel even when no HTTP file exists.
|
|
102
|
-
Run a one-shot turn through it:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
agent-sdk run --dir examples/slack-agent \
|
|
106
|
-
--message "Explain the Agent SDK simply."
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
The same project also exposes an MCP endpoint. Since this agent has no server
|
|
110
|
-
tools, its MCP surface contains `ask` and `check`, but not `call_tool`.
|
|
111
|
-
|
|
112
|
-
These automatic surfaces let you test the prompt from the CLI and let another
|
|
113
|
-
agent delegate to it later. The authored Slack channel only changes how work
|
|
114
|
-
arrives and where replies go.
|
|
115
|
-
|
|
116
|
-
## Know when to add a dedicated app
|
|
117
|
-
|
|
118
|
-
An account-linked Slack transport is a fit for mentions, direct messages, thread
|
|
119
|
-
continuity, and agent-branded replies. Move to a dedicated Socket Mode channel
|
|
120
|
-
when you need:
|
|
121
|
-
|
|
122
|
-
- top-level channel watching,
|
|
123
|
-
- interactive approval buttons,
|
|
124
|
-
- a separate bot identity, or
|
|
125
|
-
- Slack app events unsupported by the account-linked relay.
|
|
126
|
-
|
|
127
|
-
Compare this example with [Playbook router](./benny.md), which adds allowlisted channel
|
|
128
|
-
watching, and [Weather agent](./weather-agent.md), which adds approval buttons
|
|
129
|
-
through a second Slack channel.
|
|
130
|
-
|
|
131
|
-
## Turn the channel into your own Slack agent
|
|
132
|
-
|
|
133
|
-
Copy the three authored files, then change:
|
|
134
|
-
|
|
135
|
-
- `name` in `agent.ts` for the harness identity,
|
|
136
|
-
- `agentName` in `slack.ts` for the single-token router name,
|
|
137
|
-
- the instructions for your domain, and
|
|
138
|
-
- suggested prompts for the tasks teammates should try.
|
|
139
|
-
|
|
140
|
-
Keep `agentName` free of whitespace. Use PascalCase for multiword names.
|
|
141
|
-
|
|
142
|
-
## Where to go next
|
|
143
|
-
|
|
144
|
-
- [Slack](../guides/slack.md)
|
|
145
|
-
- [Channels](../reference/channels.md)
|
|
146
|
-
- [Sessions and streaming](../reference/sessions.md)
|
|
147
|
-
- [Playground](../reference/playground.md)
|
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "Explore the full Agent SDK surface with a weather agent"
|
|
3
|
-
description: "Trace cloud tools, MCP, channels, skills, subagents, schedules, hooks, A/B metrics, and evals through one agent."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Explore the full Agent SDK surface with a weather agent
|
|
7
|
-
|
|
8
|
-
The weather agent is the broadest small example in the repository. It fetches
|
|
9
|
-
live conditions and forecasts, converts units through MCP, writes notes in a
|
|
10
|
-
session workspace, and runs from HTTP, Slack, a schedule, and the MCP endpoint.
|
|
11
|
-
|
|
12
|
-
Use this project when you want to see how the Agent SDK's filesystem pieces fit
|
|
13
|
-
together before you design a larger agent.
|
|
14
|
-
|
|
15
|
-
[Browse the weather agent source.](../../examples/weather-agent/)
|
|
16
|
-
|
|
17
|
-
## See the runtime features together
|
|
18
|
-
|
|
19
|
-
Most examples focus on one feature. Weather agent puts the major runtime
|
|
20
|
-
features side by side:
|
|
21
|
-
|
|
22
|
-
| Capability | Source | Role |
|
|
23
|
-
| --- | --- | --- |
|
|
24
|
-
| Root config and instructions | [`agent/agent.ts`](../../examples/weather-agent/agent/agent.ts), [`agent/instructions.md`](../../examples/weather-agent/agent/instructions.md) | Select the cloud runtime and route each request. |
|
|
25
|
-
| Server tools | [`agent/tools/`](../../examples/weather-agent/agent/tools/) | Fetch Open-Meteo data and call MCP from the serve host. |
|
|
26
|
-
| Agent tool | [`save_weather_note.ts`](../../examples/weather-agent/agent/tools/save_weather_note.ts) | Run a Python script inside the session workspace. |
|
|
27
|
-
| Stdio MCP | [`units.ts`](../../examples/weather-agent/agent/mcp-connections/units.ts), [`probe.ts`](../../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. |
|
|
28
|
-
| Custom HTTP | [`webhook.ts`](../../examples/weather-agent/agent/channels/webhook.ts) | Start a turn or call MCP without a model turn. |
|
|
29
|
-
| Slack | [`slack.ts`](../../examples/weather-agent/agent/channels/slack.ts), [`slack-app.ts`](../../examples/weather-agent/agent/channels/slack-app.ts) | Compare account-linked chat with a dedicated app. |
|
|
30
|
-
| Skill and subagent | [`forecast.md`](../../examples/weather-agent/agent/skills/forecast.md), [`researcher/`](../../examples/weather-agent/agent/subagents/researcher/) | Load a procedure on demand or delegate broad research. |
|
|
31
|
-
| Schedule and hooks | [`heartbeat.md`](../../examples/weather-agent/agent/schedules/heartbeat.md), [`audit.ts`](../../examples/weather-agent/agent/hooks/audit.ts), [`journal.ts`](../../examples/weather-agent/agent/hooks/journal.ts) | Start recurring tasks, log usage, and save turn summaries. |
|
|
32
|
-
| A/B and evals | [`agent/ab.ts`](../../examples/weather-agent/agent/ab.ts), [`evals/`](../../examples/weather-agent/evals/) | Compare a sticky variant and protect tool routing with regression cases. |
|
|
33
|
-
|
|
34
|
-
## Follow one request
|
|
35
|
-
|
|
36
|
-
A current-weather question takes this path:
|
|
37
|
-
|
|
38
|
-
1. The built-in HTTP channel, Slack, or the custom `/report` route creates a
|
|
39
|
-
durable session.
|
|
40
|
-
2. `instructions.md` tells the model to call `get_weather` instead of
|
|
41
|
-
guessing.
|
|
42
|
-
3. The server tool geocodes the city, fetches Open-Meteo, validates the
|
|
43
|
-
response, and returns normalized fields.
|
|
44
|
-
4. The agent writes a short answer. The Agent SDK records every event in the
|
|
45
|
-
session stream.
|
|
46
|
-
5. The audit hook observes `turn.completed`. If the session joined the A/B
|
|
47
|
-
experiment, the collector updates its metrics too.
|
|
48
|
-
|
|
49
|
-
Forecasts route to `get_forecast`. Unit conversions route to
|
|
50
|
-
`convert_temperature`, which calls the `units` MCP server through
|
|
51
|
-
`ctx.host.mcp`. Climate history and broad comparisons route to the
|
|
52
|
-
`researcher` subagent.
|
|
53
|
-
|
|
54
|
-
## Prepare the example
|
|
55
|
-
|
|
56
|
-
You need:
|
|
57
|
-
|
|
58
|
-
- Node 22.13 or newer.
|
|
59
|
-
- An agent-runtime credential.
|
|
60
|
-
- Network access to Open-Meteo.
|
|
61
|
-
- Python 3 for `save_weather_note`.
|
|
62
|
-
|
|
63
|
-
The project mounts an account-linked Slack channel. The Agent SDK checks the
|
|
64
|
-
connection at startup, so sign in even when you plan to call a deterministic
|
|
65
|
-
tool.
|
|
66
|
-
|
|
67
|
-
The optional dedicated Slack app also needs a token pair.
|
|
68
|
-
`agent-sdk slack create --dir examples/weather-agent` provisions the
|
|
69
|
-
app and writes the tokens for you (see the
|
|
70
|
-
[Slack guide](../guides/slack.md#set-it-up)); with hand-minted tokens,
|
|
71
|
-
export them instead:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
export WEATHER_AGENT_SLACK_BOT_TOKEN=xoxb-...
|
|
75
|
-
export WEATHER_AGENT_SLACK_APP_TOKEN=xapp-...
|
|
76
|
-
agent-sdk slack doctor --prefix WEATHER_AGENT
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Without those two tokens, the dedicated channel stays idle. The
|
|
80
|
-
account-linked channel still works.
|
|
81
|
-
|
|
82
|
-
## Inspect before running
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
agent-sdk validate --dir examples/weather-agent
|
|
86
|
-
agent-sdk info --dir examples/weather-agent --json
|
|
87
|
-
agent-sdk eval --dir examples/weather-agent --list
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
`validate` should pass. `info` and `eval --list` should match the capabilities
|
|
91
|
-
described above.
|
|
92
|
-
|
|
93
|
-
## Call the typed tools
|
|
94
|
-
|
|
95
|
-
Start with the current-weather server tool:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
agent-sdk call get_weather \
|
|
99
|
-
--dir examples/weather-agent \
|
|
100
|
-
--input '{"city":"New York City"}'
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
`defineTool` gives the input a Zod schema. The Agent SDK validates the JSON before
|
|
104
|
-
`execute` runs. The result includes the matched place, condition,
|
|
105
|
-
temperature, humidity, wind, gusts, and precipitation.
|
|
106
|
-
|
|
107
|
-
Try the forecast:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
agent-sdk call get_forecast \
|
|
111
|
-
--dir examples/weather-agent \
|
|
112
|
-
--input '{"city":"Lisbon","days":5}'
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
The tool accepts one to seven days. Shared Open-Meteo code lives under
|
|
116
|
-
`agent/lib/`, so the Agent SDK imports it without discovering another tool.
|
|
117
|
-
|
|
118
|
-
## Compare server and agent execution
|
|
119
|
-
|
|
120
|
-
Most weather tools use the default `execution: "server"`. Their TypeScript
|
|
121
|
-
runs inside the serve host and can reach `ctx.host` services.
|
|
122
|
-
|
|
123
|
-
`save_weather_note` uses `execution: "agent"` instead. The Agent SDK materializes
|
|
124
|
-
its script into the agent environment. The script reads JSON from stdin and
|
|
125
|
-
appends to `weather-notes.md` in that session's workspace:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
agent-sdk run --dir examples/weather-agent \
|
|
129
|
-
--message "Save a note that Boston is cold and windy."
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Each session gets its own workspace. Saving a note doesn't edit the authored
|
|
133
|
-
example.
|
|
134
|
-
|
|
135
|
-
This split matters on cloud. Server tools stay on the Agent SDK host.
|
|
136
|
-
Agent tools run inside the cloud workspace.
|
|
137
|
-
|
|
138
|
-
## Verify tool execution on the agent VM
|
|
139
|
-
|
|
140
|
-
Ask the agent to call `probe_cloud_tool` on the `probe` MCP server.
|
|
141
|
-
`agent/mcp-connections/probe.ts` authors that tool as TypeScript. The Agent
|
|
142
|
-
SDK packages it as stdio MCP so a cloud VM with no checkout of this example
|
|
143
|
-
can still run it. The model lists the server and calls the tool; it does
|
|
144
|
-
not write a `.sh`.
|
|
145
|
-
|
|
146
|
-
A real call writes `vm-tool-observations/<id>.json` in the agent cwd and
|
|
147
|
-
returns hostname, cwd, and pid. Stream events show `probe:probe_cloud_tool`,
|
|
148
|
-
not `shell`.
|
|
149
|
-
|
|
150
|
-
A local tool script or a marker under `probes/` means the model
|
|
151
|
-
invented a substitute.
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
agent-sdk run --dir examples/weather-agent \
|
|
155
|
-
--message "Test custom tool execution from this cloud agent. Call probe_cloud_tool."
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Use MCP connections in three places
|
|
159
|
-
|
|
160
|
-
`agent/mcp-connections/units.ts` starts a local stdio server. The filename
|
|
161
|
-
makes its server name `units`. The Agent SDK exposes it to:
|
|
162
|
-
|
|
163
|
-
- the model as MCP tools,
|
|
164
|
-
- server tools through `ctx.host.mcp`, and
|
|
165
|
-
- channel handlers through `host.mcp`.
|
|
166
|
-
|
|
167
|
-
`probe` is a second stdio connection. Its tools are TypeScript `execute`
|
|
168
|
-
functions; the Agent SDK packages them so a cloud VM can spawn the server
|
|
169
|
-
without this checkout. The model calls `probe_cloud_tool` directly; no host
|
|
170
|
-
tool wraps it.
|
|
171
|
-
|
|
172
|
-
`convert_temperature` demonstrates the server-tool path:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
agent-sdk call convert_temperature \
|
|
176
|
-
--dir examples/weather-agent \
|
|
177
|
-
--input '{"value":72,"from":"F"}'
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
The custom channel demonstrates the handler path. Start the dev server:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
agent-sdk dev examples/weather-agent
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Then call MCP deterministically through `/convert`:
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
curl -s -X POST \
|
|
190
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/convert \
|
|
191
|
-
-H 'content-type: application/json' \
|
|
192
|
-
-d '{"value":20,"from":"C"}'
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
No model chooses a tool in this route. The handler calls the MCP server and
|
|
196
|
-
returns its result.
|
|
197
|
-
|
|
198
|
-
## Keep conversation state in a custom channel
|
|
199
|
-
|
|
200
|
-
`POST /report` starts a model turn and waits for it:
|
|
201
|
-
|
|
202
|
-
```bash
|
|
203
|
-
curl -s -X POST \
|
|
204
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
205
|
-
-H 'content-type: application/json' \
|
|
206
|
-
-d '{"message":"What is the weather in Paris?"}'
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
The response includes a `key`. Send it back on the next request to continue
|
|
210
|
-
the same session:
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
curl -s -X POST \
|
|
214
|
-
http://127.0.0.1:3000/weather-agent/v1/channels/webhook/report \
|
|
215
|
-
-H 'content-type: application/json' \
|
|
216
|
-
-d '{"message":"How about tomorrow?","key":"<key>"}'
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
This is the custom-channel version of a continuation token. See
|
|
220
|
-
[webhooks and custom channels](../guides/webhooks.md) for route schemas,
|
|
221
|
-
authentication, and asynchronous handlers.
|
|
222
|
-
|
|
223
|
-
## Load procedures and delegate research
|
|
224
|
-
|
|
225
|
-
The forecast skill gives the root agent an on-demand procedure. The Agent SDK
|
|
226
|
-
advertises the skill's description, then the harness loads its content when
|
|
227
|
-
the request matches.
|
|
228
|
-
|
|
229
|
-
The `researcher` directory is an SDK subagent. Its description tells the
|
|
230
|
-
parent when to delegate. It inherits the parent's execution surface, but
|
|
231
|
-
gets its own instructions:
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
agent-sdk run --dir examples/weather-agent \
|
|
235
|
-
--message "Compare record summer temperatures across Paris, London, and Rome."
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
Use a skill when the same agent needs a procedure. Use a subagent when the
|
|
239
|
-
parent should hand a bounded task to a specialist. The
|
|
240
|
-
[subagents reference](../reference/subagents.md) explains the current
|
|
241
|
-
inheritance limits.
|
|
242
|
-
|
|
243
|
-
## Trigger the schedule and inspect the hook
|
|
244
|
-
|
|
245
|
-
The heartbeat schedule runs at 09:00 UTC on weekdays. Automatic schedule
|
|
246
|
-
timers stay off under `--dev`, so dispatch it manually:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
curl -s -X POST \
|
|
250
|
-
http://127.0.0.1:3000/weather-agent/v1/dev/schedules/heartbeat
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
It creates a task session to check San Francisco, New York, and London.
|
|
254
|
-
The audit hook logs usage after each completed turn. Hooks observe recorded
|
|
255
|
-
events; their failures don't fail the turn.
|
|
256
|
-
|
|
257
|
-
## Measure variants and regressions
|
|
258
|
-
|
|
259
|
-
The `weather-tool-efficiency` A/B experiment assigns sessions by a sticky
|
|
260
|
-
hash:
|
|
261
|
-
|
|
262
|
-
- `control` returns current conditions in Fahrenheit.
|
|
263
|
-
- `treatment` adds a brief Celsius instruction and changes `get_weather` to
|
|
264
|
-
return Celsius fields.
|
|
265
|
-
|
|
266
|
-
Samples and aggregate snapshots persist under the project state
|
|
267
|
-
directory. The treatment
|
|
268
|
-
only changes current conditions; `get_forecast` still returns Fahrenheit.
|
|
269
|
-
Treat the branch as an example of `ctx.session.abs`, not a complete unit
|
|
270
|
-
policy.
|
|
271
|
-
|
|
272
|
-
List and run the evals:
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
agent-sdk eval --dir examples/weather-agent --list
|
|
276
|
-
agent-sdk eval --dir examples/weather-agent --json
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
The suite covers weather and forecast routing, the local converter, workspace
|
|
280
|
-
notes, and the VM-side probe.
|
|
281
|
-
|
|
282
|
-
## Turn the weather tour into your own agent
|
|
283
|
-
|
|
284
|
-
Keep the shape and replace the domain:
|
|
285
|
-
|
|
286
|
-
- Swap Open-Meteo tools for your typed service clients.
|
|
287
|
-
- Keep deterministic transforms behind direct server tools or MCP.
|
|
288
|
-
- Use an agent tool only when code must run in the agent workspace.
|
|
289
|
-
- Put reusable procedures in skills and narrow specialist work into
|
|
290
|
-
subagents.
|
|
291
|
-
- Add a channel only when the external surface needs its own identity,
|
|
292
|
-
continuation key, or delivery behavior.
|
|
293
|
-
|
|
294
|
-
## Where to go next
|
|
295
|
-
|
|
296
|
-
- [Tools](../reference/tools.md)
|
|
297
|
-
- [MCP connections](../reference/connections.md)
|
|
298
|
-
- [Human-in-the-loop approvals](../guides/human-in-the-loop.md)
|
|
299
|
-
- [Slack](../guides/slack.md)
|
|
300
|
-
- [Schedules and reminders](../reference/schedules.md)
|
|
301
|
-
- [Evals](../evals.md)
|
|
302
|
-
- [Live A/B metrics](../ab.md)
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor-account mode for the Slack channel pack: instead of a dedicated
|
|
3
|
-
* Slack app (Socket Mode + `xoxb`/`xapp` tokens), the channel rides the
|
|
4
|
-
* signed-in Cursor account's Slack connection. Inbound events are relayed
|
|
5
|
-
* by the serve host from `/v0/slack-events` (see
|
|
6
|
-
* `internal/cursor-slack-relay.ts`); outbound Web API calls run through a
|
|
7
|
-
* {@link SlackApiTransport} bound to the backend proxy.
|
|
8
|
-
*
|
|
9
|
-
* This file is the seam between the channel definition (authored at
|
|
10
|
-
* `defineChannel` time) and the serve-time relay: `slackChannel()` registers
|
|
11
|
-
* a runtime ref here, and the server discovers it, binds the transport, and
|
|
12
|
-
* dispatches relayed envelopes through the pack's normal inbound path.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import type { ArtifactsApi, HostContext, SendMessageFn } from "../../types.js";
|
|
16
|
-
import { dispatchInboundMessage } from "./dispatch.js";
|
|
17
|
-
import type { EventIdDedupe } from "./event-id-dedupe.js";
|
|
18
|
-
import { slackTextToMarkdown } from "./inbound.js";
|
|
19
|
-
import type { SlackLog } from "./log.js";
|
|
20
|
-
import type {
|
|
21
|
-
SlackApiTransport,
|
|
22
|
-
SlackChannelOptions,
|
|
23
|
-
SlackCredentials,
|
|
24
|
-
SlackMessage,
|
|
25
|
-
SlackMessageFile,
|
|
26
|
-
SlackMessageHandler,
|
|
27
|
-
} from "./types.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Transport placeholder created at `slackChannel()` definition time and
|
|
31
|
-
* bound to the real backend proxy caller when the serve host starts its
|
|
32
|
-
* relay. Calls before binding soft-fail Slack-style.
|
|
33
|
-
*/
|
|
34
|
-
export interface PendingSlackApiTransport extends SlackApiTransport {
|
|
35
|
-
bind(impl: SlackApiTransport["call"]): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function createPendingSlackApiTransport(): PendingSlackApiTransport {
|
|
39
|
-
let bound: SlackApiTransport["call"] | undefined;
|
|
40
|
-
return {
|
|
41
|
-
kind: "api-transport",
|
|
42
|
-
label: "cursor-account",
|
|
43
|
-
bind(impl) {
|
|
44
|
-
bound = impl;
|
|
45
|
-
},
|
|
46
|
-
async call(method, args) {
|
|
47
|
-
if (bound === undefined) {
|
|
48
|
-
return { ok: false, error: "cursor_slack_relay_not_started" };
|
|
49
|
-
}
|
|
50
|
-
return bound(method, args);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* One routed Slack event from `/v0/slack-events` (mirror of the backend's
|
|
57
|
-
* SlackAgentEventEnvelope, minus server-only fields).
|
|
58
|
-
*/
|
|
59
|
-
export interface CursorSlackEnvelope {
|
|
60
|
-
eventName: string;
|
|
61
|
-
slackTeamId: string;
|
|
62
|
-
channelId: string;
|
|
63
|
-
channelType?: string;
|
|
64
|
-
threadTs: string;
|
|
65
|
-
messageTs: string;
|
|
66
|
-
slackUserId?: string;
|
|
67
|
-
text: string;
|
|
68
|
-
agentName: string;
|
|
69
|
-
consumerId: string;
|
|
70
|
-
/**
|
|
71
|
-
* How the backend routed the event: leading agent name or owned thread.
|
|
72
|
-
*/
|
|
73
|
-
matchedBy: "name" | "thread";
|
|
74
|
-
eventId?: string;
|
|
75
|
-
receivedAtMs: number;
|
|
76
|
-
/**
|
|
77
|
-
* Slack file uploads on the triggering message. When `dataBase64` is set
|
|
78
|
-
* the Cursor backend already downloaded bytes (cursorAccount has no bot
|
|
79
|
-
* token for files.slack.com).
|
|
80
|
-
*/
|
|
81
|
-
files?: SlackMessageFile[];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Serve-time runtime handle for one cursor-account Slack channel. */
|
|
85
|
-
export interface SlackCursorAccountRuntime {
|
|
86
|
-
options: SlackChannelOptions;
|
|
87
|
-
/** The channel's live credentials (botToken slot holds the transport). */
|
|
88
|
-
credentials: SlackCredentials;
|
|
89
|
-
transport: PendingSlackApiTransport;
|
|
90
|
-
eventIds: EventIdDedupe;
|
|
91
|
-
onAppMention: SlackMessageHandler;
|
|
92
|
-
onDirectMessage: SlackMessageHandler;
|
|
93
|
-
getLog: () => SlackLog;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const runtimeByDefinition = new WeakMap<object, SlackCursorAccountRuntime>();
|
|
97
|
-
|
|
98
|
-
export function registerSlackCursorAccountRuntime(
|
|
99
|
-
definition: object,
|
|
100
|
-
runtime: SlackCursorAccountRuntime
|
|
101
|
-
): void {
|
|
102
|
-
runtimeByDefinition.set(definition, runtime);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Recover the cursor-account runtime for a channel definition, if it was
|
|
107
|
-
* created via `slackChannel({ cursorAccount: true })`.
|
|
108
|
-
*/
|
|
109
|
-
export function getSlackCursorAccountRuntime(
|
|
110
|
-
definition: object
|
|
111
|
-
): SlackCursorAccountRuntime | undefined {
|
|
112
|
-
return runtimeByDefinition.get(definition);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Dispatch one relayed envelope through the pack's normal inbound path
|
|
117
|
-
* (same handlers, session continuation, and reply delivery as Socket Mode).
|
|
118
|
-
*/
|
|
119
|
-
export async function dispatchCursorSlackEnvelope(args: {
|
|
120
|
-
runtime: SlackCursorAccountRuntime;
|
|
121
|
-
envelope: CursorSlackEnvelope;
|
|
122
|
-
send: SendMessageFn;
|
|
123
|
-
host: HostContext;
|
|
124
|
-
artifacts: ArtifactsApi;
|
|
125
|
-
hasContinuationSession?: (continuationToken: string) => Promise<boolean>;
|
|
126
|
-
isContinuationBusy?: (continuationToken: string) => Promise<boolean>;
|
|
127
|
-
getContinuationLastBotMessageTs?: (
|
|
128
|
-
continuationToken: string
|
|
129
|
-
) => Promise<string | undefined>;
|
|
130
|
-
interruptContinuation?: (continuationToken: string) => Promise<boolean>;
|
|
131
|
-
}): Promise<void> {
|
|
132
|
-
const { runtime, envelope } = args;
|
|
133
|
-
const log = runtime.getLog();
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
envelope.eventId !== undefined &&
|
|
137
|
-
envelope.eventId.length > 0 &&
|
|
138
|
-
!runtime.eventIds.tryHandle(envelope.eventId)
|
|
139
|
-
) {
|
|
140
|
-
log.debug("cursor-account inbound dedupe drop", {
|
|
141
|
-
event_id: envelope.eventId,
|
|
142
|
-
});
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const message: SlackMessage = {
|
|
147
|
-
text: envelope.text,
|
|
148
|
-
body: envelope.text,
|
|
149
|
-
markdown: slackTextToMarkdown(envelope.text),
|
|
150
|
-
ts: envelope.messageTs,
|
|
151
|
-
threadTs: envelope.threadTs,
|
|
152
|
-
channelId: envelope.channelId,
|
|
153
|
-
teamId: envelope.slackTeamId,
|
|
154
|
-
...(envelope.slackUserId === undefined
|
|
155
|
-
? {}
|
|
156
|
-
: {
|
|
157
|
-
author: { userId: envelope.slackUserId, isBot: false },
|
|
158
|
-
}),
|
|
159
|
-
files: envelope.files,
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// DMs to @Cursor route as direct messages; everything else (explicit
|
|
163
|
-
// `@Cursor <agent> …` mentions and claimed-thread replies) dispatches on
|
|
164
|
-
// the mention handler — a claimed-thread reply is addressed to the agent
|
|
165
|
-
// by construction. Mentions/DM disable toggles are rejected at
|
|
166
|
-
// `slackChannel({ cursorAccount: true })` construction so the backend
|
|
167
|
-
// never consumes events the host would drop.
|
|
168
|
-
const isDm =
|
|
169
|
-
envelope.channelType === "im" || envelope.channelId.startsWith("D");
|
|
170
|
-
const kind = isDm ? "direct_message" : "app_mention";
|
|
171
|
-
const handler = isDm ? runtime.onDirectMessage : runtime.onAppMention;
|
|
172
|
-
await dispatchInboundMessage({
|
|
173
|
-
kind,
|
|
174
|
-
message,
|
|
175
|
-
handler,
|
|
176
|
-
send: args.send,
|
|
177
|
-
credentials: runtime.credentials,
|
|
178
|
-
host: args.host,
|
|
179
|
-
artifacts: args.artifacts,
|
|
180
|
-
log,
|
|
181
|
-
evalCommandsEnabled: runtime.options.evalCommands !== false,
|
|
182
|
-
cursorAgentName: envelope.agentName,
|
|
183
|
-
// Backend router already refused externals for this envelope.
|
|
184
|
-
blockExternals: false,
|
|
185
|
-
...(args.hasContinuationSession === undefined
|
|
186
|
-
? {}
|
|
187
|
-
: { hasContinuationSession: args.hasContinuationSession }),
|
|
188
|
-
...(args.isContinuationBusy === undefined
|
|
189
|
-
? {}
|
|
190
|
-
: { isContinuationBusy: args.isContinuationBusy }),
|
|
191
|
-
...(args.getContinuationLastBotMessageTs === undefined
|
|
192
|
-
? {}
|
|
193
|
-
: {
|
|
194
|
-
getContinuationLastBotMessageTs: args.getContinuationLastBotMessageTs,
|
|
195
|
-
}),
|
|
196
|
-
...(args.interruptContinuation === undefined
|
|
197
|
-
? {}
|
|
198
|
-
: { interruptContinuation: args.interruptContinuation }),
|
|
199
|
-
continuation: runtime.options.continuation,
|
|
200
|
-
...(envelope.eventId === undefined ? {} : { eventId: envelope.eventId }),
|
|
201
|
-
});
|
|
202
|
-
}
|