@cursor/july 0.1.91 → 0.1.93
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 +4 -0
- package/README.md +117 -162
- 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/continuation.d.ts +1 -1
- package/dist/continuation.js +1 -1
- package/dist/docs/404.html +4 -2
- package/dist/docs/ab.html +10 -8
- package/dist/docs/ab.md +332 -0
- 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.CjWU-x0z.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.ChpIC3Zy.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BCPT6xA-.js → VPLocalSearchBox.Cxy8ySFQ.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BEA8BF3c.js → theme.Dvq1Bktu.js} +2 -2
- package/dist/docs/assets/concepts.md.F6AiPorA.js +1 -0
- package/dist/docs/assets/{concepts.md.CRfU3bVg.lean.js → concepts.md.F6AiPorA.lean.js} +1 -1
- package/dist/docs/assets/{deployment.md.DX_hc3ze.js → deployment.md.DoLFAzfm.js} +6 -6
- 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/{example-agents_approval-buddy.md.DNL83puR.js → example-agents_approval-buddy.md.DmezILPg.js} +1 -1
- package/dist/docs/assets/{example-agents_benny.md.C40vHRLc.js → example-agents_benny.md.B0kwY7D_.js} +2 -4
- package/dist/docs/assets/{example-agents_benny.md.C40vHRLc.lean.js → example-agents_benny.md.B0kwY7D_.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_codebase-wiki.md.Dftj_tPp.js → example-agents_codebase-wiki.md.BBNw9Ekr.js} +3 -3
- package/dist/docs/assets/{example-agents_codebase-wiki.md.Dftj_tPp.lean.js → example-agents_codebase-wiki.md.BBNw9Ekr.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_concierge.md.MrKpQndp.js → example-agents_concierge.md.BzB2b20R.js} +2 -3
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.js +2 -0
- package/dist/docs/assets/example-agents_index.md.ChBp0AX6.lean.js +1 -0
- package/dist/docs/assets/{example-agents_knowledge-base.md.DqKqHQ9u.js → example-agents_knowledge-base.md.CrA85ig-.js} +1 -1
- package/dist/docs/assets/{example-agents_security-reviewer.md.Bai6D0Ee.js → example-agents_security-reviewer.md.74pPpWYj.js} +1 -1
- package/dist/docs/assets/{example-agents_weather-agent.md.lVEAbWFf.js → example-agents_weather-agent.md.CaGpmw3Y.js} +2 -2
- package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.js → guides_agent-to-agent.md.B3JIaAqz.js} +1 -1
- package/dist/docs/assets/{guides_cloud-runtime.md.BSMLIBHr.js → guides_cloud-runtime.md.BnvjPiia.js} +2 -2
- package/dist/docs/assets/{guides_cloud-runtime.md.BSMLIBHr.lean.js → guides_cloud-runtime.md.BnvjPiia.lean.js} +1 -1
- package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.js → guides_convert-automation.md.Bboisykk.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.js → guides_github.md.DqJhuaN1.js} +5 -5
- package/dist/docs/assets/{guides_github.md.Cdt1s2QC.lean.js → guides_github.md.DqJhuaN1.lean.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.js → guides_mcp-oauth.md.CJvrXtkN.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.js → guides_slack.md.mqeNKs84.js} +2 -2
- 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.BAaMXLFd.js → index.md.B-lVR4wT.js} +3 -3
- package/dist/docs/assets/{index.md.BAaMXLFd.lean.js → index.md.B-lVR4wT.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.DsrarzEg.js → quickstart.md.BrmfrrIr.js} +1 -1
- 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.D9KESDsD.js} +10 -11
- package/dist/docs/assets/{reference_cli.md.B7GkAJRC.lean.js → reference_cli.md.D9KESDsD.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DYidrb-j.js → reference_connections.md.DB6SsN6U.js} +3 -3
- package/dist/docs/assets/reference_hooks.md.BxN87gCw.js +14 -0
- package/dist/docs/assets/{reference_hooks.md.B9FSgdDe.lean.js → reference_hooks.md.BxN87gCw.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.C68BERYr.js +11 -0
- package/dist/docs/assets/reference_http-api.md.C68BERYr.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.CwkSbEWT.js → reference_project-layout.md.WN9nwJht.js} +2 -2
- 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.BFW9retM.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.js → reference_tools.md.DuKvkYWG.js} +4 -4
- package/dist/docs/assets/{reference_tools.md.wpaJtHn6.lean.js → reference_tools.md.DuKvkYWG.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.R4K_qytS.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.1HAR3RXE.lean.js → templates_pr-autofixer.md.R4K_qytS.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.vCWwvqcJ.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DYECCZiJ.lean.js → troubleshooting.md.vCWwvqcJ.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +9 -7
- package/dist/docs/building-with-agents.md +118 -0
- package/dist/docs/concepts.html +7 -8
- package/dist/docs/concepts.md +169 -0
- package/dist/docs/deployment.html +13 -11
- package/dist/docs/deployment.md +462 -0
- package/dist/docs/evals.html +12 -10
- package/dist/docs/evals.md +460 -0
- package/dist/docs/example-agents/approval-buddy.html +7 -5
- package/dist/docs/example-agents/approval-buddy.md +266 -0
- package/dist/docs/example-agents/benny.html +7 -7
- package/dist/docs/example-agents/benny.md +173 -0
- package/dist/docs/example-agents/bugbot.html +6 -4
- package/dist/docs/example-agents/bugbot.md +229 -0
- package/dist/docs/example-agents/codebase-wiki.html +8 -6
- package/dist/docs/example-agents/codebase-wiki.md +167 -0
- package/dist/docs/example-agents/codeowners-review.html +6 -4
- package/dist/docs/example-agents/codeowners-review.md +192 -0
- package/dist/docs/example-agents/concierge.html +9 -8
- package/dist/docs/example-agents/concierge.md +200 -0
- package/dist/docs/example-agents/index.html +8 -6
- package/dist/docs/example-agents/index.md +99 -0
- package/dist/docs/example-agents/knowledge-base.html +8 -6
- package/dist/docs/example-agents/knowledge-base.md +168 -0
- package/dist/docs/example-agents/oncall.html +6 -4
- package/dist/docs/example-agents/oncall.md +212 -0
- package/dist/docs/example-agents/security-reviewer.html +9 -7
- package/dist/docs/example-agents/security-reviewer.md +265 -0
- package/dist/docs/example-agents/slack-agent.html +6 -4
- package/dist/docs/example-agents/slack-agent.md +142 -0
- package/dist/docs/example-agents/weather-agent.html +9 -7
- package/dist/docs/example-agents/weather-agent.md +297 -0
- package/dist/docs/guides/agent-to-agent.html +7 -5
- package/dist/docs/guides/agent-to-agent.md +113 -0
- package/dist/docs/guides/cloud-runtime.html +8 -6
- package/dist/docs/guides/cloud-runtime.md +114 -0
- package/dist/docs/guides/convert-automation.html +8 -6
- package/dist/docs/guides/convert-automation.md +171 -0
- package/dist/docs/guides/github.html +11 -9
- package/dist/docs/guides/github.md +275 -0
- package/dist/docs/guides/human-in-the-loop.html +6 -4
- package/dist/docs/guides/human-in-the-loop.md +126 -0
- package/dist/docs/guides/mcp-oauth.html +8 -6
- package/dist/docs/guides/mcp-oauth.md +159 -0
- package/dist/docs/guides/opentelemetry.html +6 -4
- package/dist/docs/guides/opentelemetry.md +209 -0
- package/dist/docs/guides/slack.html +9 -7
- package/dist/docs/guides/slack.md +337 -0
- package/dist/docs/guides/webhooks.html +8 -6
- package/dist/docs/guides/webhooks.md +463 -0
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +8 -6
- package/dist/docs/hillclimbing.md +88 -0
- package/dist/docs/index.html +8 -6
- package/dist/docs/index.md +171 -0
- package/dist/docs/llms-full.txt +10968 -0
- package/dist/docs/llms.txt +74 -0
- package/dist/docs/quickstart.html +7 -5
- package/dist/docs/quickstart.md +364 -0
- package/dist/docs/reference/agent-config.html +10 -8
- package/dist/docs/reference/agent-config.md +251 -0
- package/dist/docs/reference/artifacts.html +6 -4
- package/dist/docs/reference/artifacts.md +112 -0
- package/dist/docs/reference/channels.html +8 -6
- package/dist/docs/reference/channels.md +244 -0
- package/dist/docs/reference/cli.html +16 -15
- package/dist/docs/reference/cli.md +947 -0
- package/dist/docs/reference/connections.html +10 -8
- package/dist/docs/reference/connections.md +263 -0
- package/dist/docs/reference/hooks.html +8 -6
- package/dist/docs/reference/hooks.md +98 -0
- package/dist/docs/reference/http-api.html +9 -7
- package/dist/docs/reference/http-api.md +247 -0
- package/dist/docs/reference/instructions.html +8 -6
- package/dist/docs/reference/instructions.md +74 -0
- package/dist/docs/reference/playground.html +7 -5
- package/dist/docs/reference/playground.md +57 -0
- package/dist/docs/reference/project-layout.html +9 -7
- package/dist/docs/reference/project-layout.md +107 -0
- package/dist/docs/reference/prompt.html +8 -6
- package/dist/docs/reference/prompt.md +42 -0
- package/dist/docs/reference/schedules.html +8 -6
- package/dist/docs/reference/schedules.md +214 -0
- package/dist/docs/reference/sessions.html +7 -12
- package/dist/docs/reference/sessions.md +159 -0
- package/dist/docs/reference/skills.html +8 -6
- package/dist/docs/reference/skills.md +83 -0
- package/dist/docs/reference/subagents.html +6 -4
- package/dist/docs/reference/subagents.md +71 -0
- package/dist/docs/reference/tools.html +10 -8
- package/dist/docs/reference/tools.md +293 -0
- package/dist/docs/scaffolding-agents.html +7 -5
- package/dist/docs/scaffolding-agents.md +129 -0
- package/dist/docs/storage.html +11 -9
- package/dist/docs/storage.md +176 -0
- package/dist/docs/templates/agentic-owners.html +9 -7
- package/dist/docs/templates/agentic-owners.md +92 -0
- package/dist/docs/templates/demo.html +6 -4
- package/dist/docs/templates/demo.md +79 -0
- package/dist/docs/templates/pr-autofixer.html +8 -6
- package/dist/docs/templates/pr-autofixer.md +128 -0
- package/dist/docs/templates/security-reviewer.html +6 -4
- package/dist/docs/templates/security-reviewer.md +84 -0
- package/dist/docs/templates/triage.html +6 -4
- package/dist/docs/templates/triage.md +98 -0
- package/dist/docs/troubleshooting.html +7 -5
- package/dist/docs/troubleshooting.md +111 -0
- 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/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/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 +3 -0
- 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 +226 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -1
- package/dist/internal/init-scaffold.d.ts.map +1 -1
- package/dist/internal/init-scaffold.js +1 -0
- package/dist/internal/playground/static.d.ts.map +1 -1
- package/dist/internal/playground/static.js +2 -0
- 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 +21 -3
- package/dist/internal/session-engine.d.ts +5 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +16 -4
- 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/playground/assets/{index-DDvyC2z6.js → index-D9MFzhNE.js} +1 -1
- package/dist/playground/index.html +1 -1
- package/dist/types.d.ts +9 -17
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -10
- package/docs/ab.md +7 -13
- package/docs/building-with-agents.md +5 -11
- package/docs/concepts.md +12 -17
- package/docs/deployment.md +8 -10
- package/docs/evals.md +16 -37
- package/docs/example-agents/approval-buddy.md +1 -1
- package/docs/example-agents/benny.md +4 -13
- package/docs/example-agents/codebase-wiki.md +5 -8
- package/docs/example-agents/concierge.md +2 -3
- package/docs/example-agents/index.md +6 -9
- package/docs/example-agents/knowledge-base.md +2 -2
- package/docs/example-agents/security-reviewer.md +5 -5
- package/docs/example-agents/weather-agent.md +4 -3
- package/docs/guides/agent-to-agent.md +1 -1
- package/docs/guides/cloud-runtime.md +8 -25
- package/docs/guides/convert-automation.md +3 -3
- package/docs/guides/github.md +11 -23
- package/docs/guides/mcp-oauth.md +4 -4
- package/docs/guides/slack.md +4 -4
- package/docs/guides/webhooks.md +3 -3
- package/docs/hillclimbing.md +1 -1
- package/docs/quickstart.md +1 -1
- package/docs/reference/agent-config.md +10 -15
- package/docs/reference/channels.md +20 -31
- package/docs/reference/cli.md +27 -37
- package/docs/reference/connections.md +9 -14
- package/docs/reference/hooks.md +10 -14
- package/docs/reference/http-api.md +18 -38
- package/docs/reference/instructions.md +1 -1
- package/docs/reference/playground.md +14 -19
- package/docs/reference/project-layout.md +2 -2
- 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/tools.md +12 -17
- 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 +3 -6
- package/docs/troubleshooting.md +6 -6
- package/package.json +9 -2
- package/skills/ab/SKILL.md +3 -0
- package/skills/create-agent/SKILL.md +3 -0
- package/skills/debug/SKILL.md +3 -0
- package/skills/evals/SKILL.md +3 -0
- package/skills/framework-map/SKILL.md +3 -0
- package/skills/github/SKILL.md +3 -0
- package/skills/hillclimb/SKILL.md +3 -0
- package/skills/mcp-auth/SKILL.md +3 -0
- package/skills/otel/SKILL.md +3 -0
- package/skills/setup-slack/SKILL.md +3 -0
- 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/continuation.ts +1 -1
- 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/continuation-channel.ts +62 -45
- package/src/internal/continuation-identity.ts +123 -38
- package/src/internal/deploy-manifest.ts +5 -9
- package/src/internal/discovery.ts +3 -0
- package/src/internal/distribution.ts +4 -3
- package/src/internal/hosted-delivery-protocol.ts +114 -0
- package/src/internal/hosted-delivery.ts +327 -0
- package/src/internal/http-channel.ts +0 -2
- package/src/internal/init-scaffold.ts +1 -0
- package/src/internal/playground/static.ts +2 -0
- package/src/internal/review-comments.ts +542 -229
- package/src/internal/server.ts +29 -2
- package/src/internal/session-engine.ts +29 -7
- package/src/internal/shallow-clone.ts +30 -16
- package/src/types.ts +9 -17
- 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_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/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_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/fsd.html +0 -39
- package/docs/example-agents/fsd.md +0 -334
- /package/dist/docs/assets/{deployment.md.DX_hc3ze.lean.js → deployment.md.DoLFAzfm.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_approval-buddy.md.DNL83puR.lean.js → example-agents_approval-buddy.md.DmezILPg.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_concierge.md.MrKpQndp.lean.js → example-agents_concierge.md.BzB2b20R.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_knowledge-base.md.DqKqHQ9u.lean.js → example-agents_knowledge-base.md.CrA85ig-.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_security-reviewer.md.Bai6D0Ee.lean.js → example-agents_security-reviewer.md.74pPpWYj.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_weather-agent.md.lVEAbWFf.lean.js → example-agents_weather-agent.md.CaGpmw3Y.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.BCeVdJRJ.lean.js → guides_agent-to-agent.md.B3JIaAqz.lean.js} +0 -0
- /package/dist/docs/assets/{guides_convert-automation.md.D06eIzea.lean.js → guides_convert-automation.md.Bboisykk.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.Du0f7pGU.lean.js → guides_mcp-oauth.md.CJvrXtkN.lean.js} +0 -0
- /package/dist/docs/assets/{guides_slack.md.DiUmk_Oi.lean.js → guides_slack.md.mqeNKs84.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.BrmfrrIr.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_connections.md.DYidrb-j.lean.js → reference_connections.md.DB6SsN6U.lean.js} +0 -0
- /package/dist/docs/assets/{reference_project-layout.md.CwkSbEWT.lean.js → reference_project-layout.md.WN9nwJht.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.BFW9retM.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DSJSIpWU.lean.js → templates_agentic-owners.md.DqtPdm6f.lean.js} +0 -0
|
@@ -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(
|
package/src/continuation.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Per-channel selectors still override type (`"github.issue/v2"`,
|
|
15
15
|
* `"github.none/v2"`). Other `/v2` selectors: `"slack.thread/v2"`,
|
|
16
|
-
* `"origin.pr/v2"`, `"none/v2"`.
|
|
16
|
+
* `"origin.pr/v2"`, `"deployments.deployment/v2"`, `"none/v2"`.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
export type {
|
|
@@ -3,19 +3,22 @@
|
|
|
3
3
|
* node:module `register()` from authored-loaders.ts; runs on Node's loader
|
|
4
4
|
* thread — keep this module dependency-free).
|
|
5
5
|
*
|
|
6
|
-
* Authored files import the framework by bare specifier.
|
|
7
|
-
*
|
|
6
|
+
* Authored files import the framework by bare specifier. On compiled runs the
|
|
7
|
+
* CLI pins every public package name onto the running `dist/` entries via
|
|
8
|
+
* `directAliases` so channel-option WeakMaps stay single-copy:
|
|
8
9
|
*
|
|
9
|
-
* - `@anysphere/agent-serve[/subpath]` (
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - `@cursor/july[/subpath]` (the published name) and `@cursor/agentkit
|
|
13
|
-
* [/subpath]` (the future public name) normally resolve through the
|
|
14
|
-
* project's own node_modules; `fallbackAliases` only apply when that
|
|
15
|
-
* fails (npx/global installs, projects without a local dependency), so a
|
|
16
|
-
* real install in the user's project keeps precedence.
|
|
10
|
+
* - `@anysphere/agent-serve[/subpath]` (historical monorepo name; not on npm)
|
|
11
|
+
* - `@cursor/july[/subpath]` (published name)
|
|
12
|
+
* - `@cursor/agentkit[/subpath]` (future public name)
|
|
17
13
|
*
|
|
18
|
-
*
|
|
14
|
+
* Preferring a project's own `node_modules` (or tsx tsconfig paths that map
|
|
15
|
+
* onto this package's `src/`) would load a second module instance and break
|
|
16
|
+
* `getGitHubChannelOptions` / continuation stamping / hosted-delivery.
|
|
17
|
+
*
|
|
18
|
+
* `fallbackAliases` remains for tests and any future soft remap; production
|
|
19
|
+
* registration leaves it empty.
|
|
20
|
+
*
|
|
21
|
+
* A separate case is first-party factory agents that relative-import this
|
|
19
22
|
* package's `src/` from a monorepo checkout. Hosted engines `npm install`
|
|
20
23
|
* only the agent directory, so files under `packages/agent-serve/src` have
|
|
21
24
|
* no `node_modules`. Bare specifiers from that tree (`zod`, octokit, …)
|
|
@@ -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 {
|
|
@@ -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,
|