@cursor/july 0.1.111 → 0.1.112
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/dist/bin/agent-serve.js +18 -1
- package/dist/channels/github/github-channel.d.ts +29 -19
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +29 -19
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -1
- package/dist/channels/slack/agentic-delivery.js +2 -0
- package/dist/channels/slack/dispatch.d.ts +11 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +142 -39
- package/dist/channels/slack/placeholder.d.ts +26 -0
- package/dist/channels/slack/placeholder.d.ts.map +1 -1
- package/dist/channels/slack/placeholder.js +28 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +9 -16
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.Drol6mi6.js → app.DxTdhphC.js} +4 -4
- package/dist/docs/assets/building-with-agents.md.BBCx0AUo.js +9 -0
- package/dist/docs/assets/building-with-agents.md.BBCx0AUo.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.QmjDU6Jh.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CdqoBZJX.js → VPLocalSearchBox.CR3KTF0X.js} +1 -1
- package/dist/docs/assets/chunks/{arc.BVX3ycTn.js → arc.CVVqBOdS.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CcChnMxX.js → architectureDiagram-Q4EWVU46.CJHGP4ki.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.xwtXO-yt.js → baseUniq.r7UVVRBP.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.CijZ_taK.js → blockDiagram-DXYQGD6D.DKmMaTre.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.0FBvwBvK.js → c4Diagram-AHTNJAMY.DDJsntUO.js} +1 -1
- package/dist/docs/assets/chunks/channel.BjpoSbz_.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CELMmMDA.js → chunk-4BX2VUAB.BK2rKt6W.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.C4bhFtSm.js → chunk-4TB4RGXK.DRLV8RnF.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.ZnQ9gRRQ.js → chunk-55IACEB6.DaKjxtb7.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DPlmglG-.js → chunk-EDXVE4YY.C5sPCIT1.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.BrUk8pff.js → chunk-FMBD7UC4.CSGWyNTB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CcmWIncu.js → chunk-OYMX7WX6.D5tK9XEr.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.D65-cs8I.js → chunk-QZHKN3VN.BeZGd1UZ.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.qoXZpG9F.js → chunk-YZCP3GAM.U_tfWwQR.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BgxOlMHw.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BgxOlMHw.js +1 -0
- package/dist/docs/assets/chunks/clone.DRuGBKZC.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.8rYtqudO.js → cose-bilkent-S5V4N54A.DVeRXIb6.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.DrRP1fOh.js → dagre-KV5264BT.BpKJAeRZ.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DHj_xA2_.js → diagram-5BDNPKRD.BQOtrd1Z.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.Bz_6nAKj.js → diagram-G4DWMVQ6.CSDAhjPI.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BWA0xSW9.js → diagram-MMDJMWI5.Dpztst2S.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.CpTJLNJI.js → diagram-TYMM5635.qJHRizHR.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.-7AWWSrP.js → erDiagram-SMLLAGMA.vbDotH3l.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BTnQ742_.js → flowDiagram-DWJPFMVM.CqS_ZQr4.js} +1 -1
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.B5_HiiQ5.js → ganttDiagram-T4ZO3ILL.DTLdR4pN.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CZcNTFZd.js → gitGraphDiagram-UUTBAWPF.D04lnbnr.js} +1 -1
- package/dist/docs/assets/chunks/{graph.V2GLaab4.js → graph.BlfqLJsM.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.7pZOkCCU.js → infoDiagram-42DDH7IO.tAooImWA.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DSMo3Qa3.js → ishikawaDiagram-UXIWVN3A.ClUsVqnJ.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BNEgWN1S.js → journeyDiagram-VCZTEJTY.C3tUgyCg.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.B-4d4tC7.js → kanban-definition-6JOO6SKY.CtD9-QCe.js} +1 -1
- package/dist/docs/assets/chunks/{layout.Dvbn9nSb.js → layout.D38U-LnT.js} +1 -1
- package/dist/docs/assets/chunks/{linear.D2GM4p4b.js → linear.BJmssyhN.js} +1 -1
- package/dist/docs/assets/chunks/{min.DVBtLK-B.js → min.DNgXoouU.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.CnJRI55x.js → mindmap-definition-QFDTVHPH.Dcp6cxeu.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.CtoaTFlA.js → pieDiagram-DEJITSTG.CLDw6zIs.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DtT24_vN.js → quadrantDiagram-34T5L4WZ.CYaeeY4c.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CjSO4o8f.js → requirementDiagram-MS252O5E.gMYuRpq2.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.-wWiIVWa.js → sankeyDiagram-XADWPNL6.CZqyHFbc.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.DSk8s4gX.js → sequenceDiagram-FGHM5R23.BTsCjUDN.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BFKAsdkN.js → stateDiagram-FHFEXIEX.CftT9mLJ.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.-43J68xB.js +1 -0
- package/dist/docs/assets/chunks/{theme.C0MctGaz.js → theme.B_7J9ZsV.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.TUNJbAFe.js → timeline-definition-GMOUNBTQ.DbU3WUNw.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.C-RGNnk4.js → vennDiagram-DHZGUBPP.ixsq-q2u.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.WRXz-Dux.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DH4zt73Y.js → wardleyDiagram-NUSXRM2D.C0ewvgbp.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.B-3k6bF6.js → xychartDiagram-5P7HB3ND.nAEhF4bO.js} +1 -1
- package/dist/docs/assets/deployment.md.D2jQZuFx.js +32 -0
- package/dist/docs/assets/deployment.md.D2jQZuFx.lean.js +1 -0
- package/dist/docs/assets/evals.md.BYvfZ-PO.js +72 -0
- package/dist/docs/assets/evals.md.BYvfZ-PO.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.8oDTfu-E.js +30 -0
- package/dist/docs/assets/guides_agent-to-agent.md.8oDTfu-E.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.mpevW-VP.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.mpevW-VP.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.Cp1O3u-X.js +15 -0
- package/dist/docs/assets/guides_cloud-agents.md.Cp1O3u-X.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.CqEyfP6Y.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.CqEyfP6Y.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.BwpBp3ed.js +156 -0
- package/dist/docs/assets/guides_github.md.BwpBp3ed.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.DaEC3nMk.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.DaEC3nMk.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.CMhZNdEU.js +16 -0
- package/dist/docs/assets/guides_grokbot-agents.md.CMhZNdEU.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.Bnp4F99w.js +22 -0
- package/dist/docs/assets/guides_improve.md.Bnp4F99w.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.bSFakfCY.js +50 -0
- package/dist/docs/assets/guides_mcp-oauth.md.bSFakfCY.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.BKDxQmmd.js +35 -0
- package/dist/docs/assets/guides_opentelemetry.md.BKDxQmmd.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.Bo96y42E.js +70 -0
- package/dist/docs/assets/guides_slack.md.Bo96y42E.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.1A72_VEE.js +92 -0
- package/dist/docs/assets/guides_webhooks.md.1A72_VEE.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.D4E1o5Sa.js +7 -0
- package/dist/docs/assets/hillclimbing.md.D4E1o5Sa.lean.js +1 -0
- package/dist/docs/assets/{index.md.BFVyY2KT.js → index.md.C-t81M5J.js} +2 -2
- package/dist/docs/assets/{index.md.BFVyY2KT.lean.js → index.md.C-t81M5J.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.D3MjSZN-.js → quickstart.md.DAvVhuuU.js} +1 -1
- package/dist/docs/assets/{quickstart.md.D3MjSZN-.lean.js → quickstart.md.DAvVhuuU.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.CfVA-LZJ.js → reference_agent-config.md.DGPyw7ms.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.CfVA-LZJ.lean.js → reference_agent-config.md.DGPyw7ms.lean.js} +1 -1
- package/dist/docs/assets/{reference_artifacts.md.Vf7qyIZ-.js → reference_artifacts.md.Bu_4HmsD.js} +1 -1
- package/dist/docs/assets/{reference_artifacts.md.Vf7qyIZ-.lean.js → reference_artifacts.md.Bu_4HmsD.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.icqLKcTc.js → reference_channels.md.nFWbzAic.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.icqLKcTc.lean.js → reference_channels.md.nFWbzAic.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.B2dBL6L8.js → reference_cli.md.DLWDz9ij.js} +3 -1
- package/dist/docs/assets/{reference_cli.md.B2dBL6L8.lean.js → reference_cli.md.DLWDz9ij.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Cb3U_c8n.js → reference_connections.md.CmyrlXfY.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.Cb3U_c8n.lean.js → reference_connections.md.CmyrlXfY.lean.js} +1 -1
- package/dist/docs/assets/reference_evals.md.DNJzM_yf.js +57 -0
- package/dist/docs/assets/reference_evals.md.DNJzM_yf.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.Ceq-qT8d.js +58 -0
- package/dist/docs/assets/reference_extensions.md.Ceq-qT8d.lean.js +1 -0
- package/dist/docs/assets/{reference_hooks.md.CZuynAxj.js → reference_hooks.md.B7uzNENk.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.CZuynAxj.lean.js → reference_hooks.md.B7uzNENk.lean.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.DTKcYE6L.js → reference_http-api.md.CduHavZ2.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.DTKcYE6L.lean.js → reference_http-api.md.CduHavZ2.lean.js} +1 -1
- package/dist/docs/assets/{reference_instructions.md.D7gkckK-.js → reference_instructions.md.CU1My5My.js} +1 -1
- package/dist/docs/assets/{reference_instructions.md.D7gkckK-.lean.js → reference_instructions.md.CU1My5My.lean.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.D2YExv5K.js → reference_playground.md.Ch2d0Iqi.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.D2YExv5K.lean.js → reference_playground.md.Ch2d0Iqi.lean.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.DPxbUJyt.js → reference_project-layout.md.BGhgpy9V.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.DPxbUJyt.lean.js → reference_project-layout.md.BGhgpy9V.lean.js} +1 -1
- package/dist/docs/assets/{reference_prompt.md.BQ5uAv1F.js → reference_prompt.md.Ccp0R53H.js} +1 -1
- package/dist/docs/assets/{reference_prompt.md.BQ5uAv1F.lean.js → reference_prompt.md.Ccp0R53H.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.BasfZWO-.js → reference_schedules.md.B2Nm6FaD.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.BasfZWO-.lean.js → reference_schedules.md.B2Nm6FaD.lean.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.YKvIsWAx.js → reference_sessions.md.1_6Vyv7x.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.YKvIsWAx.lean.js → reference_sessions.md.1_6Vyv7x.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.rNgpsGd0.js → reference_skills.md.DjQkRefx.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.rNgpsGd0.lean.js → reference_skills.md.DjQkRefx.lean.js} +1 -1
- package/dist/docs/assets/{reference_subagents.md.e5qitjJt.js → reference_subagents.md.BHsSMMyO.js} +1 -1
- package/dist/docs/assets/{reference_subagents.md.e5qitjJt.lean.js → reference_subagents.md.BHsSMMyO.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.BdCO2aHZ.js → reference_tools.md.BYzUTeVA.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.BdCO2aHZ.lean.js → reference_tools.md.BYzUTeVA.lean.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.Da_AGDlH.js → templates_agentic-owners.md.9M575F5C.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.Da_AGDlH.lean.js → templates_agentic-owners.md.9M575F5C.lean.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.DqxocIGh.js → templates_pr-autofixer.md.ws0DDXDy.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.DqxocIGh.lean.js → templates_pr-autofixer.md.ws0DDXDy.lean.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.Bhnvd8VE.js → templates_security-reviewer.md.KEFYXzfK.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.Bhnvd8VE.lean.js → templates_security-reviewer.md.KEFYXzfK.lean.js} +1 -1
- package/dist/docs/assets/templates_thermo-quality-review.md.VNJ_mohX.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.VNJ_mohX.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.Hi3zWOkP.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.Hi3zWOkP.lean.js +1 -0
- package/dist/docs/assets/{templates_triage.md.BdBWO9Ic.js → templates_triage.md.CVGe_FG6.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.BdBWO9Ic.lean.js → templates_triage.md.CVGe_FG6.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.mnfFG2Em.js +1 -0
- package/dist/docs/assets/troubleshooting.md.mnfFG2Em.lean.js +1 -0
- package/dist/docs/building-with-agents.html +44 -48
- package/dist/docs/building-with-agents.md +94 -82
- package/dist/docs/deployment.html +59 -78
- package/dist/docs/deployment.md +117 -363
- package/dist/docs/evals.html +85 -224
- package/dist/docs/evals.md +146 -673
- package/dist/docs/guides/agent-to-agent.html +58 -42
- package/dist/docs/guides/agent-to-agent.md +112 -35
- package/dist/docs/guides/bitbucket.html +179 -44
- package/dist/docs/guides/bitbucket.md +249 -48
- package/dist/docs/guides/cloud-agents.html +46 -40
- package/dist/docs/guides/cloud-agents.md +119 -66
- package/dist/docs/guides/convert-automation.html +80 -49
- package/dist/docs/guides/convert-automation.md +156 -147
- package/dist/docs/guides/github.html +184 -92
- package/dist/docs/guides/github.md +260 -245
- package/dist/docs/guides/gitlab.html +184 -45
- package/dist/docs/guides/gitlab.md +249 -50
- package/dist/docs/guides/grokbot-agents.html +48 -41
- package/dist/docs/guides/grokbot-agents.md +99 -53
- package/dist/docs/guides/improve.html +48 -40
- package/dist/docs/guides/improve.md +111 -58
- package/dist/docs/guides/mcp-oauth.html +74 -52
- package/dist/docs/guides/mcp-oauth.md +111 -121
- package/dist/docs/guides/opentelemetry.html +63 -54
- package/dist/docs/guides/opentelemetry.md +96 -165
- package/dist/docs/guides/slack.html +83 -59
- package/dist/docs/guides/slack.md +157 -227
- package/dist/docs/guides/webhooks.html +97 -230
- package/dist/docs/guides/webhooks.md +154 -385
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +44 -38
- package/dist/docs/hillclimbing.md +101 -55
- package/dist/docs/index.html +38 -38
- package/dist/docs/index.md +2 -0
- package/dist/docs/llms-full.txt +3082 -3104
- package/dist/docs/llms.txt +21 -18
- package/dist/docs/quickstart.html +37 -37
- package/dist/docs/reference/agent-config.html +37 -37
- package/dist/docs/reference/artifacts.html +38 -38
- package/dist/docs/reference/channels.html +37 -37
- package/dist/docs/reference/cli.html +39 -37
- package/dist/docs/reference/cli.md +2 -0
- package/dist/docs/reference/connections.html +37 -37
- package/dist/docs/reference/evals.html +116 -0
- package/dist/docs/reference/evals.md +293 -0
- package/dist/docs/reference/extensions.html +80 -84
- package/dist/docs/reference/extensions.md +127 -199
- package/dist/docs/reference/hooks.html +39 -39
- package/dist/docs/reference/hooks.md +34 -34
- package/dist/docs/reference/http-api.html +37 -37
- package/dist/docs/reference/instructions.html +37 -37
- package/dist/docs/reference/playground.html +37 -37
- package/dist/docs/reference/project-layout.html +37 -37
- package/dist/docs/reference/prompt.html +37 -37
- package/dist/docs/reference/schedules.html +37 -37
- package/dist/docs/reference/sessions.html +37 -37
- package/dist/docs/reference/skills.html +37 -37
- package/dist/docs/reference/subagents.html +37 -37
- package/dist/docs/reference/tools.html +37 -37
- package/dist/docs/templates/agentic-owners.html +38 -38
- package/dist/docs/templates/pr-autofixer.html +37 -37
- package/dist/docs/templates/security-reviewer.html +38 -38
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +75 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +74 -0
- package/dist/docs/templates/triage.html +37 -37
- package/dist/docs/troubleshooting.html +38 -38
- package/dist/docs/troubleshooting.md +97 -66
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +3 -7
- package/dist/extensions/improve/extension.d.ts +3 -1
- package/dist/extensions/improve/extension.d.ts.map +1 -1
- package/dist/extensions/improve/extension.js +4 -2
- package/dist/extensions/improve/skills/yourself.js +1 -1
- package/dist/filesystem.d.ts +46 -2
- package/dist/filesystem.d.ts.map +1 -1
- package/dist/filesystem.js +149 -102
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/cli-ax.d.ts +6 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +72 -14
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +1 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +2 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -1
- package/dist/internal/filesystem/tools.js +2 -2
- package/dist/internal/filesystem/walk.d.ts +7 -4
- package/dist/internal/filesystem/walk.d.ts.map +1 -1
- package/dist/internal/filesystem/walk.js +34 -11
- package/dist/internal/hosted-admission-adapter.d.ts +3 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +17 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +50 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +8 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +4 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +94 -39
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +11 -5
- package/dist/internal/skill-catalog.d.ts +28 -0
- package/dist/internal/skill-catalog.d.ts.map +1 -0
- package/dist/internal/skill-catalog.js +44 -0
- package/dist/playground/assets/index-B1c1LeIf.js +67 -0
- package/dist/playground/assets/index-CK2LX3iD.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -0
- package/docs/building-with-agents.md +96 -84
- package/docs/deployment.md +118 -364
- package/docs/evals.md +147 -674
- package/docs/guides/agent-to-agent.md +113 -36
- package/docs/guides/bitbucket.md +250 -49
- package/docs/guides/cloud-agents.md +119 -67
- package/docs/guides/convert-automation.md +157 -148
- package/docs/guides/github.md +261 -246
- package/docs/guides/gitlab.md +250 -51
- package/docs/guides/grokbot-agents.md +100 -55
- package/docs/guides/improve.md +112 -59
- package/docs/guides/mcp-oauth.md +112 -122
- package/docs/guides/opentelemetry.md +97 -166
- package/docs/guides/slack.md +158 -228
- package/docs/guides/webhooks.md +155 -386
- package/docs/hillclimbing.md +102 -56
- package/docs/reference/cli.md +2 -0
- package/docs/reference/evals.md +298 -0
- package/docs/reference/extensions.md +128 -200
- package/docs/reference/hooks.md +34 -34
- package/docs/templates/thermo-quality-review.md +80 -0
- package/docs/templates/thermo-review.md +79 -0
- package/docs/troubleshooting.md +98 -67
- package/package.json +1 -1
- package/skills/github/SKILL.md +21 -13
- package/src/bin/agent-serve.ts +22 -0
- package/src/channels/github/github-channel.ts +29 -19
- package/src/channels/slack/agentic-delivery.ts +2 -0
- package/src/channels/slack/dispatch.ts +126 -4
- package/src/channels/slack/placeholder.ts +51 -0
- package/src/channels/slack/slack-channel.ts +9 -2
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +3 -7
- package/src/extensions/improve/extension.ts +4 -2
- package/src/extensions/improve/skills/yourself.ts +1 -1
- package/src/filesystem.ts +168 -65
- package/src/index.ts +3 -0
- package/src/internal/cli-ax.ts +88 -15
- package/src/internal/continuation-identity.ts +1 -0
- package/src/internal/cursor-agent-template.ts +2 -0
- package/src/internal/filesystem/tools.ts +2 -0
- package/src/internal/filesystem/walk.ts +60 -15
- package/src/internal/hosted-admission-adapter.ts +3 -0
- package/src/internal/hosted-delivery-protocol.ts +78 -1
- package/src/internal/hosted-delivery.ts +8 -0
- package/src/internal/init-project.ts +4 -0
- package/src/internal/server.ts +104 -41
- package/src/internal/session-engine.ts +16 -4
- package/src/internal/skill-catalog.ts +69 -0
- package/src/types.ts +9 -0
- package/templates/thermo-quality-review/README.md +35 -0
- package/templates/thermo-quality-review/agent/agent.ts +8 -0
- package/templates/thermo-quality-review/agent/channels/github.ts +42 -0
- package/templates/thermo-quality-review/agent/instructions.md +43 -0
- package/templates/thermo-quality-review/agent/tools/post_findings.ts +70 -0
- package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
- package/templates/thermo-quality-review/evals/review.eval.ts +62 -0
- package/templates/thermo-quality-review/package.json +18 -0
- package/templates/thermo-quality-review/tsconfig.json +12 -0
- package/templates/thermo-review/README.md +35 -0
- package/templates/thermo-review/agent/agent.ts +8 -0
- package/templates/thermo-review/agent/channels/github.ts +42 -0
- package/templates/thermo-review/agent/instructions.md +40 -0
- package/templates/thermo-review/agent/tools/post_findings.ts +70 -0
- package/templates/thermo-review/evals/evals.config.ts +5 -0
- package/templates/thermo-review/evals/review.eval.ts +53 -0
- package/templates/thermo-review/package.json +18 -0
- package/templates/thermo-review/tsconfig.json +12 -0
- package/dist/docs/assets/building-with-agents.md.CEGVXkmO.js +0 -13
- package/dist/docs/assets/building-with-agents.md.CEGVXkmO.lean.js +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DtXk1hy-.js +0 -1
- package/dist/docs/assets/chunks/channel.Bkv1N-gK.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CZDco1o8.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CZDco1o8.js +0 -1
- package/dist/docs/assets/chunks/clone.YSt_40_s.js +0 -1
- package/dist/docs/assets/chunks/framework.dypDpWZ3.js +0 -19
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.C4CLm481.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.g5efOWmT.js +0 -162
- package/dist/docs/assets/deployment.md.Dm4Qo3hp.js +0 -51
- package/dist/docs/assets/deployment.md.Dm4Qo3hp.lean.js +0 -1
- package/dist/docs/assets/evals.md.BLDRt5LH.js +0 -211
- package/dist/docs/assets/evals.md.BLDRt5LH.lean.js +0 -1
- package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.js +0 -14
- package/dist/docs/assets/guides_agent-to-agent.md.BI0xclmy.lean.js +0 -1
- package/dist/docs/assets/guides_bitbucket.md.CTpCl__f.js +0 -10
- package/dist/docs/assets/guides_bitbucket.md.CTpCl__f.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.lSE_l7lH.js +0 -9
- package/dist/docs/assets/guides_cloud-agents.md.lSE_l7lH.lean.js +0 -1
- package/dist/docs/assets/guides_convert-automation.md.Ck6Cr68A.js +0 -12
- package/dist/docs/assets/guides_convert-automation.md.Ck6Cr68A.lean.js +0 -1
- package/dist/docs/assets/guides_github.md.D6ER29dG.js +0 -64
- package/dist/docs/assets/guides_github.md.D6ER29dG.lean.js +0 -1
- package/dist/docs/assets/guides_gitlab.md.P-TjBnS5.js +0 -14
- package/dist/docs/assets/guides_gitlab.md.P-TjBnS5.lean.js +0 -1
- package/dist/docs/assets/guides_grokbot-agents.md.WBZIOvkz.js +0 -9
- package/dist/docs/assets/guides_grokbot-agents.md.WBZIOvkz.lean.js +0 -1
- package/dist/docs/assets/guides_improve.md.BKaDuKKK.js +0 -14
- package/dist/docs/assets/guides_improve.md.BKaDuKKK.lean.js +0 -1
- package/dist/docs/assets/guides_mcp-oauth.md.DMNMpXtO.js +0 -28
- package/dist/docs/assets/guides_mcp-oauth.md.DMNMpXtO.lean.js +0 -1
- package/dist/docs/assets/guides_opentelemetry.md._CRfDyzH.js +0 -26
- package/dist/docs/assets/guides_opentelemetry.md._CRfDyzH.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.DdT8rmsj.js +0 -46
- package/dist/docs/assets/guides_slack.md.DdT8rmsj.lean.js +0 -1
- package/dist/docs/assets/guides_webhooks.md.aQW10HRe.js +0 -225
- package/dist/docs/assets/guides_webhooks.md.aQW10HRe.lean.js +0 -1
- package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.js +0 -1
- package/dist/docs/assets/hillclimbing.md.Dq4kkVIL.lean.js +0 -1
- package/dist/docs/assets/reference_extensions.md.wlFD3cUR.js +0 -62
- package/dist/docs/assets/reference_extensions.md.wlFD3cUR.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.BcgNoYtJ.js +0 -1
- package/dist/docs/assets/troubleshooting.md.BcgNoYtJ.lean.js +0 -1
- package/dist/playground/assets/index-BLlKgZtI.css +0 -1
- package/dist/playground/assets/index-CDS5p9sR.js +0 -67
package/docs/guides/webhooks.md
CHANGED
|
@@ -1,469 +1,238 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Webhooks & custom channels"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Receive provider events, keep one conversation per domain object, and deliver agent replies back out."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Webhook agents
|
|
7
7
|
|
|
8
|
-
A custom channel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
mechanism. The [GitLab](./gitlab.md) and [Bitbucket](./bitbucket.md) packs
|
|
13
|
-
use it too. This page is the mechanism itself.
|
|
8
|
+
A custom channel turns an event from another system into an agent
|
|
9
|
+
conversation, then sends the result back to the system that started it.
|
|
10
|
+
Use one when the built-in [HTTP API](../reference/http-api.md) does not
|
|
11
|
+
match the provider's payload, conversation key, or reply path.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
Author `agent/channels/<id>.ts`. Its routes mount under
|
|
14
|
+
`/<slug>/v1/channels/<id>`.
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
default multi-agent layout). `POST /v1/session` starts a conversation,
|
|
19
|
-
`POST /v1/session/:id` follows up, and `GET /v1/session/:id/stream`
|
|
20
|
-
streams NDJSON events, plus sessions, approvals, and tool routes. See
|
|
21
|
-
the [HTTP API reference](../reference/http-api.md).
|
|
16
|
+
## Receive a webhook and send the answer back
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Define a channel
|
|
28
|
-
|
|
29
|
-
Author `agent/channels/<id>.ts` with `defineChannel`. The filename is
|
|
30
|
-
the channel id, and routes mount under `/v1/channels/<id>`:
|
|
18
|
+
When a ticket system sends a new message, this endpoint responds with
|
|
19
|
+
`202 Accepted` right away. The agent keeps working after the HTTP
|
|
20
|
+
request ends, and its completed answer appears as a comment on the
|
|
21
|
+
ticket.
|
|
31
22
|
|
|
32
23
|
```ts
|
|
24
|
+
// agent/channels/tickets.ts
|
|
33
25
|
import { defineChannel, POST } from "@cursor/july/channels";
|
|
34
26
|
import { z } from "zod";
|
|
27
|
+
import { postTicketComment } from "../lib/tickets.js";
|
|
35
28
|
|
|
36
|
-
|
|
29
|
+
type TicketState = {
|
|
30
|
+
ticketId: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default defineChannel<TicketState>({
|
|
34
|
+
state: { ticketId: "" },
|
|
37
35
|
routes: [
|
|
38
|
-
POST("/
|
|
39
|
-
description: "
|
|
36
|
+
POST("/ticket", {
|
|
37
|
+
description: "Answer a new ticket message",
|
|
40
38
|
bodySchema: z.object({
|
|
39
|
+
ticketId: z.string(),
|
|
41
40
|
message: z.string(),
|
|
42
|
-
thread: z.string().optional(),
|
|
43
41
|
}),
|
|
44
|
-
handler: async (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
handler: async (_request, { send, waitUntil, body }) => {
|
|
43
|
+
waitUntil(
|
|
44
|
+
send(body.message, {
|
|
45
|
+
state: { ticketId: body.ticketId },
|
|
46
|
+
title: `Ticket ${body.ticketId}`,
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
return Response.json({ accepted: true }, { status: 202 });
|
|
50
50
|
},
|
|
51
51
|
}),
|
|
52
52
|
],
|
|
53
53
|
events: {
|
|
54
|
-
"message.completed"(event, channel
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
async "message.completed"(event, channel) {
|
|
55
|
+
if (event.data.finishReason === "tool_call" || event.data.text === "") {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await postTicketComment(channel.state.ticketId, event.data.text);
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
});
|
|
60
62
|
```
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-d '{"message":"hello","thread":"ticket-42"}'
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Schemas are Zod, and required
|
|
64
|
+
`postTicketComment` is a small wrapper around the ticket provider's
|
|
65
|
+
SDK. Keeping that write in the event handler means the webhook request
|
|
66
|
+
does not stay open while the model works.
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
require a Zod `bodySchema`. Compile-time checks enforce this, so plain
|
|
72
|
-
JSON Schema objects won't type-check. Use `z.object({})` or
|
|
73
|
-
`z.unknown()` when a surface is intentionally open. The host validates
|
|
74
|
-
before your handler runs, handlers receive typed `args.body` and
|
|
75
|
-
`args.query`, and empty POST bodies are coerced to `{}` first.
|
|
68
|
+
## Keep one conversation per ticket
|
|
76
69
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
Without a conversation key, every delivery creates a new session. Add
|
|
71
|
+
the ticket ID as the `continuationToken` so the opening message and all
|
|
72
|
+
later comments resume the same conversation, while a different ticket
|
|
73
|
+
starts its own.
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
| `callTool(name, input, opts?)` | Run an authored server tool with no model turn ([Tools](../reference/tools.md#call-a-tool-without-a-model-turn)) |
|
|
91
|
-
| `body`, `query`, `params` | Validated payloads and path params |
|
|
92
|
-
| `auth` | The `AuthContext` the route's auth chain resolved |
|
|
93
|
-
| `requestIp` | The TCP peer address |
|
|
94
|
-
| `host` | Shared host services: `host.mcp`, `host.github`, `host.slack`, `host.reminders` |
|
|
95
|
-
| `waitUntil(promise)` | Background work that outlives the response |
|
|
75
|
+
```ts
|
|
76
|
+
waitUntil(
|
|
77
|
+
send(body.message, {
|
|
78
|
+
continuationToken: `ticket:${body.ticketId}`,
|
|
79
|
+
state: { ticketId: body.ticketId },
|
|
80
|
+
title: `Ticket ${body.ticketId}`,
|
|
81
|
+
})
|
|
82
|
+
);
|
|
83
|
+
```
|
|
96
84
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
`channel.state`.
|
|
85
|
+
The channel owns this key. Callers only need to send the domain ID they
|
|
86
|
+
already know.
|
|
100
87
|
|
|
101
|
-
##
|
|
88
|
+
## Prepare evidence before the turn
|
|
102
89
|
|
|
103
|
-
Webhook
|
|
104
|
-
|
|
90
|
+
Webhook payloads often contain little more than an object ID. This
|
|
91
|
+
handler fetches the full ticket through a deterministic tool and writes
|
|
92
|
+
the result to `ticket.json`, so the model begins with a stable snapshot
|
|
93
|
+
instead of spending the turn looking for context.
|
|
105
94
|
|
|
106
95
|
```ts
|
|
107
|
-
handler: async (
|
|
96
|
+
handler: async (_request, { callTool, send, waitUntil, body }) => {
|
|
97
|
+
const prepared = await callTool("prepare_ticket", {
|
|
98
|
+
ticketId: body.ticketId,
|
|
99
|
+
});
|
|
100
|
+
if (prepared.isError) {
|
|
101
|
+
return Response.json(
|
|
102
|
+
{ error: prepared.errorMessage ?? "Could not prepare ticket" },
|
|
103
|
+
{ status: 502 }
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
108
107
|
waitUntil(
|
|
109
|
-
send(
|
|
110
|
-
continuationToken: `
|
|
108
|
+
send("Read ticket.json, then draft the reply.", {
|
|
109
|
+
continuationToken: `ticket:${body.ticketId}`,
|
|
110
|
+
state: { ticketId: body.ticketId },
|
|
111
|
+
workspaceFiles: {
|
|
112
|
+
"ticket.json": JSON.stringify(prepared.result, null, 2) ?? "null",
|
|
113
|
+
},
|
|
111
114
|
})
|
|
112
115
|
);
|
|
113
116
|
return Response.json({ accepted: true }, { status: 202 });
|
|
114
117
|
},
|
|
115
118
|
```
|
|
116
119
|
|
|
117
|
-
|
|
120
|
+
The same `message.completed` handler from the first example delivers
|
|
121
|
+
the answer back to the ticket.
|
|
118
122
|
|
|
119
|
-
|
|
120
|
-
handler, then hand the model prepared evidence. Fetch the PR with
|
|
121
|
-
`callTool`, seed the files it needs, and make the prompt about judgment
|
|
122
|
-
rather than about finding things:
|
|
123
|
+
## Routes receive, events deliver
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
const session = await send("Review the prepared PR under pr/.", {
|
|
131
|
-
continuationToken: `pr:${body.pr}`,
|
|
132
|
-
});
|
|
133
|
-
return Response.json({ sessionId: session.id });
|
|
134
|
-
},
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
This host-prep shape is the change with the largest effect on latency
|
|
138
|
-
and quality. [Hillclimbing](../hillclimbing.md) lists it first.
|
|
139
|
-
|
|
140
|
-
## Deliver replies back out
|
|
141
|
-
|
|
142
|
-
The `events` map subscribes the channel to stream events for the
|
|
143
|
-
sessions it owns. Typical wiring: `message.completed` posts the
|
|
144
|
-
assistant text back to the caller's surface, and `turn.failed` posts an
|
|
145
|
-
error notice. The full vocabulary is in
|
|
146
|
-
[Sessions and streaming](../reference/sessions.md#which-events-can-i-stream).
|
|
147
|
-
|
|
148
|
-
## Auth: loopback by default, on purpose
|
|
125
|
+
Routes own inbound HTTP. A route validates the request, decides whether
|
|
126
|
+
to start or resume a turn, and responds to the caller. The channel's
|
|
127
|
+
`events` handlers receive session events later, which is where you
|
|
128
|
+
deliver the model's answer or report a failure to the originating
|
|
129
|
+
system.
|
|
149
130
|
|
|
150
|
-
|
|
151
|
-
default is `[localDevStrict()]`: direct loopback callers only. Requests
|
|
152
|
-
carrying proxy-forwarding headers (`X-Forwarded-For`, `X-Real-IP`,
|
|
153
|
-
`Forwarded`, `X-Forwarded-Host`) are rejected, and a loopback `Host`
|
|
154
|
-
header is required. So a tunnel, a same-host reverse proxy, or a
|
|
155
|
-
DNS-rebinding page can't silently re-expose the route.
|
|
156
|
-
|
|
157
|
-
Before real traffic, author auth explicitly:
|
|
158
|
-
|
|
159
|
-
```ts
|
|
160
|
-
import { bearerAuth, defineChannel, localDevStrict } from "@cursor/july/channels";
|
|
161
|
-
|
|
162
|
-
export default defineChannel({
|
|
163
|
-
auth: [localDevStrict(), bearerAuth(process.env.WEBHOOK_TOKEN ?? "")],
|
|
164
|
-
routes: [/* … */],
|
|
165
|
-
});
|
|
166
|
-
```
|
|
131
|
+
## Validate payloads with Zod
|
|
167
132
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
`
|
|
171
|
-
|
|
133
|
+
`POST`, `PUT`, and `PATCH` routes require a Zod `bodySchema`; `GET`
|
|
134
|
+
requires a `querySchema`. Validation runs before the handler, and the
|
|
135
|
+
parsed value arrives as typed `body` or `query`. Use `z.unknown()` when
|
|
136
|
+
the provider controls a variable payload and your own parser will
|
|
137
|
+
narrow it.
|
|
172
138
|
|
|
173
|
-
The
|
|
174
|
-
|
|
139
|
+
The route description and schema also appear in `GET /v1/info`. The
|
|
140
|
+
playground uses them to add a **Try** action and a matching slash
|
|
141
|
+
command, so you can exercise the same handler without building a
|
|
142
|
+
separate test UI.
|
|
175
143
|
|
|
176
|
-
|
|
177
|
-
swaps the default for `bearerAuth` on every channel that doesn't author
|
|
178
|
-
its own chain, and `--allow-anonymous` swaps it for `allowAll()`
|
|
179
|
-
(trusted networks only). Authored `auth` arrays always win over both.
|
|
144
|
+
## Use handler context
|
|
180
145
|
|
|
181
|
-
|
|
146
|
+
The handler context keeps deterministic setup and model work in one
|
|
147
|
+
route:
|
|
182
148
|
|
|
183
|
-
|
|
184
|
-
normally send `X-Agent-Alias-Token` on every request. Webhook providers
|
|
185
|
-
often cannot set it.
|
|
149
|
+
- `send` starts or resumes the agent conversation.
|
|
186
150
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
routes stay private. See [Deployment](../deployment.md#use-the-hosted-agent).
|
|
151
|
+
- `callTool` runs an authored server tool without starting a model
|
|
152
|
+
turn.
|
|
190
153
|
|
|
191
|
-
|
|
154
|
+
- `waitUntil` keeps background work alive after the HTTP response. Await
|
|
155
|
+
`send` when the caller needs the session handle, then call
|
|
156
|
+
`session.waitForCompletion()` if it also needs the turn outcome.
|
|
192
157
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
resume sessions, and replies land back on the issue as comments. The
|
|
196
|
-
same shape works for any tracker with signed webhooks.
|
|
158
|
+
- `host` provides authenticated services for API calls made by channel
|
|
159
|
+
code.
|
|
197
160
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
the signing secret. Linear requires a public HTTPS URL, so use a
|
|
201
|
-
tunnel during local development or test with signed fixtures (below).
|
|
202
|
-
Set three environment variables:
|
|
161
|
+
The full handler API lives in the
|
|
162
|
+
[Channels reference](../reference/channels.md#handler-arguments).
|
|
203
163
|
|
|
204
|
-
|
|
205
|
-
LINEAR_WEBHOOK_SECRET=lin_wh_... # the webhook's signing secret
|
|
206
|
-
LINEAR_API_KEY=lin_api_... # posts replies as comments
|
|
207
|
-
LINEAR_AGENT_USER_ID=... # the API key's user: query { viewer { id } }
|
|
208
|
-
```
|
|
164
|
+
## Protect public webhooks
|
|
209
165
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
turn.
|
|
166
|
+
Custom routes accept direct loopback requests by default. They reject
|
|
167
|
+
forwarded requests, so a tunnel or reverse proxy does not silently turn
|
|
168
|
+
a local development endpoint into a public one.
|
|
214
169
|
|
|
215
|
-
|
|
170
|
+
Before accepting remote traffic, choose an explicit boundary.
|
|
171
|
+
`bearerAuth()` works when the sender can attach an authorization header.
|
|
172
|
+
On managed hosting, webhook providers often cannot attach the agent
|
|
173
|
+
alias token, so `publicEndpoint()` lets that custom channel bypass it.
|
|
174
|
+
That opens the route to every caller; verify the provider signature
|
|
175
|
+
before starting a turn or calling a tool.
|
|
216
176
|
|
|
217
177
|
```ts
|
|
218
|
-
import { Buffer } from "node:buffer";
|
|
219
|
-
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
220
178
|
import { defineChannel, POST, publicEndpoint } from "@cursor/july/channels";
|
|
221
179
|
import { z } from "zod";
|
|
222
|
-
|
|
223
|
-
const secret = process.env.LINEAR_WEBHOOK_SECRET ?? "";
|
|
224
|
-
const apiKey = process.env.LINEAR_API_KEY ?? "";
|
|
225
|
-
const agentUserId = process.env.LINEAR_AGENT_USER_ID ?? "";
|
|
226
|
-
|
|
227
|
-
interface LinearWebhook {
|
|
228
|
-
action: string;
|
|
229
|
-
type: string;
|
|
230
|
-
url?: string;
|
|
231
|
-
webhookTimestamp: number;
|
|
232
|
-
data: {
|
|
233
|
-
id: string;
|
|
234
|
-
title?: string;
|
|
235
|
-
description?: string;
|
|
236
|
-
body?: string;
|
|
237
|
-
issueId?: string;
|
|
238
|
-
userId?: string;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Linear signs the raw body: hex HMAC-SHA256 in `Linear-Signature`.
|
|
243
|
-
function verified(rawBody: string, header: string | null): boolean {
|
|
244
|
-
if (secret === "" || header === null) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
const expected = createHmac("sha256", secret).update(rawBody).digest();
|
|
248
|
-
const received = Buffer.from(header, "hex");
|
|
249
|
-
return (
|
|
250
|
-
received.length === expected.length && timingSafeEqual(received, expected)
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
async function postComment(issueId: string, body: string): Promise<void> {
|
|
255
|
-
const response = await fetch("https://api.linear.app/graphql", {
|
|
256
|
-
method: "POST",
|
|
257
|
-
headers: { "content-type": "application/json", authorization: apiKey },
|
|
258
|
-
body: JSON.stringify({
|
|
259
|
-
query:
|
|
260
|
-
"mutation($input: CommentCreateInput!) { commentCreate(input: $input) { success } }",
|
|
261
|
-
variables: { input: { issueId, body } },
|
|
262
|
-
}),
|
|
263
|
-
});
|
|
264
|
-
if (!response.ok) {
|
|
265
|
-
throw new Error(`commentCreate failed: ${response.status}`);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function issueIdFromToken(token: string | null): string | null {
|
|
270
|
-
if (token === null || !token.startsWith("linear:")) {
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
return token.slice("linear:".length);
|
|
274
|
-
}
|
|
180
|
+
import { verifyProviderSignature } from "../lib/tickets.js";
|
|
275
181
|
|
|
276
182
|
export default defineChannel({
|
|
277
183
|
auth: [publicEndpoint()],
|
|
278
184
|
routes: [
|
|
279
185
|
POST("/", {
|
|
280
|
-
description: "
|
|
281
|
-
// The payload shape varies by `Linear-Event`; parse after verifying.
|
|
186
|
+
description: "Signed ticket webhook",
|
|
282
187
|
bodySchema: z.unknown(),
|
|
283
|
-
handler: async
|
|
188
|
+
handler: async request => {
|
|
284
189
|
const rawBody = await request.text();
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
const event = JSON.parse(rawBody) as LinearWebhook;
|
|
289
|
-
// Reject stale deliveries to guard against replay.
|
|
290
|
-
if (Math.abs(Date.now() - event.webhookTimestamp) > 60_000) {
|
|
190
|
+
const signature = request.headers.get("x-provider-signature");
|
|
191
|
+
if (!verifyProviderSignature(rawBody, signature)) {
|
|
291
192
|
return Response.json({ ok: false }, { status: 401 });
|
|
292
193
|
}
|
|
293
|
-
// Skip the agent's own comments so replies don't re-trigger it.
|
|
294
|
-
if (event.type === "Comment" && event.data.userId === agentUserId) {
|
|
295
|
-
return Response.json({ ok: true });
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// New issue → new session. New comment → follow-up on the same
|
|
299
|
-
// session, keyed by issue id through the continuation token.
|
|
300
|
-
let issueId: string | undefined;
|
|
301
|
-
let message: string | undefined;
|
|
302
|
-
if (event.type === "Issue" && event.action === "create") {
|
|
303
|
-
issueId = event.data.id;
|
|
304
|
-
message = `New Linear issue: ${event.data.title}\n\n${
|
|
305
|
-
event.data.description ?? ""
|
|
306
|
-
}\n${event.url ?? ""}`;
|
|
307
|
-
} else if (event.type === "Comment" && event.action === "create") {
|
|
308
|
-
issueId = event.data.issueId;
|
|
309
|
-
message = event.data.body;
|
|
310
|
-
}
|
|
311
|
-
if (issueId === undefined || message === undefined) {
|
|
312
|
-
return Response.json({ ok: true });
|
|
313
|
-
}
|
|
314
194
|
|
|
315
|
-
//
|
|
316
|
-
// seconds: ACK now, run the turn in the background.
|
|
317
|
-
waitUntil(send(message, { continuationToken: `linear:${issueId}` }));
|
|
195
|
+
// Parse and dispatch only after the signature passes.
|
|
318
196
|
return Response.json({ ok: true });
|
|
319
197
|
},
|
|
320
198
|
}),
|
|
321
199
|
],
|
|
322
|
-
events: {
|
|
323
|
-
async "message.completed"(event, channel) {
|
|
324
|
-
if (event.data.finishReason === "tool_call" || event.data.text === "") {
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
const issueId = issueIdFromToken(channel.continuationToken);
|
|
328
|
-
if (issueId !== null) {
|
|
329
|
-
await postComment(issueId, event.data.text);
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
async "turn.failed"(event, channel) {
|
|
333
|
-
const issueId = issueIdFromToken(channel.continuationToken);
|
|
334
|
-
if (issueId !== null) {
|
|
335
|
-
await postComment(issueId, `Turn failed: ${event.data.message}`);
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
},
|
|
339
200
|
});
|
|
340
201
|
```
|
|
341
202
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
```ts
|
|
348
|
-
// agent/mcp-connections/linear.ts
|
|
349
|
-
import { defineConnection } from "@cursor/july/connections";
|
|
350
|
-
|
|
351
|
-
// Uses the signed-in Cursor account's Linear connector.
|
|
352
|
-
export default defineConnection({ cursorAccount: true, servers: ["Linear"] });
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
See [MCP connections](../reference/connections.md) for the direct
|
|
356
|
-
`https://mcp.linear.app/mcp` form when the host isn't signed in to
|
|
357
|
-
Cursor.
|
|
358
|
-
|
|
359
|
-
### Production Linear agents: expiring OAuth tokens
|
|
203
|
+
`publicEndpoint()` only opens this channel's routes. The built-in
|
|
204
|
+
session and tool APIs stay private. See
|
|
205
|
+
[Auth policies](../reference/channels.md#auth-policies) for bearer
|
|
206
|
+
tokens and the complete policy reference.
|
|
360
207
|
|
|
361
|
-
|
|
362
|
-
is an OAuth application: installing it in a workspace mints an access
|
|
363
|
-
token with an expiry plus a refresh token. The serve host can be
|
|
364
|
-
replaced at any time, so the pair can't live in process memory.
|
|
365
|
-
Persist it in `host.kv` instead.
|
|
366
|
-
Route handlers receive `host` in their args, and event handlers get the
|
|
367
|
-
same services on `ctx`.
|
|
208
|
+
## Test locally
|
|
368
209
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
deploy-time env vars fit them.
|
|
374
|
-
- Back kv with durable storage. On Cursor-managed hosting, use
|
|
375
|
-
`cursorHostedStorage` in `agent/storage.ts`. Without it, kv falls back
|
|
376
|
-
to local disk and a host replacement drops the tokens.
|
|
377
|
-
|
|
378
|
-
Save the pair when the install flow completes, then refresh on demand:
|
|
379
|
-
|
|
380
|
-
```ts
|
|
381
|
-
import type { HostKvApi } from "@cursor/july/kv";
|
|
382
|
-
|
|
383
|
-
interface LinearTokens {
|
|
384
|
-
accessToken: string;
|
|
385
|
-
refreshToken: string;
|
|
386
|
-
expiresAtMs: number;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const TOKENS_KEY = "linear/oauth-tokens";
|
|
390
|
-
|
|
391
|
-
export async function linearAccessToken(kv: HostKvApi): Promise<string> {
|
|
392
|
-
const tokens = (await kv.get(TOKENS_KEY)) as LinearTokens | undefined;
|
|
393
|
-
if (tokens === undefined) {
|
|
394
|
-
throw new Error("No Linear tokens stored. Complete the install flow first.");
|
|
395
|
-
}
|
|
396
|
-
if (Date.now() < tokens.expiresAtMs - 60_000) {
|
|
397
|
-
return tokens.accessToken;
|
|
398
|
-
}
|
|
399
|
-
const response = await fetch("https://api.linear.app/oauth/token", {
|
|
400
|
-
method: "POST",
|
|
401
|
-
headers: { "content-type": "application/x-www-form-urlencoded" },
|
|
402
|
-
body: new URLSearchParams({
|
|
403
|
-
grant_type: "refresh_token",
|
|
404
|
-
refresh_token: tokens.refreshToken,
|
|
405
|
-
client_id: process.env.LINEAR_CLIENT_ID ?? "",
|
|
406
|
-
client_secret: process.env.LINEAR_CLIENT_SECRET ?? "",
|
|
407
|
-
}),
|
|
408
|
-
});
|
|
409
|
-
if (!response.ok) {
|
|
410
|
-
throw new Error(`Linear token refresh failed: ${response.status}`);
|
|
411
|
-
}
|
|
412
|
-
const next = (await response.json()) as {
|
|
413
|
-
access_token: string;
|
|
414
|
-
refresh_token?: string;
|
|
415
|
-
expires_in: number;
|
|
416
|
-
};
|
|
417
|
-
const rotated: LinearTokens = {
|
|
418
|
-
accessToken: next.access_token,
|
|
419
|
-
refreshToken: next.refresh_token ?? tokens.refreshToken,
|
|
420
|
-
expiresAtMs: Date.now() + next.expires_in * 1000,
|
|
421
|
-
};
|
|
422
|
-
await kv.put(TOKENS_KEY, rotated);
|
|
423
|
-
return rotated.accessToken;
|
|
424
|
-
}
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
Then authorize GraphQL calls with `Bearer ${await
|
|
428
|
-
linearAccessToken(host.kv)}` in place of the static `apiKey` above.
|
|
429
|
-
Writes to `host.kv` await the durable sink and propagate errors, so a
|
|
430
|
-
failed save surfaces instead of silently losing the rotated refresh
|
|
431
|
-
token.
|
|
432
|
-
|
|
433
|
-
To test without a public URL, save a payload from the webhook's
|
|
434
|
-
delivery log (or the sample in
|
|
435
|
-
[Linear's webhook docs](https://linear.app/developers/webhooks)) under
|
|
436
|
-
`fixtures/`, refresh its `webhookTimestamp`, and sign it yourself:
|
|
210
|
+
Run the agent in development mode, then replay the same payload the
|
|
211
|
+
provider will send. The response should return immediately, and the
|
|
212
|
+
resulting session should appear in the playground while the reply is
|
|
213
|
+
delivered.
|
|
437
214
|
|
|
438
215
|
```bash
|
|
439
|
-
|
|
440
|
-
process.stdout.write(createHmac("sha256",process.env.LINEAR_WEBHOOK_SECRET)
|
|
441
|
-
.update(fs.readFileSync("fixtures/issue-create.json")).digest("hex"))')
|
|
442
|
-
curl -X POST http://127.0.0.1:3000/<slug>/v1/channels/linear/ \
|
|
443
|
-
-H 'content-type: application/json' -H "linear-signature: $SIG" \
|
|
444
|
-
--data-binary @fixtures/issue-create.json
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
## Test a channel
|
|
216
|
+
agent-sdk serve --dir . --dev
|
|
448
217
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
there. When something looks wrong, inspect the session event stream.
|
|
455
|
-
The stream is the record of what happened.
|
|
456
|
-
|
|
457
|
-
For GitHub specifically, don't hand-roll fixtures.
|
|
458
|
-
`agent-sdk github replay` synthesizes real-shaped, signed payloads
|
|
459
|
-
from any PR you can read. See the [GitHub guide](./github.md).
|
|
460
|
-
|
|
461
|
-
## What's next
|
|
462
|
-
|
|
463
|
-
Continue with these pages:
|
|
218
|
+
curl -sS -X POST \
|
|
219
|
+
http://127.0.0.1:3000/<slug>/v1/channels/tickets/ticket \
|
|
220
|
+
-H 'content-type: application/json' \
|
|
221
|
+
-d '{"ticketId":"ENG-142","message":"CSV export returns 500"}'
|
|
222
|
+
```
|
|
464
223
|
|
|
465
|
-
|
|
466
|
-
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
224
|
+
Keep representative payloads under `fixtures/` and pass them with
|
|
225
|
+
`--data-binary @fixtures/<event>.json`. You can also open the route's
|
|
226
|
+
**Try** action in the playground for manual probes.
|
|
227
|
+
|
|
228
|
+
## Related
|
|
229
|
+
|
|
230
|
+
- [Channels reference](../reference/channels.md): route methods,
|
|
231
|
+
handler arguments, events, state, and auth policies
|
|
232
|
+
- [Triage Linear or Jira issues](../templates/triage.md): a complete
|
|
233
|
+
signed tracker webhook with reply delivery
|
|
234
|
+
- [HTTP API](../reference/http-api.md): built-in session, follow-up,
|
|
235
|
+
stream, and tool routes
|
|
236
|
+
- [Deployment](../deployment.md#use-the-hosted-agent): stable hosted
|
|
237
|
+
URLs and alias-token behavior
|
|
238
|
+
- [Evals](../evals.md): turn saved payloads into regression fixtures
|