@cursor/july 0.1.92 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -20
- package/README.md +115 -182
- package/dist/channels/deployments/deployments-channel.d.ts +7 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +26 -2
- package/dist/channels/deployments/types.d.ts +8 -0
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/github-channel.d.ts +3 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +28 -56
- package/dist/channels/slack/attachments.js +2 -2
- package/dist/channels/slack/dispatch.d.ts +0 -7
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +4 -7
- package/dist/channels/slack/eval-directive.d.ts +5 -12
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +8 -19
- package/dist/channels/slack/index.d.ts +0 -6
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +0 -6
- package/dist/channels/slack/setup.d.ts +4 -4
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +8 -15
- package/dist/channels/slack/slack-channel.d.ts +6 -13
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +15 -101
- package/dist/channels/slack/types.d.ts +12 -79
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels/slack/types.js +1 -15
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +12 -0
- package/dist/connections.d.ts +18 -9
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +17 -8
- package/dist/continuation.d.ts +1 -1
- package/dist/continuation.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +8 -8
- package/dist/docs/ab.md +7 -13
- package/dist/docs/assets/{ab.md.CVzWxLoB.js → ab.md.DJo5r4R-.js} +4 -4
- package/dist/docs/assets/{ab.md.CVzWxLoB.lean.js → ab.md.DJo5r4R-.lean.js} +1 -1
- package/dist/docs/assets/{app.Bci6CM9E.js → app.CFDEas4I.js} +1 -1
- package/dist/docs/assets/building-with-agents.md.DI4mEzlt.js +13 -0
- package/dist/docs/assets/{building-with-agents.md.DH8A_cHA.lean.js → building-with-agents.md.DI4mEzlt.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.B1IIYpYS.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Ct4NSiLm.js} +2 -2
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +1 -0
- package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.lwAgBIMI.lean.js} +1 -1
- package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.D9msOFOW.js} +9 -14
- package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.D9msOFOW.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.a0SMN6r9.js → evals.md.lfJoEVc8.js} +6 -6
- package/dist/docs/assets/{evals.md.a0SMN6r9.lean.js → evals.md.lfJoEVc8.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.BDb0t1QV.js} +2 -2
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +9 -0
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +1 -0
- package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.B4sjlodG.js} +2 -2
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.Cnh2mL4a.js} +5 -5
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.Cnh2mL4a.lean.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.DPYmBCbV.js} +7 -9
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.DPYmBCbV.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.C32HsdKk.js} +7 -13
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.js → guides_webhooks.md.DKdA43Qm.js} +2 -2
- package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.js → hillclimbing.md.DhESf3OO.js} +1 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +5 -0
- package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.DRakGHFe.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.Nj_LjW_a.js} +2 -2
- package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.js → reference_agent-config.md.Cp_x38Nl.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.js → reference_channels.md.Cd2f2iyV.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.DQZjCnyh.lean.js → reference_channels.md.Cd2f2iyV.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.js → reference_cli.md.Cw6_ICYG.js} +10 -11
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.Cw6_ICYG.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.BH8Oc0D0.js} +7 -7
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.lean.js → reference_connections.md.BH8Oc0D0.lean.js} +1 -1
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +14 -0
- package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.a8BJxMR5.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.js +11 -0
- package/dist/docs/assets/reference_http-api.md.D89k1mdm.lean.js +1 -0
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.js → reference_instructions.md.CR7XSsGk.js} +3 -3
- package/dist/docs/assets/{reference_instructions.md.DhNCOl7r.lean.js → reference_instructions.md.CR7XSsGk.lean.js} +1 -1
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.js +1 -0
- package/dist/docs/assets/reference_playground.md.DnX5nL-B.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.Bv4KOtlB.js +19 -0
- package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.js → reference_prompt.md.DnaD5dNK.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.DNipebiG.js → reference_schedules.md.DI_JrHgq.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.tUFzz98S.lean.js → reference_sessions.md.D0mIh4KK.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.js → reference_skills.md.8son6Hjm.js} +4 -4
- package/dist/docs/assets/{reference_subagents.md.Xoav0AII.js → reference_subagents.md.CfsIloPm.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.BHeXn2id.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.BHeXn2id.lean.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +1 -0
- package/dist/docs/assets/{scaffolding-agents.md.CRDDUtYJ.lean.js → scaffolding-agents.md.D7UUkWw0.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.JbjlHWZ6.js → storage.md.BOHeqk2M.js} +5 -5
- package/dist/docs/assets/{storage.md.JbjlHWZ6.lean.js → storage.md.BOHeqk2M.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.js → templates_agentic-owners.md.DqtPdm6f.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.js → templates_pr-autofixer.md.DU7dQpor.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.DU7dQpor.lean.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.js → templates_security-reviewer.md.CTa7u_l1.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.ByFyRta2.lean.js → templates_security-reviewer.md.CTa7u_l1.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.Ctv3T8C2.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +7 -7
- package/dist/docs/building-with-agents.md +5 -11
- package/dist/docs/concepts.html +5 -8
- package/dist/docs/concepts.md +13 -17
- package/dist/docs/deployment.html +13 -18
- package/dist/docs/deployment.md +9 -30
- package/dist/docs/design/agsh.md +406 -0
- package/dist/docs/evals.html +10 -10
- package/dist/docs/evals.md +16 -37
- package/dist/docs/guides/agent-to-agent.html +6 -6
- package/dist/docs/guides/agent-to-agent.md +3 -3
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +9 -25
- package/dist/docs/guides/convert-automation.html +7 -7
- package/dist/docs/guides/convert-automation.md +4 -4
- package/dist/docs/guides/github.html +9 -9
- package/dist/docs/guides/github.md +16 -28
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +11 -13
- package/dist/docs/guides/mcp-oauth.md +14 -22
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +11 -17
- package/dist/docs/guides/slack.md +13 -50
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/guides/webhooks.md +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +1 -1
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +0 -36
- package/dist/docs/llms-full.txt +965 -3633
- package/dist/docs/llms.txt +3 -18
- package/dist/docs/quickstart.html +6 -6
- package/dist/docs/quickstart.md +3 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +10 -15
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +20 -31
- package/dist/docs/reference/cli.html +14 -15
- package/dist/docs/reference/cli.md +29 -38
- package/dist/docs/reference/connections.html +11 -11
- package/dist/docs/reference/connections.md +24 -25
- package/dist/docs/reference/hooks.html +6 -6
- package/dist/docs/reference/hooks.md +12 -17
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/http-api.md +25 -37
- package/dist/docs/reference/instructions.html +6 -6
- package/dist/docs/reference/instructions.md +1 -1
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +14 -19
- package/dist/docs/reference/project-layout.html +9 -7
- package/dist/docs/reference/project-layout.md +7 -3
- package/dist/docs/reference/prompt.html +6 -6
- package/dist/docs/reference/prompt.md +1 -1
- package/dist/docs/reference/schedules.html +6 -6
- package/dist/docs/reference/schedules.md +1 -2
- package/dist/docs/reference/sessions.html +5 -12
- package/dist/docs/reference/sessions.md +8 -19
- package/dist/docs/reference/skills.html +8 -8
- package/dist/docs/reference/skills.md +3 -3
- package/dist/docs/reference/subagents.html +6 -6
- package/dist/docs/reference/subagents.md +2 -2
- package/dist/docs/reference/tools.html +8 -8
- package/dist/docs/reference/tools.md +30 -19
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +4 -5
- package/dist/docs/storage.html +9 -9
- package/dist/docs/storage.md +37 -80
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +2 -2
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -9
- package/dist/docs/templates/security-reviewer.html +5 -5
- package/dist/docs/templates/security-reviewer.md +2 -3
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/advertise-tools.d.ts +11 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +47 -9
- package/dist/internal/authored-alias-hooks.d.ts +14 -11
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +14 -11
- package/dist/internal/authored-loaders.d.ts +7 -6
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +14 -10
- package/dist/internal/cli-deploy.d.ts +1 -1
- package/dist/internal/cli-deploy.js +5 -5
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +7 -4
- package/dist/internal/continuation-channel.d.ts +6 -3
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +44 -40
- package/dist/internal/continuation-identity.d.ts +17 -16
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +109 -36
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -1
- package/dist/internal/convert-automation/convert-workflow.js +26 -15
- package/dist/internal/convert-automation/slug.d.ts +0 -2
- package/dist/internal/convert-automation/slug.d.ts.map +1 -1
- package/dist/internal/convert-automation/slug.js +0 -8
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +5 -1
- package/dist/internal/deploy-manifest.d.ts +2 -2
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +4 -9
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +91 -13
- package/dist/internal/distribution.d.ts +4 -3
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +4 -3
- package/dist/internal/hosted-delivery-protocol.d.ts +38 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +70 -0
- package/dist/internal/hosted-delivery.d.ts +35 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +239 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -1
- package/dist/internal/mcp-endpoint.js +3 -3
- package/dist/internal/mcp-host.d.ts +8 -7
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +8 -7
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +5 -1
- package/dist/internal/playground/static.d.ts +0 -3
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +5 -7
- package/dist/internal/review-comments.d.ts +186 -63
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +350 -168
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +134 -175
- package/dist/internal/session-engine.d.ts +50 -10
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +221 -68
- package/dist/internal/shallow-clone.d.ts +8 -2
- package/dist/internal/shallow-clone.d.ts.map +1 -1
- package/dist/internal/shallow-clone.js +17 -10
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +67 -0
- package/dist/playground/assets/{index-DDvyC2z6.js → index-B3JCyigB.js} +2 -2
- package/dist/playground/index.html +1 -1
- package/dist/types.d.ts +81 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +19 -0
- package/docs/README.md +0 -36
- package/docs/ab.md +7 -13
- package/docs/building-with-agents.md +5 -11
- package/docs/concepts.md +13 -17
- package/docs/deployment.md +9 -30
- package/docs/design/agsh.md +406 -0
- package/docs/evals.md +16 -37
- package/docs/guides/agent-to-agent.md +3 -3
- package/docs/guides/cloud-runtime.md +9 -25
- package/docs/guides/convert-automation.md +4 -4
- package/docs/guides/github.md +16 -28
- package/docs/guides/mcp-oauth.md +14 -22
- package/docs/guides/slack.md +14 -51
- package/docs/guides/webhooks.md +3 -3
- package/docs/hillclimbing.md +1 -1
- package/docs/quickstart.md +3 -4
- package/docs/reference/agent-config.md +10 -15
- package/docs/reference/channels.md +20 -31
- package/docs/reference/cli.md +29 -38
- package/docs/reference/connections.md +24 -25
- package/docs/reference/hooks.md +12 -17
- package/docs/reference/http-api.md +26 -38
- package/docs/reference/instructions.md +1 -1
- package/docs/reference/playground.md +14 -19
- package/docs/reference/project-layout.md +7 -3
- package/docs/reference/prompt.md +1 -1
- package/docs/reference/schedules.md +1 -2
- package/docs/reference/sessions.md +8 -19
- package/docs/reference/skills.md +3 -3
- package/docs/reference/subagents.md +2 -2
- package/docs/reference/tools.md +30 -19
- package/docs/scaffolding-agents.md +4 -5
- package/docs/storage.md +37 -80
- package/docs/templates/agentic-owners.md +2 -2
- package/docs/templates/pr-autofixer.md +7 -9
- package/docs/templates/security-reviewer.md +2 -3
- package/docs/troubleshooting.md +8 -8
- package/package.json +16 -2
- package/skills/create-agent/SKILL.md +6 -13
- package/skills/debug/SKILL.md +2 -4
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +3 -2
- package/skills/mcp-auth/SKILL.md +10 -13
- package/skills/setup-slack/SKILL.md +21 -137
- package/src/channels/deployments/deployments-channel.ts +32 -2
- package/src/channels/deployments/types.ts +8 -0
- package/src/channels/github/github-channel.ts +71 -21
- package/src/channels/slack/attachments.ts +2 -2
- package/src/channels/slack/dispatch.ts +2 -16
- package/src/channels/slack/eval-directive.ts +8 -27
- package/src/channels/slack/index.ts +0 -6
- package/src/channels/slack/setup.ts +8 -15
- package/src/channels/slack/slack-channel.ts +14 -125
- package/src/channels/slack/types.ts +12 -96
- package/src/client.ts +23 -0
- package/src/connections.ts +20 -7
- package/src/continuation.ts +1 -1
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +45 -7
- package/src/internal/authored-alias-hooks.ts +14 -11
- package/src/internal/authored-loaders.ts +14 -10
- package/src/internal/cli-deploy.ts +5 -5
- package/src/internal/cli-mcp-oauth.ts +6 -4
- package/src/internal/continuation-channel.ts +62 -45
- package/src/internal/continuation-identity.ts +123 -38
- package/src/internal/convert-automation/convert-workflow.ts +29 -17
- package/src/internal/convert-automation/slug.ts +0 -9
- package/src/internal/cursor/account-mcp.ts +4 -1
- package/src/internal/deploy-manifest.ts +5 -9
- package/src/internal/discovery.ts +107 -13
- package/src/internal/distribution.ts +4 -3
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/hosted-delivery-protocol.ts +114 -0
- package/src/internal/hosted-delivery.ts +359 -0
- package/src/internal/http-channel.ts +0 -2
- package/src/internal/mcp-endpoint.ts +3 -3
- package/src/internal/mcp-host.ts +8 -7
- package/src/internal/peer-connections.ts +4 -1
- package/src/internal/playground/static.ts +1 -3
- package/src/internal/resolved-connections.ts +8 -10
- package/src/internal/review-comments.ts +542 -229
- package/src/internal/server.ts +180 -253
- package/src/internal/session-engine.ts +279 -70
- package/src/internal/shallow-clone.ts +30 -16
- package/src/internal/tool-catalog.ts +106 -0
- package/src/types.ts +99 -40
- package/templates/pr-autofixer/agent/channels/slack.ts +8 -2
- package/templates/triage/README.md +2 -1
- package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +0 -1
- package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +0 -1
- package/dist/channels/slack/cursor-account.d.ts +0 -87
- package/dist/channels/slack/cursor-account.d.ts.map +0 -1
- package/dist/channels/slack/cursor-account.js +0 -100
- package/dist/docs/assets/building-with-agents.md.DH8A_cHA.js +0 -13
- package/dist/docs/assets/chunks/@localSearchIndexroot.Dv-Q0XtU.js +0 -1
- package/dist/docs/assets/concepts.md.CRfU3bVg.js +0 -4
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.js +0 -10
- package/dist/docs/assets/example-agents_approval-buddy.md.DNL83puR.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.js +0 -7
- package/dist/docs/assets/example-agents_benny.md.C40vHRLc.lean.js +0 -1
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.js +0 -11
- package/dist/docs/assets/example-agents_bugbot.md.BRGMi9O2.lean.js +0 -1
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.js +0 -8
- package/dist/docs/assets/example-agents_codebase-wiki.md.Dftj_tPp.lean.js +0 -1
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.js +0 -8
- package/dist/docs/assets/example-agents_codeowners-review.md.Bfta-lBU.lean.js +0 -1
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.js +0 -23
- package/dist/docs/assets/example-agents_concierge.md.MrKpQndp.lean.js +0 -1
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.js +0 -15
- package/dist/docs/assets/example-agents_fsd.md.ZWHWWZPE.lean.js +0 -1
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.js +0 -2
- package/dist/docs/assets/example-agents_index.md.QZ8mhr6n.lean.js +0 -1
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.js +0 -11
- package/dist/docs/assets/example-agents_knowledge-base.md.DqKqHQ9u.lean.js +0 -1
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.js +0 -10
- package/dist/docs/assets/example-agents_oncall.md.DK4XkYTd.lean.js +0 -1
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.js +0 -19
- package/dist/docs/assets/example-agents_security-reviewer.md.Bai6D0Ee.lean.js +0 -1
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.js +0 -5
- package/dist/docs/assets/example-agents_slack-agent.md.D7Kdj5BV.lean.js +0 -1
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.js +0 -25
- package/dist/docs/assets/example-agents_weather-agent.md.lVEAbWFf.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BSMLIBHr.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.DiUmk_Oi.lean.js +0 -1
- package/dist/docs/assets/index.md.BAaMXLFd.js +0 -5
- package/dist/docs/assets/reference_hooks.md.B9FSgdDe.js +0 -14
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.js +0 -11
- package/dist/docs/assets/reference_http-api.md.CSHVobzG.lean.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.js +0 -1
- package/dist/docs/assets/reference_playground.md.Dfb92yQf.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.CwkSbEWT.js +0 -17
- package/dist/docs/assets/reference_sessions.md.tUFzz98S.js +0 -8
- package/dist/docs/assets/scaffolding-agents.md.CRDDUtYJ.js +0 -1
- package/dist/docs/assets/troubleshooting.md.DYECCZiJ.js +0 -1
- package/dist/docs/example-agents/approval-buddy.html +0 -36
- package/dist/docs/example-agents/approval-buddy.md +0 -266
- package/dist/docs/example-agents/benny.html +0 -33
- package/dist/docs/example-agents/benny.md +0 -182
- package/dist/docs/example-agents/bugbot.html +0 -37
- package/dist/docs/example-agents/bugbot.md +0 -229
- package/dist/docs/example-agents/codebase-wiki.html +0 -34
- package/dist/docs/example-agents/codebase-wiki.md +0 -170
- package/dist/docs/example-agents/codeowners-review.html +0 -34
- package/dist/docs/example-agents/codeowners-review.md +0 -192
- package/dist/docs/example-agents/concierge.html +0 -49
- package/dist/docs/example-agents/concierge.md +0 -201
- package/dist/docs/example-agents/fsd.html +0 -41
- package/dist/docs/example-agents/fsd.md +0 -329
- package/dist/docs/example-agents/index.html +0 -28
- package/dist/docs/example-agents/index.md +0 -102
- package/dist/docs/example-agents/knowledge-base.html +0 -37
- package/dist/docs/example-agents/knowledge-base.md +0 -168
- package/dist/docs/example-agents/oncall.html +0 -36
- package/dist/docs/example-agents/oncall.md +0 -212
- package/dist/docs/example-agents/security-reviewer.html +0 -45
- package/dist/docs/example-agents/security-reviewer.md +0 -265
- package/dist/docs/example-agents/slack-agent.html +0 -31
- package/dist/docs/example-agents/slack-agent.md +0 -142
- package/dist/docs/example-agents/weather-agent.html +0 -51
- package/dist/docs/example-agents/weather-agent.md +0 -296
- package/dist/internal/cursor-slack-relay.d.ts +0 -96
- package/dist/internal/cursor-slack-relay.d.ts.map +0 -1
- package/dist/internal/cursor-slack-relay.js +0 -176
- package/docs/example-agents/approval-buddy.md +0 -271
- package/docs/example-agents/benny.md +0 -187
- package/docs/example-agents/bugbot.md +0 -234
- package/docs/example-agents/codebase-wiki.md +0 -175
- package/docs/example-agents/codeowners-review.md +0 -197
- package/docs/example-agents/concierge.md +0 -206
- package/docs/example-agents/fsd.md +0 -334
- package/docs/example-agents/index.md +0 -107
- package/docs/example-agents/knowledge-base.md +0 -173
- package/docs/example-agents/oncall.md +0 -217
- package/docs/example-agents/security-reviewer.md +0 -270
- package/docs/example-agents/slack-agent.md +0 -147
- package/docs/example-agents/weather-agent.md +0 -301
- package/src/channels/slack/cursor-account.ts +0 -202
- package/src/internal/cursor-slack-relay.ts +0 -249
- /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.BDb0t1QV.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.B4sjlodG.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.BpnIdO0i.lean.js → guides_webhooks.md.DKdA43Qm.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.ywF3yDAd.lean.js → hillclimbing.md.DhESf3OO.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.DsrarzEg.lean.js → quickstart.md.Nj_LjW_a.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Bqylgw50.lean.js → reference_agent-config.md.Cp_x38Nl.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.Bv4KOtlB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_prompt.md.DZUMtLPD.lean.js → reference_prompt.md.DnaD5dNK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.DNipebiG.lean.js → reference_schedules.md.DI_JrHgq.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.B5ZEuHfG.lean.js → reference_skills.md.8son6Hjm.lean.js} +0 -0
- /package/dist/docs/assets/{reference_subagents.md.Xoav0AII.lean.js → reference_subagents.md.CfsIloPm.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentsdk-setup-slack
|
|
3
3
|
description: >-
|
|
4
|
-
Wire Slack to an Agent SDK agent.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
Wire Slack to an Agent SDK agent. Mint a dedicated Socket Mode app with
|
|
5
|
+
slack create (dashboard wizard), then doctor and smoke. Use the manual
|
|
6
|
+
manifest path only when the user owns the Slack app. Use when adding
|
|
7
|
+
Slack to an agent.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Setup Slack for the Agent SDK
|
|
@@ -14,132 +14,19 @@ host serves the same index at `/docs/llms.txt`.
|
|
|
14
14
|
|
|
15
15
|
Use this skill when a human asks to wire Slack to an Agent SDK agent.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
integration already installed in the workspace. No Slack app, no
|
|
22
|
-
tokens, no Slack admin. Live in minutes.
|
|
23
|
-
- **Path B — Dedicated Slack app** (Socket Mode): the agent's own bot
|
|
24
|
-
user. `agent-sdk slack create` opens a signed-in Cursor dashboard
|
|
25
|
-
wizard; Slack consent and the bot name happen there. Tokens land in
|
|
26
|
-
`.env.local` and as deployment secrets. Required for channel watching,
|
|
27
|
-
approval buttons, or a distinct bot handle.
|
|
17
|
+
`slackChannel()` is a dedicated Socket Mode Slack app: the agent's own
|
|
18
|
+
bot user. `agent-sdk slack create` opens a signed-in Cursor dashboard
|
|
19
|
+
wizard; Slack consent and the bot name happen there. Tokens land in
|
|
20
|
+
`.env.local` and as deployment secrets.
|
|
28
21
|
|
|
29
22
|
Do not generate manifests or ask anyone to paste tokens unless they
|
|
30
|
-
asked for a custom Slack app (`slack init --manual`).
|
|
31
|
-
Path B buries the user in Slack admin work they may not need.
|
|
23
|
+
asked for a custom Slack app (`slack init --manual`).
|
|
32
24
|
|
|
33
25
|
Existing bots that already have `<PREFIX>_SLACK_BOT_TOKEN` and
|
|
34
26
|
`_SLACK_APP_TOKEN` in `.env.local` keep working. Do not force them onto
|
|
35
27
|
the wizard.
|
|
36
28
|
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
Walk the user through the tradeoffs before touching files:
|
|
40
|
-
|
|
41
|
-
| | A: Cursor-hosted | B: Dedicated Slack app |
|
|
42
|
-
| --- | --- | --- |
|
|
43
|
-
| Setup | Zero Slack admin: sign the host in (`agent-sdk login` / `CURSOR_API_KEY`) and serve | One `agent-sdk slack create` per env. Finish in the dashboard wizard (Slack consent + bot name). Tokens are never shown. |
|
|
44
|
-
| Prereq | Cursor Slack integration installed in the workspace and linked to the Cursor account | Agent Serve access (`agent-sdk login`) and permission to approve a Slack app |
|
|
45
|
-
| How users reach it | `@Cursor <AgentName> …`, DMs to @Cursor, replies in claimed threads | Its own bot user: @mention, DM, channel invites |
|
|
46
|
-
| Identity | Posts as the Cursor app under the agent's name + icon | Own app name, avatar, and handle |
|
|
47
|
-
| Channel watching (dispatch without a mention) | Not available | `engagement.channelPosts` allowlist |
|
|
48
|
-
| Tool approvals / Block Kit interactivity | Not available (construction throws) | `toolApprovals: true` Approve/Deny cards |
|
|
49
|
-
| Reply delivery | Status while working, then one final post (no streaming edits) | Streaming replies with postMessage fallback |
|
|
50
|
-
| Multi-agent hosts | Any number of agents, unique `agentName` each, no extra Slack apps | One Slack app + token pair **per agent** |
|
|
51
|
-
|
|
52
|
-
Decision shortcuts; skip the question when the request already decides:
|
|
53
|
-
|
|
54
|
-
- Needs channel watching, Approve/Deny buttons, `onBlockAction`, or its
|
|
55
|
-
own bot user / handle → **Path B**. Say which requirement forced it.
|
|
56
|
-
- Workspace has no Cursor Slack integration and won't install it →
|
|
57
|
-
**Path B**.
|
|
58
|
-
- Asked for a custom Slack app they own at api.slack.com, or to paste a
|
|
59
|
-
manifest → **Path C** (`slack init --manual`).
|
|
60
|
-
- "Just get it into Slack", a first bring-up, or the user already said
|
|
61
|
-
to use the Cursor Slack integration, with none of the above → **Path A**.
|
|
62
|
-
|
|
63
|
-
### Collect the decision with AskQuestion
|
|
64
|
-
|
|
65
|
-
Otherwise ask. One single-select question via the `AskQuestion` tool,
|
|
66
|
-
recommended option first so one click accepts it:
|
|
67
|
-
|
|
68
|
-
- **Cursor-hosted Slack connection (recommended)** — zero Slack setup;
|
|
69
|
-
sign in and mention `@Cursor <AgentName>`. No channel watching or
|
|
70
|
-
approval buttons.
|
|
71
|
-
- **Dedicated Slack app (Socket Mode)** — own bot user, channel
|
|
72
|
-
watching, approval buttons. `agent-sdk slack create` opens the
|
|
73
|
-
dashboard wizard.
|
|
74
|
-
|
|
75
|
-
If `AskQuestion` is unavailable in your environment, or the user does
|
|
76
|
-
not answer, **default to Path A (Cursor-hosted)**: state the assumption
|
|
77
|
-
in one line and proceed. It is the reversible choice. A dedicated app
|
|
78
|
-
can be added later as a *second* channel file without losing anything.
|
|
79
|
-
Never mix both in one channel definition: `cursorAccount: true` rejects
|
|
80
|
-
`credentials` / `envPrefix` at construction.
|
|
81
|
-
|
|
82
|
-
## Path A — Cursor-hosted connection
|
|
83
|
-
|
|
84
|
-
Goal: mention `@Cursor <AgentName>` in the linked workspace and get a
|
|
85
|
-
threaded reply. No Slack app, no tokens, no manifests.
|
|
86
|
-
|
|
87
|
-
### A1 — Author the channel (agent)
|
|
88
|
-
|
|
89
|
-
Write `agent/channels/slack.ts` by hand. Do not run `slack create` for
|
|
90
|
-
this path:
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
import { slackChannel } from "@cursor/july/channels/slack";
|
|
94
|
-
|
|
95
|
-
export default slackChannel({
|
|
96
|
-
cursorAccount: true,
|
|
97
|
-
agentName: "MyAgent", // single token, no whitespace; prefer PascalCase
|
|
98
|
-
agentIcon: { emoji: ":robot_face:" },
|
|
99
|
-
});
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
`agentName` defaults from the mount slug (PascalCase) and must be a
|
|
103
|
-
single token. String literals with spaces fail typecheck; runtime
|
|
104
|
-
values throw at construction/serve. Names must be unique on the host;
|
|
105
|
-
an unmatched `@Cursor <name>` stays with Cursor's normal Slack agent.
|
|
106
|
-
External senders (Slack Connect / guests / other workspaces) are
|
|
107
|
-
blocked by default; see `policy.blockExternals` in
|
|
108
|
-
[docs/guides/slack.md](../../docs/guides/slack.md).
|
|
109
|
-
|
|
110
|
-
### A2 — Sign in + serve (agent)
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
agent-sdk login # or export CURSOR_API_KEY
|
|
114
|
-
agent-sdk dev .
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Confirm log: `[agent-sdk] cursor-slack: relaying Slack for <AgentName> …`.
|
|
118
|
-
An unsigned host fails `serve` with a sign-in hint naming the channel.
|
|
119
|
-
|
|
120
|
-
### A3 — Smoke (human)
|
|
121
|
-
|
|
122
|
-
1. In the Slack workspace linked to the Cursor account, post
|
|
123
|
-
`@Cursor MyAgent <question>` (or DM @Cursor)
|
|
124
|
-
2. Confirm a working status while the turn runs, then a threaded reply
|
|
125
|
-
posted under the agent's name and icon
|
|
126
|
-
3. Reply in the thread without re-mentioning; it stays with the agent
|
|
127
|
-
|
|
128
|
-
### Path A limits (enforced at construction)
|
|
129
|
-
|
|
130
|
-
- `credentials` / `envPrefix` → throw (author a second channel file for
|
|
131
|
-
a dedicated app instead)
|
|
132
|
-
- `engagement.channelPosts`, `toolApprovals`, `interactivity`,
|
|
133
|
-
`onBlockAction` → throw (Socket Mode only)
|
|
134
|
-
- `engagement.mentions: false` / `directMessages: false` → throw (the
|
|
135
|
-
relay always delivers those)
|
|
136
|
-
- Streaming is forced off: rotating status while thinking, one final
|
|
137
|
-
reply post
|
|
138
|
-
|
|
139
|
-
When one of these limits becomes a real requirement, keep the
|
|
140
|
-
cursor-account channel and add a Path B channel file beside it.
|
|
141
|
-
|
|
142
|
-
## Path B — Dedicated Slack app (Socket Mode)
|
|
29
|
+
## Dedicated Slack app (Socket Mode)
|
|
143
30
|
|
|
144
31
|
Goal: one dedicated bot per agent, tokens in `.env.local`, local serve
|
|
145
32
|
without a cloud deploy. The dashboard wizard is the only first-run.
|
|
@@ -167,7 +54,8 @@ install does not file the request. After an admin approves, click
|
|
|
167
54
|
|
|
168
55
|
`create` scaffolds `agent/channels/slack.ts` when missing. Do not paste
|
|
169
56
|
a manifest at api.slack.com for this path. `slack init` without
|
|
170
|
-
`--manual` hard-errors; see
|
|
57
|
+
`--manual` hard-errors; see the manual path below for a hand-imported
|
|
58
|
+
app.
|
|
171
59
|
|
|
172
60
|
Existing tokens in `.env.local` keep working. Skip the wizard for those
|
|
173
61
|
agents unless you want a Cursor-managed app.
|
|
@@ -203,7 +91,7 @@ app. It keeps the Slack app id and replaces the manifest and tokens.
|
|
|
203
91
|
`agent-sdk slack destroy` deletes the provisioned app. Tokens left in
|
|
204
92
|
`.env.local` simply stop working.
|
|
205
93
|
|
|
206
|
-
##
|
|
94
|
+
## Manual Slack app (`slack init --manual`)
|
|
207
95
|
|
|
208
96
|
Use this when the user wants a Slack app they own at api.slack.com, not
|
|
209
97
|
a Cursor-managed app. Not the default. Do not offer it unless they
|
|
@@ -287,7 +175,7 @@ Human:
|
|
|
287
175
|
|
|
288
176
|
## Features (defaults ON)
|
|
289
177
|
|
|
290
|
-
- Chat streaming (`chat.startStream` / `appendStream` / `stopStream`) with postMessage fallback
|
|
178
|
+
- Chat streaming (`chat.startStream` / `appendStream` / `stopStream`) with postMessage fallback
|
|
291
179
|
- Thinking / task cards for tool calls
|
|
292
180
|
- `assistant.threads.setStatus` with rotating `loading_messages`
|
|
293
181
|
- Thread title + suggested prompts
|
|
@@ -296,7 +184,7 @@ Human:
|
|
|
296
184
|
|
|
297
185
|
If a Slack API is unavailable (`method_not_found` / `missing_scope`), the pack falls back to postMessage + setStatus.
|
|
298
186
|
|
|
299
|
-
## Engagement: mentions by default, channel watch opt-in
|
|
187
|
+
## Engagement: mentions by default, channel watch opt-in
|
|
300
188
|
|
|
301
189
|
The pack dispatches only on `app_mention` + DMs unless told otherwise:
|
|
302
190
|
summoned, never proactive. To watch channels (dispatch on new posts without
|
|
@@ -323,7 +211,7 @@ each watched channel. Posts mentioning the bot stay on the
|
|
|
323
211
|
thread. `engagement.mentions` / `engagement.directMessages` can be set to
|
|
324
212
|
`false` to turn those surfaces off.
|
|
325
213
|
|
|
326
|
-
## Tool approvals over Slack (opt-in HITL
|
|
214
|
+
## Tool approvals over Slack (opt-in HITL)
|
|
327
215
|
|
|
328
216
|
Tools with `needsApproval` park until a human approves or denies. To route
|
|
329
217
|
that through Slack, set `toolApprovals: true` on `slackChannel`. It posts
|
|
@@ -357,20 +245,16 @@ Requirements and caveats:
|
|
|
357
245
|
|
|
358
246
|
## Notes
|
|
359
247
|
|
|
360
|
-
- Dev and prod are **separate Slack apps** (separate tokens)
|
|
361
|
-
|
|
362
|
-
where it relays.
|
|
363
|
-
- Socket Mode / the Cursor relay are outbound only. No Events HTTP /
|
|
364
|
-
Request URL path on either connection.
|
|
248
|
+
- Dev and prod are **separate Slack apps** (separate tokens).
|
|
249
|
+
- Socket Mode is outbound only. No Events HTTP / Request URL path.
|
|
365
250
|
- Do not `await waitForCompletion()` inside Slack dispatch handlers. The pack uses `waitUntil`.
|
|
366
251
|
- Do not share one token pair across multiple agents in the same process.
|
|
367
252
|
|
|
368
253
|
## CLI reference
|
|
369
254
|
|
|
370
|
-
|
|
371
|
-
`init --manual` / `manifest` / `doctor`.
|
|
372
|
-
|
|
373
|
-
`--manual`.
|
|
255
|
+
Wizard tooling is `create` / `destroy` / `icon` / `doctor`. Manual is
|
|
256
|
+
`init --manual` / `manifest` / `doctor`. `slack setup` prints this
|
|
257
|
+
guide. `slack init` hard-errors unless `--manual`.
|
|
374
258
|
|
|
375
259
|
```bash
|
|
376
260
|
agent-sdk slack setup
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
|
|
3
3
|
import { defineChannel, localDevStrict, POST } from "../../channels.js";
|
|
4
4
|
import { resolveDeploymentSubscriptions } from "../../internal/cursor-deployment-relay.js";
|
|
5
|
+
import { bindLocalIngressSend } from "../../internal/local-ingress.js";
|
|
5
6
|
import type { ChannelDefinition, ChannelHandlerArgs } from "../../types.js";
|
|
6
7
|
import {
|
|
7
8
|
DEPLOYMENT_EVENT_TYPES,
|
|
@@ -39,6 +40,24 @@ export function getDeploymentsChannelOptions(
|
|
|
39
40
|
return deploymentsChannelOptionsByDefinition.get(definition);
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Events a {@link deploymentsChannel} dispatches on, unioned from its
|
|
45
|
+
* subscriptions. Published as `meta.deploymentEventTypes` so the deploy
|
|
46
|
+
* manifest can extract `eventTypes`. An empty deploy-source list is an
|
|
47
|
+
* inert channel and yields no events.
|
|
48
|
+
*/
|
|
49
|
+
export function deriveDeploymentEventTypes(
|
|
50
|
+
options: Pick<DeploymentsChannelOptions, "deploySourceUris" | "events">
|
|
51
|
+
): string[] {
|
|
52
|
+
const events = new Set<string>();
|
|
53
|
+
for (const subscription of resolveDeploymentSubscriptions(options)) {
|
|
54
|
+
for (const event of subscription.events) {
|
|
55
|
+
events.add(event);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return [...events].sort();
|
|
59
|
+
}
|
|
60
|
+
|
|
42
61
|
/**
|
|
43
62
|
* Core deployment-event dispatch, used by the channel's replay route and by
|
|
44
63
|
* the serve host's relay fan-out. Whether the event matches this channel's
|
|
@@ -49,7 +68,15 @@ export async function dispatchDeploymentEvent(input: {
|
|
|
49
68
|
event: DeploymentEvent;
|
|
50
69
|
args: ChannelHandlerArgs;
|
|
51
70
|
}): Promise<Response> {
|
|
52
|
-
await input.options.onEvent(
|
|
71
|
+
await input.options.onEvent(
|
|
72
|
+
input.event,
|
|
73
|
+
bindLocalIngressSend(input.args, {
|
|
74
|
+
identity: input.options.continuation,
|
|
75
|
+
kind: DEPLOYMENTS_CHANNEL_KIND,
|
|
76
|
+
eventType: input.event.eventType,
|
|
77
|
+
payload: input.event,
|
|
78
|
+
})
|
|
79
|
+
);
|
|
53
80
|
return Response.json({ ok: true });
|
|
54
81
|
}
|
|
55
82
|
|
|
@@ -89,7 +116,10 @@ export function deploymentsChannel(
|
|
|
89
116
|
|
|
90
117
|
const definition = defineChannel({
|
|
91
118
|
auth: options.auth ?? [localDevStrict()],
|
|
92
|
-
meta: {
|
|
119
|
+
meta: {
|
|
120
|
+
kind: DEPLOYMENTS_CHANNEL_KIND,
|
|
121
|
+
deploymentEventTypes: deriveDeploymentEventTypes(options),
|
|
122
|
+
},
|
|
93
123
|
...(options.onStart === undefined ? {} : { onStart: options.onStart }),
|
|
94
124
|
...(options.onStop === undefined ? {} : { onStop: options.onStop }),
|
|
95
125
|
routes: [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ContinuationIdentity } from "../../continuation.js";
|
|
1
2
|
import type { ChannelDefinition, ChannelHandlerArgs } from "../../types.js";
|
|
2
3
|
|
|
3
4
|
/** {@link ChannelMeta.kind} value used by {@link deploymentsChannel}. */
|
|
@@ -77,4 +78,11 @@ export interface DeploymentsChannelOptions {
|
|
|
77
78
|
auth?: ChannelDefinition["auth"];
|
|
78
79
|
onStart?: ChannelDefinition["onStart"];
|
|
79
80
|
onStop?: ChannelDefinition["onStop"];
|
|
81
|
+
/**
|
|
82
|
+
* Continuation selector. Omitted inherits {@link AgentConfig.architecture}:
|
|
83
|
+
* `"deployments.none/v1"` unless the agent set `architecture: "v2"` (then
|
|
84
|
+
* `"deployments.deployment/v2"`). Override with `"deployments.none/v2"`
|
|
85
|
+
* for one-shot events.
|
|
86
|
+
*/
|
|
87
|
+
continuation?: ContinuationIdentity;
|
|
80
88
|
}
|
|
@@ -480,6 +480,39 @@ function verifyWebhookSha256Signature(args: {
|
|
|
480
480
|
* Run authored GitHub hooks and `send()`. Does not extract a v2 mailbox —
|
|
481
481
|
* the local CP (or hosted verified ingress) stamps before this runs.
|
|
482
482
|
*/
|
|
483
|
+
export type GitHubDispatchOutcome = "skip" | "send" | "task";
|
|
484
|
+
|
|
485
|
+
const dispatchOutcomeByResponse = new WeakMap<
|
|
486
|
+
Response,
|
|
487
|
+
GitHubDispatchOutcome
|
|
488
|
+
>();
|
|
489
|
+
|
|
490
|
+
function withDispatchOutcome(
|
|
491
|
+
response: Response,
|
|
492
|
+
outcome: GitHubDispatchOutcome
|
|
493
|
+
): Response {
|
|
494
|
+
dispatchOutcomeByResponse.set(response, outcome);
|
|
495
|
+
return response;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export function getGitHubDispatchOutcome(
|
|
499
|
+
response: Response
|
|
500
|
+
): GitHubDispatchOutcome | undefined {
|
|
501
|
+
return dispatchOutcomeByResponse.get(response);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const PROPAGATE_BACKGROUND_ERRORS = Symbol("propagateBackgroundErrors");
|
|
505
|
+
|
|
506
|
+
type GitHubHandlerArgs = ChannelHandlerArgs & {
|
|
507
|
+
[PROPAGATE_BACKGROUND_ERRORS]?: true;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
export function withPropagatingGitHubBackgroundErrors(
|
|
511
|
+
args: ChannelHandlerArgs
|
|
512
|
+
): ChannelHandlerArgs {
|
|
513
|
+
return Object.assign(args, { [PROPAGATE_BACKGROUND_ERRORS]: true as const });
|
|
514
|
+
}
|
|
515
|
+
|
|
483
516
|
export async function dispatchGitHubWebhook(input: {
|
|
484
517
|
options: GitHubChannelOptions;
|
|
485
518
|
eventName: string | null;
|
|
@@ -1589,25 +1622,25 @@ async function startTurn(input: {
|
|
|
1589
1622
|
scheduleAfterAck(input.args, async () => {
|
|
1590
1623
|
await sendTurn();
|
|
1591
1624
|
});
|
|
1592
|
-
return
|
|
1593
|
-
|
|
1594
|
-
|
|
1625
|
+
return withDispatchOutcome(
|
|
1626
|
+
Response.json(
|
|
1627
|
+
{ ok: true, dispatched: true, mode: "turn" },
|
|
1628
|
+
{ status: 202 }
|
|
1629
|
+
),
|
|
1630
|
+
"send"
|
|
1595
1631
|
);
|
|
1596
1632
|
}
|
|
1597
1633
|
|
|
1598
1634
|
const session = await sendTurn();
|
|
1599
|
-
return
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
const detail =
|
|
1609
|
-
error instanceof Error ? (error.stack ?? error.message) : String(error);
|
|
1610
|
-
console.error(`[github] background dispatch failed: ${detail}`);
|
|
1635
|
+
return withDispatchOutcome(
|
|
1636
|
+
Response.json({
|
|
1637
|
+
ok: true,
|
|
1638
|
+
sessionId: session.id,
|
|
1639
|
+
isNew: session.isNew,
|
|
1640
|
+
continuationToken: session.continuationToken,
|
|
1641
|
+
}),
|
|
1642
|
+
"send"
|
|
1643
|
+
);
|
|
1611
1644
|
}
|
|
1612
1645
|
|
|
1613
1646
|
function scheduleAfterAck(
|
|
@@ -1617,14 +1650,25 @@ function scheduleAfterAck(
|
|
|
1617
1650
|
// Defer past the current turn so the 202 can flush before work starts
|
|
1618
1651
|
// (and so tests can assert scheduling without racing microtasks).
|
|
1619
1652
|
args.waitUntil(
|
|
1620
|
-
new Promise<void>((resolve) => {
|
|
1653
|
+
new Promise<void>((resolve, reject) => {
|
|
1621
1654
|
setImmediate(() => {
|
|
1622
1655
|
Promise.resolve()
|
|
1623
1656
|
.then(work)
|
|
1624
1657
|
.then(
|
|
1625
1658
|
() => resolve(),
|
|
1626
1659
|
(error: unknown) => {
|
|
1627
|
-
|
|
1660
|
+
if (
|
|
1661
|
+
(args as GitHubHandlerArgs)[PROPAGATE_BACKGROUND_ERRORS] ===
|
|
1662
|
+
true
|
|
1663
|
+
) {
|
|
1664
|
+
reject(error);
|
|
1665
|
+
return;
|
|
1666
|
+
}
|
|
1667
|
+
const detail =
|
|
1668
|
+
error instanceof Error
|
|
1669
|
+
? (error.stack ?? error.message)
|
|
1670
|
+
: String(error);
|
|
1671
|
+
console.error(`[github] background dispatch failed: ${detail}`);
|
|
1628
1672
|
resolve();
|
|
1629
1673
|
}
|
|
1630
1674
|
);
|
|
@@ -1639,9 +1683,12 @@ function acknowledgeTask(
|
|
|
1639
1683
|
extra: Record<string, unknown>
|
|
1640
1684
|
): Response {
|
|
1641
1685
|
scheduleAfterAck(args, dispatch.task);
|
|
1642
|
-
return
|
|
1643
|
-
|
|
1644
|
-
|
|
1686
|
+
return withDispatchOutcome(
|
|
1687
|
+
Response.json(
|
|
1688
|
+
{ ok: true, dispatched: true, mode: "task", ...extra },
|
|
1689
|
+
{ status: 202 }
|
|
1690
|
+
),
|
|
1691
|
+
"task"
|
|
1645
1692
|
);
|
|
1646
1693
|
}
|
|
1647
1694
|
|
|
@@ -1649,7 +1696,10 @@ function skipped(
|
|
|
1649
1696
|
reason: string,
|
|
1650
1697
|
extra: Record<string, unknown> = {}
|
|
1651
1698
|
): Response {
|
|
1652
|
-
return
|
|
1699
|
+
return withDispatchOutcome(
|
|
1700
|
+
Response.json({ ok: true, skipped: true, reason, ...extra }),
|
|
1701
|
+
"skip"
|
|
1702
|
+
);
|
|
1653
1703
|
}
|
|
1654
1704
|
|
|
1655
1705
|
function formatCiMessage(
|
|
@@ -381,8 +381,8 @@ async function downloadSlackFileBytes(args: {
|
|
|
381
381
|
maxBytes: number;
|
|
382
382
|
downloadTimeoutMs: number;
|
|
383
383
|
}): Promise<{ data: Uint8Array; mimeType: string; filename: string } | null> {
|
|
384
|
-
//
|
|
385
|
-
//
|
|
384
|
+
// Transport callers cannot mint a Bearer for files.slack.com; they
|
|
385
|
+
// must pre-attach `dataBase64` on the file ref instead.
|
|
386
386
|
if (isSlackApiTransport(args.botToken)) {
|
|
387
387
|
return null;
|
|
388
388
|
}
|
|
@@ -162,8 +162,6 @@ export interface SlackInboundDispatchDeps extends SlackContinuationProbes {
|
|
|
162
162
|
* `host.evals` is present.
|
|
163
163
|
*/
|
|
164
164
|
evalCommandsEnabled?: boolean;
|
|
165
|
-
/** cursorAccount agent name stripped before `eval` directive parsing. */
|
|
166
|
-
cursorAgentName?: string;
|
|
167
165
|
/**
|
|
168
166
|
* Drop external senders before the handler. Defaults to `true`; pass
|
|
169
167
|
* `false` to admit them (or when an upstream gate already refused them).
|
|
@@ -245,11 +243,6 @@ export async function dispatchInboundMessage(args: {
|
|
|
245
243
|
evalCommandsEnabled?: boolean;
|
|
246
244
|
/** See {@link SlackInboundDispatchDeps.followUpStatus}. Defaults to `true`. */
|
|
247
245
|
followUpStatus?: boolean;
|
|
248
|
-
/**
|
|
249
|
-
* cursorAccount agent display name — stripped before parsing `eval …`
|
|
250
|
-
* (`OncallBuddy eval list`).
|
|
251
|
-
*/
|
|
252
|
-
cursorAgentName?: string;
|
|
253
246
|
blockExternals?: boolean;
|
|
254
247
|
continuation?: ContinuationIdentity;
|
|
255
248
|
}): Promise<void> {
|
|
@@ -342,14 +335,10 @@ export async function dispatchInboundMessage(args: {
|
|
|
342
335
|
|
|
343
336
|
// Built-in eval directive: run playground batches without an agent turn.
|
|
344
337
|
const evalCommandsEnabled = args.evalCommandsEnabled !== false;
|
|
345
|
-
const evalParseOptions =
|
|
346
|
-
args.cursorAgentName === undefined || args.cursorAgentName === ""
|
|
347
|
-
? undefined
|
|
348
|
-
: { agentName: args.cursorAgentName };
|
|
349
338
|
const evalDirective =
|
|
350
339
|
evalCommandsEnabled && args.host.evals !== undefined
|
|
351
|
-
? (parseSlackEvalDirective(message.text
|
|
352
|
-
parseSlackEvalDirective(message.markdown
|
|
340
|
+
? (parseSlackEvalDirective(message.text) ??
|
|
341
|
+
parseSlackEvalDirective(message.markdown))
|
|
353
342
|
: null;
|
|
354
343
|
if (evalDirective !== null && args.host.evals !== undefined) {
|
|
355
344
|
log.info("eval directive", {
|
|
@@ -657,7 +646,6 @@ export function dispatchInboundFromEventBody(
|
|
|
657
646
|
artifacts: deps.artifacts,
|
|
658
647
|
log,
|
|
659
648
|
evalCommandsEnabled: deps.evalCommandsEnabled,
|
|
660
|
-
cursorAgentName: deps.cursorAgentName,
|
|
661
649
|
followUpStatus: deps.followUpStatus,
|
|
662
650
|
blockExternals: deps.blockExternals,
|
|
663
651
|
...continuationArg(deps.continuation),
|
|
@@ -701,7 +689,6 @@ export function dispatchInboundFromEventBody(
|
|
|
701
689
|
artifacts: deps.artifacts,
|
|
702
690
|
log,
|
|
703
691
|
evalCommandsEnabled: deps.evalCommandsEnabled,
|
|
704
|
-
cursorAgentName: deps.cursorAgentName,
|
|
705
692
|
followUpStatus: deps.followUpStatus,
|
|
706
693
|
blockExternals: deps.blockExternals,
|
|
707
694
|
...continuationArg(deps.continuation),
|
|
@@ -739,7 +726,6 @@ export function dispatchInboundFromEventBody(
|
|
|
739
726
|
artifacts: deps.artifacts,
|
|
740
727
|
log,
|
|
741
728
|
evalCommandsEnabled: false,
|
|
742
|
-
cursorAgentName: deps.cursorAgentName,
|
|
743
729
|
followUpStatus: deps.followUpStatus,
|
|
744
730
|
blockExternals: deps.blockExternals,
|
|
745
731
|
...continuationArg(deps.continuation),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Built-in Slack `eval` directive — run playground evals from a mention/DM
|
|
3
3
|
* without per-agent custom handlers (parity with CLI / playground runs).
|
|
4
4
|
*
|
|
5
|
-
* Examples (after stripping @mentions
|
|
5
|
+
* Examples (after stripping @mentions):
|
|
6
6
|
* eval
|
|
7
7
|
* eval triage/open-incidents smoke
|
|
8
8
|
* eval --tag oncall
|
|
@@ -29,29 +29,15 @@ export type SlackEvalDirective =
|
|
|
29
29
|
| { kind: "cancel"; runId: string }
|
|
30
30
|
| { kind: "run"; filterIds?: string[]; tags?: string[] };
|
|
31
31
|
|
|
32
|
-
function escapeRegExp(value: string): string {
|
|
33
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
34
|
-
}
|
|
35
|
-
|
|
36
32
|
/**
|
|
37
33
|
* Normalize inbound Slack text for directive parsing: strip leading
|
|
38
|
-
* `<@U…>` mentions
|
|
39
|
-
* cursorAccount agentName prefix (`OncallBuddy eval …`).
|
|
34
|
+
* `<@U…>` mentions and leading `@U…` markdown mentions.
|
|
40
35
|
*/
|
|
41
|
-
export function normalizeSlackEvalDirectiveBody(
|
|
42
|
-
text: string,
|
|
43
|
-
options?: { agentName?: string }
|
|
44
|
-
): string {
|
|
36
|
+
export function normalizeSlackEvalDirectiveBody(text: string): string {
|
|
45
37
|
let body = stripLeadingSlackMentions(text);
|
|
46
|
-
// markdown form from slackTextToMarkdown / cursorAccount envelopes
|
|
47
38
|
while (/^@[A-Za-z0-9._-]+\s+/.test(body)) {
|
|
48
39
|
body = body.replace(/^@[A-Za-z0-9._-]+\s+/, "").trim();
|
|
49
40
|
}
|
|
50
|
-
const agentName = options?.agentName?.trim();
|
|
51
|
-
if (agentName !== undefined && agentName.length > 0) {
|
|
52
|
-
const prefix = new RegExp(`^${escapeRegExp(agentName)}\\s+`, "i");
|
|
53
|
-
body = body.replace(prefix, "").trim();
|
|
54
|
-
}
|
|
55
41
|
return body;
|
|
56
42
|
}
|
|
57
43
|
|
|
@@ -60,10 +46,9 @@ export function normalizeSlackEvalDirectiveBody(
|
|
|
60
46
|
* eval command (falls through to the normal agent handler).
|
|
61
47
|
*/
|
|
62
48
|
export function parseSlackEvalDirective(
|
|
63
|
-
text: string
|
|
64
|
-
options?: { agentName?: string }
|
|
49
|
+
text: string
|
|
65
50
|
): SlackEvalDirective | null {
|
|
66
|
-
const body = normalizeSlackEvalDirectiveBody(text
|
|
51
|
+
const body = normalizeSlackEvalDirectiveBody(text);
|
|
67
52
|
if (body.length === 0) {
|
|
68
53
|
return null;
|
|
69
54
|
}
|
|
@@ -141,14 +126,10 @@ export function parseSlackEvalDirective(
|
|
|
141
126
|
}
|
|
142
127
|
|
|
143
128
|
/** True when either raw Slack text or markdown form is an eval directive. */
|
|
144
|
-
export function isSlackEvalDirective(
|
|
145
|
-
text: string,
|
|
146
|
-
markdown: string,
|
|
147
|
-
options?: { agentName?: string }
|
|
148
|
-
): boolean {
|
|
129
|
+
export function isSlackEvalDirective(text: string, markdown: string): boolean {
|
|
149
130
|
return (
|
|
150
|
-
parseSlackEvalDirective(text
|
|
151
|
-
parseSlackEvalDirective(markdown
|
|
131
|
+
parseSlackEvalDirective(text) !== null ||
|
|
132
|
+
parseSlackEvalDirective(markdown) !== null
|
|
152
133
|
);
|
|
153
134
|
}
|
|
154
135
|
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
* // Multi-agent serve: one Slack app per agent
|
|
11
11
|
* export default slackChannel({ envPrefix: "MY_AGENT" });
|
|
12
12
|
* // → MY_AGENT_SLACK_BOT_TOKEN + MY_AGENT_SLACK_APP_TOKEN
|
|
13
|
-
*
|
|
14
|
-
* // No Slack app at all: ride the signed-in Cursor account's Slack
|
|
15
|
-
* // connection (`@Cursor <agent name> …` routes here; replies post as
|
|
16
|
-
* // this agent through the Cursor Slack app)
|
|
17
|
-
* export default slackChannel({ cursorAccount: true });
|
|
18
13
|
* ```
|
|
19
14
|
*/
|
|
20
15
|
|
|
@@ -28,7 +23,6 @@ export * from "./bot-mentions.js";
|
|
|
28
23
|
export * from "./channel-watch.js";
|
|
29
24
|
export * from "./constants.js";
|
|
30
25
|
export * from "./credentials.js";
|
|
31
|
-
export * from "./cursor-account.js";
|
|
32
26
|
export * from "./defaults.js";
|
|
33
27
|
export * from "./dispatch.js";
|
|
34
28
|
export * from "./doctor.js";
|
|
@@ -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).",
|