@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
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
* ESM loader itself on startup.
|
|
9
9
|
*
|
|
10
10
|
* On compiled runs it additionally registers alias hooks so authored bare
|
|
11
|
-
* imports of the framework resolve against the running package
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* imports of the framework resolve against the running package's `dist/` —
|
|
12
|
+
* `@anysphere/agent-serve[/x]`, `@cursor/july[/x]`, and `@cursor/agentkit[/x]`
|
|
13
|
+
* all short-circuit to the same files the CLI loaded. Channel option WeakMaps
|
|
14
|
+
* (`getGitHubChannelOptions`, …) require that identity; letting tsx path-map
|
|
15
|
+
* or a second install win loads a duplicate module and breaks continuation /
|
|
16
|
+
* hosted-delivery lookups. Bare npm deps from monorepo `packages/agent-serve/`
|
|
17
|
+
* source still retry against this package (hosted factory engines).
|
|
17
18
|
* Source runs (tsx from the monorepo) skip both — the host loader and
|
|
18
19
|
* tsconfig paths already cover them.
|
|
19
20
|
*/
|
|
@@ -168,18 +169,21 @@ function registerFrameworkAliases(): void {
|
|
|
168
169
|
}
|
|
169
170
|
const distDir = join(packageRootDir(), "dist");
|
|
170
171
|
const directAliases: Record<string, string> = {};
|
|
171
|
-
const fallbackAliases: Record<string, string> = {};
|
|
172
172
|
for (const [subpath, file] of AUTHORING_ENTRY_FILES) {
|
|
173
173
|
const target = pathToFileURL(join(distDir, file)).href;
|
|
174
174
|
const suffix = subpath === "" ? "" : `/${subpath}`;
|
|
175
|
+
// Always pin framework imports to this process's dist. Channel factories
|
|
176
|
+
// stash options in module-local WeakMaps; a second copy (tsx tsconfig
|
|
177
|
+
// paths → src/, or a mismatched node_modules install) makes
|
|
178
|
+
// getGitHubChannelOptions miss and hosted-delivery return 422.
|
|
175
179
|
directAliases[`${LEGACY_PACKAGE_NAME}${suffix}`] = target;
|
|
176
|
-
|
|
177
|
-
|
|
180
|
+
directAliases[`${PACKAGE_NAME}${suffix}`] = target;
|
|
181
|
+
directAliases[`${AGENTKIT_PACKAGE_NAME}${suffix}`] = target;
|
|
178
182
|
}
|
|
179
183
|
const hooksUrl = new URL("./authored-alias-hooks.js", import.meta.url);
|
|
180
184
|
const data: AuthoredAliasHookData = {
|
|
181
185
|
directAliases,
|
|
182
|
-
fallbackAliases,
|
|
186
|
+
fallbackAliases: {},
|
|
183
187
|
// Hosted factory agents relative-import this package's src/ from a
|
|
184
188
|
// monorepo checkout while npm install ran only in the agent directory.
|
|
185
189
|
// Bare specifiers from that tree retry against this package.json.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* All intelligence is server-side (backend/server/src/agentServe/); these
|
|
7
7
|
* handlers resolve parameters (credentials, team, slug, the project's
|
|
8
8
|
* `hosting` / `architecture` manifest block), call the v1 agent-serve or
|
|
9
|
-
* v2
|
|
9
|
+
* v2 agentsdk management API through `deploy-client.ts`, poll status, and
|
|
10
10
|
* render.
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -658,7 +658,7 @@ async function deployOne(
|
|
|
658
658
|
if (!ctx.json) {
|
|
659
659
|
ctx.err(" architecture: v2\n");
|
|
660
660
|
}
|
|
661
|
-
return
|
|
661
|
+
return deployOneAgentsdk(ctx, extras, {
|
|
662
662
|
slug,
|
|
663
663
|
gitRepoUrl,
|
|
664
664
|
gitRef,
|
|
@@ -782,7 +782,7 @@ async function deployOne(
|
|
|
782
782
|
* poll the matching GET. The v2 accept path starts freeze bake; it does
|
|
783
783
|
* not mint an engine alias or alias token.
|
|
784
784
|
*/
|
|
785
|
-
async function
|
|
785
|
+
async function deployOneAgentsdk(
|
|
786
786
|
ctx: DeployCliContext,
|
|
787
787
|
extras: { jsonCollect?: unknown[] } | undefined,
|
|
788
788
|
args: {
|
|
@@ -1189,10 +1189,10 @@ export async function cmdStop(
|
|
|
1189
1189
|
return ctx;
|
|
1190
1190
|
}
|
|
1191
1191
|
// Stop takes only a slug, so there is no manifest to dispatch on (unlike
|
|
1192
|
-
// deploy). The v2
|
|
1192
|
+
// deploy). The v2 agentsdk control plane goes first: v1 endpoints refuse
|
|
1193
1193
|
// `architecture: "v2"` slugs with a 409 rather than a 404, so v1-first
|
|
1194
1194
|
// could not fall through. A v2 404 (including an older backend without
|
|
1195
|
-
// the agentkit mount) falls back to the v1 stop.
|
|
1195
|
+
// the `/internal/agentkit` mount) falls back to the v1 stop.
|
|
1196
1196
|
let architecture: "v1" | "v2" = "v2";
|
|
1197
1197
|
let accepted: StopAccepted | AgentkitStopAccepted;
|
|
1198
1198
|
try {
|
|
@@ -68,13 +68,15 @@ export async function cmdMcpOauth(
|
|
|
68
68
|
const err = options.err ?? ((text) => process.stderr.write(text));
|
|
69
69
|
const out = options.out ?? ((text) => process.stdout.write(text));
|
|
70
70
|
const project = await loadAgentProject(options.dir);
|
|
71
|
-
const
|
|
71
|
+
const authored = [
|
|
72
|
+
...project.agent.connections,
|
|
73
|
+
...(project.agent.hostConnections ?? []),
|
|
74
|
+
];
|
|
75
|
+
const connection = authored.find(
|
|
72
76
|
(entry) => entry.name === options.connection
|
|
73
77
|
);
|
|
74
78
|
if (connection === undefined) {
|
|
75
|
-
const known =
|
|
76
|
-
project.agent.connections.map((entry) => entry.name).join(", ") ||
|
|
77
|
-
"(none)";
|
|
79
|
+
const known = authored.map((entry) => entry.name).join(", ") || "(none)";
|
|
78
80
|
err(
|
|
79
81
|
`${LOG_PREFIX} Unknown MCP connection "${options.connection}". Authored: ${known}.\n`
|
|
80
82
|
);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { getDeploymentsChannelOptions } from "../channels/deployments/deployments-channel.js";
|
|
1
2
|
import { getGitHubChannelOptions } from "../channels/github/github-channel.js";
|
|
2
3
|
import { getOriginChannelOptions } from "../channels/origin/origin-channel.js";
|
|
3
4
|
import { getSlackChannelOptions } from "../channels/slack/slack-channel.js";
|
|
4
5
|
import type {
|
|
5
6
|
AgentArchitecture,
|
|
6
7
|
ChannelDefinition,
|
|
8
|
+
ChannelMeta,
|
|
7
9
|
HttpChannelDefinition,
|
|
8
10
|
} from "../types.js";
|
|
9
11
|
import {
|
|
@@ -14,23 +16,48 @@ import {
|
|
|
14
16
|
normalizeIdentity,
|
|
15
17
|
} from "./continuation-identity.js";
|
|
16
18
|
|
|
19
|
+
type ContinuationChannelOptions = {
|
|
20
|
+
continuation?: ContinuationIdentity;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const CONTINUATION_CHANNEL_PACKS: ReadonlyArray<{
|
|
24
|
+
kind: "github" | "slack" | "origin" | "deployments";
|
|
25
|
+
getOptions: (definition: object) => ContinuationChannelOptions | undefined;
|
|
26
|
+
usesDeclaredEvents: boolean;
|
|
27
|
+
}> = [
|
|
28
|
+
{
|
|
29
|
+
kind: "github",
|
|
30
|
+
getOptions: getGitHubChannelOptions,
|
|
31
|
+
usesDeclaredEvents: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "slack",
|
|
35
|
+
getOptions: getSlackChannelOptions,
|
|
36
|
+
usesDeclaredEvents: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
kind: "origin",
|
|
40
|
+
getOptions: getOriginChannelOptions,
|
|
41
|
+
usesDeclaredEvents: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
kind: "deployments",
|
|
45
|
+
getOptions: getDeploymentsChannelOptions,
|
|
46
|
+
usesDeclaredEvents: true,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
17
50
|
export function channelContinuationIdentity(
|
|
18
51
|
definition: object | undefined
|
|
19
52
|
): ContinuationIdentity {
|
|
20
53
|
if (definition === undefined) {
|
|
21
54
|
return defaultContinuationSelector();
|
|
22
55
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (slack !== undefined) {
|
|
29
|
-
return normalizeIdentity(slack.continuation, "slack");
|
|
30
|
-
}
|
|
31
|
-
const origin = getOriginChannelOptions(definition);
|
|
32
|
-
if (origin !== undefined) {
|
|
33
|
-
return normalizeIdentity(origin.continuation, "origin");
|
|
56
|
+
for (const pack of CONTINUATION_CHANNEL_PACKS) {
|
|
57
|
+
const options = pack.getOptions(definition);
|
|
58
|
+
if (options !== undefined) {
|
|
59
|
+
return normalizeIdentity(options.continuation, pack.kind);
|
|
60
|
+
}
|
|
34
61
|
}
|
|
35
62
|
return defaultContinuationSelector();
|
|
36
63
|
}
|
|
@@ -44,8 +71,9 @@ export function httpContinuationIdentity(
|
|
|
44
71
|
/**
|
|
45
72
|
* Stamp `/v2` continuation defaults onto channel constructors that omitted
|
|
46
73
|
* `continuation` when the agent deploys onto v2 architecture. GitHub/Origin
|
|
47
|
-
* type (`pr` / `issue` / `none`) follows declared webhook events.
|
|
48
|
-
*
|
|
74
|
+
* type (`pr` / `issue` / `none`) follows declared webhook events.
|
|
75
|
+
* Deployments default to `deployments.deployment/v2`. Explicit per-channel
|
|
76
|
+
* selectors are left alone. Idempotent.
|
|
49
77
|
*/
|
|
50
78
|
export function applyAgentContinuationDefaults(project: {
|
|
51
79
|
agent: { architecture?: AgentArchitecture };
|
|
@@ -70,42 +98,34 @@ function stampOmittedChannelContinuation(
|
|
|
70
98
|
definition: object,
|
|
71
99
|
version: ContinuationProtocolVersion
|
|
72
100
|
): void {
|
|
73
|
-
const events =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
events
|
|
81
|
-
);
|
|
101
|
+
const events = channelDeclaredEventTypes(
|
|
102
|
+
(definition as ChannelDefinition).meta
|
|
103
|
+
);
|
|
104
|
+
for (const pack of CONTINUATION_CHANNEL_PACKS) {
|
|
105
|
+
const options = pack.getOptions(definition);
|
|
106
|
+
if (options === undefined) {
|
|
107
|
+
continue;
|
|
82
108
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (slack !== undefined) {
|
|
87
|
-
if (slack.continuation === undefined) {
|
|
88
|
-
slack.continuation = defaultContinuationSelector("slack", version);
|
|
89
|
-
}
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const origin = getOriginChannelOptions(definition);
|
|
93
|
-
if (origin !== undefined) {
|
|
94
|
-
if (origin.continuation === undefined) {
|
|
95
|
-
origin.continuation = defaultContinuationSelector(
|
|
96
|
-
"origin",
|
|
109
|
+
if (options.continuation === undefined) {
|
|
110
|
+
options.continuation = defaultContinuationSelector(
|
|
111
|
+
pack.kind,
|
|
97
112
|
version,
|
|
98
|
-
events
|
|
113
|
+
pack.usesDeclaredEvents ? events : undefined
|
|
99
114
|
);
|
|
100
115
|
}
|
|
116
|
+
return;
|
|
101
117
|
}
|
|
102
118
|
}
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
/** Kind-specific event lists on `ChannelMeta`; a definition sets at most one. */
|
|
121
|
+
export function channelDeclaredEventTypes(
|
|
122
|
+
meta: ChannelMeta | undefined
|
|
106
123
|
): readonly string[] | undefined {
|
|
107
|
-
|
|
108
|
-
|
|
124
|
+
return (
|
|
125
|
+
meta?.githubWebhookEvents ??
|
|
126
|
+
meta?.originWebhookEvents ??
|
|
127
|
+
meta?.deploymentEventTypes
|
|
128
|
+
);
|
|
109
129
|
}
|
|
110
130
|
|
|
111
131
|
export function handshakeChannelContinuation(input: {
|
|
@@ -113,10 +133,7 @@ export function handshakeChannelContinuation(input: {
|
|
|
113
133
|
definition: ChannelDefinition;
|
|
114
134
|
}): { ok: true } | { ok: false; error: string } {
|
|
115
135
|
const kind = input.definition.meta?.kind;
|
|
116
|
-
const eventTypes =
|
|
117
|
-
...(input.definition.meta?.githubWebhookEvents ?? []),
|
|
118
|
-
...(input.definition.meta?.originWebhookEvents ?? []),
|
|
119
|
-
];
|
|
136
|
+
const eventTypes = channelDeclaredEventTypes(input.definition.meta);
|
|
120
137
|
const result = handshakeContinuation({
|
|
121
138
|
kind,
|
|
122
139
|
eventTypes,
|
|
@@ -2,20 +2,27 @@
|
|
|
2
2
|
* Continuation identity is a closed selector string. Omitted `continuation`
|
|
3
3
|
* on a channel constructor stays `/v1` (engine pack minting) so existing
|
|
4
4
|
* agents do not change: `githubChannel()` → `github.pr/v1`, `slackChannel()`
|
|
5
|
-
* → `slack.thread/v1`, `originChannel()` → `origin.pr/v1`,
|
|
6
|
-
* → `none/v1
|
|
5
|
+
* → `slack.thread/v1`, `originChannel()` → `origin.pr/v1`,
|
|
6
|
+
* `deploymentsChannel()` → `deployments.none/v1`, `httpChannel()` →
|
|
7
|
+
* `none/v1`.
|
|
7
8
|
*
|
|
8
9
|
* Opt the whole agent into the v2 control plane with
|
|
9
10
|
* `defineAgent({ architecture: "v2" })`. That stamps `/v2` defaults from
|
|
10
11
|
* the channel kind and declared events (`github.pr/v2`, `github.issue/v2`,
|
|
11
|
-
* `github.none/v2`, `slack.thread/v2`,
|
|
12
|
-
*
|
|
12
|
+
* `github.none/v2`, `slack.thread/v2`, `origin.pr/v2`,
|
|
13
|
+
* `deployments.deployment/v2`, …) onto every channel that omitted a
|
|
14
|
+
* selector. An explicit per-channel selector still overrides. JSONPath
|
|
13
15
|
* and per-agent format strings are rejected.
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
18
|
import { randomBytes } from "node:crypto";
|
|
17
19
|
|
|
18
|
-
export type ConversationType =
|
|
20
|
+
export type ConversationType =
|
|
21
|
+
| "pr"
|
|
22
|
+
| "issue"
|
|
23
|
+
| "thread"
|
|
24
|
+
| "origin-pr"
|
|
25
|
+
| "deployment";
|
|
19
26
|
|
|
20
27
|
export const CONTINUATION_SELECTORS = [
|
|
21
28
|
"github.pr/v1",
|
|
@@ -29,6 +36,9 @@ export const CONTINUATION_SELECTORS = [
|
|
|
29
36
|
"origin.pr/v1",
|
|
30
37
|
"origin.pr/v2",
|
|
31
38
|
"origin.none/v2",
|
|
39
|
+
"deployments.none/v1",
|
|
40
|
+
"deployments.none/v2",
|
|
41
|
+
"deployments.deployment/v2",
|
|
32
42
|
"none/v1",
|
|
33
43
|
"none/v2",
|
|
34
44
|
] as const;
|
|
@@ -42,7 +52,7 @@ export type ParsedContinuation = {
|
|
|
42
52
|
selector: ContinuationSelector;
|
|
43
53
|
version: 1 | 2;
|
|
44
54
|
type: ConversationType | "none";
|
|
45
|
-
kind: "github" | "slack" | "origin" | "http";
|
|
55
|
+
kind: "github" | "slack" | "origin" | "deployments" | "http";
|
|
46
56
|
};
|
|
47
57
|
|
|
48
58
|
export type ContinuationClaim = {
|
|
@@ -50,7 +60,8 @@ export type ContinuationClaim = {
|
|
|
50
60
|
resource:
|
|
51
61
|
| { owner: string; repo: string; number: number }
|
|
52
62
|
| { channelId: string; threadTs: string }
|
|
53
|
-
| { fullName: string; number: number }
|
|
63
|
+
| { fullName: string; number: number }
|
|
64
|
+
| { deploymentId: string };
|
|
54
65
|
};
|
|
55
66
|
|
|
56
67
|
export type MailboxContinuation = {
|
|
@@ -59,7 +70,7 @@ export type MailboxContinuation = {
|
|
|
59
70
|
|
|
60
71
|
export type ContinuationBuiltin = {
|
|
61
72
|
type: ConversationType;
|
|
62
|
-
kind: "github" | "slack" | "origin";
|
|
73
|
+
kind: "github" | "slack" | "origin" | "deployments";
|
|
63
74
|
events: readonly string[];
|
|
64
75
|
format: string;
|
|
65
76
|
};
|
|
@@ -105,6 +116,12 @@ export const BUILTINS: readonly ContinuationBuiltin[] = [
|
|
|
105
116
|
],
|
|
106
117
|
format: "origin-pr:{fullName}#{number}",
|
|
107
118
|
},
|
|
119
|
+
{
|
|
120
|
+
type: "deployment",
|
|
121
|
+
kind: "deployments",
|
|
122
|
+
events: ["deployment.created", "deployment.succeeded"],
|
|
123
|
+
format: "deployments:{deploymentId}",
|
|
124
|
+
},
|
|
108
125
|
] as const;
|
|
109
126
|
|
|
110
127
|
export class V2EngineError extends Error {
|
|
@@ -128,6 +145,13 @@ const SELECTOR_FIELDS: {
|
|
|
128
145
|
"origin.pr/v1": { version: 1, type: "origin-pr", kind: "origin" },
|
|
129
146
|
"origin.pr/v2": { version: 2, type: "origin-pr", kind: "origin" },
|
|
130
147
|
"origin.none/v2": { version: 2, type: "none", kind: "origin" },
|
|
148
|
+
"deployments.none/v1": { version: 1, type: "none", kind: "deployments" },
|
|
149
|
+
"deployments.none/v2": { version: 2, type: "none", kind: "deployments" },
|
|
150
|
+
"deployments.deployment/v2": {
|
|
151
|
+
version: 2,
|
|
152
|
+
type: "deployment",
|
|
153
|
+
kind: "deployments",
|
|
154
|
+
},
|
|
131
155
|
"none/v1": { version: 1, type: "none", kind: "http" },
|
|
132
156
|
"none/v2": { version: 2, type: "none", kind: "http" },
|
|
133
157
|
};
|
|
@@ -151,6 +175,8 @@ export function defaultContinuationSelector(
|
|
|
151
175
|
return "slack.thread/v1";
|
|
152
176
|
case "origin":
|
|
153
177
|
return "origin.pr/v1";
|
|
178
|
+
case "deployments":
|
|
179
|
+
return "deployments.none/v1";
|
|
154
180
|
default:
|
|
155
181
|
return "none/v1";
|
|
156
182
|
}
|
|
@@ -162,6 +188,8 @@ export function defaultContinuationSelector(
|
|
|
162
188
|
return "slack.thread/v2";
|
|
163
189
|
case "origin":
|
|
164
190
|
return originV2Default(eventTypes);
|
|
191
|
+
case "deployments":
|
|
192
|
+
return deploymentsV2Default(eventTypes);
|
|
165
193
|
default:
|
|
166
194
|
return "none/v2";
|
|
167
195
|
}
|
|
@@ -189,6 +217,17 @@ function originV2Default(eventTypes?: readonly string[]): ContinuationSelector {
|
|
|
189
217
|
return "origin.pr/v2";
|
|
190
218
|
}
|
|
191
219
|
|
|
220
|
+
function deploymentsV2Default(
|
|
221
|
+
eventTypes?: readonly string[]
|
|
222
|
+
): ContinuationSelector {
|
|
223
|
+
const events = eventTypes ?? [];
|
|
224
|
+
const deploymentEvents = new Set(builtinForType("deployment")?.events ?? []);
|
|
225
|
+
if (events.some((event) => !deploymentEvents.has(event))) {
|
|
226
|
+
return "deployments.none/v2";
|
|
227
|
+
}
|
|
228
|
+
return "deployments.deployment/v2";
|
|
229
|
+
}
|
|
230
|
+
|
|
192
231
|
export function parseContinuationSelector(
|
|
193
232
|
selector: string
|
|
194
233
|
): ParsedContinuation | undefined {
|
|
@@ -249,6 +288,7 @@ export function formatConversationKey(
|
|
|
249
288
|
number?: number;
|
|
250
289
|
channelId?: string;
|
|
251
290
|
threadTs?: string;
|
|
291
|
+
deploymentId?: string;
|
|
252
292
|
}
|
|
253
293
|
): string {
|
|
254
294
|
switch (type) {
|
|
@@ -260,30 +300,51 @@ export function formatConversationKey(
|
|
|
260
300
|
return `origin-pr:${fields.fullName}#${fields.number}`;
|
|
261
301
|
case "thread":
|
|
262
302
|
return `${fields.channelId}:${fields.threadTs}`;
|
|
303
|
+
case "deployment":
|
|
304
|
+
return `deployments:${fields.deploymentId}`;
|
|
263
305
|
}
|
|
264
306
|
}
|
|
265
307
|
|
|
266
308
|
export function mintClaim(claim: ContinuationClaim): string {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
309
|
+
switch (claim.type) {
|
|
310
|
+
case "thread": {
|
|
311
|
+
const resource = claim.resource;
|
|
312
|
+
if (!("channelId" in resource && "threadTs" in resource)) {
|
|
313
|
+
throw new V2EngineError(
|
|
314
|
+
"v2: thread claim requires channelId and threadTs"
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
return `cont:${formatConversationKey("thread", resource)}`;
|
|
318
|
+
}
|
|
319
|
+
case "deployment": {
|
|
320
|
+
const resource = claim.resource;
|
|
321
|
+
if (!("deploymentId" in resource)) {
|
|
322
|
+
throw new V2EngineError("v2: deployment claim requires deploymentId");
|
|
323
|
+
}
|
|
324
|
+
return `cont:${formatConversationKey("deployment", resource)}`;
|
|
325
|
+
}
|
|
326
|
+
case "pr":
|
|
327
|
+
case "issue":
|
|
328
|
+
case "origin-pr": {
|
|
329
|
+
const resource = claim.resource;
|
|
330
|
+
const fullName =
|
|
331
|
+
"fullName" in resource
|
|
332
|
+
? resource.fullName
|
|
333
|
+
: "owner" in resource
|
|
334
|
+
? `${resource.owner}/${resource.repo}`
|
|
335
|
+
: undefined;
|
|
336
|
+
const number = "number" in resource ? resource.number : undefined;
|
|
337
|
+
if (fullName === undefined || number === undefined) {
|
|
338
|
+
throw new V2EngineError(
|
|
339
|
+
`v2: ${claim.type} claim requires repository and number`
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
return `cont:${formatConversationKey(claim.type, {
|
|
343
|
+
fullName,
|
|
344
|
+
number,
|
|
345
|
+
})}`;
|
|
273
346
|
}
|
|
274
|
-
return `cont:${formatConversationKey("thread", resource)}`;
|
|
275
|
-
}
|
|
276
|
-
const fullName =
|
|
277
|
-
"fullName" in resource
|
|
278
|
-
? resource.fullName
|
|
279
|
-
: `${resource.owner}/${resource.repo}`;
|
|
280
|
-
if (claim.type === "thread") {
|
|
281
|
-
throw new V2EngineError("v2: thread claim requires channelId and threadTs");
|
|
282
347
|
}
|
|
283
|
-
return `cont:${formatConversationKey(claim.type, {
|
|
284
|
-
fullName,
|
|
285
|
-
number: resource.number,
|
|
286
|
-
})}`;
|
|
287
348
|
}
|
|
288
349
|
|
|
289
350
|
export function handshakeContinuation(input: {
|
|
@@ -358,18 +419,16 @@ export function extractContinuation(
|
|
|
358
419
|
return extractSlack(payload);
|
|
359
420
|
case "origin-pr":
|
|
360
421
|
return extractOrigin(payload);
|
|
422
|
+
case "deployment":
|
|
423
|
+
return extractDeployment(payload);
|
|
361
424
|
}
|
|
362
425
|
}
|
|
363
426
|
|
|
364
427
|
/**
|
|
365
|
-
*
|
|
366
|
-
* `
|
|
367
|
-
*
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Extract primitive used by the control plane (hosted
|
|
371
|
-
* `routeVerifiedIngressContinuation` and local
|
|
372
|
-
* `routeLocalIngressContinuation`). Channel adapters must not call this.
|
|
428
|
+
* CP mailbox stamp. Hosted `routeVerifiedIngressContinuation` and local
|
|
429
|
+
* `routeLocalIngressContinuation` call this; channel adapters must not.
|
|
430
|
+
* Membership miss or missing identity fields stamp `evt:` instead of
|
|
431
|
+
* joining the conversation index.
|
|
373
432
|
*/
|
|
374
433
|
export function stampMailboxContinuation(
|
|
375
434
|
identity: ContinuationIdentity,
|
|
@@ -533,15 +592,13 @@ function extractSlack(payload: unknown): string | undefined {
|
|
|
533
592
|
}
|
|
534
593
|
|
|
535
594
|
function extractOrigin(payload: unknown): string | undefined {
|
|
536
|
-
const record =
|
|
595
|
+
const record = originExtractRecord(payload);
|
|
537
596
|
if (record === undefined) {
|
|
538
597
|
return undefined;
|
|
539
598
|
}
|
|
540
599
|
const inner = asRecord(record.pullRequest) ?? asRecord(record.pull_request);
|
|
541
600
|
const number = positiveInt(inner?.number);
|
|
542
|
-
const repository =
|
|
543
|
-
asRecord(record.repository) ??
|
|
544
|
-
asRecord(asRecord(asRecord(record.event)?.payload)?.repository);
|
|
601
|
+
const repository = asRecord(record.repository) ?? asRecord(inner?.repository);
|
|
545
602
|
const fullName =
|
|
546
603
|
nonEmpty(asRecord(repository)?.fullName) ??
|
|
547
604
|
nonEmpty(asRecord(repository)?.full_name) ??
|
|
@@ -552,6 +609,33 @@ function extractOrigin(payload: unknown): string | undefined {
|
|
|
552
609
|
return `cont:${formatConversationKey("origin-pr", { fullName, number })}`;
|
|
553
610
|
}
|
|
554
611
|
|
|
612
|
+
/**
|
|
613
|
+
* Mailbox stores the Origin delivery envelope; local/hosted CP extract
|
|
614
|
+
* also accepts the compact `{ pullRequest, repository }` shape.
|
|
615
|
+
*/
|
|
616
|
+
function originExtractRecord(
|
|
617
|
+
payload: unknown
|
|
618
|
+
): Record<string, unknown> | undefined {
|
|
619
|
+
const record = asRecord(payload);
|
|
620
|
+
if (record === undefined) {
|
|
621
|
+
return undefined;
|
|
622
|
+
}
|
|
623
|
+
const nested = asRecord(asRecord(record.event)?.payload);
|
|
624
|
+
if (nested !== undefined && asRecord(record.pullRequest) === undefined) {
|
|
625
|
+
return nested;
|
|
626
|
+
}
|
|
627
|
+
return record;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function extractDeployment(payload: unknown): string | undefined {
|
|
631
|
+
const record = asRecord(payload);
|
|
632
|
+
const deploymentId = nonEmpty(record?.deploymentId);
|
|
633
|
+
if (deploymentId === undefined) {
|
|
634
|
+
return undefined;
|
|
635
|
+
}
|
|
636
|
+
return `cont:${formatConversationKey("deployment", { deploymentId })}`;
|
|
637
|
+
}
|
|
638
|
+
|
|
555
639
|
function githubFullName(payload: Record<string, unknown>): string | undefined {
|
|
556
640
|
const repository = asRecord(payload.repository);
|
|
557
641
|
return nonEmpty(repository?.full_name) ?? originFullName(repository);
|
|
@@ -564,6 +648,7 @@ function originFullName(
|
|
|
564
648
|
return undefined;
|
|
565
649
|
}
|
|
566
650
|
const owner =
|
|
651
|
+
nonEmpty(asRecord(repository.owner)?.slug) ??
|
|
567
652
|
nonEmpty(repository.owner) ??
|
|
568
653
|
nonEmpty(asRecord(repository.owner)?.login) ??
|
|
569
654
|
nonEmpty(asRecord(repository.owner)?.name);
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
* clock — `exportedAt` comes from the caller.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { envPrefixFromName } from "../../channels/slack/credentials.js";
|
|
9
10
|
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "../distribution.js";
|
|
10
11
|
import { MEMORY_TS } from "../init-scaffold.js";
|
|
11
|
-
import {
|
|
12
|
+
import { SlugRegistry, slugify } from "./slug.js";
|
|
12
13
|
import type {
|
|
13
14
|
ActionJson,
|
|
14
15
|
ConvertedFile,
|
|
@@ -998,11 +999,11 @@ function emitSlackChannel(
|
|
|
998
999
|
"The Slack trigger marked triggering messages with a completion reaction; agentsdk has no completion-reaction option, so that signal is lost unless agent/instructions.md tells the agent to add the reaction itself via Slack tools."
|
|
999
1000
|
);
|
|
1000
1001
|
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
`Slack channel-watch / reaction / channel-created triggers need a dedicated Socket Mode Slack app
|
|
1004
|
-
|
|
1005
|
-
|
|
1002
|
+
out.setupSteps.push(
|
|
1003
|
+
socketMode
|
|
1004
|
+
? `Slack channel-watch / reaction / channel-created triggers need a dedicated Socket Mode Slack app: run \`${CLI_COMMAND_NAME} slack create --channel-posts\`, then finish in the dashboard wizard.`
|
|
1005
|
+
: `Slack mentions need a dedicated Socket Mode Slack app: run \`${CLI_COMMAND_NAME} slack create\`, then finish in the dashboard wizard.`
|
|
1006
|
+
);
|
|
1006
1007
|
|
|
1007
1008
|
const header = [
|
|
1008
1009
|
`import { slackChannel } from "${PACKAGE_NAME}/channels/slack";`,
|
|
@@ -1069,26 +1070,37 @@ function emitSlackChannel(
|
|
|
1069
1070
|
}
|
|
1070
1071
|
body = [
|
|
1071
1072
|
"//",
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
"export default slackChannel({",
|
|
1075
|
-
...engagement,
|
|
1076
|
-
"});",
|
|
1073
|
+
`// Run \`${CLI_COMMAND_NAME} slack create --channel-posts\` for a dedicated Slack app.`,
|
|
1074
|
+
...slackChannelExport(automation.name, engagement),
|
|
1077
1075
|
];
|
|
1078
1076
|
} else {
|
|
1079
|
-
const agentName = pascalCase(automation.name, "ExportedAgent");
|
|
1080
1077
|
body = [
|
|
1081
1078
|
"//",
|
|
1082
|
-
`//
|
|
1083
|
-
|
|
1084
|
-
" cursorAccount: true,",
|
|
1085
|
-
` agentName: ${JSON.stringify(agentName)},`,
|
|
1086
|
-
"});",
|
|
1079
|
+
`// Run \`${CLI_COMMAND_NAME} slack create\` for a dedicated Slack app.`,
|
|
1080
|
+
...slackChannelExport(automation.name, []),
|
|
1087
1081
|
];
|
|
1088
1082
|
}
|
|
1089
1083
|
out.files.push({ path, contents: `${[...header, ...body].join("\n")}\n` });
|
|
1090
1084
|
}
|
|
1091
1085
|
|
|
1086
|
+
/**
|
|
1087
|
+
* `slack create` writes `<DIR>_SLACK_*` from the project directory. Convert
|
|
1088
|
+
* names that directory from the automation (`Nightly Triage` →
|
|
1089
|
+
* `nightly-triage` → `NIGHTLY_TRIAGE`). Emit the same prefix so minted
|
|
1090
|
+
* tokens bind.
|
|
1091
|
+
*/
|
|
1092
|
+
function slackChannelExport(name: string, optionLines: string[]): string[] {
|
|
1093
|
+
const prefix = envPrefixFromName(slugify(name, "automation"));
|
|
1094
|
+
const options = [
|
|
1095
|
+
...(prefix === "" ? [] : [` envPrefix: ${JSON.stringify(prefix)},`]),
|
|
1096
|
+
...optionLines,
|
|
1097
|
+
];
|
|
1098
|
+
if (options.length === 0) {
|
|
1099
|
+
return ["export default slackChannel();"];
|
|
1100
|
+
}
|
|
1101
|
+
return ["export default slackChannel({", ...options, "});"];
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1092
1104
|
function slackChannelList(
|
|
1093
1105
|
trigger: SlackChannelsTriggerJson | undefined
|
|
1094
1106
|
): string[] {
|
|
@@ -9,15 +9,6 @@ export function slugify(name: string, fallback: string): string {
|
|
|
9
9
|
return slug === "" ? fallback : slug;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/** Single-token PascalCase (Slack cursorAccount agentName). */
|
|
13
|
-
export function pascalCase(name: string, fallback: string): string {
|
|
14
|
-
const words = name.split(/[^a-zA-Z0-9]+/).filter((word) => word !== "");
|
|
15
|
-
if (words.length === 0) {
|
|
16
|
-
return fallback;
|
|
17
|
-
}
|
|
18
|
-
return words.map((word) => word[0]?.toUpperCase() + word.slice(1)).join("");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
12
|
/** Dedupes slugs with numeric suffixes: `linear`, `linear-2`, `linear-3`, … */
|
|
22
13
|
export class SlugRegistry {
|
|
23
14
|
private readonly used = new Set<string>();
|
|
@@ -85,7 +85,10 @@ export function collectCursorAccountConnections(
|
|
|
85
85
|
const bySlug = new Map<string, CursorAccountConnectionRef[]>();
|
|
86
86
|
for (const { slug, project } of mounts) {
|
|
87
87
|
const refs: CursorAccountConnectionRef[] = [];
|
|
88
|
-
for (const connection of
|
|
88
|
+
for (const connection of [
|
|
89
|
+
...project.agent.connections,
|
|
90
|
+
...(project.agent.hostConnections ?? []),
|
|
91
|
+
]) {
|
|
89
92
|
if (!isCursorAccountTransport(connection.transport)) {
|
|
90
93
|
continue;
|
|
91
94
|
}
|