@cursor/bdk 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/dist/bin/agent-serve.js +32 -8
- package/dist/channels/github/auth.d.ts.map +1 -1
- package/dist/channels/github/auth.js +36 -5
- package/dist/channels/slack/attachments.d.ts +2 -1
- package/dist/channels/slack/attachments.d.ts.map +1 -1
- package/dist/channels/slack/attachments.js +19 -9
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +26 -24
- package/dist/channels/slack/thread-context.d.ts +21 -11
- package/dist/channels/slack/thread-context.d.ts.map +1 -1
- package/dist/channels/slack/thread-context.js +75 -27
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.DtYVVVyK.js → app.4kQ8Db_q.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.CvuAJ0My.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.D47xT7J4.js → VPLocalSearchBox.DY1RwB8Q.js} +1 -1
- package/dist/docs/assets/chunks/{arc.CDJ6xzxR.js → arc.CxE_fSPK.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.l1Xnjd3N.js → architectureDiagram-Q4EWVU46.CPX426ui.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.x-finShZ.js → baseUniq.CB52JrKG.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.COC3qynH.js → blockDiagram-DXYQGD6D.J0cNaQCL.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.DdQO850E.js → c4Diagram-AHTNJAMY.DJn3vEGT.js} +1 -1
- package/dist/docs/assets/chunks/channel.BoNycAoN.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.Dpn8omLk.js → chunk-4BX2VUAB.Dao618F6.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.C0XWStUN.js → chunk-4TB4RGXK.QW8Rhjai.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.DsKSZfIM.js → chunk-55IACEB6.DfRLLKF_.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.dNU6JDu6.js → chunk-EDXVE4YY.CIV2ApKQ.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DN41fxKE.js → chunk-FMBD7UC4.BEheSuxp.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.COpKCZus.js → chunk-OYMX7WX6.CUN88ENB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.HDB-azx2.js → chunk-QZHKN3VN.CgqCs8b_.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.DEeX_a2j.js → chunk-YZCP3GAM.iCH0nnTJ.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.C4x07Gkj.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.C4x07Gkj.js +1 -0
- package/dist/docs/assets/chunks/clone.Db22cH_-.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.C3yGL2A8.js → cose-bilkent-S5V4N54A.BLcUxhWE.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.Bpl24en4.js → dagre-KV5264BT.Ep7LofOm.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.nFco6seU.js → diagram-5BDNPKRD.Bzf4GSQ4.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.DXhA6DWR.js → diagram-G4DWMVQ6.DD6Jh-eM.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.8GoOYcwk.js → diagram-MMDJMWI5.oOIl8bWd.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.DDBlqvlJ.js → diagram-TYMM5635.DHs85Ade.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.vl_N81P4.js → erDiagram-SMLLAGMA.BIb5ghCk.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.Cteg8g7I.js → flowDiagram-DWJPFMVM.DV4paY9k.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.D4aMhlMM.js → ganttDiagram-T4ZO3ILL.AyEKA6_v.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.DF_J0D4q.js → gitGraphDiagram-UUTBAWPF.BltiCDFo.js} +1 -1
- package/dist/docs/assets/chunks/{graph.DJs0LDCf.js → graph.DzuEYGdC.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Bb-4RQwg.js → infoDiagram-42DDH7IO.BV2l981J.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.DEtQRSbc.js → ishikawaDiagram-UXIWVN3A.BA4Izf-m.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.DhQQ75FA.js → journeyDiagram-VCZTEJTY.DjaFbFS3.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.C4gEw3Rk.js → kanban-definition-6JOO6SKY.CfTFieDs.js} +1 -1
- package/dist/docs/assets/chunks/{layout.DT-PGlXa.js → layout.DzfWqTBV.js} +1 -1
- package/dist/docs/assets/chunks/{linear.BMMe__JW.js → linear.BO6mpulV.js} +1 -1
- package/dist/docs/assets/chunks/{min.XyaU9K9Q.js → min.BGgTadgT.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.CbBM6xZ-.js → mindmap-definition-QFDTVHPH.DPuIXVWY.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.DFJoIVou.js → pieDiagram-DEJITSTG.BOnl3bBg.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CQjkDYqb.js → quadrantDiagram-34T5L4WZ.DNB6Ckdc.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.D-mK-JQu.js → requirementDiagram-MS252O5E.D5-Qo7vb.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.BStQInpd.js → sankeyDiagram-XADWPNL6.8t65cesf.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.CA_eooPJ.js → sequenceDiagram-FGHM5R23.CaG07BdS.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BXl-b7ad.js → stateDiagram-FHFEXIEX.TKOweTB6.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CuqmyQc4.js +1 -0
- package/dist/docs/assets/chunks/{theme.q37tOs4x.js → theme.Dx-JhpTB.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.vjuaGOSe.js → timeline-definition-GMOUNBTQ.fE53zQ2s.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BxduJl-F.js → vennDiagram-DHZGUBPP.DJsZZaJg.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.844kyrjl.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.D1z3ds0D.js → wardleyDiagram-NUSXRM2D.CMZ-Ru_t.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CRU5Ti9b.js → xychartDiagram-5P7HB3ND.XXrhBc7a.js} +1 -1
- package/dist/docs/assets/{deployment.md.nGo1yIsa.js → deployment.md.UhnJIMr-.js} +6 -9
- package/dist/docs/assets/{deployment.md.nGo1yIsa.lean.js → deployment.md.UhnJIMr-.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.js → guides_github.md.Bq9kQU9B.js} +9 -3
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.lean.js → guides_github.md.Bq9kQU9B.lean.js} +1 -1
- package/dist/docs/assets/{guides_jev.md.BNDm14Gy.js → guides_jev.md.CRcgmjDb.js} +2 -2
- package/dist/docs/assets/{guides_jev.md.BNDm14Gy.lean.js → guides_jev.md.CRcgmjDb.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.js → guides_slack.md.diqqXTTm.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.lean.js → guides_slack.md.diqqXTTm.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.wG4shE1f.js → quickstart.md.CHpHPBUN.js} +5 -3
- package/dist/docs/assets/{quickstart.md.wG4shE1f.lean.js → quickstart.md.CHpHPBUN.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.DzGI777n.js → reference_agent-config.md.Cj5uBKp4.js} +1 -1
- package/dist/docs/assets/{reference_artifacts.md.CFMNPreZ.js → reference_artifacts.md.CQfKq8F2.js} +1 -1
- package/dist/docs/assets/reference_cli.md.DgeLTO18.js +91 -0
- package/dist/docs/assets/reference_cli.md.DgeLTO18.lean.js +1 -0
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.js → reference_connections.md.COq--gAm.js} +7 -3
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.lean.js → reference_connections.md.COq--gAm.lean.js} +1 -1
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.js → reference_evals.md.CJm3uCUm.js} +4 -4
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.lean.js → reference_evals.md.CJm3uCUm.lean.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.CPPrkWlJ.js → reference_extensions.md.pa2tN-e4.js} +4 -3
- package/dist/docs/assets/{reference_extensions.md.CPPrkWlJ.lean.js → reference_extensions.md.pa2tN-e4.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.CRFTxt9M.js → reference_skills.md.Cy00QMKS.js} +3 -3
- package/dist/docs/assets/{reference_skills.md.CRFTxt9M.lean.js → reference_skills.md.Cy00QMKS.lean.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Cw5PKa3t.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.BzZSu1Gz.lean.js → troubleshooting.md.Cw5PKa3t.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +41 -44
- package/dist/docs/deployment.md +49 -16
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +43 -37
- package/dist/docs/guides/github.md +34 -0
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +37 -37
- package/dist/docs/guides/jev.md +7 -0
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +5 -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 +223 -94
- package/dist/docs/quickstart.html +40 -38
- package/dist/docs/quickstart.md +7 -1
- package/dist/docs/reference/agent-config.html +37 -37
- package/dist/docs/reference/agent-config.md +1 -1
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/artifacts.md +1 -1
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +55 -61
- package/dist/docs/reference/cli.md +65 -63
- package/dist/docs/reference/connections.html +42 -38
- package/dist/docs/reference/connections.md +28 -2
- package/dist/docs/reference/evals.html +39 -39
- package/dist/docs/reference/evals.md +6 -7
- package/dist/docs/reference/extensions.html +39 -38
- package/dist/docs/reference/extensions.md +13 -0
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +38 -38
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.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 +7 -3
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +63 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +158 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +59 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +206 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +25 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +37 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +32 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +34 -0
- package/dist/extensions/jev/extension.d.ts +3 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -1
- package/dist/extensions/jev/extension.js +10 -1
- package/dist/extensions/jev/lib/evaluate.d.ts +4 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -1
- package/dist/extensions/jev/lib/evaluate.js +6 -2
- package/dist/extensions.d.ts +4 -2
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +5 -2
- package/dist/internal/cli-ax.d.ts +1 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +43 -10
- package/dist/internal/cli-deploy.d.ts +5 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +41 -9
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +2 -1
- package/dist/internal/cli-skills.d.ts +1 -1
- package/dist/internal/cli-skills.d.ts.map +1 -1
- package/dist/internal/cli-skills.js +5 -5
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +84 -0
- package/dist/internal/cursor/backend-client.js +5 -0
- package/dist/internal/deploy-client.d.ts +30 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +45 -9
- package/dist/internal/discovery/agent-config.d.ts +6 -5
- package/dist/internal/discovery/agent-config.d.ts.map +1 -1
- package/dist/internal/discovery/agent-config.js +29 -28
- package/dist/internal/discovery/agent.js +1 -1
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +11 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +12 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +36 -11
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +31 -8
- package/dist/internal/hosted-delivery.d.ts +2 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +228 -48
- package/dist/internal/hosting.d.ts +10 -2
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +33 -3
- package/dist/internal/install-cursor-skills.d.ts +20 -24
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +50 -48
- package/dist/internal/legacy-command-guard.d.ts +2 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -1
- package/dist/internal/legacy-command-guard.js +10 -1
- package/dist/internal/mcp-host.d.ts +6 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +35 -16
- package/dist/internal/sdk-runner.d.ts +2 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +10 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +9 -5
- package/dist/types.d.ts +29 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/deployment.md +49 -16
- package/docs/guides/github.md +34 -0
- package/docs/guides/jev.md +7 -0
- package/docs/guides/slack.md +5 -0
- package/docs/quickstart.md +7 -1
- package/docs/reference/agent-config.md +1 -1
- package/docs/reference/artifacts.md +1 -1
- package/docs/reference/cli.md +65 -63
- package/docs/reference/connections.md +28 -2
- package/docs/reference/evals.md +6 -7
- package/docs/reference/extensions.md +13 -0
- package/docs/troubleshooting.md +7 -3
- package/package.json +1 -11
- package/scripts/install-cursor-skills.mjs +1 -1
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/deploy/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +1 -1
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/templates/agents-md/bot/lib/collect.ts +1 -4
- package/templates/code-wiki/bot/channels/github.ts +2 -2
- package/templates/demo/bot/channels/github.ts +5 -1
- package/templates/pr-autofixer/bot/lib/start-drive.ts +4 -4
- package/templates/triage/bot/lib/types.ts +6 -6
- package/dist/docs/assets/chunks/@localSearchIndexroot.BgTA2tV1.js +0 -1
- package/dist/docs/assets/chunks/channel.B2nMEx82.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.D8iCH2ve.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.D8iCH2ve.js +0 -1
- package/dist/docs/assets/chunks/clone.5XNLjby0.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.yGM2uLZQ.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.DKfyIejL.js +0 -162
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +0 -97
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +0 -1
- package/src/artifacts.ts +0 -68
- package/src/bin/agent-serve.ts +0 -1833
- package/src/channels/bitbucket/api.ts +0 -891
- package/src/channels/bitbucket/binding.ts +0 -417
- package/src/channels/bitbucket/bitbucket-channel.ts +0 -162
- package/src/channels/bitbucket/bitbucket-webhook.ts +0 -519
- package/src/channels/bitbucket/checks.ts +0 -146
- package/src/channels/bitbucket/cursor-account.ts +0 -106
- package/src/channels/bitbucket/defaults.ts +0 -100
- package/src/channels/bitbucket/events.ts +0 -74
- package/src/channels/bitbucket/index.ts +0 -51
- package/src/channels/bitbucket/replay.ts +0 -421
- package/src/channels/bitbucket/state.ts +0 -59
- package/src/channels/bitbucket/types.ts +0 -261
- package/src/channels/change-monitors/change-monitors-channel.ts +0 -63
- package/src/channels/change-monitors/index.ts +0 -8
- package/src/channels/change-monitors/types.ts +0 -42
- package/src/channels/checks.ts +0 -185
- package/src/channels/deployments/deployments-channel.ts +0 -224
- package/src/channels/deployments/index.ts +0 -25
- package/src/channels/deployments/types.ts +0 -92
- package/src/channels/github/api.ts +0 -526
- package/src/channels/github/auth.ts +0 -254
- package/src/channels/github/binding.ts +0 -233
- package/src/channels/github/checks.ts +0 -145
- package/src/channels/github/cursor-account.ts +0 -303
- package/src/channels/github/defaults.ts +0 -168
- package/src/channels/github/events.ts +0 -67
- package/src/channels/github/forward.ts +0 -359
- package/src/channels/github/github-channel.ts +0 -2334
- package/src/channels/github/index.ts +0 -54
- package/src/channels/github/progress.ts +0 -365
- package/src/channels/github/replay.ts +0 -372
- package/src/channels/github/state.ts +0 -124
- package/src/channels/github/types.ts +0 -590
- package/src/channels/gitlab/api.ts +0 -329
- package/src/channels/gitlab/binding.ts +0 -231
- package/src/channels/gitlab/checks.ts +0 -228
- package/src/channels/gitlab/cursor-account.ts +0 -105
- package/src/channels/gitlab/defaults.ts +0 -80
- package/src/channels/gitlab/events.ts +0 -37
- package/src/channels/gitlab/gitlab-channel.ts +0 -160
- package/src/channels/gitlab/gitlab-webhook.ts +0 -509
- package/src/channels/gitlab/index.ts +0 -44
- package/src/channels/gitlab/replay.ts +0 -328
- package/src/channels/gitlab/state.ts +0 -55
- package/src/channels/gitlab/types.ts +0 -247
- package/src/channels/issues/index.ts +0 -9
- package/src/channels/issues/issues-channel.ts +0 -45
- package/src/channels/issues/types.ts +0 -38
- package/src/channels/origin/api.ts +0 -507
- package/src/channels/origin/binding.ts +0 -114
- package/src/channels/origin/checks.ts +0 -250
- package/src/channels/origin/cursor-account.ts +0 -58
- package/src/channels/origin/defaults.ts +0 -140
- package/src/channels/origin/events.ts +0 -35
- package/src/channels/origin/index.ts +0 -35
- package/src/channels/origin/origin-channel.ts +0 -815
- package/src/channels/origin/origin-webhook.ts +0 -296
- package/src/channels/origin/reactions.ts +0 -72
- package/src/channels/origin/state.ts +0 -54
- package/src/channels/origin/types.ts +0 -295
- package/src/channels/slack/agentic-delivery.ts +0 -634
- package/src/channels/slack/agentic-posted.ts +0 -135
- package/src/channels/slack/agentic-signals.ts +0 -231
- package/src/channels/slack/api.ts +0 -761
- package/src/channels/slack/approvals.ts +0 -279
- package/src/channels/slack/assistant.ts +0 -76
- package/src/channels/slack/attachments.ts +0 -596
- package/src/channels/slack/auth.ts +0 -127
- package/src/channels/slack/blocks.ts +0 -131
- package/src/channels/slack/bot-mentions.ts +0 -318
- package/src/channels/slack/channel-watch.ts +0 -314
- package/src/channels/slack/cli-project.ts +0 -249
- package/src/channels/slack/code-fences.ts +0 -171
- package/src/channels/slack/constants.ts +0 -38
- package/src/channels/slack/credentials.ts +0 -88
- package/src/channels/slack/defaults.ts +0 -714
- package/src/channels/slack/dispatch.ts +0 -1060
- package/src/channels/slack/doctor.ts +0 -338
- package/src/channels/slack/eval-directive.ts +0 -306
- package/src/channels/slack/event-id-dedupe.ts +0 -30
- package/src/channels/slack/external-policy.ts +0 -75
- package/src/channels/slack/footer.ts +0 -106
- package/src/channels/slack/inbound.ts +0 -416
- package/src/channels/slack/index.ts +0 -53
- package/src/channels/slack/init.ts +0 -169
- package/src/channels/slack/interactive.ts +0 -406
- package/src/channels/slack/links.ts +0 -23
- package/src/channels/slack/live-delivery.ts +0 -489
- package/src/channels/slack/log.ts +0 -70
- package/src/channels/slack/manifest.ts +0 -240
- package/src/channels/slack/message-body.ts +0 -82
- package/src/channels/slack/nudge-carrier.ts +0 -224
- package/src/channels/slack/nudge-store.ts +0 -334
- package/src/channels/slack/paint-start.ts +0 -93
- package/src/channels/slack/placeholder.ts +0 -358
- package/src/channels/slack/pr-ref.ts +0 -74
- package/src/channels/slack/progress-delivery.ts +0 -138
- package/src/channels/slack/reasoning-card.ts +0 -125
- package/src/channels/slack/reasoning-chip.ts +0 -41
- package/src/channels/slack/recording-sink.ts +0 -167
- package/src/channels/slack/redact.ts +0 -6
- package/src/channels/slack/reply-options.ts +0 -279
- package/src/channels/slack/setup.ts +0 -125
- package/src/channels/slack/slack-channel.ts +0 -744
- package/src/channels/slack/socket-mode.ts +0 -140
- package/src/channels/slack/stop.ts +0 -25
- package/src/channels/slack/stream.ts +0 -66
- package/src/channels/slack/thread-context.ts +0 -485
- package/src/channels/slack/tool-approval-events.ts +0 -233
- package/src/channels/slack/tool-cards.ts +0 -198
- package/src/channels/slack/tool-chip.ts +0 -34
- package/src/channels/slack/types.ts +0 -787
- package/src/channels/slack/upload.ts +0 -137
- package/src/channels.ts +0 -543
- package/src/connections.ts +0 -153
- package/src/dashboard-session-url.ts +0 -30
- package/src/evals/assertions.ts +0 -688
- package/src/evals/expect.ts +0 -250
- package/src/evals/judge.ts +0 -329
- package/src/evals/loaders.ts +0 -111
- package/src/evals/matchers.ts +0 -223
- package/src/evals/reporters.ts +0 -257
- package/src/evals/results.ts +0 -130
- package/src/evals/run-facts.ts +0 -306
- package/src/evals.ts +0 -709
- package/src/extensions/cursor-cloud-agents/extension.ts +0 -131
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +0 -386
- package/src/extensions/cursor-cloud-agents/lib/channels.ts +0 -11
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +0 -98
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +0 -5
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +0 -80
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +0 -19
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +0 -37
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +0 -21
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +0 -47
- package/src/extensions/cursor-cloud-agents/tools/get.ts +0 -18
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +0 -62
- package/src/extensions/cursor-cloud-agents/tools/list.ts +0 -31
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +0 -36
- package/src/extensions/improve/extension.ts +0 -69
- package/src/extensions/improve/skills/yourself.ts +0 -50
- package/src/extensions/jev/extension.ts +0 -95
- package/src/extensions/jev/lib/evaluate.ts +0 -266
- package/src/extensions/jev/skills/gated-write.md +0 -25
- package/src/extensions/jev/skills/questions.md +0 -33
- package/src/extensions/jev/tools/evaluate.ts +0 -82
- package/src/extensions/slack-communication/evals/harness.ts +0 -705
- package/src/extensions/slack-communication/evals/slack-communication.eval.ts +0 -830
- package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +0 -172
- package/src/extensions/slack-communication/extension.ts +0 -44
- package/src/extensions/slack-communication/skills/slack-voice.ts +0 -56
- package/src/extensions/slack-communication/tools/delete-message.ts +0 -33
- package/src/extensions/slack-communication/tools/edit-message.ts +0 -42
- package/src/extensions/slack-communication/tools/post-card.ts +0 -28
- package/src/extensions/slack-communication/tools/post-file.ts +0 -82
- package/src/extensions/slack-communication/tools/post-update.ts +0 -40
- package/src/extensions/slack-communication/tools/react.ts +0 -30
- package/src/extensions/slack-communication/tools/set-status.ts +0 -21
- package/src/extensions.ts +0 -179
- package/src/files-backends/agent-store-presigned-url.ts +0 -11
- package/src/files-backends/cursor-hosted.ts +0 -1212
- package/src/files-backends/local-fs.ts +0 -163
- package/src/files.ts +0 -293
- package/src/filesystem.ts +0 -2005
- package/src/hooks.ts +0 -30
- package/src/index.ts +0 -259
- package/src/internal/advertise-tools.ts +0 -370
- package/src/internal/approval-gate.ts +0 -103
- package/src/internal/artifacts-store.ts +0 -836
- package/src/internal/as-of.ts +0 -257
- package/src/internal/auth.ts +0 -46
- package/src/internal/authored-alias-hooks.ts +0 -138
- package/src/internal/authored-loaders.ts +0 -188
- package/src/internal/bounded-int.ts +0 -24
- package/src/internal/bounded.ts +0 -25
- package/src/internal/brand.ts +0 -28
- package/src/internal/browser-origin-guard.ts +0 -67
- package/src/internal/builtin-tools/artifacts.ts +0 -62
- package/src/internal/builtin-tools/index.ts +0 -53
- package/src/internal/builtin-tools/reminders.ts +0 -145
- package/src/internal/channel-dispatch.ts +0 -129
- package/src/internal/channel-route-dispatch.ts +0 -58
- package/src/internal/channel-state.ts +0 -83
- package/src/internal/chat-client.ts +0 -594
- package/src/internal/cli-ax.ts +0 -2273
- package/src/internal/cli-bitbucket.ts +0 -438
- package/src/internal/cli-convert-automation.ts +0 -335
- package/src/internal/cli-cursor.ts +0 -282
- package/src/internal/cli-deploy.ts +0 -2486
- package/src/internal/cli-docs.ts +0 -192
- package/src/internal/cli-github.ts +0 -806
- package/src/internal/cli-gitlab.ts +0 -452
- package/src/internal/cli-images.ts +0 -672
- package/src/internal/cli-manifest.ts +0 -56
- package/src/internal/cli-mcp-oauth.ts +0 -395
- package/src/internal/cli-mcp.ts +0 -808
- package/src/internal/cli-skills.ts +0 -99
- package/src/internal/cli-slack-manual.ts +0 -418
- package/src/internal/cli-slack.ts +0 -874
- package/src/internal/cloud-merge.ts +0 -51
- package/src/internal/cloud-turn-cost.ts +0 -159
- package/src/internal/continuation-channel.ts +0 -233
- package/src/internal/continuation-identity.ts +0 -935
- package/src/internal/conversation-mirror.ts +0 -423
- package/src/internal/convert-automation/convert-workflow.ts +0 -1377
- package/src/internal/convert-automation/slug.ts +0 -29
- package/src/internal/convert-automation/types.ts +0 -212
- package/src/internal/cron.ts +0 -76
- package/src/internal/cursor/account-mcp.ts +0 -692
- package/src/internal/cursor/backend-client.ts +0 -978
- package/src/internal/cursor/bound-secret-file.ts +0 -101
- package/src/internal/cursor/credentials.ts +0 -560
- package/src/internal/cursor/cursor-api-transport.ts +0 -65
- package/src/internal/cursor/github-credentials.ts +0 -228
- package/src/internal/cursor/hosted-bound-secrets.ts +0 -71
- package/src/internal/cursor/hosted-deployment-secrets.ts +0 -100
- package/src/internal/cursor/hosted-store-secrets.ts +0 -152
- package/src/internal/cursor/session-token.ts +0 -111
- package/src/internal/cursor/store-api-client.ts +0 -323
- package/src/internal/cursor-account-mcp-auth.ts +0 -303
- package/src/internal/cursor-agent-template.ts +0 -50
- package/src/internal/cursor-deployment-relay.ts +0 -315
- package/src/internal/cursor-event-relay.ts +0 -675
- package/src/internal/cursor-relay-core.ts +0 -563
- package/src/internal/deferred-channel-session.ts +0 -61
- package/src/internal/deploy-client.ts +0 -1504
- package/src/internal/deploy-manifest.ts +0 -361
- package/src/internal/deploy-source.ts +0 -144
- package/src/internal/describe-error.ts +0 -32
- package/src/internal/dev-mode.ts +0 -20
- package/src/internal/discovery/agent-config.ts +0 -288
- package/src/internal/discovery/agent.ts +0 -381
- package/src/internal/discovery/channels.ts +0 -100
- package/src/internal/discovery/connections.ts +0 -505
- package/src/internal/discovery/context.ts +0 -38
- package/src/internal/discovery/cursor-plugin.ts +0 -628
- package/src/internal/discovery/extension-overlay.ts +0 -247
- package/src/internal/discovery/extensions.ts +0 -490
- package/src/internal/discovery/fs.ts +0 -103
- package/src/internal/discovery/hooks.ts +0 -63
- package/src/internal/discovery/info.ts +0 -174
- package/src/internal/discovery/instructions.ts +0 -98
- package/src/internal/discovery/modules.ts +0 -107
- package/src/internal/discovery/names.ts +0 -45
- package/src/internal/discovery/project.ts +0 -319
- package/src/internal/discovery/reminders.ts +0 -65
- package/src/internal/discovery/runtime.ts +0 -158
- package/src/internal/discovery/schedules.ts +0 -120
- package/src/internal/discovery/seed-files.ts +0 -34
- package/src/internal/discovery/services.ts +0 -151
- package/src/internal/discovery/skills.ts +0 -174
- package/src/internal/discovery/subagent.ts +0 -138
- package/src/internal/discovery/tools.ts +0 -170
- package/src/internal/discovery.ts +0 -27
- package/src/internal/distribution.ts +0 -126
- package/src/internal/docs-site.ts +0 -248
- package/src/internal/duration.ts +0 -37
- package/src/internal/env-file.ts +0 -83
- package/src/internal/eval-judge-model.ts +0 -142
- package/src/internal/eval-run-store.ts +0 -585
- package/src/internal/eval-runner.ts +0 -823
- package/src/internal/evals-client.ts +0 -475
- package/src/internal/event-log.ts +0 -342
- package/src/internal/event-mapper.ts +0 -811
- package/src/internal/expected-delivery-failure.ts +0 -34
- package/src/internal/factory-resource-channel.ts +0 -103
- package/src/internal/filesystem/errors.ts +0 -207
- package/src/internal/filesystem/format.ts +0 -253
- package/src/internal/filesystem/merge.ts +0 -192
- package/src/internal/filesystem/nearest.ts +0 -112
- package/src/internal/filesystem/scratch.ts +0 -239
- package/src/internal/filesystem/sdk-schemas.ts +0 -204
- package/src/internal/filesystem/tools.ts +0 -804
- package/src/internal/filesystem/walk.ts +0 -366
- package/src/internal/fixtures/units-server.ts +0 -52
- package/src/internal/framework-file-storage.ts +0 -357
- package/src/internal/framework-storage-selection.ts +0 -156
- package/src/internal/frontmatter.ts +0 -108
- package/src/internal/github-fanout.ts +0 -144
- package/src/internal/guest-network.ts +0 -391
- package/src/internal/handleAgentServeTrigger.ts +0 -286
- package/src/internal/host-files.ts +0 -341
- package/src/internal/host-kv.ts +0 -81
- package/src/internal/host-otel.ts +0 -231
- package/src/internal/host-platforms.ts +0 -170
- package/src/internal/hosted-admission-adapter.ts +0 -47
- package/src/internal/hosted-admission-context.ts +0 -37
- package/src/internal/hosted-catch-protocol.ts +0 -112
- package/src/internal/hosted-catch.ts +0 -179
- package/src/internal/hosted-delivery-protocol.ts +0 -787
- package/src/internal/hosted-delivery.ts +0 -1152
- package/src/internal/hosted-execution-diag.ts +0 -291
- package/src/internal/hosted-execution-flush.ts +0 -136
- package/src/internal/hosted-execution-latency.ts +0 -301
- package/src/internal/hosted-managed-automation.ts +0 -116
- package/src/internal/hosting.ts +0 -107
- package/src/internal/http-channel-define.ts +0 -25
- package/src/internal/http-channel.ts +0 -669
- package/src/internal/http-control-plane-session.ts +0 -110
- package/src/internal/ids.ts +0 -39
- package/src/internal/incoming-headers-to-fetch.ts +0 -45
- package/src/internal/init-interview.ts +0 -360
- package/src/internal/init-project.ts +0 -711
- package/src/internal/init-scaffold.ts +0 -182
- package/src/internal/inline-stdio-define-stub.ts +0 -4
- package/src/internal/inline-stdio-mcp.ts +0 -230
- package/src/internal/install-cursor-skills.ts +0 -601
- package/src/internal/is-record.ts +0 -3
- package/src/internal/json-schema.ts +0 -95
- package/src/internal/legacy-command-guard.ts +0 -54
- package/src/internal/listen-port.ts +0 -85
- package/src/internal/local-control-plane.ts +0 -442
- package/src/internal/local-env.ts +0 -59
- package/src/internal/local-ingress.ts +0 -90
- package/src/internal/log-ring.ts +0 -59
- package/src/internal/logs-client.ts +0 -477
- package/src/internal/map-pool.ts +0 -39
- package/src/internal/mcp-endpoint.ts +0 -747
- package/src/internal/mcp-host.ts +0 -481
- package/src/internal/mcp-oauth-on-demand.ts +0 -337
- package/src/internal/mcp-oauth-persist.ts +0 -118
- package/src/internal/mcp-oauth.ts +0 -549
- package/src/internal/net.ts +0 -29
- package/src/internal/open-browser.ts +0 -41
- package/src/internal/otel/attrs.ts +0 -16
- package/src/internal/otel/collector.ts +0 -937
- package/src/internal/otel/config.ts +0 -287
- package/src/internal/otel/http.ts +0 -122
- package/src/internal/otel/mcp.ts +0 -56
- package/src/internal/otel/propagation.ts +0 -17
- package/src/internal/otel/runtime.ts +0 -441
- package/src/internal/package-inline-stdio.ts +0 -114
- package/src/internal/peer-connections.ts +0 -96
- package/src/internal/platform-schedule-sync.ts +0 -75
- package/src/internal/platform-timers.ts +0 -365
- package/src/internal/playground/static.ts +0 -278
- package/src/internal/playground/toolchain.ts +0 -270
- package/src/internal/playground-proxy.ts +0 -564
- package/src/internal/process-memory-telemetry.ts +0 -334
- package/src/internal/project-layout.ts +0 -31
- package/src/internal/prompt-context.ts +0 -116
- package/src/internal/reminder-control-plane-protocol.ts +0 -482
- package/src/internal/reminder-runner.ts +0 -1559
- package/src/internal/reminder-schedule.ts +0 -104
- package/src/internal/reminder-store.ts +0 -176
- package/src/internal/request-error-status.ts +0 -95
- package/src/internal/request-headers.ts +0 -21
- package/src/internal/resolve-prod-target.ts +0 -334
- package/src/internal/resolved-connections.ts +0 -190
- package/src/internal/router.ts +0 -143
- package/src/internal/run-client.ts +0 -354
- package/src/internal/runtime-dispatch-runner.ts +0 -50
- package/src/internal/sanitize-mcp-tool-name.ts +0 -31
- package/src/internal/schedule-runner.ts +0 -154
- package/src/internal/scm/pr-url.ts +0 -245
- package/src/internal/sdk-runner.ts +0 -948
- package/src/internal/serve-restart.ts +0 -113
- package/src/internal/server.ts +0 -3135
- package/src/internal/session-cost.ts +0 -208
- package/src/internal/session-engine.ts +0 -5618
- package/src/internal/session-links.ts +0 -84
- package/src/internal/session-run-log.ts +0 -535
- package/src/internal/session-store.ts +0 -307
- package/src/internal/session-urls.ts +0 -32
- package/src/internal/sessions-client.ts +0 -239
- package/src/internal/skill-catalog.ts +0 -66
- package/src/internal/skills-sync.ts +0 -55
- package/src/internal/slack-provision-client.ts +0 -544
- package/src/internal/slack-thread-key.ts +0 -11
- package/src/internal/sleep.ts +0 -3
- package/src/internal/start-log-store.ts +0 -164
- package/src/internal/steering.ts +0 -17
- package/src/internal/storage-coordinator.ts +0 -800
- package/src/internal/storage-roles.ts +0 -86
- package/src/internal/storage.ts +0 -1
- package/src/internal/store-api-protocol.ts +0 -205
- package/src/internal/store-mirror.ts +0 -73
- package/src/internal/stream-progress.ts +0 -294
- package/src/internal/terminal-style.ts +0 -133
- package/src/internal/testing/factory-resource-fixtures.ts +0 -84
- package/src/internal/testing/scm-continuation-fixtures.ts +0 -285
- package/src/internal/tool-catalog.ts +0 -104
- package/src/internal/tool-policy.ts +0 -222
- package/src/internal/tool-result.ts +0 -50
- package/src/internal/trajectory.ts +0 -418
- package/src/internal/turn-cost.ts +0 -136
- package/src/internal/turn-governor.ts +0 -145
- package/src/internal/turn-lease-store.ts +0 -144
- package/src/internal/turn-outbox.ts +0 -77
- package/src/internal/update-check.ts +0 -517
- package/src/internal/v2-hosting.ts +0 -52
- package/src/internal/workspace-sync.ts +0 -114
- package/src/internal/workspace.ts +0 -505
- package/src/kv/memory-kv.ts +0 -94
- package/src/kv.ts +0 -18
- package/src/memory.ts +0 -487
- package/src/otel-public.ts +0 -24
- package/src/otel.ts +0 -320
- package/src/prompt.ts +0 -80
- package/src/reminders.ts +0 -65
- package/src/schedules.ts +0 -31
- package/src/skills.ts +0 -27
- package/src/storage-backends/cursor-hosted-v2.ts +0 -204
- package/src/storage-backends/cursor-hosted.ts +0 -388
- package/src/storage-backends/file-kv.ts +0 -276
- package/src/storage-protocol.ts +0 -261
- package/src/storage.ts +0 -408
- package/src/tools.ts +0 -166
- package/src/types.ts +0 -3766
- /package/dist/docs/assets/{reference_agent-config.md.DzGI777n.lean.js → reference_agent-config.md.Cj5uBKp4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_artifacts.md.CFMNPreZ.lean.js → reference_artifacts.md.CQfKq8F2.lean.js} +0 -0
|
@@ -1,823 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Discover and run filesystem evals under `<project>/evals/`.
|
|
3
|
-
*
|
|
4
|
-
* Case identity: single-`test` files use the path
|
|
5
|
-
* (`evals/weather/nyc.eval.ts` → `weather/nyc`); multi-`cases` files use
|
|
6
|
-
* `<fileId>/<case.id>` (`evals/weather.eval.ts` + `nyc` → `weather/nyc`).
|
|
7
|
-
* Drive with `t.send`, assert with `t.succeeded` / `t.calledTool` /
|
|
8
|
-
* `t.messageIncludes` / `t.check`.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type { Dirent } from "node:fs";
|
|
12
|
-
import { readdir } from "node:fs/promises";
|
|
13
|
-
import { join, relative, resolve } from "node:path";
|
|
14
|
-
import type { EvalAssertionHandle, EvalAssertions } from "../evals/assertions.js";
|
|
15
|
-
import {
|
|
16
|
-
computeVerdict,
|
|
17
|
-
createAssertions,
|
|
18
|
-
EvalAssertionRecorder,
|
|
19
|
-
EvalRequireFailure,
|
|
20
|
-
EvalSkipSignal,
|
|
21
|
-
} from "../evals/assertions.js";
|
|
22
|
-
import { evaluateExpectation } from "../evals/expect.js";
|
|
23
|
-
import type {
|
|
24
|
-
EvalJudge,
|
|
25
|
-
EvalJudgeCaller,
|
|
26
|
-
EvalJudgeCallOptions,
|
|
27
|
-
EvalJudgeGrader,
|
|
28
|
-
} from "../evals/judge.js";
|
|
29
|
-
import { EVAL_JUDGE_GRADERS, EvalJudgeUnavailableError, renderSubmission } from "../evals/judge.js";
|
|
30
|
-
import { EVAL_ROOT_ENV } from "../evals/loaders.js";
|
|
31
|
-
import { combineReporters } from "../evals/reporters.js";
|
|
32
|
-
import { summarizeEvalResults } from "../evals/results.js";
|
|
33
|
-
import type {
|
|
34
|
-
EvalCaseDefinition,
|
|
35
|
-
EvalConfigFile,
|
|
36
|
-
EvalDefinition,
|
|
37
|
-
EvalReporter,
|
|
38
|
-
EvalReporterTarget,
|
|
39
|
-
EvalRunResult,
|
|
40
|
-
EvalRunSummary,
|
|
41
|
-
EvalSendOptions,
|
|
42
|
-
EvalTestContext,
|
|
43
|
-
EvalTurnResult,
|
|
44
|
-
EvalVerdict,
|
|
45
|
-
Expectation,
|
|
46
|
-
} from "../evals.js";
|
|
47
|
-
import {
|
|
48
|
-
EVAL_MAX_CONCURRENCY_LIMIT,
|
|
49
|
-
expandEvalDefinition,
|
|
50
|
-
expandSummarySuiteSelection,
|
|
51
|
-
isEvalSummaryCase,
|
|
52
|
-
matchesEvalIdFilter,
|
|
53
|
-
normalizeEvalMaxConcurrency,
|
|
54
|
-
} from "../evals.js";
|
|
55
|
-
import type { ModelSetting, SessionEvent } from "../types.js";
|
|
56
|
-
import { importAuthoredModule } from "./authored-loaders.js";
|
|
57
|
-
import { isDefinitionOfKind } from "./brand.js";
|
|
58
|
-
import { callJudgeModel, EVAL_JUDGE_MODEL_ENV, resolveJudgeModel } from "./eval-judge-model.js";
|
|
59
|
-
import { mapPool } from "./map-pool.js";
|
|
60
|
-
import { RunSessionTimeoutError, runSession } from "./run-client.js";
|
|
61
|
-
import { buildTrajectory } from "./trajectory.js";
|
|
62
|
-
|
|
63
|
-
export interface DiscoveredEval {
|
|
64
|
-
/** Runnable datapoint id (`weather/nyc` or file id for single-test files). */
|
|
65
|
-
id: string;
|
|
66
|
-
/** File id under `evals/` (`weather` for `evals/weather.eval.ts`). */
|
|
67
|
-
fileId: string;
|
|
68
|
-
path: string;
|
|
69
|
-
definition: EvalCaseDefinition;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export type { EvalRunResult } from "../evals.js";
|
|
73
|
-
|
|
74
|
-
export interface EvalSelectionOptions {
|
|
75
|
-
filterIds?: string[];
|
|
76
|
-
tags?: string[];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface RunEvalsOptions extends EvalSelectionOptions {
|
|
80
|
-
projectRoot: string;
|
|
81
|
-
baseUrl: string;
|
|
82
|
-
timeoutMs?: number;
|
|
83
|
-
/** Override `evals.config.ts` `maxConcurrency` (CLI `--max-concurrency`). */
|
|
84
|
-
maxConcurrency?: number;
|
|
85
|
-
/**
|
|
86
|
-
* Reporters attached by the caller (CLI `--junit` / `--artifacts`), in
|
|
87
|
-
* addition to the ones declared in `evals.config.ts` and on each eval.
|
|
88
|
-
*/
|
|
89
|
-
reporters?: readonly EvalReporter[];
|
|
90
|
-
/** Ignore reporters declared in config and eval files (`--skip-report`). */
|
|
91
|
-
skipReport?: boolean;
|
|
92
|
-
/** Reported to reporters so a destination can label the run. */
|
|
93
|
-
target?: EvalReporterTarget;
|
|
94
|
-
/** Treat soft threshold misses as failures when summarizing. */
|
|
95
|
-
strict?: boolean;
|
|
96
|
-
/** Injected judge model call; defaults to the Cursor SDK caller. */
|
|
97
|
-
judgeCaller?: EvalJudgeCaller;
|
|
98
|
-
bearerToken?: string;
|
|
99
|
-
/** Extra request headers (e.g. hosted engineAccess). */
|
|
100
|
-
headers?: Record<string, string>;
|
|
101
|
-
verbose?: boolean;
|
|
102
|
-
onEvent?: (event: SessionEvent) => void;
|
|
103
|
-
/** Fired when a case begins executing (after concurrency slot acquired). */
|
|
104
|
-
onCaseStart?: (id: string) => void;
|
|
105
|
-
/** Fired when a case finishes (pass or fail). */
|
|
106
|
-
onCaseDone?: (result: EvalRunResult) => void;
|
|
107
|
-
/** Fired for each session event during a case (for live progress / sessionId). */
|
|
108
|
-
onCaseEvent?: (id: string, event: SessionEvent) => void;
|
|
109
|
-
importModule?: (absolutePath: string) => Promise<Record<string, unknown>>;
|
|
110
|
-
/**
|
|
111
|
-
* Pre-discovered evals + config. When set, skips filesystem discovery and
|
|
112
|
-
* selection filters (caller already chose the case list).
|
|
113
|
-
*/
|
|
114
|
-
discovered?: {
|
|
115
|
-
evals: readonly DiscoveredEval[];
|
|
116
|
-
config: Partial<EvalConfigFile>;
|
|
117
|
-
};
|
|
118
|
-
/** When aborted, stop starting new cases and cancel in-flight turns. */
|
|
119
|
-
signal?: AbortSignal;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
async function listEvalFiles(dir: string): Promise<string[]> {
|
|
123
|
-
const out: string[] = [];
|
|
124
|
-
async function walk(current: string): Promise<void> {
|
|
125
|
-
let entries: Dirent[];
|
|
126
|
-
try {
|
|
127
|
-
entries = await readdir(current, { withFileTypes: true });
|
|
128
|
-
} catch {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
for (const entry of entries) {
|
|
132
|
-
if (entry.name.startsWith(".")) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
const abs = join(current, entry.name);
|
|
136
|
-
if (entry.isDirectory()) {
|
|
137
|
-
if (entry.name === "node_modules") {
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
await walk(abs);
|
|
141
|
-
} else if (entry.isFile()) {
|
|
142
|
-
out.push(abs);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
await walk(dir);
|
|
147
|
-
return out.sort();
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export async function discoverEvals(
|
|
151
|
-
projectRoot: string,
|
|
152
|
-
importModule: (absolutePath: string) => Promise<Record<string, unknown>> = importAuthoredModule,
|
|
153
|
-
): Promise<{
|
|
154
|
-
evals: DiscoveredEval[];
|
|
155
|
-
config: Partial<EvalConfigFile>;
|
|
156
|
-
}> {
|
|
157
|
-
const root = resolve(projectRoot);
|
|
158
|
-
const evalsDir = join(root, "evals");
|
|
159
|
-
const files = await listEvalFiles(evalsDir);
|
|
160
|
-
const evals: DiscoveredEval[] = [];
|
|
161
|
-
let config: Partial<EvalConfigFile> = {};
|
|
162
|
-
|
|
163
|
-
// Fixture loaders resolve relative paths against the app root, so a dataset
|
|
164
|
-
// path reads the same however deep the eval file sits and whatever cwd the
|
|
165
|
-
// CLI ran from.
|
|
166
|
-
process.env[EVAL_ROOT_ENV] = root;
|
|
167
|
-
|
|
168
|
-
for (const abs of files) {
|
|
169
|
-
const rel = relative(evalsDir, abs).replace(/\\/g, "/");
|
|
170
|
-
if (rel === "evals.config.ts" || rel === "evals.config.js") {
|
|
171
|
-
const mod = await importModule(abs);
|
|
172
|
-
if (mod.default !== null && typeof mod.default === "object") {
|
|
173
|
-
config = mod.default as Partial<EvalConfigFile>;
|
|
174
|
-
}
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
if (!rel.endsWith(".eval.ts") && !rel.endsWith(".eval.js")) {
|
|
178
|
-
continue;
|
|
179
|
-
}
|
|
180
|
-
const mod = await importModule(abs);
|
|
181
|
-
const fileId = rel.replace(/\.eval\.(ts|js)$/, "").replace(/\/index$/, "");
|
|
182
|
-
try {
|
|
183
|
-
for (const expanded of expandEvalModule(fileId, mod.default)) {
|
|
184
|
-
evals.push({
|
|
185
|
-
id: expanded.id,
|
|
186
|
-
fileId,
|
|
187
|
-
path: abs,
|
|
188
|
-
definition: expanded.definition,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
} catch (error) {
|
|
192
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
193
|
-
throw new Error(`${rel}: ${message}`);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return { evals, config };
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Expand one eval module's default export into runnable datapoints.
|
|
202
|
-
*
|
|
203
|
-
* A file normally exports a single `defineEval(...)`. It may instead export an
|
|
204
|
-
* **array** of them to fan out over a dataset, in which case ids come from the
|
|
205
|
-
* file name plus a zero-padded index in array order (`sql/0000`, `sql/0001`, …).
|
|
206
|
-
* Prefer `cases` when the datapoints are hand-written and deserve stable names;
|
|
207
|
-
* the array form is for generated datasets where the index *is* the name.
|
|
208
|
-
*/
|
|
209
|
-
export function expandEvalModule(
|
|
210
|
-
fileId: string,
|
|
211
|
-
defaultExport: unknown,
|
|
212
|
-
): Array<{ id: string; definition: EvalCaseDefinition }> {
|
|
213
|
-
if (Array.isArray(defaultExport)) {
|
|
214
|
-
if (defaultExport.length === 0) {
|
|
215
|
-
throw new Error("default export array is empty; export at least one defineEval({ ... })");
|
|
216
|
-
}
|
|
217
|
-
return defaultExport.flatMap((entry, index) => {
|
|
218
|
-
if (!isDefinitionOfKind(entry, "eval")) {
|
|
219
|
-
throw new Error(`default export array entry ${index} must be defineEval({ ... })`);
|
|
220
|
-
}
|
|
221
|
-
return expandEvalDefinition(
|
|
222
|
-
`${fileId}/${String(index).padStart(4, "0")}`,
|
|
223
|
-
entry as EvalDefinition,
|
|
224
|
-
);
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
if (!isDefinitionOfKind(defaultExport, "eval")) {
|
|
228
|
-
throw new Error("default export must be defineEval({ ... }) or an array of them");
|
|
229
|
-
}
|
|
230
|
-
return expandEvalDefinition(fileId, defaultExport as EvalDefinition);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/** Apply id/tag filters used by CLI, playground, and `runDiscoveredEvals`. */
|
|
234
|
-
export function filterDiscoveredEvals(
|
|
235
|
-
evals: readonly DiscoveredEval[],
|
|
236
|
-
options: EvalSelectionOptions = {},
|
|
237
|
-
): DiscoveredEval[] {
|
|
238
|
-
let selected = evals as DiscoveredEval[];
|
|
239
|
-
if (options.filterIds !== undefined && options.filterIds.length > 0) {
|
|
240
|
-
selected = selected.filter(e => options.filterIds!.some(f => matchesEvalIdFilter(e.id, f)));
|
|
241
|
-
}
|
|
242
|
-
if (options.tags !== undefined && options.tags.length > 0) {
|
|
243
|
-
selected = selected.filter(e => (e.definition.tags ?? []).some(t => options.tags!.includes(t)));
|
|
244
|
-
}
|
|
245
|
-
// Suite aggregators (`summary` tag) need sibling cases from the same file.
|
|
246
|
-
return expandSummarySuiteSelection(evals, selected, e => isEvalSummaryCase(e.definition.tags));
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export async function runDiscoveredEvals(options: RunEvalsOptions): Promise<EvalRunResult[]> {
|
|
250
|
-
let selected: readonly DiscoveredEval[];
|
|
251
|
-
let config: Partial<EvalConfigFile>;
|
|
252
|
-
|
|
253
|
-
if (options.discovered !== undefined) {
|
|
254
|
-
selected = options.discovered.evals;
|
|
255
|
-
config = options.discovered.config;
|
|
256
|
-
} else {
|
|
257
|
-
const importModule = options.importModule ?? importAuthoredModule;
|
|
258
|
-
const discovered = await discoverEvals(options.projectRoot, importModule);
|
|
259
|
-
config = discovered.config;
|
|
260
|
-
selected = filterDiscoveredEvals(discovered.evals, {
|
|
261
|
-
filterIds: options.filterIds,
|
|
262
|
-
tags: options.tags,
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (selected.length === 0) {
|
|
267
|
-
return [];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const maxConcurrency =
|
|
271
|
-
options.maxConcurrency === undefined
|
|
272
|
-
? resolveEvalMaxConcurrency(config)
|
|
273
|
-
: normalizeEvalMaxConcurrency(options.maxConcurrency);
|
|
274
|
-
const defaultTimeoutMs = options.timeoutMs ?? config.timeoutMs ?? 180_000;
|
|
275
|
-
const reporter = buildReporterHub(options, config, selected);
|
|
276
|
-
const startedAt = new Date().toISOString();
|
|
277
|
-
|
|
278
|
-
await reporter?.runStart(selected, options.target ?? { baseUrl: options.baseUrl, mode: "local" });
|
|
279
|
-
|
|
280
|
-
// Iterations of the same authored datapoint share one concurrency slot and
|
|
281
|
-
// run sequentially. maxConcurrency is therefore the max number of distinct
|
|
282
|
-
// datapoints in flight, not datapoints × iterations.
|
|
283
|
-
const groups = groupEvalsForIterationSchedule(selected);
|
|
284
|
-
const nested = await mapPool(
|
|
285
|
-
groups,
|
|
286
|
-
maxConcurrency,
|
|
287
|
-
async group => {
|
|
288
|
-
const results: EvalRunResult[] = [];
|
|
289
|
-
for (const discovered of group) {
|
|
290
|
-
if (options.signal?.aborted) {
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
if (options.verbose) {
|
|
294
|
-
process.stderr.write(` eval ${discovered.id}…\n`);
|
|
295
|
-
}
|
|
296
|
-
options.onCaseStart?.(discovered.id);
|
|
297
|
-
const result = await runOneEval(discovered, {
|
|
298
|
-
baseUrl: options.baseUrl,
|
|
299
|
-
defaultTimeoutMs,
|
|
300
|
-
bearerToken: options.bearerToken,
|
|
301
|
-
headers: options.headers,
|
|
302
|
-
verbose: Boolean(options.verbose),
|
|
303
|
-
signal: options.signal,
|
|
304
|
-
judge: {
|
|
305
|
-
configModel: config.judge?.model,
|
|
306
|
-
caller: options.judgeCaller ?? callJudgeModel,
|
|
307
|
-
},
|
|
308
|
-
onEvent: event => {
|
|
309
|
-
options.onCaseEvent?.(discovered.id, event);
|
|
310
|
-
options.onEvent?.(event);
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
options.onCaseDone?.(result);
|
|
314
|
-
await reporter?.caseComplete(discovered, result);
|
|
315
|
-
results.push(result);
|
|
316
|
-
}
|
|
317
|
-
return results;
|
|
318
|
-
},
|
|
319
|
-
{ signal: options.signal },
|
|
320
|
-
);
|
|
321
|
-
const results = nested.flat();
|
|
322
|
-
|
|
323
|
-
await reporter?.runComplete(
|
|
324
|
-
summarizeEvalResults(results, {
|
|
325
|
-
strict: options.strict === true,
|
|
326
|
-
startedAt,
|
|
327
|
-
finishedAt: new Date().toISOString(),
|
|
328
|
-
}),
|
|
329
|
-
);
|
|
330
|
-
return results;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
interface ReporterHub {
|
|
334
|
-
runStart(evals: readonly DiscoveredEval[], target: EvalReporterTarget): Promise<void>;
|
|
335
|
-
caseComplete(discovered: DiscoveredEval, result: EvalRunResult): Promise<void>;
|
|
336
|
-
runComplete(summary: EvalRunSummary): Promise<void>;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Fan results out to the reporters that observe them.
|
|
341
|
-
*
|
|
342
|
-
* Run-wide reporters (CLI flags plus `evals.config.ts`) see every case; an
|
|
343
|
-
* eval's own `reporters` only see that eval. The run lifecycle hooks fire on
|
|
344
|
-
* every reporter in the run, so a per-eval destination still gets its
|
|
345
|
-
* `onRunStart` / `onRunComplete` pair.
|
|
346
|
-
*/
|
|
347
|
-
function buildReporterHub(
|
|
348
|
-
options: RunEvalsOptions,
|
|
349
|
-
config: Partial<EvalConfigFile>,
|
|
350
|
-
selected: readonly DiscoveredEval[],
|
|
351
|
-
): ReporterHub | undefined {
|
|
352
|
-
const skip = options.skipReport === true;
|
|
353
|
-
const runWide = [...(options.reporters ?? []), ...(skip ? [] : (config.reporters ?? []))];
|
|
354
|
-
const perEval = skip ? [] : selected.flatMap(e => e.definition.reporters ?? []);
|
|
355
|
-
const everyReporter = [...new Set([...runWide, ...perEval])];
|
|
356
|
-
if (everyReporter.length === 0) {
|
|
357
|
-
return undefined;
|
|
358
|
-
}
|
|
359
|
-
const onError = (error: unknown): void => {
|
|
360
|
-
// A broken destination must not fail the eval run itself.
|
|
361
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
362
|
-
process.stderr.write(`eval reporter error: ${detail}\n`);
|
|
363
|
-
};
|
|
364
|
-
const all = combineReporters(everyReporter, onError);
|
|
365
|
-
return {
|
|
366
|
-
async runStart(evals, target) {
|
|
367
|
-
await all.onRunStart?.(
|
|
368
|
-
evals.map(e => ({
|
|
369
|
-
id: e.id,
|
|
370
|
-
fileId: e.fileId,
|
|
371
|
-
description: e.definition.description,
|
|
372
|
-
tags: e.definition.tags,
|
|
373
|
-
})),
|
|
374
|
-
target,
|
|
375
|
-
);
|
|
376
|
-
},
|
|
377
|
-
async caseComplete(discovered, result) {
|
|
378
|
-
const observers = [
|
|
379
|
-
...new Set([...runWide, ...(skip ? [] : (discovered.definition.reporters ?? []))]),
|
|
380
|
-
];
|
|
381
|
-
await combineReporters(observers, onError).onEvalComplete?.(result);
|
|
382
|
-
},
|
|
383
|
-
async runComplete(summary) {
|
|
384
|
-
await all.onRunComplete?.(summary);
|
|
385
|
-
},
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Schedule key for {@link groupEvalsForIterationSchedule}: iteration siblings
|
|
391
|
-
* (`weather/nyc/1`…`/3`) share a key; single-iteration ids keep their full id.
|
|
392
|
-
*/
|
|
393
|
-
export function iterationScheduleKey(discovered: DiscoveredEval): string {
|
|
394
|
-
const iterations = discovered.definition.iterations ?? 1;
|
|
395
|
-
const iteration = discovered.definition.iteration ?? 1;
|
|
396
|
-
if (iterations <= 1) {
|
|
397
|
-
return discovered.id;
|
|
398
|
-
}
|
|
399
|
-
const suffix = `/${iteration}`;
|
|
400
|
-
if (discovered.id.endsWith(suffix)) {
|
|
401
|
-
return discovered.id.slice(0, -suffix.length);
|
|
402
|
-
}
|
|
403
|
-
return discovered.id;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Group expanded iteration cases so each authored datapoint's iterations run
|
|
408
|
-
* back-to-back under one {@link mapPool} slot (sorted by iteration index).
|
|
409
|
-
*/
|
|
410
|
-
export function groupEvalsForIterationSchedule(
|
|
411
|
-
evals: readonly DiscoveredEval[],
|
|
412
|
-
): DiscoveredEval[][] {
|
|
413
|
-
const groups = new Map<string, DiscoveredEval[]>();
|
|
414
|
-
const order: string[] = [];
|
|
415
|
-
for (const discovered of evals) {
|
|
416
|
-
const key = iterationScheduleKey(discovered);
|
|
417
|
-
let group = groups.get(key);
|
|
418
|
-
if (group === undefined) {
|
|
419
|
-
group = [];
|
|
420
|
-
groups.set(key, group);
|
|
421
|
-
order.push(key);
|
|
422
|
-
}
|
|
423
|
-
group.push(discovered);
|
|
424
|
-
}
|
|
425
|
-
return order.map(key => {
|
|
426
|
-
const group = groups.get(key)!;
|
|
427
|
-
return group.sort((a, b) => (a.definition.iteration ?? 1) - (b.definition.iteration ?? 1));
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
function resolveEvalMaxConcurrency(config: Partial<EvalConfigFile>): number {
|
|
432
|
-
if (config.maxConcurrency === undefined) {
|
|
433
|
-
throw new Error(
|
|
434
|
-
`evals/evals.config.ts must define maxConcurrency (1–${EVAL_MAX_CONCURRENCY_LIMIT}; hard limit is due to model provider request limits). Example:\n` +
|
|
435
|
-
` import { defineEvalConfig } from "@cursor/bdk/evals";\n` +
|
|
436
|
-
` export default defineEvalConfig({ maxConcurrency: 20 });`,
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
return normalizeEvalMaxConcurrency(config.maxConcurrency);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
interface RunOneEvalJudgeOptions {
|
|
443
|
-
/** Judge model from `evals.config.ts`. */
|
|
444
|
-
configModel?: ModelSetting;
|
|
445
|
-
caller: EvalJudgeCaller;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
async function runOneEval(
|
|
449
|
-
discovered: DiscoveredEval,
|
|
450
|
-
opts: {
|
|
451
|
-
baseUrl: string;
|
|
452
|
-
defaultTimeoutMs: number;
|
|
453
|
-
bearerToken?: string;
|
|
454
|
-
headers?: Record<string, string>;
|
|
455
|
-
verbose: boolean;
|
|
456
|
-
judge: RunOneEvalJudgeOptions;
|
|
457
|
-
onEvent?: (event: SessionEvent) => void;
|
|
458
|
-
signal?: AbortSignal;
|
|
459
|
-
},
|
|
460
|
-
): Promise<EvalRunResult> {
|
|
461
|
-
const logs: string[] = [];
|
|
462
|
-
const metrics: Record<string, string | number> = {};
|
|
463
|
-
const recorder = new EvalAssertionRecorder();
|
|
464
|
-
const def = discovered.definition;
|
|
465
|
-
const timeoutMs = def.timeoutMs ?? opts.defaultTimeoutMs;
|
|
466
|
-
const startedAt = Date.now();
|
|
467
|
-
|
|
468
|
-
let sessionId: string | undefined;
|
|
469
|
-
let continuationToken: string | undefined;
|
|
470
|
-
// The session stream replays from an index and the client stops at the first
|
|
471
|
-
// terminal event, so each send must resume after the previous turn's last
|
|
472
|
-
// event or it would re-read that turn instead of the new one.
|
|
473
|
-
let nextEventIndex = 0;
|
|
474
|
-
const allEvents: SessionEvent[] = [];
|
|
475
|
-
const inputs: string[] = [];
|
|
476
|
-
const turns: EvalTurnResult[] = [];
|
|
477
|
-
let reply: string | null = null;
|
|
478
|
-
|
|
479
|
-
const toolsUsed = (): string[] =>
|
|
480
|
-
buildTrajectory(allEvents).turns.flatMap(t => t.toolCalls.map(c => c.toolName));
|
|
481
|
-
|
|
482
|
-
const toolCallIo = () =>
|
|
483
|
-
buildTrajectory(allEvents).turns.flatMap(turn =>
|
|
484
|
-
turn.toolCalls.map(c => ({
|
|
485
|
-
toolName: c.toolName,
|
|
486
|
-
...(c.args === undefined ? {} : { args: c.args }),
|
|
487
|
-
...(c.output === undefined ? {} : { output: c.output }),
|
|
488
|
-
isError: c.isError,
|
|
489
|
-
})),
|
|
490
|
-
);
|
|
491
|
-
|
|
492
|
-
const finish = (extra: {
|
|
493
|
-
verdict: EvalVerdict;
|
|
494
|
-
ok: boolean;
|
|
495
|
-
error?: string;
|
|
496
|
-
skipReason?: string;
|
|
497
|
-
finalText?: string;
|
|
498
|
-
}): EvalRunResult => ({
|
|
499
|
-
id: discovered.id,
|
|
500
|
-
path: discovered.path,
|
|
501
|
-
...(def.description === undefined ? {} : { description: def.description }),
|
|
502
|
-
ok: extra.ok,
|
|
503
|
-
verdict: extra.verdict,
|
|
504
|
-
skipReason: extra.skipReason,
|
|
505
|
-
assertions: recorder.results(),
|
|
506
|
-
error: extra.error,
|
|
507
|
-
logs,
|
|
508
|
-
metrics,
|
|
509
|
-
metadata: def.metadata,
|
|
510
|
-
tags: def.tags,
|
|
511
|
-
inputs,
|
|
512
|
-
toolCalls: toolCallIo(),
|
|
513
|
-
...(sessionId === undefined ? {} : { sessionId }),
|
|
514
|
-
finalText: extra.finalText,
|
|
515
|
-
tools: toolsUsed(),
|
|
516
|
-
durationMs: Date.now() - startedAt,
|
|
517
|
-
});
|
|
518
|
-
|
|
519
|
-
if (opts.signal?.aborted) {
|
|
520
|
-
return finish({ verdict: "failed", ok: false, error: "cancelled" });
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
// A judge that cannot reach a model must not look like a quality regression:
|
|
524
|
-
// the case is skipped visibly instead.
|
|
525
|
-
let judgeUnavailable: string | undefined;
|
|
526
|
-
const timeout = new AbortController();
|
|
527
|
-
const timer = setTimeout(() => timeout.abort(), clampTimerDelay(timeoutMs));
|
|
528
|
-
// A pending case timer must not hold the process open on its own.
|
|
529
|
-
timer.unref?.();
|
|
530
|
-
|
|
531
|
-
const runAssertions: EvalAssertions = createAssertions({
|
|
532
|
-
recorder,
|
|
533
|
-
events: () => allEvents,
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
const judge = createJudgeSurface({
|
|
537
|
-
recorder,
|
|
538
|
-
grader: name => EVAL_JUDGE_GRADERS[name],
|
|
539
|
-
resolveModel: callModel =>
|
|
540
|
-
resolveJudgeModel({
|
|
541
|
-
call: callModel,
|
|
542
|
-
evalLevel: def.judge?.model,
|
|
543
|
-
config: opts.judge.configModel,
|
|
544
|
-
env: process.env[EVAL_JUDGE_MODEL_ENV],
|
|
545
|
-
}),
|
|
546
|
-
caller: opts.judge.caller,
|
|
547
|
-
defaultValue: () => reply,
|
|
548
|
-
onUnavailable: message => {
|
|
549
|
-
judgeUnavailable = judgeUnavailable ?? message;
|
|
550
|
-
},
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
const t: EvalTestContext = {
|
|
554
|
-
...runAssertions,
|
|
555
|
-
get reply() {
|
|
556
|
-
return reply;
|
|
557
|
-
},
|
|
558
|
-
get sessionId() {
|
|
559
|
-
return sessionId;
|
|
560
|
-
},
|
|
561
|
-
get events() {
|
|
562
|
-
return allEvents;
|
|
563
|
-
},
|
|
564
|
-
get turns() {
|
|
565
|
-
return turns;
|
|
566
|
-
},
|
|
567
|
-
get iteration() {
|
|
568
|
-
return def.iteration ?? 1;
|
|
569
|
-
},
|
|
570
|
-
get iterations() {
|
|
571
|
-
return def.iterations ?? 1;
|
|
572
|
-
},
|
|
573
|
-
get signal() {
|
|
574
|
-
return timeout.signal;
|
|
575
|
-
},
|
|
576
|
-
judge,
|
|
577
|
-
async send(message: string, options: EvalSendOptions = {}): Promise<EvalTurnResult> {
|
|
578
|
-
inputs.push(message);
|
|
579
|
-
const result = await runSession({
|
|
580
|
-
baseUrl: opts.baseUrl,
|
|
581
|
-
messages: [message],
|
|
582
|
-
sessionId,
|
|
583
|
-
continuationToken,
|
|
584
|
-
startIndex: nextEventIndex,
|
|
585
|
-
purpose: "eval",
|
|
586
|
-
bearerToken: opts.bearerToken,
|
|
587
|
-
headers: opts.headers,
|
|
588
|
-
workspaceDir: options.workspaceDir,
|
|
589
|
-
workspaceFiles: options.workspaceFiles,
|
|
590
|
-
cloud: options.cloud,
|
|
591
|
-
timeoutMs,
|
|
592
|
-
signal: opts.signal,
|
|
593
|
-
onEvent: opts.onEvent,
|
|
594
|
-
});
|
|
595
|
-
sessionId = result.sessionId;
|
|
596
|
-
continuationToken = result.continuationToken;
|
|
597
|
-
nextEventIndex = result.nextEventIndex ?? nextEventIndex;
|
|
598
|
-
allEvents.push(...result.events);
|
|
599
|
-
if (result.trajectory.finalText !== "") {
|
|
600
|
-
reply = result.trajectory.finalText;
|
|
601
|
-
}
|
|
602
|
-
const index = turns.length + 1;
|
|
603
|
-
// The turn is immutable, so its assertions read a frozen event slice
|
|
604
|
-
// even after later turns append to the run.
|
|
605
|
-
const turnEvents = [...result.events];
|
|
606
|
-
const turn: EvalTurnResult = {
|
|
607
|
-
...createAssertions({
|
|
608
|
-
recorder,
|
|
609
|
-
events: () => turnEvents,
|
|
610
|
-
scope: `turn[${index}]`,
|
|
611
|
-
}),
|
|
612
|
-
message: result.trajectory.finalText,
|
|
613
|
-
sessionId: result.sessionId,
|
|
614
|
-
events: turnEvents,
|
|
615
|
-
toolCalls: result.trajectory.turns.flatMap(turn => turn.toolCalls.map(c => c.toolName)),
|
|
616
|
-
ok: result.ok,
|
|
617
|
-
index,
|
|
618
|
-
expectOk() {
|
|
619
|
-
if (!result.ok) {
|
|
620
|
-
throw new Error(
|
|
621
|
-
`turn[${index}] failed: ${result.trajectory.turns.find(x => x.failed)?.error ?? "unknown error"}`,
|
|
622
|
-
);
|
|
623
|
-
}
|
|
624
|
-
return turn;
|
|
625
|
-
},
|
|
626
|
-
};
|
|
627
|
-
turns.push(turn);
|
|
628
|
-
return turn;
|
|
629
|
-
},
|
|
630
|
-
async require<T>(value: T, assertion: Expectation): Promise<T> {
|
|
631
|
-
const outcome = evaluateExpectation(value, assertion);
|
|
632
|
-
recorder.record({
|
|
633
|
-
name: `require(${assertion.kind})`,
|
|
634
|
-
passed: outcome.passed,
|
|
635
|
-
detail: outcome.detail,
|
|
636
|
-
score: outcome.score,
|
|
637
|
-
severity: "gate",
|
|
638
|
-
});
|
|
639
|
-
if (!outcome.passed) {
|
|
640
|
-
throw new EvalRequireFailure(`require(${assertion.kind})`);
|
|
641
|
-
}
|
|
642
|
-
return value;
|
|
643
|
-
},
|
|
644
|
-
skip(reason: string): never {
|
|
645
|
-
throw new EvalSkipSignal(reason);
|
|
646
|
-
},
|
|
647
|
-
log(message: string) {
|
|
648
|
-
logs.push(message);
|
|
649
|
-
if (opts.verbose) {
|
|
650
|
-
process.stderr.write(` ${message}\n`);
|
|
651
|
-
}
|
|
652
|
-
},
|
|
653
|
-
metric(name: string, value: string | number) {
|
|
654
|
-
const key = name.trim();
|
|
655
|
-
if (key === "") {
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
metrics[key] = value;
|
|
659
|
-
if (opts.verbose) {
|
|
660
|
-
process.stderr.write(` metric ${key}=${String(value)}\n`);
|
|
661
|
-
}
|
|
662
|
-
},
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
try {
|
|
666
|
-
await def.test(t);
|
|
667
|
-
} catch (error) {
|
|
668
|
-
if (error instanceof EvalSkipSignal) {
|
|
669
|
-
clearTimeout(timer);
|
|
670
|
-
return finish({
|
|
671
|
-
verdict: "skipped",
|
|
672
|
-
ok: true,
|
|
673
|
-
skipReason: error.reason,
|
|
674
|
-
finalText: reply ?? undefined,
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
if (!(error instanceof EvalRequireFailure)) {
|
|
678
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
679
|
-
if (error instanceof RunSessionTimeoutError && sessionId === undefined) {
|
|
680
|
-
sessionId = error.sessionId;
|
|
681
|
-
}
|
|
682
|
-
await recorder.waitForPending().catch(() => undefined);
|
|
683
|
-
clearTimeout(timer);
|
|
684
|
-
return finish({
|
|
685
|
-
verdict: "failed",
|
|
686
|
-
ok: false,
|
|
687
|
-
error: message,
|
|
688
|
-
finalText: reply ?? undefined,
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
// `require` already recorded the failing gate; fall through so the verdict
|
|
692
|
-
// comes from the assertions rather than a duplicate execution error.
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
await recorder.waitForPending();
|
|
696
|
-
clearTimeout(timer);
|
|
697
|
-
|
|
698
|
-
const assertions = recorder.results();
|
|
699
|
-
const traj = buildTrajectory(allEvents);
|
|
700
|
-
// With no assertions at all, keep the historical fallback: a case that just
|
|
701
|
-
// drives the agent passes when the run itself succeeded.
|
|
702
|
-
const verdict: EvalVerdict =
|
|
703
|
-
assertions.length > 0
|
|
704
|
-
? computeVerdict(assertions)
|
|
705
|
-
: traj.ok && traj.turns.length > 0
|
|
706
|
-
? "passed"
|
|
707
|
-
: "failed";
|
|
708
|
-
const finalText = reply ?? traj.finalText;
|
|
709
|
-
|
|
710
|
-
// An unreachable judge means the *judged* signal is unknown, so the case is
|
|
711
|
-
// reported as skipped rather than as a quality regression. It must not also
|
|
712
|
-
// bury a deterministic gate that already failed: skipping a failed case would
|
|
713
|
-
// turn a red eval green on any machine that happens to lack credentials.
|
|
714
|
-
if (judgeUnavailable !== undefined && verdict !== "failed") {
|
|
715
|
-
logs.push(`judge skipped: ${judgeUnavailable}`);
|
|
716
|
-
return finish({
|
|
717
|
-
verdict: "skipped",
|
|
718
|
-
ok: true,
|
|
719
|
-
skipReason: judgeUnavailable,
|
|
720
|
-
finalText,
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
if (judgeUnavailable !== undefined) {
|
|
724
|
-
logs.push(
|
|
725
|
-
`judge unavailable (${judgeUnavailable}), but a gate already failed — reporting the failure`,
|
|
726
|
-
);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
return finish({
|
|
730
|
-
verdict,
|
|
731
|
-
ok: verdict !== "failed",
|
|
732
|
-
finalText,
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
/** Clamp a case timeout to a delay `setTimeout` can represent. */
|
|
737
|
-
function clampTimerDelay(timeoutMs: number): number {
|
|
738
|
-
const MAX_TIMER = 2_147_483_647;
|
|
739
|
-
return Math.min(Math.max(timeoutMs, 0), MAX_TIMER);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
/**
|
|
743
|
-
* Build `t.judge`. Each grader records its slot immediately and resolves it
|
|
744
|
-
* during finalization, so several judges overlap instead of serializing.
|
|
745
|
-
*/
|
|
746
|
-
function createJudgeSurface(args: {
|
|
747
|
-
recorder: EvalAssertionRecorder;
|
|
748
|
-
grader: (name: keyof typeof EVAL_JUDGE_GRADERS) => EvalJudgeGrader;
|
|
749
|
-
resolveModel: (call?: ModelSetting) => ModelSetting | undefined;
|
|
750
|
-
caller: EvalJudgeCaller;
|
|
751
|
-
defaultValue: () => unknown;
|
|
752
|
-
onUnavailable: (message: string) => void;
|
|
753
|
-
}): EvalJudge {
|
|
754
|
-
const grade = (
|
|
755
|
-
graderName: keyof typeof EVAL_JUDGE_GRADERS,
|
|
756
|
-
reference: string,
|
|
757
|
-
options: EvalJudgeCallOptions | undefined,
|
|
758
|
-
): EvalAssertionHandle => {
|
|
759
|
-
const grader = args.grader(graderName);
|
|
760
|
-
const model = args.resolveModel(options?.model);
|
|
761
|
-
const name = `judge.${graderName}(${truncateForName(reference)})`;
|
|
762
|
-
if (model === undefined) {
|
|
763
|
-
// A missing judge model is an authoring error, not a flaky provider.
|
|
764
|
-
return args.recorder.record({
|
|
765
|
-
name,
|
|
766
|
-
passed: false,
|
|
767
|
-
severity: "gate",
|
|
768
|
-
detail:
|
|
769
|
-
"no judge model configured; set judge.model in evals.config.ts, on the eval, or on the call",
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
const submission = renderSubmission(
|
|
773
|
-
options !== undefined && "on" in options ? options.on : args.defaultValue(),
|
|
774
|
-
);
|
|
775
|
-
const settle = (async () => {
|
|
776
|
-
const reply = await args.caller({
|
|
777
|
-
prompt: grader.buildPrompt({ submission, reference }),
|
|
778
|
-
model,
|
|
779
|
-
});
|
|
780
|
-
const result = grader.parse(reply);
|
|
781
|
-
return {
|
|
782
|
-
passed: true,
|
|
783
|
-
score: result.score,
|
|
784
|
-
detail:
|
|
785
|
-
result.rationale === undefined
|
|
786
|
-
? `${result.choice} (${result.score.toFixed(2)})`
|
|
787
|
-
: `${result.choice} (${result.score.toFixed(2)}) — ${result.rationale}`,
|
|
788
|
-
};
|
|
789
|
-
})().catch((error: unknown) => {
|
|
790
|
-
if (error instanceof EvalJudgeUnavailableError) {
|
|
791
|
-
args.onUnavailable(error.message);
|
|
792
|
-
return { passed: true, detail: `skipped: ${error.message}` };
|
|
793
|
-
}
|
|
794
|
-
throw error;
|
|
795
|
-
});
|
|
796
|
-
// Soft by default: a judge is a tracked score until given a bar.
|
|
797
|
-
return args.recorder.recordAsync(
|
|
798
|
-
{ name, passed: true, severity: "soft", detail: "grading…" },
|
|
799
|
-
settle,
|
|
800
|
-
);
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
return {
|
|
804
|
-
async model(prompt, options) {
|
|
805
|
-
const model = args.resolveModel(options?.model);
|
|
806
|
-
if (model === undefined) {
|
|
807
|
-
throw new Error(
|
|
808
|
-
"t.judge.model: no judge model configured; set judge.model in evals.config.ts, on the eval, or on the call",
|
|
809
|
-
);
|
|
810
|
-
}
|
|
811
|
-
return args.caller({ prompt, model });
|
|
812
|
-
},
|
|
813
|
-
factuality: (expected, options) => grade("factuality", expected, options),
|
|
814
|
-
summarizes: (expected, options) => grade("summarizes", expected, options),
|
|
815
|
-
closedQA: (criteria, options) => grade("closedQA", criteria, options),
|
|
816
|
-
sql: (expected, options) => grade("sql", expected, options),
|
|
817
|
-
};
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
function truncateForName(text: string): string {
|
|
821
|
-
const oneLine = text.replace(/\s+/g, " ").trim();
|
|
822
|
-
return oneLine.length > 60 ? `${oneLine.slice(0, 59)}…` : oneLine;
|
|
823
|
-
}
|