@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,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Best-effort
|
|
2
|
+
* Best-effort PR references from free-form chat (Slack, etc.).
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { type PrProvider, parsePrUrl } from "../../internal/scm/pr-url.js";
|
|
6
|
+
|
|
5
7
|
export interface GithubPrRef {
|
|
6
8
|
/** Normalized URL `https://github.com/owner/repo/pull/N`. */
|
|
7
9
|
url: string;
|
|
@@ -12,39 +14,68 @@ export interface GithubPrRef {
|
|
|
12
14
|
number: number;
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
export type OriginPrRef = GithubPrRef;
|
|
18
|
+
|
|
19
|
+
const URL_IN_TEXT = /https?:\/\/[^\s>|]+/gi;
|
|
20
|
+
|
|
21
|
+
function githubRef(owner: string, repo: string, number: number): GithubPrRef {
|
|
22
|
+
return {
|
|
23
|
+
owner,
|
|
24
|
+
repo,
|
|
25
|
+
number,
|
|
26
|
+
url: `https://github.com/${owner}/${repo}/pull/${number}`,
|
|
27
|
+
label: `${owner}/${repo}#${number}`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function firstUrlRef(
|
|
32
|
+
text: string,
|
|
33
|
+
provider: PrProvider
|
|
34
|
+
): GithubPrRef | undefined {
|
|
35
|
+
const matches = text.match(URL_IN_TEXT);
|
|
36
|
+
if (matches === null) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
for (const raw of matches) {
|
|
40
|
+
const parsed = parsePrUrl(raw);
|
|
41
|
+
if (parsed?.provider === provider) {
|
|
42
|
+
return {
|
|
43
|
+
owner: parsed.owner,
|
|
44
|
+
repo: parsed.repo,
|
|
45
|
+
number: parsed.number,
|
|
46
|
+
url: parsed.url,
|
|
47
|
+
label: `${parsed.owner}/${parsed.repo}#${parsed.number}`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Find the first Origin PR URL in `text`.
|
|
56
|
+
* Does not treat bare `owner/repo#N` as Origin.
|
|
57
|
+
*/
|
|
58
|
+
export function extractOriginPrRef(text: string): OriginPrRef | undefined {
|
|
59
|
+
return firstUrlRef(text, "origin");
|
|
60
|
+
}
|
|
61
|
+
|
|
15
62
|
/**
|
|
16
63
|
* Find the first GitHub PR URL or `owner/repo#N` in `text`.
|
|
17
64
|
* Returns `undefined` when none is present.
|
|
18
65
|
*/
|
|
19
66
|
export function extractGithubPrRef(text: string): GithubPrRef | undefined {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (urlMatch !== null) {
|
|
24
|
-
const owner = urlMatch[1] as string;
|
|
25
|
-
const repo = urlMatch[2] as string;
|
|
26
|
-
const number = Number(urlMatch[3]);
|
|
27
|
-
return {
|
|
28
|
-
owner,
|
|
29
|
-
repo,
|
|
30
|
-
number,
|
|
31
|
-
url: `https://github.com/${owner}/${repo}/pull/${number}`,
|
|
32
|
-
label: `${owner}/${repo}#${number}`,
|
|
33
|
-
};
|
|
67
|
+
const fromUrl = firstUrlRef(text, "github");
|
|
68
|
+
if (fromUrl !== undefined) {
|
|
69
|
+
return fromUrl;
|
|
34
70
|
}
|
|
35
71
|
|
|
36
72
|
const hashMatch = text.match(/\b([\w.-]+)\/([\w.-]+)#(\d+)\b/);
|
|
37
73
|
if (hashMatch === null) {
|
|
38
74
|
return undefined;
|
|
39
75
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
repo,
|
|
46
|
-
number,
|
|
47
|
-
url: `https://github.com/${owner}/${repo}/pull/${number}`,
|
|
48
|
-
label: `${owner}/${repo}#${number}`,
|
|
49
|
-
};
|
|
76
|
+
return githubRef(
|
|
77
|
+
hashMatch[1] as string,
|
|
78
|
+
hashMatch[2] as string,
|
|
79
|
+
Number(hashMatch[3])
|
|
80
|
+
);
|
|
50
81
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slack setup guide printed by `agent-serve slack setup`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* is
|
|
7
|
-
*
|
|
4
|
+
* Dedicated Socket Mode app via `slack create` (dashboard wizard).
|
|
5
|
+
* `slack init --manual` is the unmanaged paste-at-api.slack.com path.
|
|
6
|
+
* {@link SLACK_SETUP_PHASES} is that checklist; its ids key
|
|
7
|
+
* `.agent-serve/slack/setup-status.json`.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
export interface SlackSetupPhase {
|
|
@@ -101,17 +101,10 @@ export function formatSlackSetupGuide(): string {
|
|
|
101
101
|
const lines: string[] = [
|
|
102
102
|
"agent-serve — Slack setup",
|
|
103
103
|
"",
|
|
104
|
-
"
|
|
105
|
-
"",
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
" Sign in (agent-serve login / CURSOR_API_KEY), serve, then mention",
|
|
109
|
-
' "@Cursor MyAgent ..." in the linked workspace. No app, no tokens.',
|
|
110
|
-
" B) Dedicated Slack app (Socket Mode) via the dashboard wizard:",
|
|
111
|
-
" agent-serve slack create --dir .",
|
|
112
|
-
" Finish Slack consent and the bot name there. The CLI writes",
|
|
113
|
-
" tokens into .env.local. Use this when you need your own bot",
|
|
114
|
-
" user, channel watching, or approval buttons.",
|
|
104
|
+
"Dedicated Slack app (Socket Mode) via the dashboard wizard:",
|
|
105
|
+
" agent-serve slack create --dir .",
|
|
106
|
+
" Finish Slack consent and the bot name there. The CLI writes",
|
|
107
|
+
" tokens into .env.local.",
|
|
115
108
|
"",
|
|
116
109
|
"Manual Slack app: `slack init --manual`. Phases below.",
|
|
117
110
|
"Goal: importable dev + prod Slack apps over Socket Mode (no public URL).",
|
|
@@ -39,10 +39,6 @@ import {
|
|
|
39
39
|
tryResolveAppToken,
|
|
40
40
|
tryResolveBotToken,
|
|
41
41
|
} from "./credentials.js";
|
|
42
|
-
import {
|
|
43
|
-
createPendingSlackApiTransport,
|
|
44
|
-
registerSlackCursorAccountRuntime,
|
|
45
|
-
} from "./cursor-account.js";
|
|
46
42
|
import {
|
|
47
43
|
buildDefaultEvents,
|
|
48
44
|
createDefaultOnChannelPost,
|
|
@@ -67,12 +63,10 @@ import {
|
|
|
67
63
|
startSlackSocketMode,
|
|
68
64
|
} from "./socket-mode.js";
|
|
69
65
|
import { buildToolApprovalEvents } from "./tool-approval-events.js";
|
|
70
|
-
import {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
type SlackCredentials,
|
|
75
|
-
type SlackCursorAgentName,
|
|
66
|
+
import type {
|
|
67
|
+
SlackChannelOptions,
|
|
68
|
+
SlackChannelState,
|
|
69
|
+
SlackCredentials,
|
|
76
70
|
} from "./types.js";
|
|
77
71
|
|
|
78
72
|
/** Options used to construct a slack channel — for host-level credential binding. */
|
|
@@ -98,8 +92,7 @@ export interface SlackChannelHostBinding {
|
|
|
98
92
|
}
|
|
99
93
|
|
|
100
94
|
/**
|
|
101
|
-
* First
|
|
102
|
-
* `cursorAccount` channels — those have no local bot token for
|
|
95
|
+
* First Slack channel on a project. Used for
|
|
103
96
|
* {@link HostContext.slack.getClient}.
|
|
104
97
|
*/
|
|
105
98
|
export function resolveDedicatedSlackHostBinding(
|
|
@@ -107,7 +100,7 @@ export function resolveDedicatedSlackHostBinding(
|
|
|
107
100
|
): SlackChannelHostBinding | undefined {
|
|
108
101
|
for (const channel of channels) {
|
|
109
102
|
const options = slackChannelOptionsByDefinition.get(channel.definition);
|
|
110
|
-
if (options === undefined
|
|
103
|
+
if (options === undefined) {
|
|
111
104
|
continue;
|
|
112
105
|
}
|
|
113
106
|
return {
|
|
@@ -121,97 +114,19 @@ export function resolveDedicatedSlackHostBinding(
|
|
|
121
114
|
/**
|
|
122
115
|
* Create a Slack channel. Author as `agent/channels/slack.ts` default export.
|
|
123
116
|
*
|
|
124
|
-
* Missing credentials are not an error: without a token pair
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* When `cursorAccount` is on, `agentName` must be a single token (no
|
|
129
|
-
* whitespace) — string literals with spaces fail at the type level;
|
|
130
|
-
* runtime values are still checked by {@link assertSlackCursorAgentName}.
|
|
117
|
+
* Missing credentials are not an error: without a token pair the channel
|
|
118
|
+
* mounts idle and logs `channel idle`, so serving an agent never blocks
|
|
119
|
+
* on Slack setup.
|
|
131
120
|
*/
|
|
132
|
-
export function slackChannel
|
|
133
|
-
authored:
|
|
134
|
-
agentName?: SlackCursorAgentName<Name>;
|
|
135
|
-
} = {}
|
|
121
|
+
export function slackChannel(
|
|
122
|
+
authored: SlackChannelOptions = {}
|
|
136
123
|
): ChannelDefinition<SlackChannelState> {
|
|
137
124
|
const options = { ...authored };
|
|
138
125
|
if (options.continuation !== undefined) {
|
|
139
126
|
options.continuation = normalizeIdentity(options.continuation, "slack");
|
|
140
127
|
}
|
|
141
|
-
const cursorAccount = options.cursorAccount === true;
|
|
142
|
-
if (cursorAccount) {
|
|
143
|
-
// Token pair and the Cursor connection are different Slack apps —
|
|
144
|
-
// they can't be mixed on one channel definition.
|
|
145
|
-
if (options.credentials !== undefined || options.envPrefix !== undefined) {
|
|
146
|
-
throw new Error(
|
|
147
|
-
"slackChannel({ cursorAccount: true }) uses the Cursor account's Slack connection — do not also set credentials/envPrefix. Author a second slack channel file for a dedicated Slack app."
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
if (options.agentName !== undefined) {
|
|
151
|
-
assertSlackCursorAgentName(options.agentName);
|
|
152
|
-
}
|
|
153
|
-
// Channel watching is Socket Mode only — cursorAccount agents must be
|
|
154
|
-
// explicitly addressed (@mention, DM, or claimed-thread reply).
|
|
155
|
-
if (options.engagement?.channelPosts !== undefined) {
|
|
156
|
-
throw new Error(
|
|
157
|
-
"slackChannel({ cursorAccount: true }) does not support engagement.channelPosts — agents must be explicitly addressed (@mention, DM, or claimed-thread reply). Channel watching is Socket Mode only."
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
// Bot-mention wake needs the app's own bot identity (auth.test) and
|
|
161
|
-
// Socket Mode event delivery; the Cursor relay drops bot-authored
|
|
162
|
-
// mentions before they reach the agent.
|
|
163
|
-
if (options.engagement?.botMentions !== undefined) {
|
|
164
|
-
throw new Error(
|
|
165
|
-
"slackChannel({ cursorAccount: true }) does not support engagement.botMentions — bot-to-bot mention wake is Socket Mode only (author a dedicated Slack app channel)."
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
// Mentions/DMs are always routed by the backend. Disabling them
|
|
169
|
-
// client-side would black-hole events the webhook already stole from
|
|
170
|
-
// native Cursor handling — reject at construction instead.
|
|
171
|
-
if (options.engagement?.mentions === false) {
|
|
172
|
-
throw new Error(
|
|
173
|
-
"slackChannel({ cursorAccount: true }) cannot set engagement.mentions to false — the Cursor Slack relay always delivers mention and claimed-thread traffic."
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
if (options.engagement?.directMessages === false) {
|
|
177
|
-
throw new Error(
|
|
178
|
-
"slackChannel({ cursorAccount: true }) cannot set engagement.directMessages to false — DM continuity is part of the Cursor Slack connection."
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
// Tool approvals / interactivity ride Slack Socket Mode `interactive`
|
|
182
|
-
// envelopes; the Cursor connection does not relay Block Kit clicks, so
|
|
183
|
-
// there is no backend tap to route Approve/Deny over cursorAccount.
|
|
184
|
-
// Reject at construction (same posture as channelPosts) instead of
|
|
185
|
-
// silently dropping clicks. Approvals stay available on a dedicated
|
|
186
|
-
// Socket Mode Slack app channel.
|
|
187
|
-
if (options.toolApprovals === true) {
|
|
188
|
-
throw new Error(
|
|
189
|
-
"slackChannel({ cursorAccount: true }) does not support toolApprovals — Approve/Deny clicks are not relayed over the Cursor Slack connection. Tool approvals are Socket Mode only (author a dedicated Slack app channel for them)."
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
if (options.interactivity === true) {
|
|
193
|
-
throw new Error(
|
|
194
|
-
"slackChannel({ cursorAccount: true }) does not support interactivity — interactive Block Kit clicks are not relayed over the Cursor Slack connection. Interactivity is Socket Mode only."
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
if (options.onBlockAction !== undefined) {
|
|
198
|
-
throw new Error(
|
|
199
|
-
"slackChannel({ cursorAccount: true }) does not support onBlockAction — interactive Block Kit clicks are not relayed over the Cursor Slack connection. Block actions are Socket Mode only."
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
if (options.onReactionAdded !== undefined) {
|
|
203
|
-
throw new Error(
|
|
204
|
-
"slackChannel({ cursorAccount: true }) does not support onReactionAdded because the Cursor Slack relay does not forward reaction events. Reaction handling is Socket Mode only."
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const accountTransport = cursorAccount
|
|
209
|
-
? createPendingSlackApiTransport()
|
|
210
|
-
: undefined;
|
|
211
128
|
const credentials =
|
|
212
|
-
|
|
213
|
-
? { botToken: accountTransport }
|
|
214
|
-
: (options.credentials ?? credentialsFromEnv(options.envPrefix));
|
|
129
|
+
options.credentials ?? credentialsFromEnv(options.envPrefix);
|
|
215
130
|
const envKeys = slackEnvKeys(options.envPrefix);
|
|
216
131
|
const loadingMessages = options.loadingMessages;
|
|
217
132
|
const policy = options.policy;
|
|
@@ -259,9 +174,7 @@ export function slackChannel<const Name extends string = string>(
|
|
|
259
174
|
events,
|
|
260
175
|
buildDefaultEvents({
|
|
261
176
|
credentials,
|
|
262
|
-
|
|
263
|
-
// final postMessage for the reply (proxy pins agent username/icon).
|
|
264
|
-
streaming: cursorAccount ? false : options.streaming,
|
|
177
|
+
streaming: options.streaming,
|
|
265
178
|
thinkingSteps: options.thinkingSteps,
|
|
266
179
|
suggestedPrompts: options.suggestedPrompts,
|
|
267
180
|
suggestedPromptsTitle: options.suggestedPromptsTitle,
|
|
@@ -307,8 +220,7 @@ export function slackChannel<const Name extends string = string>(
|
|
|
307
220
|
directMessagesEnabled,
|
|
308
221
|
evalCommandsEnabled,
|
|
309
222
|
followUpStatus,
|
|
310
|
-
|
|
311
|
-
blockExternals: cursorAccount ? false : blockExternals,
|
|
223
|
+
blockExternals,
|
|
312
224
|
...(args.hasContinuationSession === undefined
|
|
313
225
|
? {}
|
|
314
226
|
: { hasContinuationSession: args.hasContinuationSession }),
|
|
@@ -335,7 +247,6 @@ export function slackChannel<const Name extends string = string>(
|
|
|
335
247
|
routes: [],
|
|
336
248
|
meta: {
|
|
337
249
|
kind: "slack",
|
|
338
|
-
...(cursorAccount ? { slackCursorAccount: true } : {}),
|
|
339
250
|
...(channelPosts === undefined
|
|
340
251
|
? {}
|
|
341
252
|
: { slackChannelPosts: [...channelPosts.allow] }),
|
|
@@ -390,13 +301,6 @@ export function slackChannel<const Name extends string = string>(
|
|
|
390
301
|
async onStart(args) {
|
|
391
302
|
runtime.log = createSlackLogger(args.logger ?? options.logger);
|
|
392
303
|
|
|
393
|
-
if (cursorAccount) {
|
|
394
|
-
// Inbound arrives through the serve host's Cursor Slack relay
|
|
395
|
-
// (`/v0/slack-events`), not Socket Mode; outbound goes through the
|
|
396
|
-
// bound API transport. Nothing to start here.
|
|
397
|
-
getLog().info("channel start", { transport: "cursor-account" });
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
304
|
getLog().info("channel start", { transport: "socket" });
|
|
401
305
|
|
|
402
306
|
const appToken = await tryResolveAppToken(credentials);
|
|
@@ -640,20 +544,5 @@ export function slackChannel<const Name extends string = string>(
|
|
|
640
544
|
|
|
641
545
|
slackChannelOptionsByDefinition.set(definition, options);
|
|
642
546
|
|
|
643
|
-
if (accountTransport !== undefined) {
|
|
644
|
-
// Serve-time seam: the host discovers cursor-account channels through
|
|
645
|
-
// this registry, binds the outbound transport, and dispatches relayed
|
|
646
|
-
// inbound envelopes through the pack's normal path.
|
|
647
|
-
registerSlackCursorAccountRuntime(definition, {
|
|
648
|
-
options,
|
|
649
|
-
credentials,
|
|
650
|
-
transport: accountTransport,
|
|
651
|
-
eventIds,
|
|
652
|
-
onAppMention,
|
|
653
|
-
onDirectMessage,
|
|
654
|
-
getLog,
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
|
|
658
547
|
return definition;
|
|
659
548
|
}
|
|
@@ -13,14 +13,13 @@ import type {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Pluggable Slack Web API caller. Instead of holding a raw `xoxb-…` token,
|
|
16
|
-
* calls are executed by `call
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* platform errors) and only throw on programmer error.
|
|
16
|
+
* calls are executed by `call`. Implementations return the Slack response
|
|
17
|
+
* body (including `ok: false` platform errors) and only throw on
|
|
18
|
+
* programmer error.
|
|
20
19
|
*/
|
|
21
20
|
export interface SlackApiTransport {
|
|
22
21
|
kind: "api-transport";
|
|
23
|
-
/** Human-readable transport label for logs
|
|
22
|
+
/** Human-readable transport label for logs. */
|
|
24
23
|
label: string;
|
|
25
24
|
call(
|
|
26
25
|
method: string,
|
|
@@ -122,8 +121,8 @@ export interface SlackMessageFile {
|
|
|
122
121
|
mode?: string;
|
|
123
122
|
size?: number;
|
|
124
123
|
/**
|
|
125
|
-
* When set
|
|
126
|
-
*
|
|
124
|
+
* When set, bytes were already downloaded by the caller. Skip a second
|
|
125
|
+
* `files.info` / private URL fetch.
|
|
127
126
|
*/
|
|
128
127
|
dataBase64?: string;
|
|
129
128
|
}
|
|
@@ -333,8 +332,7 @@ export interface SlackChannelPostsOptions {
|
|
|
333
332
|
* channel the bot is in. Must be non-empty (empty is a definition error).
|
|
334
333
|
* `#names` are resolved to ids via `conversations.list` when the channel
|
|
335
334
|
* starts; the bot must be a member of each watched channel to receive its
|
|
336
|
-
* messages.
|
|
337
|
-
* `engagement.channelPosts`.
|
|
335
|
+
* messages.
|
|
338
336
|
*
|
|
339
337
|
* `"*"` suits agents whose handler decides per message (a thread the agent
|
|
340
338
|
* is already in, say) rather than per channel. Every delivered message then
|
|
@@ -384,11 +382,8 @@ export interface SlackBotMentionsOptions {
|
|
|
384
382
|
* - `"U…"` — a bot *user* id.
|
|
385
383
|
* - `"<botId>:<username>"` — compound: the posting app's `bot_id` AND its
|
|
386
384
|
* message `username` must both match (case-insensitive username). Use
|
|
387
|
-
* this
|
|
388
|
-
*
|
|
389
|
-
* agent's `username` server-side — `"B0CURSOR…:Lasso"` trusts only the
|
|
390
|
-
* Cursor app posting as Lasso, not every Cursor-connected agent.
|
|
391
|
-
* Fails closed when the event carries no username.
|
|
385
|
+
* this when several agents post through one app under different
|
|
386
|
+
* usernames. Fails closed when the event carries no username.
|
|
392
387
|
*
|
|
393
388
|
* Must be non-empty (empty is a definition error).
|
|
394
389
|
*/
|
|
@@ -432,51 +427,10 @@ export interface SlackEngagementOptions {
|
|
|
432
427
|
channelPosts?: SlackChannelPostsOptions;
|
|
433
428
|
/**
|
|
434
429
|
* Opt-in bot-to-bot mention wake (see {@link SlackBotMentionsOptions}).
|
|
435
|
-
* Socket Mode only — rejected on `cursorAccount: true`.
|
|
436
430
|
*/
|
|
437
431
|
botMentions?: SlackBotMentionsOptions;
|
|
438
432
|
}
|
|
439
433
|
|
|
440
|
-
/**
|
|
441
|
-
* Whitespace forbidden in {@link SlackChannelOptions.agentName}. The Cursor
|
|
442
|
-
* Slack router matches on leading words; multi-word names collide with Named
|
|
443
|
-
* Agent shortened-prefix matching (`Approval …` stealing `ApprovalBuddy`).
|
|
444
|
-
*/
|
|
445
|
-
type SlackAgentNameWhitespace = " " | "\t" | "\n" | "\r" | "\f" | "\v";
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Single-token Cursor Slack handle for `cursorAccount` routing
|
|
449
|
-
* (`@Cursor <name> …`). String literals that contain whitespace become
|
|
450
|
-
* `never` (type error at the call site); plain `string` stays `string` and
|
|
451
|
-
* is still rejected at runtime by {@link assertSlackCursorAgentName}.
|
|
452
|
-
*/
|
|
453
|
-
export type SlackCursorAgentName<S extends string = string> = string extends S
|
|
454
|
-
? string
|
|
455
|
-
: S extends `${string}${SlackAgentNameWhitespace}${string}`
|
|
456
|
-
? never
|
|
457
|
-
: S;
|
|
458
|
-
|
|
459
|
-
const SLACK_CURSOR_AGENT_NAME_WHITESPACE = /\s/;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Runtime guard for {@link SlackChannelOptions.agentName}. Call from
|
|
463
|
-
* `slackChannel({ cursorAccount: true })` construction and serve-time
|
|
464
|
-
* name resolution so derived defaults cannot sneak spaces in.
|
|
465
|
-
*/
|
|
466
|
-
export function assertSlackCursorAgentName(name: string): void {
|
|
467
|
-
const trimmed = name.trim();
|
|
468
|
-
if (trimmed.length === 0) {
|
|
469
|
-
throw new Error(
|
|
470
|
-
'slackChannel({ cursorAccount: true }) agentName must be a non-empty single token (no whitespace), e.g. "ApprovalBuddy".'
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
if (SLACK_CURSOR_AGENT_NAME_WHITESPACE.test(trimmed)) {
|
|
474
|
-
throw new Error(
|
|
475
|
-
`slackChannel({ cursorAccount: true }) agentName must be a single token with no whitespace (got ${JSON.stringify(name)}). Use PascalCase like "ApprovalBuddy" — multi-word names break @Cursor routing.`
|
|
476
|
-
);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
434
|
/** `"thread"` = anyone in the thread (default); `"author"` = session starter only. */
|
|
481
435
|
export type SlackRespondTo = "thread" | "author";
|
|
482
436
|
|
|
@@ -504,38 +458,6 @@ export interface SlackChannelOptions {
|
|
|
504
458
|
* Ignored when `credentials` is set explicitly.
|
|
505
459
|
*/
|
|
506
460
|
envPrefix?: string;
|
|
507
|
-
/**
|
|
508
|
-
* Use the signed-in Cursor account's Slack connection instead of a
|
|
509
|
-
* dedicated Slack app: no bot/app tokens, no extra install. Inbound
|
|
510
|
-
* traffic (`@Cursor <agent name> …` mentions, replies in threads the
|
|
511
|
-
* agent owns, and DMs) is relayed from the Cursor backend
|
|
512
|
-
* (`/v0/slack-events`), and outbound Web API calls are proxied through it
|
|
513
|
-
* — the agent posts as the Cursor Slack app with this agent's name and
|
|
514
|
-
* icon.
|
|
515
|
-
*
|
|
516
|
-
* Both paths stay first-class: omit this (default) for the classic
|
|
517
|
-
* Socket-Mode channel with your own Slack app and tokens. Requires a
|
|
518
|
-
* signed-in host (`agent-serve login` / `CURSOR_API_KEY`) and a Slack
|
|
519
|
-
* account linked to the Cursor account. Mutually exclusive with
|
|
520
|
-
* `credentials` / `envPrefix`. `engagement.mentions: false` and
|
|
521
|
-
* `engagement.directMessages: false` are rejected (the relay always
|
|
522
|
-
* carries that traffic). Channel watching (`engagement.channelPosts`) and
|
|
523
|
-
* tool approvals / interactivity (`toolApprovals` / `interactivity`) are
|
|
524
|
-
* Socket Mode only — not supported on cursorAccount; agents must be
|
|
525
|
-
* explicitly addressed, and Approve/Deny buttons need a dedicated Slack
|
|
526
|
-
* app.
|
|
527
|
-
*/
|
|
528
|
-
cursorAccount?: boolean;
|
|
529
|
-
/**
|
|
530
|
-
* Single-token display name registered with the Cursor backend when
|
|
531
|
-
* {@link cursorAccount} is on: `@Cursor <agentName> …` routes here, and
|
|
532
|
-
* replies post under this username. **No whitespace** — prefer PascalCase
|
|
533
|
-
* (`ApprovalBuddy`). Defaults to a PascalCase name derived from the
|
|
534
|
-
* agent's mount slug (or project name).
|
|
535
|
-
*/
|
|
536
|
-
agentName?: SlackCursorAgentName;
|
|
537
|
-
/** Avatar for posts when {@link cursorAccount} is on. */
|
|
538
|
-
agentIcon?: { url?: string; emoji?: string };
|
|
539
461
|
/**
|
|
540
462
|
* Optional log sink. When omitted, uses `console.log` until the server
|
|
541
463
|
* mounts the channel and rebinds to {@link ServeOptions.logger}.
|
|
@@ -573,9 +495,7 @@ export interface SlackChannelOptions {
|
|
|
573
495
|
deliverDefaults?: boolean;
|
|
574
496
|
/**
|
|
575
497
|
* Stream assistant text while the turn runs via `chat.startStream` /
|
|
576
|
-
* `appendStream` / `stopStream` (defaults to `true`
|
|
577
|
-
* Ignored when {@link cursorAccount} is on — that path never edits posts
|
|
578
|
-
* (`setStatus` + one final `chat.postMessage` only).
|
|
498
|
+
* `appendStream` / `stopStream` (defaults to `true`).
|
|
579
499
|
*/
|
|
580
500
|
streaming?: boolean;
|
|
581
501
|
/**
|
|
@@ -598,9 +518,7 @@ export interface SlackChannelOptions {
|
|
|
598
518
|
*
|
|
599
519
|
* Framework park/resume is enabled by `needsApproval` on server tools.
|
|
600
520
|
* Set this to `true` to also post Block Kit Approve/Deny cards and route
|
|
601
|
-
* the Socket Mode `interactive` clicks to `resolveApproval`.
|
|
602
|
-
* only — rejected on `cursorAccount: true` (the Cursor Slack connection
|
|
603
|
-
* does not relay Block Kit clicks).
|
|
521
|
+
* the Socket Mode `interactive` clicks to `resolveApproval`.
|
|
604
522
|
*
|
|
605
523
|
* Defaults to `false`. For custom composition, spread
|
|
606
524
|
* `buildToolApprovalEvents({ credentials })` into `events`.
|
|
@@ -609,8 +527,7 @@ export interface SlackChannelOptions {
|
|
|
609
527
|
/**
|
|
610
528
|
* Route interactive payloads to approval resolution without opting into
|
|
611
529
|
* the full {@link buildToolApprovalEvents} handler pack. Use when
|
|
612
|
-
* composing `buildToolApprovalEvents` into `events` manually.
|
|
613
|
-
* only — rejected on `cursorAccount: true`.
|
|
530
|
+
* composing `buildToolApprovalEvents` into `events` manually.
|
|
614
531
|
*/
|
|
615
532
|
interactivity?: boolean;
|
|
616
533
|
/**
|
|
@@ -622,7 +539,6 @@ export interface SlackChannelOptions {
|
|
|
622
539
|
* thread, or `null` to ignore the click. Setting this implies
|
|
623
540
|
* interactive routing; the Slack app manifest still needs
|
|
624
541
|
* `interactivity` enabled (`buildSlackManifest({ interactivity: true })`).
|
|
625
|
-
* Socket Mode only — rejected on `cursorAccount: true`.
|
|
626
542
|
*/
|
|
627
543
|
onBlockAction?: SlackBlockActionHandler;
|
|
628
544
|
/**
|
package/src/client.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side plumbing for talking to a running agent-serve deployment:
|
|
3
|
+
* production target resolution (stored Cursor login → engineAccess URL and
|
|
4
|
+
* headers), request-header assembly, and the sessions listing used for
|
|
5
|
+
* latest-session binding.
|
|
6
|
+
*
|
|
7
|
+
* This entry point exists for first-party CLI clients (`agsh`); agent code
|
|
8
|
+
* should not need it.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
mergeRequestHeaders,
|
|
13
|
+
type RequestAuth,
|
|
14
|
+
} from "./internal/request-headers.js";
|
|
15
|
+
export {
|
|
16
|
+
PROD_ENGINE_WAKE_HEADERS,
|
|
17
|
+
ProdTargetError,
|
|
18
|
+
type ResolvedProdTarget,
|
|
19
|
+
type ResolveProdTargetOptions,
|
|
20
|
+
resolveProdTarget,
|
|
21
|
+
} from "./internal/resolve-prod-target.js";
|
|
22
|
+
export { listSessions } from "./internal/sessions-client.js";
|
|
23
|
+
export type { SessionSummary } from "./types.js";
|
package/src/connections.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `defineConnection` — authored at `agent/mcp-connections/<name>.ts
|
|
2
|
+
* `defineConnection` — authored at `agent/mcp-connections/<name>.ts`
|
|
3
|
+
* (model + host) or `agent/host-connections/<name>.ts` (host + `mcp oauth`
|
|
4
|
+
* only).
|
|
3
5
|
*
|
|
4
6
|
* A connection gives tools from an external MCP server. The filename
|
|
5
|
-
* becomes the connection (server) name.
|
|
6
|
-
* `mcpServers`), host (`ctx.host.mcp`),
|
|
7
|
-
* Pass `advertiseTools: true` for named
|
|
8
|
-
*
|
|
7
|
+
* becomes the connection (server) name. Files under `mcp-connections/`
|
|
8
|
+
* are available to the agent (SDK `mcpServers`), host (`ctx.host.mcp`),
|
|
9
|
+
* and channel/schedule handlers. Pass `advertiseTools: true` for named
|
|
10
|
+
* tools on local turns. Pass `effects: "read"` with `advertiseTools` to
|
|
11
|
+
* advertise only tools the server classifies as reads. Files under
|
|
12
|
+
* `host-connections/` stay off the model.
|
|
9
13
|
*
|
|
10
14
|
* ```ts
|
|
11
15
|
* import { defineConnection } from "@cursor/july/connections";
|
|
@@ -27,11 +31,16 @@
|
|
|
27
31
|
* },
|
|
28
32
|
* });
|
|
29
33
|
*
|
|
30
|
-
* // privileged connector, model cannot call directly:
|
|
31
34
|
* export default defineConnection({
|
|
32
35
|
* cursorAccount: true,
|
|
33
36
|
* servers: ["anytool"],
|
|
34
|
-
*
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* // query-only: advertise only tools classified as reads
|
|
40
|
+
* export default defineConnection({
|
|
41
|
+
* url: "https://api.cursor.com/v1/agent/mcp",
|
|
42
|
+
* advertiseTools: true,
|
|
43
|
+
* effects: "read",
|
|
35
44
|
* });
|
|
36
45
|
* ```
|
|
37
46
|
*
|
|
@@ -107,15 +116,19 @@ import type { ConnectionConfig, ConnectionDefinition } from "./types.js";
|
|
|
107
116
|
export type {
|
|
108
117
|
ConnectionConfig,
|
|
109
118
|
ConnectionDefinition,
|
|
119
|
+
ConnectionEffects,
|
|
110
120
|
ConnectionTransport,
|
|
111
121
|
HostMcpCallResult,
|
|
112
122
|
HostMcpRegistry,
|
|
113
123
|
HostMcpToolInfo,
|
|
114
124
|
InlineStdioConnectionConfig,
|
|
115
125
|
InlineStdioToolConfig,
|
|
126
|
+
ToolEffect,
|
|
116
127
|
} from "./types.js";
|
|
117
128
|
export {
|
|
118
129
|
isInlineStdioConnection,
|
|
130
|
+
isToolEffect,
|
|
131
|
+
normalizeConnectionEffects,
|
|
119
132
|
normalizeCursorAccountServers,
|
|
120
133
|
} from "./types.js";
|
|
121
134
|
|
|
@@ -125,8 +125,12 @@ export function isCursorUserStoreFilesAvailable(
|
|
|
125
125
|
export interface CursorHostedFilesOptions {
|
|
126
126
|
/** Control-plane base URL (default: `CURSOR_API_BASE_URL`, else api.cursor.com). */
|
|
127
127
|
baseUrl?: string;
|
|
128
|
-
/**
|
|
129
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Bearer credential (default: `CURSOR_API_KEY`). A function is re-resolved
|
|
130
|
+
* on every call — hosted freeze snapshots listen unsigned and bind the key
|
|
131
|
+
* file after serve start.
|
|
132
|
+
*/
|
|
133
|
+
apiKey?: string | (() => string | undefined);
|
|
130
134
|
/** File store to address (default: `AGENT_SERVE_STORE_SOURCE_ID`). */
|
|
131
135
|
storeSourceId?: string;
|
|
132
136
|
/** Test seam; defaults to global fetch. */
|
|
@@ -622,7 +626,9 @@ function resolveStoreSourceId(options: CursorHostedFilesOptions): string {
|
|
|
622
626
|
}
|
|
623
627
|
|
|
624
628
|
function resolveApiKey(options: CursorHostedFilesOptions): string {
|
|
625
|
-
const
|
|
629
|
+
const configured =
|
|
630
|
+
typeof options.apiKey === "function" ? options.apiKey() : options.apiKey;
|
|
631
|
+
const key = (configured ?? process.env.CURSOR_API_KEY)?.trim();
|
|
626
632
|
if (key === undefined || key === "") {
|
|
627
633
|
throw new Error(
|
|
628
634
|
"cursorHostedFiles requires CURSOR_API_KEY (deployment pod credential on Cursor hosting)"
|
package/src/files.ts
CHANGED
|
@@ -184,6 +184,17 @@ export const agentStoreKeys = {
|
|
|
184
184
|
`${STORAGE_KEY_ROOT}/${agent}/memory/journal.jsonl`,
|
|
185
185
|
memoryJournalRotated: (agent: string, stamp: string): string =>
|
|
186
186
|
`${STORAGE_KEY_ROOT}/${agent}/memory/journal-${stamp}.jsonl`,
|
|
187
|
+
// SDK conversation mirror (the runner's SQLite store, exported through the
|
|
188
|
+
// store APIs): one manifest per SDK agent id plus its content-addressed
|
|
189
|
+
// checkpoint blobs. See internal/conversation-mirror.ts.
|
|
190
|
+
conversationManifest: (agent: string, sdkAgentId: string): string =>
|
|
191
|
+
`${STORAGE_KEY_ROOT}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/manifest.json`,
|
|
192
|
+
conversationBlob: (
|
|
193
|
+
agent: string,
|
|
194
|
+
sdkAgentId: string,
|
|
195
|
+
blobId: string
|
|
196
|
+
): string =>
|
|
197
|
+
`${STORAGE_KEY_ROOT}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/blobs/${encodeURIComponent(blobId)}`,
|
|
187
198
|
} as const;
|
|
188
199
|
|
|
189
200
|
/**
|