@cursor/july 0.1.113 → 0.2.0
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/channels/slack/inbound.d.ts +7 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +23 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +83 -4
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.CAeK13eM.js → app.9eAtsjAM.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.DjNBgxTF.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.C9LbPHod.js → VPLocalSearchBox.C9s69nxj.js} +1 -1
- package/dist/docs/assets/chunks/{arc.CmMq2zmS.js → arc.DmWDRaF-.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CCXB8Uj5.js → architectureDiagram-Q4EWVU46.BE1Wj4f3.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.CyQo6eLe.js → baseUniq.pmEZGnWu.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.JYq6w91N.js → blockDiagram-DXYQGD6D.D6mM-5XN.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.BRV8GPJJ.js → c4Diagram-AHTNJAMY.ZQYTPC1b.js} +1 -1
- package/dist/docs/assets/chunks/channel.BNF8VK-B.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.Bv4ooYQR.js → chunk-4BX2VUAB.CKJ7gaK8.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.t4JtKPcj.js → chunk-4TB4RGXK.CL61HnvB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.34lCHj9Y.js → chunk-55IACEB6.DsA4XA1m.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BSwrPNrt.js → chunk-EDXVE4YY.BODHCHFW.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.Beeun-R-.js → chunk-FMBD7UC4.D6NBaZTa.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.BUUFUcJc.js → chunk-OYMX7WX6.BLPuqFXg.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.B2XjHzN_.js → chunk-QZHKN3VN.BFs_ML8Z.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.CLYG8znk.js → chunk-YZCP3GAM.BDjuFyZv.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.iViHzfrK.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.iViHzfrK.js +1 -0
- package/dist/docs/assets/chunks/clone.CJoR2BBM.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DVEa6fZp.js → cose-bilkent-S5V4N54A.D85HNEsi.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.C9PZQK-S.js → dagre-KV5264BT.V463KlSF.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DoN0uv3Y.js → diagram-5BDNPKRD.DhBDu1ab.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.Czv3duqx.js → diagram-G4DWMVQ6.v6sC68zl.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BinJ5kWb.js → diagram-MMDJMWI5.DhHsdXYv.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.DW326M4K.js → diagram-TYMM5635.BPWNSFZc.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.U2pR_OA7.js → erDiagram-SMLLAGMA.Cq0wTMPL.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.ByWJXeYK.js → flowDiagram-DWJPFMVM.MveMtucC.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.OquF0Rtg.js → ganttDiagram-T4ZO3ILL.BzKfGUSf.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.Bpn01P7X.js → gitGraphDiagram-UUTBAWPF.OToXTSW_.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CNRB6ETL.js → graph.D82tam-l.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CqhknMWi.js → infoDiagram-42DDH7IO.DzFlRmcE.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.C6xpR2af.js → ishikawaDiagram-UXIWVN3A.CVPRJiKe.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.Cg5f7oB3.js → journeyDiagram-VCZTEJTY.CQvNTfQC.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.Cx9YTwlU.js → kanban-definition-6JOO6SKY.BwywywUl.js} +1 -1
- package/dist/docs/assets/chunks/{layout.ljS-wFtK.js → layout.C4BkPPba.js} +1 -1
- package/dist/docs/assets/chunks/{linear.jSxNrsFC.js → linear.FoSfGKD4.js} +1 -1
- package/dist/docs/assets/chunks/{min.Cum8AlQw.js → min.yLh8jqfl.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.BLiysLpe.js → mindmap-definition-QFDTVHPH.C9Dq2_CN.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.BoIDyuKF.js → pieDiagram-DEJITSTG.CiGyBcES.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.DLkpDytR.js → quadrantDiagram-34T5L4WZ.1FWea9nj.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DqTVqSu2.js → requirementDiagram-MS252O5E.B1q7ntiV.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.CG_6FF7j.js → sankeyDiagram-XADWPNL6.Cpr4oU_k.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BIp9602K.js → sequenceDiagram-FGHM5R23.CUK68STn.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.COSXsD9I.js → stateDiagram-FHFEXIEX.zU0yL2m4.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.nV8Nl-td.js +1 -0
- package/dist/docs/assets/chunks/{theme.CXJ7PNwy.js → theme.DhnKd0CD.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CXdVqkLq.js → timeline-definition-GMOUNBTQ.CNYoXo3F.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.CZxGuc4r.js → vennDiagram-DHZGUBPP.DFWH3G9s.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.3oVgfqQk.js → wardley-RL74JXVD.Do4PwzeN.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.6_irCgGJ.js → wardleyDiagram-NUSXRM2D.7WLkqM7s.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.TRPe92m3.js → xychartDiagram-5P7HB3ND.-SyUNgWw.js} +1 -1
- package/dist/docs/assets/{deployment.md.D2jQZuFx.js → deployment.md.D2YX7u_I.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.CD4T5FIl.js → guides_agent-to-agent.md.C6kPY8nu.js} +2 -2
- package/dist/docs/assets/{guides_cloud-agents.md.Cp1O3u-X.js → guides_cloud-agents.md.BPJqTZjT.js} +1 -1
- package/dist/docs/assets/{guides_grokbot-agents.md.CMhZNdEU.js → guides_grokbot-agents.md.CzV715v8.js} +1 -1
- package/dist/docs/assets/guides_hooks.md.BT9GLwEp.js +50 -0
- package/dist/docs/assets/guides_hooks.md.BT9GLwEp.lean.js +1 -0
- package/dist/docs/assets/{guides_jev.md.F5fAkkfN.js → guides_jev.md.DeSCqMaO.js} +6 -44
- package/dist/docs/assets/guides_jev.md.DeSCqMaO.lean.js +1 -0
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.js → guides_slack.md.DVjNyqq5.js} +3 -3
- package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.DVjNyqq5.lean.js} +1 -1
- package/dist/docs/assets/reference_agent-config.md.BRxAlnRy.js +36 -0
- package/dist/docs/assets/{reference_agent-config.md.DGPyw7ms.lean.js → reference_agent-config.md.BRxAlnRy.lean.js} +1 -1
- package/dist/docs/assets/reference_artifacts.md.KRX0sAdt.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.KRX0sAdt.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.DZr14vm7.js +23 -0
- package/dist/docs/assets/reference_channels.md.DZr14vm7.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.js +97 -0
- package/dist/docs/assets/reference_cli.md.BvnQM8wd.lean.js +1 -0
- package/dist/docs/assets/{reference_connections.md.Je9dMsdd.js → reference_connections.md.DJGUCxrr.js} +18 -30
- package/dist/docs/assets/{reference_connections.md.Je9dMsdd.lean.js → reference_connections.md.DJGUCxrr.lean.js} +1 -1
- package/dist/docs/assets/{reference_evals.md.DNJzM_yf.js → reference_evals.md.C6umwNC6.js} +6 -7
- package/dist/docs/assets/reference_evals.md.C6umwNC6.lean.js +1 -0
- package/dist/docs/assets/{reference_extensions.md.Cv5aLCz_.js → reference_extensions.md.DbNYu-DP.js} +3 -3
- package/dist/docs/assets/{reference_extensions.md.Cv5aLCz_.lean.js → reference_extensions.md.DbNYu-DP.lean.js} +1 -1
- package/dist/docs/assets/reference_hooks.md.BfOkhTU0.js +45 -0
- package/dist/docs/assets/{reference_hooks.md.B7uzNENk.lean.js → reference_hooks.md.BfOkhTU0.lean.js} +1 -1
- package/dist/docs/assets/reference_http-api.md.DdwtBeCj.js +11 -0
- package/dist/docs/assets/{reference_http-api.md.CduHavZ2.lean.js → reference_http-api.md.DdwtBeCj.lean.js} +1 -1
- package/dist/docs/assets/reference_instructions.md.B2mcIzT6.js +14 -0
- package/dist/docs/assets/reference_instructions.md.B2mcIzT6.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.CyrQD_n3.js +1 -0
- package/dist/docs/assets/reference_playground.md.CyrQD_n3.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.BEMzxAkq.js +19 -0
- package/dist/docs/assets/{reference_project-layout.md.BGhgpy9V.lean.js → reference_project-layout.md.BEMzxAkq.lean.js} +1 -1
- package/dist/docs/assets/reference_prompt.md.BFrqjHFL.js +9 -0
- package/dist/docs/assets/reference_prompt.md.BFrqjHFL.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BB9N3tRR.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BB9N3tRR.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BBp-GIt-.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.1_6Vyv7x.lean.js → reference_sessions.md.BBp-GIt-.lean.js} +1 -1
- package/dist/docs/assets/reference_skills.md.BVmi3UJ_.js +15 -0
- package/dist/docs/assets/{reference_skills.md.DjQkRefx.lean.js → reference_skills.md.BVmi3UJ_.lean.js} +1 -1
- package/dist/docs/assets/reference_subagents.md.DRoRy2Uj.js +10 -0
- package/dist/docs/assets/{reference_subagents.md.Dl16gcBj.lean.js → reference_subagents.md.DRoRy2Uj.lean.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.B1dH1lpa.js → reference_tools.md.CgocLDX1.js} +9 -6
- package/dist/docs/assets/{reference_tools.md.B1dH1lpa.lean.js → reference_tools.md.CgocLDX1.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.HY95rCCz.js +1 -0
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +37 -37
- package/dist/docs/deployment.md +1 -1
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +38 -38
- package/dist/docs/guides/agent-to-agent.md +11 -12
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +36 -36
- package/dist/docs/guides/cloud-agents.md +1 -1
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +37 -37
- package/dist/docs/guides/grokbot-agents.md +1 -1
- package/dist/docs/guides/hooks.html +109 -0
- package/dist/docs/guides/hooks.md +111 -0
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +42 -80
- package/dist/docs/guides/jev.md +22 -79
- package/dist/docs/guides/mcp-oauth.html +36 -36
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +7 -0
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +1683 -2054
- package/dist/docs/llms.txt +9 -8
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +42 -46
- package/dist/docs/reference/agent-config.md +48 -81
- package/dist/docs/reference/artifacts.html +39 -40
- package/dist/docs/reference/artifacts.md +71 -70
- package/dist/docs/reference/channels.html +41 -61
- package/dist/docs/reference/channels.md +134 -201
- package/dist/docs/reference/cli.html +127 -125
- package/dist/docs/reference/cli.md +685 -753
- package/dist/docs/reference/connections.html +54 -66
- package/dist/docs/reference/connections.md +92 -128
- package/dist/docs/reference/evals.html +42 -43
- package/dist/docs/reference/evals.md +42 -50
- package/dist/docs/reference/extensions.html +38 -38
- package/dist/docs/reference/extensions.md +9 -13
- package/dist/docs/reference/hooks.html +39 -67
- package/dist/docs/reference/hooks.md +72 -146
- package/dist/docs/reference/http-api.html +39 -39
- package/dist/docs/reference/http-api.md +137 -161
- package/dist/docs/reference/instructions.html +39 -39
- package/dist/docs/reference/instructions.md +21 -36
- package/dist/docs/reference/playground.html +36 -36
- package/dist/docs/reference/playground.md +26 -43
- package/dist/docs/reference/project-layout.html +38 -38
- package/dist/docs/reference/project-layout.md +12 -17
- package/dist/docs/reference/prompt.html +42 -42
- package/dist/docs/reference/prompt.md +18 -13
- package/dist/docs/reference/schedules.html +56 -91
- package/dist/docs/reference/schedules.md +52 -99
- package/dist/docs/reference/sessions.html +36 -36
- package/dist/docs/reference/sessions.md +36 -40
- package/dist/docs/reference/skills.html +38 -38
- package/dist/docs/reference/skills.md +15 -26
- package/dist/docs/reference/subagents.html +38 -38
- package/dist/docs/reference/subagents.md +20 -30
- package/dist/docs/reference/tools.html +44 -41
- package/dist/docs/reference/tools.md +45 -64
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/pr-autofixer.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +36 -36
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +9 -1
- package/dist/internal/deploy-client.d.ts +6 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -0
- package/dist/internal/discovery/agent-config.d.ts +3 -1
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +7 -4
- package/dist/internal/framework-storage-selection.d.ts +1 -1
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +20 -2
- package/dist/internal/reminder-runner.d.ts +79 -1
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +276 -44
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +7 -0
- package/dist/memory.d.ts +4 -0
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +28 -4
- package/dist/playground/assets/index-DLwnR9ys.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +16 -9
- package/dist/types.d.ts.map +1 -1
- package/docs/deployment.md +1 -1
- package/docs/guides/agent-to-agent.md +11 -12
- package/docs/guides/cloud-agents.md +1 -1
- package/docs/guides/grokbot-agents.md +1 -1
- package/docs/guides/hooks.md +116 -0
- package/docs/guides/jev.md +23 -80
- package/docs/guides/slack.md +7 -0
- package/docs/reference/agent-config.md +48 -81
- package/docs/reference/artifacts.md +72 -71
- package/docs/reference/channels.md +135 -202
- package/docs/reference/cli.md +686 -754
- package/docs/reference/connections.md +93 -129
- package/docs/reference/evals.md +43 -51
- package/docs/reference/extensions.md +9 -13
- package/docs/reference/hooks.md +72 -146
- package/docs/reference/http-api.md +137 -161
- package/docs/reference/instructions.md +22 -37
- package/docs/reference/playground.md +26 -43
- package/docs/reference/project-layout.md +12 -17
- package/docs/reference/prompt.md +20 -15
- package/docs/reference/schedules.md +52 -99
- package/docs/reference/sessions.md +36 -40
- package/docs/reference/skills.md +15 -26
- package/docs/reference/subagents.md +20 -30
- package/docs/reference/tools.md +45 -64
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
- package/src/channels/slack/inbound.ts +24 -0
- package/src/channels/slack/slack-channel.ts +123 -1
- package/src/internal/cli-deploy.ts +12 -1
- package/src/internal/deploy-client.ts +9 -0
- package/src/internal/discovery/agent-config.ts +8 -6
- package/src/internal/framework-storage-selection.ts +1 -1
- package/src/internal/platform-timers.ts +24 -2
- package/src/internal/reminder-runner.ts +426 -63
- package/src/internal/server.ts +8 -0
- package/src/memory.ts +37 -3
- package/src/types.ts +16 -9
- package/dist/docs/assets/chunks/@localSearchIndexroot.Ck9E52Ls.js +0 -1
- package/dist/docs/assets/chunks/channel.BHiYmnZ4.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.Degh8l90.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.Degh8l90.js +0 -1
- package/dist/docs/assets/chunks/clone.BIywbczV.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.qrxrbFsX.js +0 -1
- package/dist/docs/assets/guides_jev.md.F5fAkkfN.lean.js +0 -1
- package/dist/docs/assets/reference_agent-config.md.DGPyw7ms.js +0 -40
- package/dist/docs/assets/reference_artifacts.md.Bu_4HmsD.js +0 -19
- package/dist/docs/assets/reference_artifacts.md.Bu_4HmsD.lean.js +0 -1
- package/dist/docs/assets/reference_channels.md.nFWbzAic.js +0 -43
- package/dist/docs/assets/reference_channels.md.nFWbzAic.lean.js +0 -1
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.js +0 -95
- package/dist/docs/assets/reference_cli.md.DLWDz9ij.lean.js +0 -1
- package/dist/docs/assets/reference_evals.md.DNJzM_yf.lean.js +0 -1
- package/dist/docs/assets/reference_hooks.md.B7uzNENk.js +0 -73
- package/dist/docs/assets/reference_http-api.md.CduHavZ2.js +0 -11
- package/dist/docs/assets/reference_instructions.md.CU1My5My.js +0 -14
- package/dist/docs/assets/reference_instructions.md.CU1My5My.lean.js +0 -1
- package/dist/docs/assets/reference_playground.md.Ch2d0Iqi.js +0 -1
- package/dist/docs/assets/reference_playground.md.Ch2d0Iqi.lean.js +0 -1
- package/dist/docs/assets/reference_project-layout.md.BGhgpy9V.js +0 -19
- package/dist/docs/assets/reference_prompt.md.Ccp0R53H.js +0 -1
- package/dist/docs/assets/reference_prompt.md.Ccp0R53H.lean.js +0 -1
- package/dist/docs/assets/reference_schedules.md.B2Nm6FaD.js +0 -82
- package/dist/docs/assets/reference_schedules.md.B2Nm6FaD.lean.js +0 -1
- package/dist/docs/assets/reference_sessions.md.1_6Vyv7x.js +0 -1
- package/dist/docs/assets/reference_skills.md.DjQkRefx.js +0 -15
- package/dist/docs/assets/reference_subagents.md.Dl16gcBj.js +0 -10
- package/dist/docs/assets/troubleshooting.md.mnfFG2Em.js +0 -1
- package/dist/playground/assets/index-DSMAewbx.css +0 -1
- /package/dist/docs/assets/{deployment.md.D2jQZuFx.lean.js → deployment.md.D2YX7u_I.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.CD4T5FIl.lean.js → guides_agent-to-agent.md.C6kPY8nu.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-agents.md.Cp1O3u-X.lean.js → guides_cloud-agents.md.BPJqTZjT.lean.js} +0 -0
- /package/dist/docs/assets/{guides_grokbot-agents.md.CMhZNdEU.lean.js → guides_grokbot-agents.md.CzV715v8.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.mnfFG2Em.lean.js → troubleshooting.md.HY95rCCz.lean.js} +0 -0
- /package/dist/playground/assets/{index-De_lpFxE.js → index-CX6oTKwz.js} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Hooks","description":"Observe session events for metrics, alerts, and other side effects without changing the turn.","frontmatter":{"title":"Hooks","description":"Observe session events for metrics, alerts, and other side effects without changing the turn."},"headers":[],"relativePath":"guides/hooks.md","filePath":"guides/hooks.md"}'),t={name:"guides/hooks.md"};function h(l,s,k,p,r,o){return n(),a("div",null,[...s[0]||(s[0]=[e(`<h1 id="hooks" tabindex="-1">Hooks <a class="header-anchor" href="#hooks" aria-label="Permalink to "Hooks""></a></h1><p>Hooks observe session events after they are recorded and run side effects such as updating metrics or sending alerts. They never change the turn, prompt, or reply. Author them under <code>agent/hooks/</code> with <code>defineHook</code> from <code>@cursor/july/hooks</code>.</p><h2 id="meter-token-usage" tabindex="-1">Meter token usage <a class="header-anchor" href="#meter-token-usage" aria-label="Permalink to "Meter token usage""></a></h2><p>With <a href="./opentelemetry.html">OpenTelemetry</a> configured, this hook adds a live turn's reported input and output tokens to your counters. Eval runs stay quiet, so the dashboard reflects live traffic instead of the test suite.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/usage.ts</span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/hooks"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
|
+
<span class="line"></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> events: {</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "turn.completed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">ctx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (ctx.session.purpose </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "eval"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (event.data.usage </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> undefined</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
13
|
+
<span class="line"></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">inputTokens</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">outputTokens</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> event.data.usage;</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"acme.tokens.input"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, inputTokens);</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.host.otel.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">increment</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"acme.tokens.output"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, outputTokens);</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
19
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="alert-on-failure" tabindex="-1">Alert on failure <a class="header-anchor" href="#alert-on-failure" aria-label="Permalink to "Alert on failure""></a></h2><p>Set <code>PAGER_WEBHOOK_URL</code> to your pager's webhook. When a live turn fails, this hook posts the agent, session, and failure message there. Eval runs and interrupted turns stay quiet, so tests and preemptions do not page anyone.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/hooks/page-on-failure.ts</span></span>
|
|
20
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineHook } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/hooks"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
21
|
+
<span class="line"></span>
|
|
22
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineHook</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
23
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> events: {</span></span>
|
|
24
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> async</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "turn.failed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">event</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">ctx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
25
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (ctx.session.purpose </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "eval"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
26
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
27
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
28
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (event.data.message </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "turn interrupted"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
29
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
30
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
31
|
+
<span class="line"></span>
|
|
32
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> pagerUrl</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">PAGER_WEBHOOK_URL</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
33
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (pagerUrl </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> undefined</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
34
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
35
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
36
|
+
<span class="line"></span>
|
|
37
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(pagerUrl, {</span></span>
|
|
38
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> method: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"POST"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
39
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> headers: { </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"content-type"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"application/json"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
40
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> body: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">JSON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">stringify</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
41
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> agent: ctx.agent.name,</span></span>
|
|
42
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> session: ctx.session.id,</span></span>
|
|
43
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> channel: ctx.channel.id,</span></span>
|
|
44
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> message: event.data.message,</span></span>
|
|
45
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }),</span></span>
|
|
46
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> signal: AbortSignal.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5_000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">),</span></span>
|
|
47
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> });</span></span>
|
|
48
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
49
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
50
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="events-when-hooks-run" tabindex="-1">Events / when hooks run <a class="header-anchor" href="#events-when-hooks-run" aria-label="Permalink to "Events / when hooks run""></a></h2><p>Use event names from the <a href="./../reference/sessions.html#stream-events">session event vocabulary</a>. A hook receives each matching event after it is recorded, and the model does not wait for the handler.</p><p>Within one session, handlers run one at a time. A slow handler delays later handlers for that session, but it does not delay the model or handlers for other sessions. Hooks also fire for evals, so check <code>ctx.session.purpose === "eval"</code> before metering or paging. A restart does not replay recorded events into hooks.</p><h2 id="when-not-to-use-a-hook" tabindex="-1">When not to use a hook <a class="header-anchor" href="#when-not-to-use-a-hook" aria-label="Permalink to "When not to use a hook""></a></h2><table tabindex="0"><thead><tr><th>Want</th><th>Use instead</th></tr></thead><tbody><tr><td>Add context before the model</td><td><code>instructions.md</code>, skills, or <code>workspaceFiles</code></td></tr><tr><td>Deliver to Slack or a PR</td><td>Channel <a href="./../reference/channels.html#events"><code>events</code></a> or packs</td></tr><tr><td>Block or approve a tool</td><td><a href="./../reference/tools.html#gate-a-tool-on-human-approval"><code>needsApproval</code></a></td></tr><tr><td>Gate final assistant text</td><td><code>defineResult</code></td></tr><tr><td>Gate behavior</td><td><a href="./../evals.html">Evals</a></td></tr></tbody></table><p><a href="https://cursor.com/docs/agent/hooks" target="_blank" rel="noreferrer">Cursor Agent hooks</a> in <code>.cursor/hooks.json</code> are a different product. They can observe, block, or modify the local agent loop.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/hooks.html">Hooks reference</a>: payloads, context, and discovery</li><li><a href="./../reference/sessions.html#stream-events">Sessions: stream events</a>: event vocabulary and payload sequence</li><li><a href="./opentelemetry.html">OpenTelemetry</a>: export traces and custom metrics</li><li><a href="./../reference/channels.html#events">Channels: events</a>: deliver replies back to Slack, source control, or another surface</li></ul>`,16)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const E=JSON.parse('{"title":"Hooks","description":"Observe session events for metrics, alerts, and other side effects without changing the turn.","frontmatter":{"title":"Hooks","description":"Observe session events for metrics, alerts, and other side effects without changing the turn."},"headers":[],"relativePath":"guides/hooks.md","filePath":"guides/hooks.md"}'),t={name:"guides/hooks.md"};function h(l,s,k,p,r,o){return n(),a("div",null,[...s[0]||(s[0]=[e("",16)])])}const c=i(t,[["render",h]]);export{E as __pageData,c as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o=JSON.parse('{"title":"Jev","description":"Use typed Jev decisions to filter
|
|
1
|
+
import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o=JSON.parse('{"title":"Jev","description":"Use typed Jev decisions to filter findings, route pull requests, and gate review actions.","frontmatter":{"title":"Jev","description":"Use typed Jev decisions to filter findings, route pull requests, and gate review actions."},"headers":[],"relativePath":"guides/jev.md","filePath":"guides/jev.md"}'),t={name:"guides/jev.md"};function h(l,s,p,k,r,E){return n(),a("div",null,[...s[0]||(s[0]=[e(`<h1 id="use-jev-in-review-tools" tabindex="-1">Use Jev in review tools <a class="header-anchor" href="#use-jev-in-review-tools" aria-label="Permalink to "Use Jev in review tools""></a></h1><p>Use Jev when a review workflow needs a typed decision instead of prose. A review agent can filter speculative findings, classify pull request risk, choose a reviewer, or decide whether a merge needs a documentation follow-up. Jev returns a choice, score, or probability; your TypeScript decides what happens next.</p><p>Set <code>TYPESAFE_API_KEY</code>. The default model is <code>jev-latest</code>.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/extensions/jev.ts</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> jev </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/extensions/jev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
3
|
<span class="line"></span>
|
|
4
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> jev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div><h2 id="start-only-the-review-turns-you-need" tabindex="-1">Start only the review turns you need <a class="header-anchor" href="#start-only-the-review-turns-you-need" aria-label="Permalink to "Start only the review turns you need""></a></h2><p>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> jev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div><h2 id="start-only-the-review-turns-you-need" tabindex="-1">Start only the review turns you need <a class="header-anchor" href="#start-only-the-review-turns-you-need" aria-label="Permalink to "Start only the review turns you need""></a></h2><p>Call Jev from a channel hook before a model turn starts. When a pull request opens or becomes ready for review, this hook sends its title, body, labels, and filenames to Jev to decide whether the change needs security review. A result that clears the threshold starts the review turn; otherwise, the hook returns <code>null</code>, so the agent doesn't run or post to GitHub.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/channels/github.ts</span></span>
|
|
5
5
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
6
6
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> defaultGitHubAuth,</span></span>
|
|
7
7
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> githubChannel,</span></span>
|
|
@@ -51,7 +51,7 @@ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
51
51
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // \`auth\` starts a model turn running as the pull request sender.</span></span>
|
|
52
52
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { auth: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">defaultGitHubAuth</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(ctx) };</span></span>
|
|
53
53
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
54
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>
|
|
54
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Jev receives only the pull request metadata shown here, not the diff.</p><h2 id="filter-findings-before-you-post-them" tabindex="-1">Filter findings before you post them <a class="header-anchor" href="#filter-findings-before-you-post-them" aria-label="Permalink to "Filter findings before you post them""></a></h2><p>Let the chat model draft a finding, then ask Jev whether the finding is a real bug in the new code. Below your threshold, the tool returns and the author never sees the draft. Above it, the finding becomes a review comment.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/tools/post_finding.ts</span></span>
|
|
55
55
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { parseGitHubPrContinuationKey } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/channels/github"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
56
56
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { above, decide } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/extensions/jev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
57
57
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineTool } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/tools"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
@@ -125,7 +125,7 @@ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
125
125
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">needsHuman</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(answers.risk) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">||</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tier </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "medium"</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ||</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tier </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">===</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "high"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
|
|
126
126
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { verdict: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"hold"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, tier };</span></span>
|
|
127
127
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
|
128
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { verdict: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"approve"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, tier };</span></span></code></pre></div><p>Your GitHub tool resolves the pull request from <code>ctx.session</code> and posts that verdict. The model does not choose the repository, pull request, or approval event.</p><h2 id="open-documentation-follow-ups-selectively" tabindex="-1">Open documentation follow-ups selectively <a class="header-anchor" href="#open-documentation-follow-ups-selectively" aria-label="Permalink to "Open documentation follow-ups selectively""></a></h2><p>After a pull request merges, a code-wiki agent can ask whether the change introduced a durable fact that belongs in the docs. A low probability
|
|
128
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { verdict: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"approve"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, tier };</span></span></code></pre></div><p>Your GitHub tool resolves the pull request from <code>ctx.session</code> and posts that verdict. The model does not choose the repository, pull request, or approval event.</p><h2 id="open-documentation-follow-ups-selectively" tabindex="-1">Open documentation follow-ups selectively <a class="header-anchor" href="#open-documentation-follow-ups-selectively" aria-label="Permalink to "Open documentation follow-ups selectively""></a></h2><p>After a pull request merges, a code-wiki agent can ask whether the change introduced a durable fact that belongs in the docs. A low probability skips the follow-up, while a high probability opens a documentation pull request.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { above, decide } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/extensions/jev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
129
129
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { openDocsPullRequest } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "../lib/wiki"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
130
130
|
<span class="line"></span>
|
|
131
131
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> answers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> decide</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -142,48 +142,10 @@ import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o
|
|
|
142
142
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">above</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(answers.updateDocs, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.8</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)) {</span></span>
|
|
143
143
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { action: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"skip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> };</span></span>
|
|
144
144
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
|
145
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> openDocsPullRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ title, summary });</span></span></code></pre></div><h2 id="write-tools-with-jev" tabindex="-1">Write tools with Jev <a class="header-anchor" href="#write-tools-with-jev" aria-label="Permalink to "Write tools with Jev""></a></h2><p
|
|
145
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> openDocsPullRequest</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ title, summary });</span></span></code></pre></div><h2 id="write-tools-with-jev" tabindex="-1">Write tools with Jev <a class="header-anchor" href="#write-tools-with-jev" aria-label="Permalink to "Write tools with Jev""></a></h2><p>Call <code>decide</code> from a channel hook, server tool, or router when you want the answer map directly. Use <code>evaluate</code> when you want <code>{ answers }</code>.</p><p>Use a boolean for a yes-or-no gate, a choice for a closed set such as risk tiers or owners, and a score for an ordered rubric. <code>above</code> returns <code>true</code> when a boolean probability or score meets the threshold. <code>needsHuman</code> returns <code>true</code> when a boolean probability or the selected choice's probability falls below the confidence threshold.</p><p>Keep the questions atomic and combine them in TypeScript. For example, ask separately whether a finding is real, whether its impact is user-visible, and whether the changed line is new. Your code owns the rule that decides whether all three are enough to post.</p><h2 id="let-the-agent-ask-jev" tabindex="-1">Let the agent ask Jev <a class="header-anchor" href="#let-the-agent-ask-jev" aria-label="Permalink to "Let the agent ask Jev""></a></h2><p>Mounting the extension adds a read-only harness tool named <code><namespace>__evaluate</code>. With the <code>agent/extensions/jev.ts</code> mount shown earlier, the model sees <code>jev__evaluate</code>.</p><p>The tool accepts one state and a list of boolean, choice, or score questions. It returns <code>{ answers }</code> and never posts, approves, or opens a pull request. Use it when the agent needs the result during the turn. Use <code>decide</code> inside a project tool when the answer and the write belong in one operation.</p><h2 id="skills-included-with-the-extension" tabindex="-1">Skills included with the extension <a class="header-anchor" href="#skills-included-with-the-extension" aria-label="Permalink to "Skills included with the extension""></a></h2><p>The extension adds two skills by default:</p><ul><li><p><code>jev__questions</code> teaches the model how to structure atomic questions, choose a question type, and read the answers.</p></li><li><p><code>jev__gated-write</code> teaches the model to put <code>decide</code> and the write in one server tool, hold on low confidence, and skip writes during evals.</p></li></ul><p>The model sees each skill's description and loads the full procedure when it applies.</p><h2 id="choose-what-to-mount" tabindex="-1">Choose what to mount <a class="header-anchor" href="#choose-what-to-mount" aria-label="Permalink to "Choose what to mount""></a></h2><p>Both contribution groups are on by default. Turn off the harness tool when Jev should only run inside tools you wrote. Turn off the skills when your agent already has its own Jev instructions.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/extensions/jev.ts</span></span>
|
|
146
146
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> jev </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/extensions/jev"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
147
147
|
<span class="line"></span>
|
|
148
148
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> jev</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
149
149
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> harnessTools: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
150
150
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> skills: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
151
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>harnessTools: false</code> removes <code>jev__evaluate</code> from discovery. <code>skills: false</code> removes both Jev skills. These switches do not remove the exported helpers, so project tools can still import <code>decide</code>, <code>above</code>, and <code>needsHuman</code>.</p><h2 id="
|
|
152
|
-
<span class="line"></span>
|
|
153
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> answers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> decide</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
154
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> state: {</span></span>
|
|
155
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> title: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Skip the refund auth check"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
156
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> summary: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"acme/checkout#42 drops the session check on POST /refunds."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
157
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
158
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> questions: {</span></span>
|
|
159
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> risk: {</span></span>
|
|
160
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"choice"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
161
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> instructions: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"What risk tier is this pull request?"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
162
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> criteria: {</span></span>
|
|
163
|
-
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "very-low"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"docs, formatting, or a mechanical rename"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
164
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> low: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"a local change with tests and no new trust boundary"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
165
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> medium: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"auth, billing, or a behavior change callers depend on"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
166
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"a likely exploit, data loss, or a broken public contract"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
167
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
168
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
169
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
170
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> apiKey: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"sk-test"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
171
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> fetch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span></span>
|
|
172
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> new</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Response</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>
|
|
173
|
-
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> JSON</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">stringify</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
174
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> answers: {</span></span>
|
|
175
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> risk: {</span></span>
|
|
176
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"choice"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
177
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> choice: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"high"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
178
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> probabilities: {</span></span>
|
|
179
|
-
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "very-low"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.02</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
180
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> low: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.05</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
181
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> medium: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.18</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
182
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> high: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.75</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
183
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
184
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
185
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
186
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }),</span></span>
|
|
187
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { status: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
188
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ),</span></span>
|
|
189
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to "Practices""></a></h2><ul><li><p>Pass the pull request title, a short summary, and the draft finding. Don't send the checkout.</p></li><li><p>Calibrate <code>above</code> and <code>needsHuman</code> on pull requests you have already labeled. <code>needsHuman</code> defaults to <code>0.7</code>.</p></li></ul><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../templates/agentic-owners.html">Agentic owners</a>: a risk tier, then the host approves or asks for reviewers</li><li><a href="./../templates/security-reviewer.html">Security reviewer</a>: a finding, or no comment</li><li><a href="./../templates/thermo-review.html">Thermo review</a>: bugs and breakage, posted the same way</li><li><a href="./../reference/cli.html#init">Code wiki</a>: documentation follow-ups after a merge</li><li><a href="./../evals.html">Evals</a>: checks on the full turn</li><li><a href="./github.html">GitHub agents</a>: how the review gets onto the pull request</li></ul>`,43)])])}const g=i(t,[["render",h]]);export{o as __pageData,g as default};
|
|
151
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p><code>harnessTools: false</code> removes <code>jev__evaluate</code> from discovery. <code>skills: false</code> removes both Jev skills. These switches do not remove the exported helpers, so project tools can still import <code>decide</code>, <code>above</code>, and <code>needsHuman</code>.</p><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to "Practices""></a></h2><ul><li><p>Pass the pull request title, a short summary, and the draft finding. Don't send the checkout.</p></li><li><p>Calibrate <code>above</code> and <code>needsHuman</code> on pull requests you have already labeled. <code>needsHuman</code> defaults to <code>0.7</code>.</p></li></ul><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../templates/agentic-owners.html">Agentic owners</a>: a risk tier, then the host approves or asks for reviewers</li><li><a href="./../templates/security-reviewer.html">Security reviewer</a>: a finding, or no comment</li><li><a href="./../templates/thermo-review.html">Thermo review</a>: bugs and breakage, posted the same way</li><li><a href="./../reference/cli.html#init">Code wiki</a>: documentation follow-ups after a merge</li><li><a href="./../evals.html">Evals</a>: checks on the full turn</li><li><a href="./github.html">GitHub agents</a>: how the review gets onto the pull request</li></ul>`,37)])])}const g=i(t,[["render",h]]);export{o as __pageData,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as i,c as a,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const o=JSON.parse('{"title":"Jev","description":"Use typed Jev decisions to filter findings, route pull requests, and gate review actions.","frontmatter":{"title":"Jev","description":"Use typed Jev decisions to filter findings, route pull requests, and gate review actions."},"headers":[],"relativePath":"guides/jev.md","filePath":"guides/jev.md"}'),t={name:"guides/jev.md"};function h(l,s,p,k,r,E){return n(),a("div",null,[...s[0]||(s[0]=[e("",37)])])}const g=i(t,[["render",h]]);export{o as __pageData,g as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as a,c as i,o as
|
|
1
|
+
import{_ as a,c as i,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),t={name:"guides/slack.md"};function l(h,s,p,k,o,r){return e(),i("div",null,[...s[0]||(s[0]=[n(`<h1 id="slack-agents" tabindex="-1">Slack agents <a class="header-anchor" href="#slack-agents" aria-label="Permalink to "Slack agents""></a></h1><p>A Slack agent wakes when someone mentions it, sends it a DM, or posts in a channel it watches. From there, it keeps the conversation in one thread and can reply all at once, stream the answer live, or decide for itself when to post updates.</p><p>Run <code>agent-sdk slack create --dir .</code>, then <code>agent-sdk slack doctor</code>.</p><h2 id="answer-a-mention-or-dm" tabindex="-1">Answer a mention or DM <a class="header-anchor" href="#answer-a-mention-or-dm" aria-label="Permalink to "Answer a mention or DM""></a></h2><p>Mention the bot in a channel or send it a DM, and it will answer in a thread on that message. Any follow-up in the same thread continues the conversation where it left off.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// agent/channels/slack.ts</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { slackChannel } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/channels/slack"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
3
|
<span class="line"></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -47,7 +47,7 @@ import{_ as a,c as i,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const c
|
|
|
47
47
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // \`{}\` starts a model turn as the sender.</span></span>
|
|
48
48
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {};</span></span>
|
|
49
49
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
50
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>When you create the app, pass <code>--channel-posts</code> and invite the bot to every channel in the allowlist.</p><h2 id="control-who-can-message" tabindex="-1">Control who can message <a class="header-anchor" href="#control-who-can-message" aria-label="Permalink to "Control who can message""></a></h2><p>By default, people outside your workspace get no reply. This matters most in Slack Connect channels, where external collaborators share the channel and can mention or reply to bots installed by your organization. Keeping <code>blockExternals</code> on prevents them from starting or steering an agent session and, through it, directing any tools available to the agent.</p><p>Set <code>blockExternals: false</code> only when external collaborators are intended users of the agent.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
50
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>When you create the app, pass <code>--channel-posts</code> and invite the bot to every channel in the allowlist.</p><p>On Cursor-managed hosting the same watch runs at admission for each delivery. <code>debounceMs</code> is ignored there: the control plane answers every delivery immediately, and edits arrive as separate deliveries that are dropped at the edge. Channel ids match without any Slack call; <code>#name</code> entries are resolved once per pod with the bot token and need the <code>channels:read</code> scope.</p><h2 id="control-who-can-message" tabindex="-1">Control who can message <a class="header-anchor" href="#control-who-can-message" aria-label="Permalink to "Control who can message""></a></h2><p>By default, people outside your workspace get no reply. This matters most in Slack Connect channels, where external collaborators share the channel and can mention or reply to bots installed by your organization. Keeping <code>blockExternals</code> on prevents them from starting or steering an agent session and, through it, directing any tools available to the agent.</p><p>Set <code>blockExternals: false</code> only when external collaborators are intended users of the agent.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
51
51
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Let external collaborators start and continue agent sessions.</span></span>
|
|
52
52
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> policy: { blockExternals: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
53
53
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>Anyone in a thread can continue its session by default. If the conversation should stay between the agent and its original author, set <code>respondTo: "author"</code>.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> slackChannel</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
@@ -67,4 +67,4 @@ import{_ as a,c as i,o as n,a3 as e}from"./chunks/framework.BNw1pucY.js";const c
|
|
|
67
67
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">},</span></span></code></pre></div><p>Use the IDs on the hook <code>ctx</code> when handling an event, and <code>ctx.host.slack.getClient()</code> when a tool needs the Slack Web API.</p><h2 id="connect" tabindex="-1">Connect <a class="header-anchor" href="#connect" aria-label="Permalink to "Connect""></a></h2><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> login</span></span>
|
|
68
68
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> create</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span></span>
|
|
69
69
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span></code></pre></div><p>After you sign in, <code>slack create</code> opens <strong>Add Slack to this agent</strong> in the browser and writes the resulting tokens to <code>.env.local</code> without printing them. You can open the same wizard from <strong>Integrations</strong> on <a href="https://cursor.com/dashboard" target="_blank" rel="noreferrer">Deployed Agents</a>.</p><p>If you already own the Slack app, initialize it with <code>agent-sdk slack init --manual --dir . --name "Triage"</code> and follow the <a href="./../../skills/setup-slack/SKILL.html">Slack setup skill</a> for installation and tokens.</p><h2 id="test-locally" tabindex="-1">Test locally <a class="header-anchor" href="#test-locally" aria-label="Permalink to "Test locally""></a></h2><p>Run <code>doctor</code> first to catch missing credentials, then start the agent and send it the same mention or DM a teammate would.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> slack</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> doctor</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefix</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> TRIAGE</span></span>
|
|
70
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to "Practices""></a></h2><ul><li><p>If the tokens are missing, the Slack channel stays idle while the rest of <code>serve</code> starts normally.</p></li><li><p>Keep <code>channelPosts.allow</code> narrow because each qualifying post can start a model turn.</p></li><li><p>Set <code>envPrefix</code> when two Slack bots share a host so the token names do not collide.</p></li></ul><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/cli.html#slack">CLI reference</a>: <code>slack create</code>, <code>doctor</code>, <code>init --manual</code></li><li><a href="./../../skills/setup-slack/SKILL.html"><code>skills/setup-slack/SKILL.md</code></a>: the companion skill for coding agents</li><li><a href="./webhooks.html">Webhooks and custom channels</a>: host prep on mention and DM handlers</li><li><a href="./../evals.html">Evals</a>: freeze a mention as a regression check</li></ul>`,
|
|
70
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">agent-sdk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> serve</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> .</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><h2 id="practices" tabindex="-1">Practices <a class="header-anchor" href="#practices" aria-label="Permalink to "Practices""></a></h2><ul><li><p>If the tokens are missing, the Slack channel stays idle while the rest of <code>serve</code> starts normally.</p></li><li><p>Keep <code>channelPosts.allow</code> narrow because each qualifying post can start a model turn.</p></li><li><p>Set <code>envPrefix</code> when two Slack bots share a host so the token names do not collide.</p></li></ul><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./../reference/cli.html#slack">CLI reference</a>: <code>slack create</code>, <code>doctor</code>, <code>init --manual</code></li><li><a href="./../../skills/setup-slack/SKILL.html"><code>skills/setup-slack/SKILL.md</code></a>: the companion skill for coding agents</li><li><a href="./webhooks.html">Webhooks and custom channels</a>: host prep on mention and DM handlers</li><li><a href="./../evals.html">Evals</a>: freeze a mention as a regression check</li></ul>`,50)])])}const E=a(t,[["render",l]]);export{c as __pageData,E as default};
|
package/dist/docs/assets/{guides_slack.md.Bo96y42E.lean.js → guides_slack.md.DVjNyqq5.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,c as i,o as
|
|
1
|
+
import{_ as a,c as i,o as e,a3 as n}from"./chunks/framework.BNw1pucY.js";const c=JSON.parse('{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread.","frontmatter":{"title":"Slack","description":"Wake your agent from mentions, DMs, and watched posts, then reply in the thread."},"headers":[],"relativePath":"guides/slack.md","filePath":"guides/slack.md"}'),t={name:"guides/slack.md"};function l(h,s,p,k,o,r){return e(),i("div",null,[...s[0]||(s[0]=[n("",50)])])}const E=a(t,[["render",l]]);export{c as __pageData,E as default};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{_ as e,c as a,o as t,a3 as i}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Agent config","description":"defineAgent at agent/agent.ts: the model, the local and cloud runtimes, and serving programmatically.","frontmatter":{"title":"Agent config","description":"defineAgent at agent/agent.ts: the model, the local and cloud runtimes, and serving programmatically."},"headers":[],"relativePath":"reference/agent-config.md","filePath":"reference/agent-config.md"}'),o={name:"reference/agent-config.md"};function n(l,s,d,r,h,c){return t(),a("div",null,[...s[0]||(s[0]=[i(`<h1 id="agent-config" tabindex="-1">Agent config <a class="header-anchor" href="#agent-config" aria-label="Permalink to "Agent config""></a></h1><p><code>agent/agent.ts</code> default-exports <code>defineAgent(config)</code>, which sets the model, execution runtime, and runtime-specific defaults. Every root config field is optional.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineAgent } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
2
|
+
<span class="line"></span>
|
|
3
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> model: {</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"grok-4.5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> params: [</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"effort"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"high"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"fast"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"true"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// optional; this is the default</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> runtime: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"local"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// default, or "cloud"</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // cloud: {</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // repos: [{ url: "https://github.com/org/repo", startingRef: "main" }],</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // },</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="agent-fields" tabindex="-1">Agent fields <a class="header-anchor" href="#agent-fields" aria-label="Permalink to "Agent fields""></a></h2><table tabindex="0"><thead><tr><th>Field</th><th>Type</th><th>Meaning</th></tr></thead><tbody><tr><td><code>model</code></td><td>string or <code>{ id, params }</code></td><td>Cursor model for turns. Defaults to <code>grok-4.5</code> with <code>effort=high</code>, <code>fast=true</code> on the root agent. Subagents omit it to inherit.</td></tr><tr><td><code>name</code></td><td>string</td><td>Display name override. Defaults to the package name or directory name.</td></tr><tr><td><code>description</code></td><td>string</td><td>What the agent is for. Required on subagents; the parent model reads it to decide when to delegate. Documentation-only on the root.</td></tr><tr><td><code>instructions</code></td><td>string</td><td>Inline instructions. Prefer <code>instructions.md</code>; this exists for subagents and generated configs.</td></tr><tr><td><code>runtime</code></td><td><code>"local"</code> or <code>"cloud"</code></td><td>Where turns execute. Default <code>"local"</code>.</td></tr><tr><td><code>cloud</code></td><td>object</td><td>Cloud agent defaults: repos, env, envVars. Used when <code>runtime</code> is <code>"cloud"</code>, and as the base merged under per-session <code>cloud</code> send options.</td></tr><tr><td><code>local</code></td><td><code>{ cwd?, workspaceDir?, sandbox? }</code></td><td>Local harness defaults; ignored for cloud turns. See <a href="#local-options">Local options</a>.</td></tr><tr><td><code>hosting</code></td><td><code>{ egressDomains?, secretNames? }</code></td><td><code>agent-sdk deploy</code> declarations for allowed egress domains and expected secret names. Ignored by local serving.</td></tr><tr><td><code>concurrency</code></td><td><code>{ maxRunningTurns? }</code></td><td>Agent-wide turn admission limit. See <a href="#concurrency">Concurrency</a>.</td></tr><tr><td><code>builtinTools</code></td><td><code>{ reminders? }</code></td><td>Framework-provided model-facing tools, opted in per capability. See <a href="#built-in-tools">Built-in tools</a>.</td></tr><tr><td><code>tools</code></td><td><code>ToolName[]</code></td><td>Allowlist of built-in harness tools offered to the model. Unset = the model's full standard toolset. See <a href="#harness-tools">Harness tools</a>.</td></tr></tbody></table><h2 id="model" tabindex="-1">Model <a class="header-anchor" href="#model" aria-label="Permalink to "Model""></a></h2><p><code>model</code> is a Cursor model id string, or <code>{ id, params }</code>. Effort and speed are params, not id suffixes. The SDK rejects suffix-style ids like <code>grok-4.5-fast</code>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"grok-4.5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> params</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"effort"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"high"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
19
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"fast"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, value: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"true"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
20
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
21
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>A plain string works when you don't need params:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">model</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"composer-2.5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span></code></pre></div><h2 id="runtime" tabindex="-1">Runtime <a class="header-anchor" href="#runtime" aria-label="Permalink to "Runtime""></a></h2><p><code>runtime: "local"</code> (the default) runs turns on this machine. Server tools, skills, sandbox seeds, and tool approvals all apply.</p><p><code>runtime: "cloud"</code> runs turns on Cursor cloud agents. Pass a <code>cloud</code> block with the repositories the VM needs. See <a href="./tools.html">Tools</a> for server- and agent-tool behavior on cloud turns.</p><p><code>validate</code> warns when <code>runtime: "cloud"</code> is combined with agent tools, when skills or sandbox seeds are present, and when the <code>cloud</code> block is missing.</p><h2 id="local-options" tabindex="-1">Local options <a class="header-anchor" href="#local-options" aria-label="Permalink to "Local options""></a></h2><p><code>local</code> sets local-harness defaults, all ignored for cloud turns.</p><p><code>local.workspaceDir</code> points every session at one shared harness cwd, for agents that work inside an existing checkout. It takes precedence over <code>cwd</code>, and a per-send <code>workspaceDir</code> still wins over both. Sessions share a working tree, so a file one turn writes is visible to the next.</p><p><code>local.sandbox</code> runs the harness inside Cursor's local sandbox. It's off by default: shell then auto-approves and inherits the serve process environment, including any credentials the host holds. Turn it on for agents whose turns read untrusted input (webhook payloads, PR diffs, inbound chat); it's a tool boundary, not a prompt-level one.</p><h3 id="local-cwd" tabindex="-1">Local cwd <a class="header-anchor" href="#local-cwd" aria-label="Permalink to "Local cwd""></a></h3><p><code>local.cwd</code> sets the parent directory for local harness workspaces. Each session uses <code><cwd>/<sessionId></code> unless a per-send <code>workspaceDir</code> overrides it.</p><p>Session workspaces are real Cursor project directories. The harness loads <code>AGENTS.md</code> and <code>.cursor</code> config from ancestor directories. An agent nested in another git repo (a monorepo package) defaults to a per-project cache directory under <code>~/.cache</code> when you omit <code>cwd</code>, so the enclosing checkout does not leak rules, skills, or MCP servers into the turn. A standalone git root keeps the in-project session workspace. Point <code>cwd</code> at a checkout only when the agent should inherit that tree.</p><h2 id="harness-tools" tabindex="-1">Harness tools <a class="header-anchor" href="#harness-tools" aria-label="Permalink to "Harness tools""></a></h2><p>Use <code>tools</code> to limit which built-in Cursor harness tools the model can call. Omit it to keep the standard toolset. When you set it, the model gets only the tools you list. An empty list disables all native built-in tools. New platform tools stay disabled until you add them.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
22
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> model: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"composer-2.5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
23
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Read-only triage agent: search and read only.</span></span>
|
|
24
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // No shell, no edits, no subagents.</span></span>
|
|
25
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> tools: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"read"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"grep"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"glob"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ls"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">],</span></span>
|
|
26
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><p>The Agent SDK always adds <code>"mcp"</code> to a configured allowlist, because authored server tools in <code>agent/tools/</code> reach the model over MCP. MCP can also expose declared connections and servers from the harness directory's ambient <code>.cursor</code> config. To exclude a checkout's MCP servers, point <code>local.cwd</code> outside the checkout. See <a href="#local-cwd">Local cwd</a>. <code>local.sandbox</code> makes MCP tool calls fail closed.</p><p>Use the SDK's public tool names, including <code>"shell"</code>, <code>"read"</code>, <code>"edit"</code>, <code>"grep"</code>, <code>"glob"</code>, <code>"ls"</code>, and <code>"task"</code>. Unknown names fail the turn with a <code>ConfigurationError</code>.</p><p>Two names have broader effects:</p><ul><li><code>"shell"</code> also grants shell input. Tools with <code>execution: "agent"</code> need it to run their scripts. Discovery warns when your allowlist would prevent those tools from running.</li><li><code>"task"</code> lets the root agent start subagents. Each subagent keeps its own curated toolset.</li></ul><p>Tool allowlists work only with the local runtime. A <code>runtime: "cloud"</code> agent that sets <code>tools</code> fails at serve startup. The Agent SDK also refuses per-send cloud sessions from a hybrid agent with an allowlist.</p><p>The allowlist controls which tools the model can call. It does not isolate the serve host. For agents that process untrusted input, also set <code>local: { sandbox: true }</code>.</p><h2 id="cloud-options" tabindex="-1">Cloud options <a class="header-anchor" href="#cloud-options" aria-label="Permalink to "Cloud options""></a></h2><p>The <code>cloud</code> block sets default repositories (each <code>{ url, startingRef? }</code>), environment selection, and <code>envVars</code>. A local agent uses the same block as the base config when a channel opens a cloud-attached session per send (the <code>cloud</code> option on <a href="./channels.html#handler-arguments"><code>send</code></a>).</p><h2 id="concurrency" tabindex="-1">Concurrency <a class="header-anchor" href="#concurrency" aria-label="Permalink to "Concurrency""></a></h2><p><code>concurrency.maxRunningTurns</code> caps how many model turns run at once across all of the agent's sessions (positive integer, hard cap 200). When every slot is busy, newly admitted turns queue FIFO instead of failing: the stream records a durable <code>turn.queued</code> event with the queue position, <code>GET /v1/sessions</code> reports <code>queued: true</code>, and each queued turn starts as soon as a slot frees. A queued turn still counts as running for busy semantics: follow-ups preempt it, and direct write-effect tool calls get <code>409 session_busy</code>. Omit for unlimited.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineAgent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
27
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> concurrency: { maxRunningTurns: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
28
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><h2 id="built-in-tools" tabindex="-1">Built-in tools <a class="header-anchor" href="#built-in-tools" aria-label="Permalink to "Built-in tools""></a></h2><p><code>builtinTools</code> opts into framework-provided model-facing tools. Each enabled capability shows up as ordinary server tools, so turns, direct calls, <code>info</code>, and the playground treat them like authored tools. Authored tools with the same name win, with a warning, and like all server tools they run on the local runtime.</p><p><code>builtinTools: { reminders: true }</code> adds three tools bound to the current conversation over <code>host.reminders</code>: <code>reminders_create</code>, <code>reminders_list</code>, and <code>reminders_cancel</code>. Sessions without a continuation key can't arm reminders. See <a href="./schedules.html#reminders">Schedules and reminders</a>.</p><h2 id="serve-programmatically" tabindex="-1">Serve programmatically <a class="header-anchor" href="#serve-programmatically" aria-label="Permalink to "Serve programmatically""></a></h2><p><code>serve(dirOrProject, options)</code> embeds the server in your own process:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { serve } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
29
|
+
<span class="line"></span>
|
|
30
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> handle</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> serve</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"./my-agent"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, {</span></span>
|
|
31
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> port: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3000</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
32
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> apiKey: process.env.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">CURSOR_API_KEY</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
33
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span>
|
|
34
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">console.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">log</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`listening on \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">handle</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
|
|
35
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// handle.callTool(...), handle.dispatchSchedule("heartbeat"),</span></span>
|
|
36
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// handle.createReminder(...), handle.project, await handle.close()</span></span></code></pre></div><p>Host settings match the documented <a href="./cli.html">CLI</a> <code>serve</code> flags. <code>serve()</code> also accepts <code>discovery</code> (project-loading options) and <code>mode: "single" | "multi"</code>. Pass <code>apiKey</code> or use the same Cursor credential as the CLI: <code>CURSOR_API_KEY</code>, <code>CURSOR_API_KEY_FILE</code>, <code>CURSOR_SERVICE_ACCOUNT_KEY</code>, or <code>agent-sdk login</code>.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./instructions.html">Instructions</a>: the required half of a minimal agent</li><li><a href="./cli.html">CLI</a>: the <code>serve</code> flags <code>serve()</code> accepts</li><li><a href="./sessions.html">Sessions</a>: workspaces, identifiers, and turn admission</li><li><a href="./schedules.html">Schedules</a>: reminder tools opted in here</li></ul>`,44)])])}const u=e(o,[["render",n]]);export{k as __pageData,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as
|
|
1
|
+
import{_ as e,c as a,o as t,a3 as i}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Agent config","description":"defineAgent at agent/agent.ts: the model, the local and cloud runtimes, and serving programmatically.","frontmatter":{"title":"Agent config","description":"defineAgent at agent/agent.ts: the model, the local and cloud runtimes, and serving programmatically."},"headers":[],"relativePath":"reference/agent-config.md","filePath":"reference/agent-config.md"}'),o={name:"reference/agent-config.md"};function n(l,s,d,r,h,c){return t(),a("div",null,[...s[0]||(s[0]=[i("",44)])])}const u=e(o,[["render",n]]);export{k as __pageData,u as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{_ as e,c as a,o as s,a3 as i}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Artifacts","description":"Declare, tag, list, stream, and download durable agent outputs.","frontmatter":{"title":"Artifacts","description":"Declare, tag, list, stream, and download durable agent outputs."},"headers":[],"relativePath":"reference/artifacts.md","filePath":"reference/artifacts.md"}'),d={name:"reference/artifacts.md"};function o(n,t,r,c,l,h){return s(),a("div",null,[...t[0]||(t[0]=[i(`<h1 id="artifacts" tabindex="-1">Artifacts <a class="header-anchor" href="#artifacts" aria-label="Permalink to "Artifacts""></a></h1><p>Artifacts are durable outputs such as reviewed pull requests, reports, or decision records. An artifact kind defines the data it accepts, and the artifacts API tags or updates records by key. Records persist across sessions and can be listed, streamed, or downloaded.</p><h2 id="artifact-kinds" tabindex="-1">Artifact kinds <a class="header-anchor" href="#artifact-kinds" aria-label="Permalink to "Artifact kinds""></a></h2><p>Author <code>agent/artifacts.ts</code> with <code>defineArtifacts</code> from <code>@cursor/july/artifacts</code>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { z } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "zod"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { defineArtifacts } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "@cursor/july/artifacts"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
|
3
|
+
<span class="line"></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> defineArtifacts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> kinds: {</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "reviewed-pr"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> description: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"A pull request this agent reviewed."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> schema: z.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">object</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({ url: z.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(), verdict: z.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() }),</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> report: { description: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"A generated report."</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> agentTool: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Option</th><th>Contract</th></tr></thead><tbody><tr><td><code>kinds</code></td><td>Map of accepted kind names to a non-empty <code>description</code> and optional Zod <code>schema</code></td></tr><tr><td><code>agentTool</code></td><td>Expose <code>tag_artifact</code> to the model; requires at least one declared kind</td></tr><tr><td><code>max</code></td><td>Positive retention cap; defaults to <code>1000</code> and evicts the oldest-updated record</td></tr></tbody></table><p>With declared kinds, <code>tag</code> rejects any other kind. With no registry, it accepts free-form kind names and defaults an omitted kind to <code>"artifact"</code>. A kind's schema validates <code>data</code>, and the parsed value is stored, including schema defaults and coercions.</p><h2 id="tag-artifacts-from-host-code" tabindex="-1">Tag artifacts from host code <a class="header-anchor" href="#tag-artifacts-from-host-code" aria-label="Permalink to "Tag artifacts from host code""></a></h2><p>Tools, hooks, channel handlers, channel <code>onStart</code>, schedules, and reminders receive an <code>ArtifactsApi</code> with <code>tag</code> and <code>list</code>.</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ctx.artifacts.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">tag</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">({</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> kind: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"reviewed-pr"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> key: prUrl,</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> title: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">\`Reviewed \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">prUrl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}\`</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> data: { url: prUrl, verdict: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"approve"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">});</span></span></code></pre></div><table tabindex="0"><thead><tr><th>Tag field</th><th>Contract</th></tr></thead><tbody><tr><td><code>data</code></td><td>Required JSON data, validated when the kind has a schema</td></tr><tr><td><code>kind</code></td><td>Declared or free-form kind</td></tr><tr><td><code>key</code></td><td>Agent-wide upsert key; the same key updates one record across kinds</td></tr><tr><td><code>title</code></td><td>Optional display title</td></tr><tr><td><code>contents</code></td><td>String or bytes served by the content route</td></tr><tr><td><code>contentType</code></td><td>MIME type for <code>contents</code></td></tr><tr><td><code>sessionId</code>, <code>turnId</code></td><td>Attribute the artifact to a session or turn</td></tr><tr><td><code>source</code></td><td><code>"host"</code> or <code>"model"</code>; defaults to <code>"host"</code></td></tr></tbody></table><p>Tool, hook, result, and channel-event contexts are session-bound, so they fill <code>sessionId</code> and the current <code>turnId</code>. Channel routes, <code>onStart</code>, schedules, and reminders receive an unbound facade; pass <code>sessionId</code> to attribute an artifact.</p><p>Re-tagging a key without <code>contents</code> keeps its file or blob when the <code>sessionId</code> stays the same. Rebinding the key to another session without new contents removes the previous payload. <code>tag</code> returns the stored <code>ArtifactRecord</code>.</p><table tabindex="0"><thead><tr><th>Record field</th><th>Contract</th></tr></thead><tbody><tr><td><code>id</code></td><td>Stable ID derived from <code>key</code>, or a generated ID when no key is set</td></tr><tr><td><code>kind</code>, <code>data</code></td><td>Validated kind and JSON payload</td></tr><tr><td><code>key</code>, <code>title</code></td><td>Optional upsert key and display title</td></tr><tr><td><code>content</code></td><td>Optional <code>{ size, contentType? }</code> metadata</td></tr><tr><td><code>sessionId</code>, <code>turnId</code></td><td>Optional session attribution</td></tr><tr><td><code>source</code></td><td><code>"host"</code> or <code>"model"</code></td></tr><tr><td><code>createdAt</code>, <code>updatedAt</code></td><td>ISO-8601 timestamps</td></tr></tbody></table><h2 id="expose-tag-artifact-to-the-model" tabindex="-1">Expose <code>tag_artifact</code> to the model <a class="header-anchor" href="#expose-tag-artifact-to-the-model" aria-label="Permalink to "Expose \`tag_artifact\` to the model""></a></h2><p>With <code>agentTool: true</code>, the <code>tag_artifact</code> server tool materializes from the kinds registry. Its input accepts the declared kinds and validates their data with the same schemas as host-side tagging. The kind descriptions tell the model which output each one represents.</p><p>An authored tool named <code>tag_artifact</code> takes precedence over the generated tool.</p><h2 id="list-artifacts" tabindex="-1">List artifacts <a class="header-anchor" href="#list-artifacts" aria-label="Permalink to "List artifacts""></a></h2><p><code>list({ kind?, sessionId? })</code> returns matching records newest-updated first. HTTP callers can list records and download content through the <a href="./http-api.html#list-and-download-artifacts">artifact routes</a>.</p><h2 id="stream-artifact-tags" tabindex="-1">Stream artifact tags <a class="header-anchor" href="#stream-artifact-tags" aria-label="Permalink to "Stream artifact tags""></a></h2><p>Tagging an artifact with a <code>sessionId</code> emits <code>artifact.tagged</code> on that session. Its event data contains <code>id</code>, <code>kind</code>, <code>key</code>, <code>title</code>, <code>data</code>, and <code>source</code>. See <a href="./sessions.html#stream-events">Stream events</a> for the event envelope.</p><h2 id="related" tabindex="-1">Related <a class="header-anchor" href="#related" aria-label="Permalink to "Related""></a></h2><ul><li><a href="./sessions.html">Sessions</a></li><li><a href="./tools.html">Tools</a></li><li><a href="./evals.html">Evals</a></li><li><a href="./http-api.html">HTTP API</a></li></ul>`,23)])])}const E=e(d,[["render",o]]);export{k as __pageData,E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,c as a,o as s,a3 as i}from"./chunks/framework.BNw1pucY.js";const k=JSON.parse('{"title":"Artifacts","description":"Declare, tag, list, stream, and download durable agent outputs.","frontmatter":{"title":"Artifacts","description":"Declare, tag, list, stream, and download durable agent outputs."},"headers":[],"relativePath":"reference/artifacts.md","filePath":"reference/artifacts.md"}'),d={name:"reference/artifacts.md"};function o(n,t,r,c,l,h){return s(),a("div",null,[...t[0]||(t[0]=[i("",23)])])}const E=e(d,[["render",o]]);export{k as __pageData,E as default};
|