@rulemetric/cli 0.2.0 → 0.2.2
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/base-command.js +13 -52
- package/dist/base-command.js.map +7 -1
- package/dist/chunk-2AM54TUK.js +59 -0
- package/dist/chunk-2AM54TUK.js.map +7 -0
- package/dist/chunk-3TIMQ3O6.js +96 -0
- package/dist/chunk-3TIMQ3O6.js.map +7 -0
- package/dist/chunk-4BHDHHKL.js +48 -0
- package/dist/chunk-4BHDHHKL.js.map +7 -0
- package/dist/chunk-4D537GXE.js +99 -0
- package/dist/chunk-4D537GXE.js.map +7 -0
- package/dist/chunk-4SCZK7AL.js +129 -0
- package/dist/chunk-4SCZK7AL.js.map +7 -0
- package/dist/chunk-4WFE4PFP.js +61 -0
- package/dist/chunk-4WFE4PFP.js.map +7 -0
- package/dist/chunk-52WIYRZH.js +73 -0
- package/dist/chunk-52WIYRZH.js.map +7 -0
- package/dist/chunk-7FAA3YNB.js +1549 -0
- package/dist/chunk-7FAA3YNB.js.map +7 -0
- package/dist/chunk-7NYKWN7U.js +12 -0
- package/dist/chunk-7NYKWN7U.js.map +7 -0
- package/dist/chunk-AULP2OWH.js +99 -0
- package/dist/chunk-AULP2OWH.js.map +7 -0
- package/dist/chunk-B5KNTGMJ.js +1788 -0
- package/dist/chunk-B5KNTGMJ.js.map +7 -0
- package/dist/chunk-BD7CY42U.js +23 -0
- package/dist/chunk-BD7CY42U.js.map +7 -0
- package/dist/chunk-BO76WKJR.js +42 -0
- package/dist/chunk-BO76WKJR.js.map +7 -0
- package/dist/chunk-BRD5RUGM.js +53 -0
- package/dist/chunk-BRD5RUGM.js.map +7 -0
- package/dist/chunk-BT6Z6545.js +43 -0
- package/dist/chunk-BT6Z6545.js.map +7 -0
- package/dist/chunk-BZDKEQKU.js +39 -0
- package/dist/chunk-BZDKEQKU.js.map +7 -0
- package/dist/chunk-CROYS75W.js +161 -0
- package/dist/chunk-CROYS75W.js.map +7 -0
- package/dist/chunk-DGHWRQXL.js +17 -0
- package/dist/chunk-DGHWRQXL.js.map +7 -0
- package/dist/chunk-DQ3KELXD.js +74 -0
- package/dist/chunk-DQ3KELXD.js.map +7 -0
- package/dist/chunk-DTFXCHHI.js +108 -0
- package/dist/chunk-DTFXCHHI.js.map +7 -0
- package/dist/chunk-DU73QUS3.js +75 -0
- package/dist/chunk-DU73QUS3.js.map +7 -0
- package/dist/chunk-EHZJ6OXD.js +307 -0
- package/dist/chunk-EHZJ6OXD.js.map +7 -0
- package/dist/chunk-EJOI2ZGU.js +109 -0
- package/dist/chunk-EJOI2ZGU.js.map +7 -0
- package/dist/chunk-EKJ2CABV.js +76 -0
- package/dist/chunk-EKJ2CABV.js.map +7 -0
- package/dist/chunk-EKP32DLN.js +16 -0
- package/dist/chunk-EKP32DLN.js.map +7 -0
- package/dist/chunk-EOOP6WTC.js +148 -0
- package/dist/chunk-EOOP6WTC.js.map +7 -0
- package/dist/chunk-ERPMDAO3.js +20 -0
- package/dist/chunk-ERPMDAO3.js.map +7 -0
- package/dist/chunk-FTJRMUID.js +96 -0
- package/dist/chunk-FTJRMUID.js.map +7 -0
- package/dist/chunk-FZKLLNDS.js +228 -0
- package/dist/chunk-FZKLLNDS.js.map +7 -0
- package/dist/chunk-GQCISMAH.js +157 -0
- package/dist/chunk-GQCISMAH.js.map +7 -0
- package/dist/chunk-IGXX624H.js +55 -0
- package/dist/chunk-IGXX624H.js.map +7 -0
- package/dist/chunk-IJGF2ETG.js +68 -0
- package/dist/chunk-IJGF2ETG.js.map +7 -0
- package/dist/chunk-IWYCRLEK.js +220 -0
- package/dist/chunk-IWYCRLEK.js.map +7 -0
- package/dist/chunk-J7N3DLH6.js +117 -0
- package/dist/chunk-J7N3DLH6.js.map +7 -0
- package/dist/chunk-JX5UI6RW.js +99 -0
- package/dist/chunk-JX5UI6RW.js.map +7 -0
- package/dist/chunk-K3BFZ7KG.js +154 -0
- package/dist/chunk-K3BFZ7KG.js.map +7 -0
- package/dist/chunk-KHJUQFIK.js +51 -0
- package/dist/chunk-KHJUQFIK.js.map +7 -0
- package/dist/chunk-KRBQLMOP.js +41 -0
- package/dist/chunk-KRBQLMOP.js.map +7 -0
- package/dist/chunk-KZRFUXGF.js +145 -0
- package/dist/chunk-KZRFUXGF.js.map +7 -0
- package/dist/chunk-L674RNKQ.js +492 -0
- package/dist/chunk-L674RNKQ.js.map +7 -0
- package/dist/chunk-N52AHNBH.js +47 -0
- package/dist/chunk-N52AHNBH.js.map +7 -0
- package/dist/chunk-NIDLJO6F.js +228 -0
- package/dist/chunk-NIDLJO6F.js.map +7 -0
- package/dist/chunk-NSBPE2FW.js +17 -0
- package/dist/chunk-NSBPE2FW.js.map +7 -0
- package/dist/chunk-OGVORIFM.js +70 -0
- package/dist/chunk-OGVORIFM.js.map +7 -0
- package/dist/chunk-OQSQC7VB.js +77 -0
- package/dist/chunk-OQSQC7VB.js.map +7 -0
- package/dist/chunk-PHLMIZKM.js +153 -0
- package/dist/chunk-PHLMIZKM.js.map +7 -0
- package/dist/chunk-PQU7GZ7A.js +92 -0
- package/dist/chunk-PQU7GZ7A.js.map +7 -0
- package/dist/chunk-PXVQLD7S.js +196 -0
- package/dist/chunk-PXVQLD7S.js.map +7 -0
- package/dist/chunk-QD6X4L4L.js +79 -0
- package/dist/chunk-QD6X4L4L.js.map +7 -0
- package/dist/chunk-QJQS6TUN.js +44 -0
- package/dist/chunk-QJQS6TUN.js.map +7 -0
- package/dist/chunk-QJXAULRC.js +191 -0
- package/dist/chunk-QJXAULRC.js.map +7 -0
- package/dist/chunk-QN34TGD3.js +83 -0
- package/dist/chunk-QN34TGD3.js.map +7 -0
- package/dist/chunk-R5MFHGHR.js +122 -0
- package/dist/chunk-R5MFHGHR.js.map +7 -0
- package/dist/chunk-RH7NHVSK.js +16 -0
- package/dist/chunk-RH7NHVSK.js.map +7 -0
- package/dist/chunk-RJ7BHDLM.js +121 -0
- package/dist/chunk-RJ7BHDLM.js.map +7 -0
- package/dist/chunk-RQ2TMLKG.js +142 -0
- package/dist/chunk-RQ2TMLKG.js.map +7 -0
- package/dist/chunk-S56LOTGQ.js +63 -0
- package/dist/chunk-S56LOTGQ.js.map +7 -0
- package/dist/chunk-UF73WX2J.js +49 -0
- package/dist/chunk-UF73WX2J.js.map +7 -0
- package/dist/chunk-W53GKIZQ.js +50 -0
- package/dist/chunk-W53GKIZQ.js.map +7 -0
- package/dist/chunk-WA4MWYRW.js +254 -0
- package/dist/chunk-WA4MWYRW.js.map +7 -0
- package/dist/chunk-WFULKPEQ.js +269 -0
- package/dist/chunk-WFULKPEQ.js.map +7 -0
- package/dist/chunk-XC6M4CSW.js +44 -0
- package/dist/chunk-XC6M4CSW.js.map +7 -0
- package/dist/chunk-XPUEGHXN.js +243 -0
- package/dist/chunk-XPUEGHXN.js.map +7 -0
- package/dist/chunk-XZXS2W24.js +148 -0
- package/dist/chunk-XZXS2W24.js.map +7 -0
- package/dist/chunk-YBNW7ARH.js +167 -0
- package/dist/chunk-YBNW7ARH.js.map +7 -0
- package/dist/chunk-YNIH3KMU.js +121 -0
- package/dist/chunk-YNIH3KMU.js.map +7 -0
- package/dist/commands/antigravity/backfill.js +135 -0
- package/dist/commands/antigravity/backfill.js.map +7 -0
- package/dist/commands/auth/create-key.js +48 -33
- package/dist/commands/auth/create-key.js.map +7 -1
- package/dist/commands/auth/login.js +58 -46
- package/dist/commands/auth/login.js.map +7 -1
- package/dist/commands/auth/logout.js +28 -13
- package/dist/commands/auth/logout.js.map +7 -1
- package/dist/commands/auth/revoke-key.js +32 -18
- package/dist/commands/auth/revoke-key.js.map +7 -1
- package/dist/commands/auth/status.js +40 -22
- package/dist/commands/auth/status.js.map +7 -1
- package/dist/commands/catalog/index.js +50 -34
- package/dist/commands/catalog/index.js.map +7 -1
- package/dist/commands/catalog/recommend.js +41 -26
- package/dist/commands/catalog/recommend.js.map +7 -1
- package/dist/commands/convert.js +72 -54
- package/dist/commands/convert.js.map +7 -1
- package/dist/commands/converters.js +52 -38
- package/dist/commands/converters.js.map +7 -1
- package/dist/commands/crons/list.js +50 -24
- package/dist/commands/crons/list.js.map +7 -1
- package/dist/commands/crons/run.js +72 -47
- package/dist/commands/crons/run.js.map +7 -1
- package/dist/commands/dashboard.js +45 -24
- package/dist/commands/dashboard.js.map +7 -1
- package/dist/commands/eval-targets/create.js +51 -39
- package/dist/commands/eval-targets/create.js.map +7 -1
- package/dist/commands/eval-targets/list.js +52 -35
- package/dist/commands/eval-targets/list.js.map +7 -1
- package/dist/commands/evals/agent.js +292 -0
- package/dist/commands/evals/agent.js.map +7 -0
- package/dist/commands/evals/benchmark.js +70 -51
- package/dist/commands/evals/benchmark.js.map +7 -1
- package/dist/commands/evals/compare.js +90 -78
- package/dist/commands/evals/compare.js.map +7 -1
- package/dist/commands/evals/create.js +64 -50
- package/dist/commands/evals/create.js.map +7 -1
- package/dist/commands/evals/optimize-description.js +225 -222
- package/dist/commands/evals/optimize-description.js.map +7 -1
- package/dist/commands/evals/optimize.js +206 -196
- package/dist/commands/evals/optimize.js.map +7 -1
- package/dist/commands/evals/run.js +178 -164
- package/dist/commands/evals/run.js.map +7 -1
- package/dist/commands/gateway/ensure.js +33 -19
- package/dist/commands/gateway/ensure.js.map +7 -1
- package/dist/commands/hooks/install.js +335 -275
- package/dist/commands/hooks/install.js.map +7 -1
- package/dist/commands/hooks/run.js +72 -53
- package/dist/commands/hooks/run.js.map +7 -1
- package/dist/commands/hooks/uninstall.js +117 -94
- package/dist/commands/hooks/uninstall.js.map +7 -1
- package/dist/commands/import.js +63 -53
- package/dist/commands/import.js.map +7 -1
- package/dist/commands/instructions/create.js +71 -58
- package/dist/commands/instructions/create.js.map +7 -1
- package/dist/commands/instructions/delete.js +53 -36
- package/dist/commands/instructions/delete.js.map +7 -1
- package/dist/commands/instructions/fork.js +33 -19
- package/dist/commands/instructions/fork.js.map +7 -1
- package/dist/commands/instructions/get.js +66 -49
- package/dist/commands/instructions/get.js.map +7 -1
- package/dist/commands/instructions/list.js +63 -46
- package/dist/commands/instructions/list.js.map +7 -1
- package/dist/commands/instructions/promote.js +41 -27
- package/dist/commands/instructions/promote.js.map +7 -1
- package/dist/commands/instructions/pull.js +37 -21
- package/dist/commands/instructions/pull.js.map +7 -1
- package/dist/commands/instructions/upstream.js +36 -21
- package/dist/commands/instructions/upstream.js.map +7 -1
- package/dist/commands/instructions/versions.js +51 -33
- package/dist/commands/instructions/versions.js.map +7 -1
- package/dist/commands/launcher.js +39 -0
- package/dist/commands/launcher.js.map +7 -0
- package/dist/commands/org/current.js +74 -68
- package/dist/commands/org/current.js.map +7 -1
- package/dist/commands/org/list.js +50 -36
- package/dist/commands/org/list.js.map +7 -1
- package/dist/commands/org/switch.js +69 -51
- package/dist/commands/org/switch.js.map +7 -1
- package/dist/commands/packs/add-instruction.js +36 -22
- package/dist/commands/packs/add-instruction.js.map +7 -1
- package/dist/commands/packs/apply.js +38 -24
- package/dist/commands/packs/apply.js.map +7 -1
- package/dist/commands/packs/create.js +47 -33
- package/dist/commands/packs/create.js.map +7 -1
- package/dist/commands/packs/fork.js +33 -19
- package/dist/commands/packs/fork.js.map +7 -1
- package/dist/commands/packs/get.js +54 -35
- package/dist/commands/packs/get.js.map +7 -1
- package/dist/commands/packs/list.js +64 -47
- package/dist/commands/packs/list.js.map +7 -1
- package/dist/commands/packs/remove-instruction.js +34 -20
- package/dist/commands/packs/remove-instruction.js.map +7 -1
- package/dist/commands/proxy/env.js +126 -116
- package/dist/commands/proxy/env.js.map +7 -1
- package/dist/commands/proxy/logs.js +83 -74
- package/dist/commands/proxy/logs.js.map +7 -1
- package/dist/commands/proxy/restart.js +34 -36
- package/dist/commands/proxy/restart.js.map +7 -1
- package/dist/commands/proxy/setup.js +432 -375
- package/dist/commands/proxy/setup.js.map +7 -1
- package/dist/commands/proxy/start.js +289 -289
- package/dist/commands/proxy/start.js.map +7 -1
- package/dist/commands/proxy/status.js +74 -64
- package/dist/commands/proxy/status.js.map +7 -1
- package/dist/commands/proxy/stop.js +81 -75
- package/dist/commands/proxy/stop.js.map +7 -1
- package/dist/commands/research/backfill.js +58 -0
- package/dist/commands/research/backfill.js.map +7 -0
- package/dist/commands/research/tail-transcript.js +69 -0
- package/dist/commands/research/tail-transcript.js.map +7 -0
- package/dist/commands/service/install.js +639 -405
- package/dist/commands/service/install.js.map +7 -1
- package/dist/commands/service/status.js +178 -111
- package/dist/commands/service/status.js.map +7 -1
- package/dist/commands/service/uninstall.js +85 -110
- package/dist/commands/service/uninstall.js.map +7 -1
- package/dist/commands/sessions/analyze.js +46 -25
- package/dist/commands/sessions/analyze.js.map +7 -1
- package/dist/commands/sessions/end.js +81 -79
- package/dist/commands/sessions/end.js.map +7 -1
- package/dist/commands/sessions/import.js +44 -27
- package/dist/commands/sessions/import.js.map +7 -1
- package/dist/commands/sessions/list.js +46 -33
- package/dist/commands/sessions/list.js.map +7 -1
- package/dist/commands/sessions/start.js +88 -87
- package/dist/commands/sessions/start.js.map +7 -1
- package/dist/commands/signals/report.js +42 -34
- package/dist/commands/signals/report.js.map +7 -1
- package/dist/commands/skills/export-approved.js +44 -30
- package/dist/commands/skills/export-approved.js.map +7 -1
- package/dist/commands/skills/install.js +99 -84
- package/dist/commands/skills/install.js.map +7 -1
- package/dist/commands/skills/list.js +59 -42
- package/dist/commands/skills/list.js.map +7 -1
- package/dist/commands/skills/publish.js +95 -78
- package/dist/commands/skills/publish.js.map +7 -1
- package/dist/commands/skills/search.js +68 -53
- package/dist/commands/skills/search.js.map +7 -1
- package/dist/commands/skills/update.js +52 -39
- package/dist/commands/skills/update.js.map +7 -1
- package/dist/commands/suggestions/accept.js +82 -59
- package/dist/commands/suggestions/accept.js.map +7 -1
- package/dist/commands/suggestions/dismiss.js +44 -26
- package/dist/commands/suggestions/dismiss.js.map +7 -1
- package/dist/commands/suggestions/list.js +59 -39
- package/dist/commands/suggestions/list.js.map +7 -1
- package/dist/commands/suggestions/refresh.js +26 -11
- package/dist/commands/suggestions/refresh.js.map +7 -1
- package/dist/cursor-BGQJ4CWI.js +134 -0
- package/dist/cursor-BGQJ4CWI.js.map +7 -0
- package/dist/dashboard/Dashboard.js +229 -126
- package/dist/dashboard/Dashboard.js.map +7 -1
- package/dist/dashboard/data.js +13 -137
- package/dist/dashboard/data.js.map +7 -1
- package/dist/dashboard/launcher/ActiveJobsList.js +10 -0
- package/dist/dashboard/launcher/ActiveJobsList.js.map +7 -0
- package/dist/dashboard/launcher/LauncherOverlay.js +14 -0
- package/dist/dashboard/launcher/LauncherOverlay.js.map +7 -0
- package/dist/dashboard/launcher/NewLaunchForm.js +10 -0
- package/dist/dashboard/launcher/NewLaunchForm.js.map +7 -0
- package/dist/dashboard/launcher/api.js +14 -0
- package/dist/dashboard/launcher/api.js.map +7 -0
- package/dist/dashboard/launcher/tool-labels.js +10 -0
- package/dist/dashboard/launcher/tool-labels.js.map +7 -0
- package/dist/dashboard/launcher/types.js +1 -0
- package/dist/dashboard/launcher/types.js.map +7 -0
- package/dist/dashboard/launcher/useLaunchJobs.js +9 -0
- package/dist/dashboard/launcher/useLaunchJobs.js.map +7 -0
- package/dist/dashboard/panels/friction.js +10 -22
- package/dist/dashboard/panels/friction.js.map +7 -1
- package/dist/dashboard/panels/insights.js +10 -109
- package/dist/dashboard/panels/insights.js.map +7 -1
- package/dist/dashboard/panels/instructions.js +10 -17
- package/dist/dashboard/panels/instructions.js.map +7 -1
- package/dist/dashboard/panels/outcomes.js +9 -28
- package/dist/dashboard/panels/outcomes.js.map +7 -1
- package/dist/dashboard/panels/overview.js +10 -20
- package/dist/dashboard/panels/overview.js.map +7 -1
- package/dist/dashboard/panels/shared.js +18 -61
- package/dist/dashboard/panels/shared.js.map +7 -1
- package/dist/dashboard/types.js +23 -26
- package/dist/dashboard/types.js.map +7 -1
- package/dist/dist-CSUYFYKI.js +52 -0
- package/dist/dist-CSUYFYKI.js.map +7 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +7 -1
- package/dist/lib/active-org-refresh.js +15 -108
- package/dist/lib/active-org-refresh.js.map +7 -1
- package/dist/lib/active-org.js +15 -95
- package/dist/lib/active-org.js.map +7 -1
- package/dist/lib/agent-loop.js +44 -0
- package/dist/lib/agent-loop.js.map +7 -0
- package/dist/lib/antigravity-transcript.js +22 -0
- package/dist/lib/antigravity-transcript.js.map +7 -0
- package/dist/lib/api-client.js +21 -92
- package/dist/lib/api-client.js.map +7 -1
- package/dist/lib/auth.js +26 -137
- package/dist/lib/auth.js.map +7 -1
- package/dist/lib/detect-languages.js +8 -113
- package/dist/lib/detect-languages.js.map +7 -1
- package/dist/lib/detect-tmux.js +9 -0
- package/dist/lib/detect-tmux.js.map +7 -0
- package/dist/lib/eval-analyzer.js +9 -89
- package/dist/lib/eval-analyzer.js.map +7 -1
- package/dist/lib/eval-benchmark.js +12 -92
- package/dist/lib/eval-benchmark.js.map +7 -1
- package/dist/lib/eval-conversation-handler.js +13 -200
- package/dist/lib/eval-conversation-handler.js.map +7 -1
- package/dist/lib/eval-executor.js +8 -83
- package/dist/lib/eval-executor.js.map +7 -1
- package/dist/lib/eval-grader.js +9 -123
- package/dist/lib/eval-grader.js.map +7 -1
- package/dist/lib/eval-meta-judge.js +9 -116
- package/dist/lib/eval-meta-judge.js.map +7 -1
- package/dist/lib/eval-trigger-tester.js +11 -96
- package/dist/lib/eval-trigger-tester.js.map +7 -1
- package/dist/lib/eval-worktree.js +8 -87
- package/dist/lib/eval-worktree.js.map +7 -1
- package/dist/lib/gateway-entry.js +20 -18
- package/dist/lib/gateway-entry.js.map +7 -1
- package/dist/lib/gateway-lifecycle.js +22 -97
- package/dist/lib/gateway-lifecycle.js.map +7 -1
- package/dist/lib/gateway.js +12 -216
- package/dist/lib/gateway.js.map +7 -1
- package/dist/lib/handlers/cron-close-stale-sessions.js +18 -7
- package/dist/lib/handlers/cron-close-stale-sessions.js.map +7 -1
- package/dist/lib/handlers/cron-data-integrity-audit.js +21 -15
- package/dist/lib/handlers/cron-data-integrity-audit.js.map +7 -1
- package/dist/lib/handlers/cron-refresh-skills.js +7 -90
- package/dist/lib/handlers/cron-refresh-skills.js.map +7 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +14 -158
- package/dist/lib/handlers/cron-suggest-instructions.js.map +7 -1
- package/dist/lib/handlers/process-announcement.js +11 -0
- package/dist/lib/handlers/process-announcement.js.map +7 -0
- package/dist/lib/handlers/process-changelog.js +11 -0
- package/dist/lib/handlers/process-changelog.js.map +7 -0
- package/dist/lib/handlers/process-conversation.js +14 -35
- package/dist/lib/handlers/process-conversation.js.map +7 -1
- package/dist/lib/handlers/process-eval.js +15 -207
- package/dist/lib/handlers/process-eval.js.map +7 -1
- package/dist/lib/handlers/process-insights.js +14 -300
- package/dist/lib/handlers/process-insights.js.map +7 -1
- package/dist/lib/handlers/process-launch.js +16 -41
- package/dist/lib/handlers/process-launch.js.map +7 -1
- package/dist/lib/handlers/process-run-cleanup.js +13 -0
- package/dist/lib/handlers/process-run-cleanup.js.map +7 -0
- package/dist/lib/handlers/process-send-message.js +10 -0
- package/dist/lib/handlers/process-send-message.js.map +7 -0
- package/dist/lib/handlers/process-session-goal.js +11 -0
- package/dist/lib/handlers/process-session-goal.js.map +7 -0
- package/dist/lib/hooks-config.js +52 -544
- package/dist/lib/hooks-config.js.map +7 -1
- package/dist/lib/insights-prompts.js +12 -145
- package/dist/lib/insights-prompts.js.map +7 -1
- package/dist/lib/job-helpers.js +1 -0
- package/dist/lib/job-helpers.js.map +7 -0
- package/dist/lib/llm-client.js +16 -274
- package/dist/lib/llm-client.js.map +7 -1
- package/dist/lib/manual-tasks.js +22 -0
- package/dist/lib/manual-tasks.js.map +7 -0
- package/dist/lib/output.js +12 -36
- package/dist/lib/output.js.map +7 -1
- package/dist/lib/permanent-job-error.js +10 -23
- package/dist/lib/permanent-job-error.js.map +7 -1
- package/dist/lib/provider-aggregator.js +57 -55
- package/dist/lib/provider-aggregator.js.map +7 -1
- package/dist/lib/research-client.js +12 -0
- package/dist/lib/research-client.js.map +7 -0
- package/dist/lib/skills-loader.js +8 -51
- package/dist/lib/skills-loader.js.map +7 -1
- package/dist/lib/statusline-shim.js +16 -0
- package/dist/lib/statusline-shim.js.map +7 -0
- package/dist/lib/terminal-target-heartbeat.js +15 -0
- package/dist/lib/terminal-target-heartbeat.js.map +7 -0
- package/dist/lib/tmux.js +16 -0
- package/dist/lib/tmux.js.map +7 -0
- package/dist/lib/transcript-rate-limit-watcher.js +22 -0
- package/dist/lib/transcript-rate-limit-watcher.js.map +7 -0
- package/dist/lib/types.js +8 -7
- package/dist/lib/types.js.map +7 -1
- package/dist/lib/version-check.js +10 -106
- package/dist/lib/version-check.js.map +7 -1
- package/dist/lib/which.js +8 -0
- package/dist/lib/which.js.map +7 -0
- package/dist/lib/worktree.js +17 -0
- package/dist/lib/worktree.js.map +7 -0
- package/dist/opencode-IQ7X5YMJ.js +190 -0
- package/dist/opencode-IQ7X5YMJ.js.map +7 -0
- package/oclif.manifest.json +299 -66
- package/package.json +28 -10
- package/dist/base-command.d.ts +0 -12
- package/dist/base-command.d.ts.map +0 -1
- package/dist/commands/auth/create-key.d.ts +0 -11
- package/dist/commands/auth/create-key.d.ts.map +0 -1
- package/dist/commands/auth/login.d.ts +0 -11
- package/dist/commands/auth/login.d.ts.map +0 -1
- package/dist/commands/auth/logout.d.ts +0 -7
- package/dist/commands/auth/logout.d.ts.map +0 -1
- package/dist/commands/auth/revoke-key.d.ts +0 -10
- package/dist/commands/auth/revoke-key.d.ts.map +0 -1
- package/dist/commands/auth/status.d.ts +0 -7
- package/dist/commands/auth/status.d.ts.map +0 -1
- package/dist/commands/catalog/index.d.ts +0 -11
- package/dist/commands/catalog/index.d.ts.map +0 -1
- package/dist/commands/catalog/recommend.d.ts +0 -9
- package/dist/commands/catalog/recommend.d.ts.map +0 -1
- package/dist/commands/convert.d.ts +0 -15
- package/dist/commands/convert.d.ts.map +0 -1
- package/dist/commands/converters.d.ts +0 -12
- package/dist/commands/converters.d.ts.map +0 -1
- package/dist/commands/crons/list.d.ts +0 -7
- package/dist/commands/crons/list.d.ts.map +0 -1
- package/dist/commands/crons/run.d.ts +0 -13
- package/dist/commands/crons/run.d.ts.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -10
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/eval-targets/create.d.ts +0 -14
- package/dist/commands/eval-targets/create.d.ts.map +0 -1
- package/dist/commands/eval-targets/list.d.ts +0 -10
- package/dist/commands/eval-targets/list.d.ts.map +0 -1
- package/dist/commands/evals/benchmark.d.ts +0 -13
- package/dist/commands/evals/benchmark.d.ts.map +0 -1
- package/dist/commands/evals/compare.d.ts +0 -15
- package/dist/commands/evals/compare.d.ts.map +0 -1
- package/dist/commands/evals/create.d.ts +0 -17
- package/dist/commands/evals/create.d.ts.map +0 -1
- package/dist/commands/evals/listen.d.ts +0 -37
- package/dist/commands/evals/listen.d.ts.map +0 -1
- package/dist/commands/evals/listen.js +0 -188
- package/dist/commands/evals/listen.js.map +0 -1
- package/dist/commands/evals/listen.test.d.ts +0 -2
- package/dist/commands/evals/listen.test.d.ts.map +0 -1
- package/dist/commands/evals/listen.test.js +0 -48
- package/dist/commands/evals/listen.test.js.map +0 -1
- package/dist/commands/evals/optimize-description.d.ts +0 -22
- package/dist/commands/evals/optimize-description.d.ts.map +0 -1
- package/dist/commands/evals/optimize.d.ts +0 -22
- package/dist/commands/evals/optimize.d.ts.map +0 -1
- package/dist/commands/evals/run.d.ts +0 -21
- package/dist/commands/evals/run.d.ts.map +0 -1
- package/dist/commands/gateway/ensure.d.ts +0 -7
- package/dist/commands/gateway/ensure.d.ts.map +0 -1
- package/dist/commands/hooks/install.d.ts +0 -16
- package/dist/commands/hooks/install.d.ts.map +0 -1
- package/dist/commands/hooks/run.d.ts +0 -11
- package/dist/commands/hooks/run.d.ts.map +0 -1
- package/dist/commands/hooks/uninstall.d.ts +0 -7
- package/dist/commands/hooks/uninstall.d.ts.map +0 -1
- package/dist/commands/import.d.ts +0 -17
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/instructions/create.d.ts +0 -17
- package/dist/commands/instructions/create.d.ts.map +0 -1
- package/dist/commands/instructions/delete.d.ts +0 -13
- package/dist/commands/instructions/delete.d.ts.map +0 -1
- package/dist/commands/instructions/fork.d.ts +0 -10
- package/dist/commands/instructions/fork.d.ts.map +0 -1
- package/dist/commands/instructions/get.d.ts +0 -15
- package/dist/commands/instructions/get.d.ts.map +0 -1
- package/dist/commands/instructions/list.d.ts +0 -12
- package/dist/commands/instructions/list.d.ts.map +0 -1
- package/dist/commands/instructions/promote.d.ts +0 -14
- package/dist/commands/instructions/promote.d.ts.map +0 -1
- package/dist/commands/instructions/pull.d.ts +0 -9
- package/dist/commands/instructions/pull.d.ts.map +0 -1
- package/dist/commands/instructions/upstream.d.ts +0 -9
- package/dist/commands/instructions/upstream.d.ts.map +0 -1
- package/dist/commands/instructions/versions.d.ts +0 -12
- package/dist/commands/instructions/versions.d.ts.map +0 -1
- package/dist/commands/org/current.d.ts +0 -7
- package/dist/commands/org/current.d.ts.map +0 -1
- package/dist/commands/org/list.d.ts +0 -7
- package/dist/commands/org/list.d.ts.map +0 -1
- package/dist/commands/org/switch.d.ts +0 -13
- package/dist/commands/org/switch.d.ts.map +0 -1
- package/dist/commands/packs/add-instruction.d.ts +0 -11
- package/dist/commands/packs/add-instruction.d.ts.map +0 -1
- package/dist/commands/packs/apply.d.ts +0 -13
- package/dist/commands/packs/apply.d.ts.map +0 -1
- package/dist/commands/packs/create.d.ts +0 -13
- package/dist/commands/packs/create.d.ts.map +0 -1
- package/dist/commands/packs/fork.d.ts +0 -10
- package/dist/commands/packs/fork.d.ts.map +0 -1
- package/dist/commands/packs/get.d.ts +0 -10
- package/dist/commands/packs/get.d.ts.map +0 -1
- package/dist/commands/packs/list.d.ts +0 -22
- package/dist/commands/packs/list.d.ts.map +0 -1
- package/dist/commands/packs/remove-instruction.d.ts +0 -11
- package/dist/commands/packs/remove-instruction.d.ts.map +0 -1
- package/dist/commands/proxy/env.d.ts +0 -14
- package/dist/commands/proxy/env.d.ts.map +0 -1
- package/dist/commands/proxy/logs.d.ts +0 -11
- package/dist/commands/proxy/logs.d.ts.map +0 -1
- package/dist/commands/proxy/restart.d.ts +0 -11
- package/dist/commands/proxy/restart.d.ts.map +0 -1
- package/dist/commands/proxy/setup.d.ts +0 -23
- package/dist/commands/proxy/setup.d.ts.map +0 -1
- package/dist/commands/proxy/start.d.ts +0 -17
- package/dist/commands/proxy/start.d.ts.map +0 -1
- package/dist/commands/proxy/status.d.ts +0 -7
- package/dist/commands/proxy/status.d.ts.map +0 -1
- package/dist/commands/proxy/stop.d.ts +0 -8
- package/dist/commands/proxy/stop.d.ts.map +0 -1
- package/dist/commands/service/install.d.ts +0 -33
- package/dist/commands/service/install.d.ts.map +0 -1
- package/dist/commands/service/install.test.d.ts +0 -2
- package/dist/commands/service/install.test.d.ts.map +0 -1
- package/dist/commands/service/install.test.js +0 -345
- package/dist/commands/service/install.test.js.map +0 -1
- package/dist/commands/service/status.d.ts +0 -6
- package/dist/commands/service/status.d.ts.map +0 -1
- package/dist/commands/service/uninstall.d.ts +0 -6
- package/dist/commands/service/uninstall.d.ts.map +0 -1
- package/dist/commands/sessions/analyze.d.ts +0 -10
- package/dist/commands/sessions/analyze.d.ts.map +0 -1
- package/dist/commands/sessions/end.d.ts +0 -9
- package/dist/commands/sessions/end.d.ts.map +0 -1
- package/dist/commands/sessions/import.d.ts +0 -13
- package/dist/commands/sessions/import.d.ts.map +0 -1
- package/dist/commands/sessions/list.d.ts +0 -11
- package/dist/commands/sessions/list.d.ts.map +0 -1
- package/dist/commands/sessions/start.d.ts +0 -11
- package/dist/commands/sessions/start.d.ts.map +0 -1
- package/dist/commands/signals/report.d.ts +0 -10
- package/dist/commands/signals/report.d.ts.map +0 -1
- package/dist/commands/signals/report.test.d.ts +0 -2
- package/dist/commands/signals/report.test.d.ts.map +0 -1
- package/dist/commands/signals/report.test.js +0 -65
- package/dist/commands/signals/report.test.js.map +0 -1
- package/dist/commands/skills/export-approved.d.ts +0 -10
- package/dist/commands/skills/export-approved.d.ts.map +0 -1
- package/dist/commands/skills/install.d.ts +0 -15
- package/dist/commands/skills/install.d.ts.map +0 -1
- package/dist/commands/skills/list.d.ts +0 -11
- package/dist/commands/skills/list.d.ts.map +0 -1
- package/dist/commands/skills/publish.d.ts +0 -17
- package/dist/commands/skills/publish.d.ts.map +0 -1
- package/dist/commands/skills/search.d.ts +0 -17
- package/dist/commands/skills/search.d.ts.map +0 -1
- package/dist/commands/skills/update.d.ts +0 -10
- package/dist/commands/skills/update.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.d.ts +0 -16
- package/dist/commands/suggestions/accept.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.test.d.ts +0 -2
- package/dist/commands/suggestions/accept.test.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.test.js +0 -52
- package/dist/commands/suggestions/accept.test.js.map +0 -1
- package/dist/commands/suggestions/dismiss.d.ts +0 -10
- package/dist/commands/suggestions/dismiss.d.ts.map +0 -1
- package/dist/commands/suggestions/list.d.ts +0 -10
- package/dist/commands/suggestions/list.d.ts.map +0 -1
- package/dist/commands/suggestions/refresh.d.ts +0 -7
- package/dist/commands/suggestions/refresh.d.ts.map +0 -1
- package/dist/dashboard/Dashboard.d.ts +0 -3
- package/dist/dashboard/Dashboard.d.ts.map +0 -1
- package/dist/dashboard/data.d.ts +0 -11
- package/dist/dashboard/data.d.ts.map +0 -1
- package/dist/dashboard/panels/friction.d.ts +0 -7
- package/dist/dashboard/panels/friction.d.ts.map +0 -1
- package/dist/dashboard/panels/insights.d.ts +0 -8
- package/dist/dashboard/panels/insights.d.ts.map +0 -1
- package/dist/dashboard/panels/instructions.d.ts +0 -9
- package/dist/dashboard/panels/instructions.d.ts.map +0 -1
- package/dist/dashboard/panels/outcomes.d.ts +0 -7
- package/dist/dashboard/panels/outcomes.d.ts.map +0 -1
- package/dist/dashboard/panels/overview.d.ts +0 -8
- package/dist/dashboard/panels/overview.d.ts.map +0 -1
- package/dist/dashboard/panels/shared.d.ts +0 -17
- package/dist/dashboard/panels/shared.d.ts.map +0 -1
- package/dist/dashboard/types.d.ts +0 -80
- package/dist/dashboard/types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.d.ts +0 -22
- package/dist/lib/active-org-refresh.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.test.d.ts +0 -2
- package/dist/lib/active-org-refresh.test.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.test.js +0 -190
- package/dist/lib/active-org-refresh.test.js.map +0 -1
- package/dist/lib/active-org.d.ts +0 -43
- package/dist/lib/active-org.d.ts.map +0 -1
- package/dist/lib/active-org.test.d.ts +0 -2
- package/dist/lib/active-org.test.d.ts.map +0 -1
- package/dist/lib/active-org.test.js +0 -147
- package/dist/lib/active-org.test.js.map +0 -1
- package/dist/lib/api-client.d.ts +0 -17
- package/dist/lib/api-client.d.ts.map +0 -1
- package/dist/lib/api-client.test.d.ts +0 -2
- package/dist/lib/api-client.test.d.ts.map +0 -1
- package/dist/lib/api-client.test.js +0 -161
- package/dist/lib/api-client.test.js.map +0 -1
- package/dist/lib/auth.d.ts +0 -27
- package/dist/lib/auth.d.ts.map +0 -1
- package/dist/lib/auth.test.d.ts +0 -2
- package/dist/lib/auth.test.d.ts.map +0 -1
- package/dist/lib/auth.test.js +0 -110
- package/dist/lib/auth.test.js.map +0 -1
- package/dist/lib/cron-registry.d.ts +0 -47
- package/dist/lib/cron-registry.d.ts.map +0 -1
- package/dist/lib/cron-registry.js +0 -102
- package/dist/lib/cron-registry.js.map +0 -1
- package/dist/lib/cron-registry.test.d.ts +0 -2
- package/dist/lib/cron-registry.test.d.ts.map +0 -1
- package/dist/lib/cron-registry.test.js +0 -136
- package/dist/lib/cron-registry.test.js.map +0 -1
- package/dist/lib/cron-runner.d.ts +0 -16
- package/dist/lib/cron-runner.d.ts.map +0 -1
- package/dist/lib/cron-runner.js +0 -68
- package/dist/lib/cron-runner.js.map +0 -1
- package/dist/lib/detect-languages.d.ts +0 -7
- package/dist/lib/detect-languages.d.ts.map +0 -1
- package/dist/lib/detect-languages.test.d.ts +0 -2
- package/dist/lib/detect-languages.test.d.ts.map +0 -1
- package/dist/lib/detect-languages.test.js +0 -29
- package/dist/lib/detect-languages.test.js.map +0 -1
- package/dist/lib/eval-analyzer.d.ts +0 -23
- package/dist/lib/eval-analyzer.d.ts.map +0 -1
- package/dist/lib/eval-benchmark.d.ts +0 -17
- package/dist/lib/eval-benchmark.d.ts.map +0 -1
- package/dist/lib/eval-conversation-handler.d.ts +0 -9
- package/dist/lib/eval-conversation-handler.d.ts.map +0 -1
- package/dist/lib/eval-executor.d.ts +0 -21
- package/dist/lib/eval-executor.d.ts.map +0 -1
- package/dist/lib/eval-executor.test.d.ts +0 -2
- package/dist/lib/eval-executor.test.d.ts.map +0 -1
- package/dist/lib/eval-executor.test.js +0 -8
- package/dist/lib/eval-executor.test.js.map +0 -1
- package/dist/lib/eval-grader.d.ts +0 -38
- package/dist/lib/eval-grader.d.ts.map +0 -1
- package/dist/lib/eval-grader.test.d.ts +0 -2
- package/dist/lib/eval-grader.test.d.ts.map +0 -1
- package/dist/lib/eval-grader.test.js +0 -8
- package/dist/lib/eval-grader.test.js.map +0 -1
- package/dist/lib/eval-meta-judge.d.ts +0 -28
- package/dist/lib/eval-meta-judge.d.ts.map +0 -1
- package/dist/lib/eval-trigger-tester.d.ts +0 -19
- package/dist/lib/eval-trigger-tester.d.ts.map +0 -1
- package/dist/lib/eval-worktree.d.ts +0 -11
- package/dist/lib/eval-worktree.d.ts.map +0 -1
- package/dist/lib/eval-worktree.test.d.ts +0 -2
- package/dist/lib/eval-worktree.test.d.ts.map +0 -1
- package/dist/lib/eval-worktree.test.js +0 -68
- package/dist/lib/eval-worktree.test.js.map +0 -1
- package/dist/lib/gateway-entry.d.ts +0 -3
- package/dist/lib/gateway-entry.d.ts.map +0 -1
- package/dist/lib/gateway-lifecycle.d.ts +0 -9
- package/dist/lib/gateway-lifecycle.d.ts.map +0 -1
- package/dist/lib/gateway.d.ts +0 -11
- package/dist/lib/gateway.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.d.ts +0 -124
- package/dist/lib/graphile-worker-runner.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.js +0 -526
- package/dist/lib/graphile-worker-runner.js.map +0 -1
- package/dist/lib/graphile-worker-runner.test.d.ts +0 -2
- package/dist/lib/graphile-worker-runner.test.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.test.js +0 -153
- package/dist/lib/graphile-worker-runner.test.js.map +0 -1
- package/dist/lib/handlers/cron-close-stale-sessions.d.ts +0 -3
- package/dist/lib/handlers/cron-close-stale-sessions.d.ts.map +0 -1
- package/dist/lib/handlers/cron-data-integrity-audit.d.ts +0 -3
- package/dist/lib/handlers/cron-data-integrity-audit.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.d.ts +0 -3
- package/dist/lib/handlers/cron-refresh-skills.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.test.d.ts +0 -2
- package/dist/lib/handlers/cron-refresh-skills.test.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.test.js +0 -114
- package/dist/lib/handlers/cron-refresh-skills.test.js.map +0 -1
- package/dist/lib/handlers/cron-regenerate-insights.d.ts +0 -3
- package/dist/lib/handlers/cron-regenerate-insights.d.ts.map +0 -1
- package/dist/lib/handlers/cron-regenerate-insights.js +0 -6
- package/dist/lib/handlers/cron-regenerate-insights.js.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.d.ts +0 -3
- package/dist/lib/handlers/cron-suggest-instructions.d.ts.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.test.d.ts +0 -2
- package/dist/lib/handlers/cron-suggest-instructions.test.d.ts.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.test.js +0 -80
- package/dist/lib/handlers/cron-suggest-instructions.test.js.map +0 -1
- package/dist/lib/handlers/process-conversation.d.ts +0 -35
- package/dist/lib/handlers/process-conversation.d.ts.map +0 -1
- package/dist/lib/handlers/process-eval.d.ts +0 -32
- package/dist/lib/handlers/process-eval.d.ts.map +0 -1
- package/dist/lib/handlers/process-insights.d.ts +0 -39
- package/dist/lib/handlers/process-insights.d.ts.map +0 -1
- package/dist/lib/handlers/process-launch.d.ts +0 -29
- package/dist/lib/handlers/process-launch.d.ts.map +0 -1
- package/dist/lib/hooks-config.d.ts +0 -119
- package/dist/lib/hooks-config.d.ts.map +0 -1
- package/dist/lib/hooks-config.test.d.ts +0 -2
- package/dist/lib/hooks-config.test.d.ts.map +0 -1
- package/dist/lib/hooks-config.test.js +0 -231
- package/dist/lib/hooks-config.test.js.map +0 -1
- package/dist/lib/insights-prompts.d.ts +0 -13
- package/dist/lib/insights-prompts.d.ts.map +0 -1
- package/dist/lib/llm-client.d.ts +0 -26
- package/dist/lib/llm-client.d.ts.map +0 -1
- package/dist/lib/llm-client.test.d.ts +0 -2
- package/dist/lib/llm-client.test.d.ts.map +0 -1
- package/dist/lib/llm-client.test.js +0 -62
- package/dist/lib/llm-client.test.js.map +0 -1
- package/dist/lib/mirror-writer-db.d.ts +0 -12
- package/dist/lib/mirror-writer-db.d.ts.map +0 -1
- package/dist/lib/mirror-writer-db.js +0 -51
- package/dist/lib/mirror-writer-db.js.map +0 -1
- package/dist/lib/mirror-writer.d.ts +0 -35
- package/dist/lib/mirror-writer.d.ts.map +0 -1
- package/dist/lib/mirror-writer.js +0 -27
- package/dist/lib/mirror-writer.js.map +0 -1
- package/dist/lib/mirror-writer.test.d.ts +0 -2
- package/dist/lib/mirror-writer.test.d.ts.map +0 -1
- package/dist/lib/mirror-writer.test.js +0 -47
- package/dist/lib/mirror-writer.test.js.map +0 -1
- package/dist/lib/output.d.ts +0 -4
- package/dist/lib/output.d.ts.map +0 -1
- package/dist/lib/output.test.d.ts +0 -2
- package/dist/lib/output.test.d.ts.map +0 -1
- package/dist/lib/output.test.js +0 -71
- package/dist/lib/output.test.js.map +0 -1
- package/dist/lib/permanent-job-error.d.ts +0 -17
- package/dist/lib/permanent-job-error.d.ts.map +0 -1
- package/dist/lib/permanent-job-error.test.d.ts +0 -2
- package/dist/lib/permanent-job-error.test.d.ts.map +0 -1
- package/dist/lib/permanent-job-error.test.js +0 -29
- package/dist/lib/permanent-job-error.test.js.map +0 -1
- package/dist/lib/provider-aggregator.d.ts +0 -24
- package/dist/lib/provider-aggregator.d.ts.map +0 -1
- package/dist/lib/provider-aggregator.test.d.ts +0 -2
- package/dist/lib/provider-aggregator.test.d.ts.map +0 -1
- package/dist/lib/provider-aggregator.test.js +0 -103
- package/dist/lib/provider-aggregator.test.js.map +0 -1
- package/dist/lib/skills-loader.d.ts +0 -6
- package/dist/lib/skills-loader.d.ts.map +0 -1
- package/dist/lib/types.d.ts +0 -48
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/version-check.d.ts +0 -11
- package/dist/lib/version-check.d.ts.map +0 -1
- package/dist/test-helpers.d.ts +0 -58
- package/dist/test-helpers.d.ts.map +0 -1
- package/dist/test-helpers.js +0 -58
- package/dist/test-helpers.js.map +0 -1
|
@@ -1,92 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export async function aggregateBenchmark(targetId, iteration) {
|
|
15
|
-
const query = iteration ? `?iteration=${iteration}` : '';
|
|
16
|
-
const runs = await apiGet(`/api/eval-targets/${targetId}/runs${query}`);
|
|
17
|
-
const completedRuns = runs.filter((r) => r.status === 'completed');
|
|
18
|
-
if (completedRuns.length === 0) {
|
|
19
|
-
return { runSummary: {}, notes: ['No completed runs found'], totalRuns: 0 };
|
|
20
|
-
}
|
|
21
|
-
// Group by configuration
|
|
22
|
-
const byConfig = {};
|
|
23
|
-
for (const run of completedRuns) {
|
|
24
|
-
if (!byConfig[run.configuration])
|
|
25
|
-
byConfig[run.configuration] = [];
|
|
26
|
-
byConfig[run.configuration].push(run);
|
|
27
|
-
}
|
|
28
|
-
const runSummary = {};
|
|
29
|
-
const notes = [];
|
|
30
|
-
for (const [config, configRuns] of Object.entries(byConfig)) {
|
|
31
|
-
const passRates = configRuns
|
|
32
|
-
.filter((r) => Object.keys(r.grading).length > 0)
|
|
33
|
-
.map((r) => r.grading.summary?.pass_rate ?? 0);
|
|
34
|
-
const durations = configRuns
|
|
35
|
-
.map((r) => r.timing.duration_ms / 1000)
|
|
36
|
-
.filter((v) => !isNaN(v));
|
|
37
|
-
const tokens = configRuns
|
|
38
|
-
.map((r) => r.timing.total_tokens ?? 0)
|
|
39
|
-
.filter((v) => v > 0);
|
|
40
|
-
runSummary[config] = {};
|
|
41
|
-
if (passRates.length > 0)
|
|
42
|
-
runSummary[config].pass_rate = computeStats(passRates);
|
|
43
|
-
if (durations.length > 0)
|
|
44
|
-
runSummary[config].time_seconds = computeStats(durations);
|
|
45
|
-
if (tokens.length > 0)
|
|
46
|
-
runSummary[config].tokens = computeStats(tokens);
|
|
47
|
-
}
|
|
48
|
-
// Compute delta if both configurations exist
|
|
49
|
-
if (runSummary.with_target && runSummary.without_target) {
|
|
50
|
-
const delta = {};
|
|
51
|
-
for (const metric of ['pass_rate', 'time_seconds', 'tokens']) {
|
|
52
|
-
const withVal = runSummary.with_target[metric]?.mean ?? 0;
|
|
53
|
-
const withoutVal = runSummary.without_target[metric]?.mean ?? 0;
|
|
54
|
-
const diff = withVal - withoutVal;
|
|
55
|
-
delta[metric] = `${diff >= 0 ? '+' : ''}${Math.round(diff * 1000) / 1000}`;
|
|
56
|
-
}
|
|
57
|
-
runSummary.delta = delta;
|
|
58
|
-
// Generate analysis notes
|
|
59
|
-
const passRateDelta = (runSummary.with_target.pass_rate?.mean ?? 0) - (runSummary.without_target.pass_rate?.mean ?? 0);
|
|
60
|
-
if (passRateDelta > 0.1) {
|
|
61
|
-
notes.push(`Target improves pass rate by ${(passRateDelta * 100).toFixed(0)}%`);
|
|
62
|
-
}
|
|
63
|
-
else if (passRateDelta < -0.1) {
|
|
64
|
-
notes.push(`Target decreases pass rate by ${(Math.abs(passRateDelta) * 100).toFixed(0)}%`);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
notes.push('Target has minimal impact on pass rate');
|
|
68
|
-
}
|
|
69
|
-
const timeDelta = (runSummary.with_target.time_seconds?.mean ?? 0) - (runSummary.without_target.time_seconds?.mean ?? 0);
|
|
70
|
-
if (Math.abs(timeDelta) > 5) {
|
|
71
|
-
notes.push(`Target ${timeDelta > 0 ? 'adds' : 'saves'} ${Math.abs(timeDelta).toFixed(1)}s average execution time`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Check for high variance
|
|
75
|
-
for (const [config, stats] of Object.entries(runSummary)) {
|
|
76
|
-
if (config === 'delta')
|
|
77
|
-
continue;
|
|
78
|
-
const passRate = stats.pass_rate;
|
|
79
|
-
if (passRate && passRate.stddev > 0.2) {
|
|
80
|
-
notes.push(`${config} shows high pass rate variance (stddev=${passRate.stddev.toFixed(2)}) — results may be unreliable`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return { runSummary, notes, totalRuns: completedRuns.length };
|
|
84
|
-
}
|
|
85
|
-
export async function postBenchmark(targetId, iteration, result) {
|
|
86
|
-
return apiPost(`/api/eval-targets/${targetId}/benchmarks`, {
|
|
87
|
-
iteration,
|
|
88
|
-
runSummary: result.runSummary,
|
|
89
|
-
notes: result.notes,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=eval-benchmark.js.map
|
|
1
|
+
import {
|
|
2
|
+
aggregateBenchmark,
|
|
3
|
+
postBenchmark
|
|
4
|
+
} from "../chunk-PQU7GZ7A.js";
|
|
5
|
+
import "../chunk-EJOI2ZGU.js";
|
|
6
|
+
import "../chunk-KZRFUXGF.js";
|
|
7
|
+
import "../chunk-NSBPE2FW.js";
|
|
8
|
+
export {
|
|
9
|
+
aggregateBenchmark,
|
|
10
|
+
postBenchmark
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=eval-benchmark.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,200 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const hasResponse = messages.slice(msgIdx + 1).some((m) => m.role === 'assistant' && (m.type === 'results' || m.type === 'proposal' || m.type === 'generated' || m.type === 'text'));
|
|
15
|
-
if (hasResponse) {
|
|
16
|
-
logger(`Message ${messageId} already processed — skipping (idempotency guard)`);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
// Helper to post assistant messages
|
|
21
|
-
const postMessage = async (content, type, data) => {
|
|
22
|
-
await apiPost(`/api/eval-conversations/${conversationId}/messages/assistant`, {
|
|
23
|
-
content,
|
|
24
|
-
type,
|
|
25
|
-
data,
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
// Decide what action to take
|
|
29
|
-
const decision = await decideAction(target, evalCases, messages, messageContent, logger);
|
|
30
|
-
logger(`Action: ${decision.action}`);
|
|
31
|
-
switch (decision.action) {
|
|
32
|
-
case 'run_evals':
|
|
33
|
-
await handleRunEvals(target, evalCases, conversationId, postMessage, logger);
|
|
34
|
-
break;
|
|
35
|
-
case 'generate_cases':
|
|
36
|
-
await handleGenerateCases(target, evalTargetId, conversationId, postMessage, logger);
|
|
37
|
-
break;
|
|
38
|
-
case 'analyze_results':
|
|
39
|
-
case 'propose_changes':
|
|
40
|
-
await handleAnalyzeAndPropose(target, evalCases, messages, messageContent, conversationId, postMessage, logger);
|
|
41
|
-
break;
|
|
42
|
-
case 'respond':
|
|
43
|
-
await postMessage(decision.response, 'text');
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async function decideAction(target, evalCases, messages, latestMessage, logger) {
|
|
48
|
-
// Build conversation summary for context
|
|
49
|
-
const recentMessages = messages.slice(-10).map((m) => `${m.role}: ${m.content.slice(0, 200)}`).join('\n');
|
|
50
|
-
const prompt = `You are an eval assistant. Decide what action to take based on the user's message.
|
|
51
|
-
|
|
52
|
-
## Current State
|
|
53
|
-
- Eval target: "${target.name}" v${target.version} (${target.type})
|
|
54
|
-
- Eval cases: ${evalCases.length} defined${evalCases.length > 0 ? ` (${evalCases.map((e) => e.name).join(', ')})` : ''}
|
|
55
|
-
- Content length: ${target.content.length} chars
|
|
56
|
-
|
|
57
|
-
## Recent Conversation
|
|
58
|
-
${recentMessages}
|
|
59
|
-
|
|
60
|
-
## User's Latest Message
|
|
61
|
-
${latestMessage}
|
|
62
|
-
|
|
63
|
-
## Available Actions
|
|
64
|
-
- run_evals: Run all eval cases against current version (with + without target). Choose this when the user wants to test, evaluate, or see how the instruction performs.
|
|
65
|
-
- generate_cases: Auto-generate eval test cases from the instruction content. Choose this when there are no eval cases (${evalCases.length} currently) or user asks to create/generate tests.
|
|
66
|
-
- analyze_results: Analyze recent eval failures and propose improvements based on user feedback. Choose this when user gives qualitative feedback like "this is wrong", "missing X", etc.
|
|
67
|
-
- propose_changes: Propose specific content edits based on conversation. Choose this when user asks for improvements or changes.
|
|
68
|
-
- respond: Just answer a question without running any evals. Choose this for informational questions.
|
|
69
|
-
|
|
70
|
-
Respond with ONLY valid JSON:
|
|
71
|
-
{"action": "run_evals", "response": "What you want to say to the user", "params": {}}`;
|
|
72
|
-
const result = await executeEval({ prompt, timeout: 30_000 });
|
|
73
|
-
try {
|
|
74
|
-
let jsonStr = result.output.trim();
|
|
75
|
-
const jsonMatch = jsonStr.match(/\{[\s\S]*\}/);
|
|
76
|
-
if (jsonMatch)
|
|
77
|
-
jsonStr = jsonMatch[0];
|
|
78
|
-
return JSON.parse(jsonStr);
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
logger('Failed to parse action decision, defaulting to respond');
|
|
82
|
-
// Fallback: simple heuristics
|
|
83
|
-
const lower = latestMessage.toLowerCase();
|
|
84
|
-
if (lower.includes('run') || lower.includes('test') || lower.includes('eval')) {
|
|
85
|
-
return { action: 'run_evals', response: 'Running evals now...' };
|
|
86
|
-
}
|
|
87
|
-
if (lower.includes('generate') || lower.includes('create') || (evalCases.length === 0 && lower.includes('start'))) {
|
|
88
|
-
return { action: 'generate_cases', response: 'Generating test cases...' };
|
|
89
|
-
}
|
|
90
|
-
return { action: 'respond', response: 'I can help you run evals, generate test cases, or analyze results. What would you like to do?' };
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async function handleRunEvals(target, evalCases, _conversationId, postMessage, logger) {
|
|
94
|
-
if (evalCases.length === 0) {
|
|
95
|
-
await postMessage('No eval cases exist yet. Would you like me to generate some from the instruction content?', 'text');
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
await postMessage(`Running ${evalCases.length} evals against "${target.name}" v${target.version}...`, 'status');
|
|
99
|
-
const results = [];
|
|
100
|
-
// Run with_target
|
|
101
|
-
for (const eval_ of evalCases) {
|
|
102
|
-
logger(`Running: ${eval_.name} (with_target)`);
|
|
103
|
-
const execResult = await executeEval({
|
|
104
|
-
prompt: eval_.prompt,
|
|
105
|
-
targetContent: target.content,
|
|
106
|
-
timeout: 120_000,
|
|
107
|
-
});
|
|
108
|
-
let passed = false;
|
|
109
|
-
let evidence = '';
|
|
110
|
-
if (!execResult.error && eval_.expectations.length > 0) {
|
|
111
|
-
const grading = await gradeEvalOutput({
|
|
112
|
-
prompt: eval_.prompt,
|
|
113
|
-
output: execResult.output,
|
|
114
|
-
expectations: eval_.expectations,
|
|
115
|
-
timeout: 120_000,
|
|
116
|
-
});
|
|
117
|
-
const summary = grading?.summary;
|
|
118
|
-
passed = summary?.pass_rate >= 1.0;
|
|
119
|
-
evidence = grading?.expectations
|
|
120
|
-
?.map((e) => `${e.passed ? 'PASS' : 'FAIL'}: ${e.text} — ${e.evidence}`)
|
|
121
|
-
.join('\n') ?? '';
|
|
122
|
-
}
|
|
123
|
-
results.push({
|
|
124
|
-
evalName: eval_.name,
|
|
125
|
-
passed,
|
|
126
|
-
output: execResult.error ?? execResult.output.slice(0, 2000),
|
|
127
|
-
expectations: eval_.expectations,
|
|
128
|
-
evidence,
|
|
129
|
-
configuration: 'with_target',
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const passedCount = results.filter((r) => r.passed).length;
|
|
133
|
-
const total = results.length;
|
|
134
|
-
await postMessage(`${passedCount} of ${total} evals passed (${Math.round((passedCount / total) * 100)}%)`, 'results', {
|
|
135
|
-
summary: { passed: passedCount, failed: total - passedCount, total, passRate: passedCount / total },
|
|
136
|
-
results: results.map((r) => ({
|
|
137
|
-
evalName: r.evalName,
|
|
138
|
-
passed: r.passed,
|
|
139
|
-
output: r.output,
|
|
140
|
-
expectations: r.expectations,
|
|
141
|
-
evidence: r.evidence,
|
|
142
|
-
})),
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
async function handleGenerateCases(target, _evalTargetId, _conversationId, postMessage, logger) {
|
|
146
|
-
await postMessage('Generating eval cases from instruction content...', 'status');
|
|
147
|
-
logger('Calling eval-from-context endpoint');
|
|
148
|
-
// Use eval-from-context endpoint
|
|
149
|
-
const result = await apiPost('/api/eval-from-context', {
|
|
150
|
-
contentHash: '',
|
|
151
|
-
name: target.name,
|
|
152
|
-
type: target.type,
|
|
153
|
-
content: target.content,
|
|
154
|
-
config: { skipBaseline: false, skipGrading: false },
|
|
155
|
-
});
|
|
156
|
-
const cases = result.evals ?? [];
|
|
157
|
-
await postMessage(`Generated ${cases.length} eval cases. Review them below:`, 'generated', {
|
|
158
|
-
cases: cases.map((c) => ({
|
|
159
|
-
id: c.id,
|
|
160
|
-
name: c.name,
|
|
161
|
-
prompt: c.prompt,
|
|
162
|
-
expectations: c.expectations,
|
|
163
|
-
})),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
async function handleAnalyzeAndPropose(target, evalCases, messages, userFeedback, _conversationId, postMessage, logger) {
|
|
167
|
-
await postMessage('Analyzing results and preparing improvements...', 'status');
|
|
168
|
-
// Find the most recent results message for context
|
|
169
|
-
const lastResults = [...messages]
|
|
170
|
-
.reverse()
|
|
171
|
-
.find((m) => m.type === 'results');
|
|
172
|
-
const evalResults = lastResults?.data?.results?.map((r) => ({
|
|
173
|
-
evalName: r.evalName,
|
|
174
|
-
prompt: '',
|
|
175
|
-
expectations: r.expectations ?? [],
|
|
176
|
-
grading: {
|
|
177
|
-
summary: { pass_rate: r.passed ? 1 : 0 },
|
|
178
|
-
expectations: r.expectations?.map((e) => ({
|
|
179
|
-
text: e,
|
|
180
|
-
passed: r.passed,
|
|
181
|
-
evidence: r.evidence ?? '',
|
|
182
|
-
})),
|
|
183
|
-
},
|
|
184
|
-
})) ?? [];
|
|
185
|
-
logger(`Analyzing ${evalResults.length} eval results with user feedback`);
|
|
186
|
-
// Include user feedback in the analysis
|
|
187
|
-
const analysis = await analyzeEvalResults({
|
|
188
|
-
content: target.content,
|
|
189
|
-
evalResults,
|
|
190
|
-
model: undefined,
|
|
191
|
-
timeout: 120_000,
|
|
192
|
-
userFeedback,
|
|
193
|
-
});
|
|
194
|
-
await postMessage(analysis.overallAssessment, 'proposal', {
|
|
195
|
-
suggestions: analysis.suggestions,
|
|
196
|
-
proposedContent: analysis.proposedContent,
|
|
197
|
-
fromVersion: target.version,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
//# sourceMappingURL=eval-conversation-handler.js.map
|
|
1
|
+
import {
|
|
2
|
+
processConversationJob
|
|
3
|
+
} from "../chunk-IWYCRLEK.js";
|
|
4
|
+
import "../chunk-3TIMQ3O6.js";
|
|
5
|
+
import "../chunk-YNIH3KMU.js";
|
|
6
|
+
import "../chunk-QN34TGD3.js";
|
|
7
|
+
import "../chunk-EJOI2ZGU.js";
|
|
8
|
+
import "../chunk-KZRFUXGF.js";
|
|
9
|
+
import "../chunk-NSBPE2FW.js";
|
|
10
|
+
export {
|
|
11
|
+
processConversationJob
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=eval-conversation-handler.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,83 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const sysPrompt = targetContent ?? systemPrompt;
|
|
10
|
-
if (sysPrompt) {
|
|
11
|
-
args.push('--system-prompt', sysPrompt);
|
|
12
|
-
}
|
|
13
|
-
if (model) {
|
|
14
|
-
args.push('--model', model);
|
|
15
|
-
}
|
|
16
|
-
const startTime = Date.now();
|
|
17
|
-
return new Promise((resolve) => {
|
|
18
|
-
// Remove CLAUDECODE flag so spawned claude doesn't think it's a nested session.
|
|
19
|
-
// Remove HTTPS_PROXY so eval runs bypass the capture proxy — these are internal
|
|
20
|
-
// infrastructure calls, not user sessions. Routing through the proxy creates
|
|
21
|
-
// phantom sessions that pollute insights.
|
|
22
|
-
const env = { ...process.env };
|
|
23
|
-
delete env.CLAUDECODE;
|
|
24
|
-
delete env.HTTPS_PROXY;
|
|
25
|
-
const proc = spawn('claude', args, {
|
|
26
|
-
cwd: workDir,
|
|
27
|
-
env,
|
|
28
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
29
|
-
});
|
|
30
|
-
let stdout = '';
|
|
31
|
-
let stderr = '';
|
|
32
|
-
proc.stdout.on('data', (data) => {
|
|
33
|
-
stdout += data.toString();
|
|
34
|
-
});
|
|
35
|
-
proc.stderr.on('data', (data) => {
|
|
36
|
-
stderr += data.toString();
|
|
37
|
-
});
|
|
38
|
-
const timer = setTimeout(() => {
|
|
39
|
-
proc.kill('SIGTERM');
|
|
40
|
-
resolve({
|
|
41
|
-
output: stdout,
|
|
42
|
-
exitCode: null,
|
|
43
|
-
durationMs: Date.now() - startTime,
|
|
44
|
-
totalTokens: 0,
|
|
45
|
-
error: `Timed out after ${timeout}ms`,
|
|
46
|
-
});
|
|
47
|
-
}, timeout);
|
|
48
|
-
proc.on('close', (code) => {
|
|
49
|
-
clearTimeout(timer);
|
|
50
|
-
const durationMs = Date.now() - startTime;
|
|
51
|
-
// Try to parse JSON output for token usage
|
|
52
|
-
let totalTokens = 0;
|
|
53
|
-
let output = stdout;
|
|
54
|
-
try {
|
|
55
|
-
const parsed = JSON.parse(stdout);
|
|
56
|
-
output = parsed.result ?? parsed.content ?? stdout;
|
|
57
|
-
totalTokens = parsed.usage?.total_tokens
|
|
58
|
-
?? ((parsed.usage?.input_tokens ?? 0) + (parsed.usage?.output_tokens ?? 0));
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
// stdout wasn't JSON, use raw text
|
|
62
|
-
}
|
|
63
|
-
resolve({
|
|
64
|
-
output,
|
|
65
|
-
exitCode: code,
|
|
66
|
-
durationMs,
|
|
67
|
-
totalTokens,
|
|
68
|
-
error: code !== 0 ? stderr || `Exit code ${code}` : undefined,
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
proc.on('error', (err) => {
|
|
72
|
-
clearTimeout(timer);
|
|
73
|
-
resolve({
|
|
74
|
-
output: '',
|
|
75
|
-
exitCode: null,
|
|
76
|
-
durationMs: Date.now() - startTime,
|
|
77
|
-
totalTokens: 0,
|
|
78
|
-
error: `Failed to spawn claude: ${err.message}`,
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=eval-executor.js.map
|
|
1
|
+
import {
|
|
2
|
+
executeEval
|
|
3
|
+
} from "../chunk-QN34TGD3.js";
|
|
4
|
+
import "../chunk-NSBPE2FW.js";
|
|
5
|
+
export {
|
|
6
|
+
executeEval
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=eval-executor.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/lib/eval-grader.js
CHANGED
|
@@ -1,123 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Search the output for evidence that the expectation is met
|
|
11
|
-
- Determine PASS or FAIL (no partial credit)
|
|
12
|
-
- Cite specific evidence (quote or description)
|
|
13
|
-
|
|
14
|
-
PASS criteria:
|
|
15
|
-
- Clear evidence the assertion is true
|
|
16
|
-
- Evidence reflects genuine completion, not surface compliance
|
|
17
|
-
|
|
18
|
-
FAIL criteria:
|
|
19
|
-
- No evidence found
|
|
20
|
-
- Evidence contradicts the expectation
|
|
21
|
-
- Cannot verify from available information
|
|
22
|
-
|
|
23
|
-
Beyond the predefined expectations, extract implicit claims from the output:
|
|
24
|
-
- Factual claims ("uses TypeScript", "has 3 parameters")
|
|
25
|
-
- Process claims ("used async/await pattern")
|
|
26
|
-
- Quality claims ("handles edge cases")
|
|
27
|
-
|
|
28
|
-
Verify each claim against the actual output.
|
|
29
|
-
|
|
30
|
-
Finally, critique the eval itself — identify assertions that are too weak (pass for wrong outputs) or important outcomes that no assertion covers.
|
|
31
|
-
|
|
32
|
-
You MUST respond with ONLY a valid JSON object matching this exact structure (no markdown, no explanation, just JSON):
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
"expectations": [
|
|
36
|
-
{ "text": "assertion text", "passed": true, "evidence": "specific quote or description" }
|
|
37
|
-
],
|
|
38
|
-
"summary": { "passed": 2, "failed": 1, "total": 3, "pass_rate": 0.67 },
|
|
39
|
-
"claims": [
|
|
40
|
-
{ "claim": "statement", "type": "factual", "verified": true, "evidence": "..." }
|
|
41
|
-
],
|
|
42
|
-
"eval_feedback": {
|
|
43
|
-
"suggestions": [{ "assertion": "suggested new assertion", "reason": "why it matters" }],
|
|
44
|
-
"overall": "brief summary assessment"
|
|
45
|
-
}
|
|
46
|
-
}`;
|
|
47
|
-
/**
|
|
48
|
-
* Grades an eval output against expectations using an LLM grader.
|
|
49
|
-
*/
|
|
50
|
-
export async function gradeEvalOutput(options) {
|
|
51
|
-
const { prompt, output, expectations, model, timeout = 120_000 } = options;
|
|
52
|
-
const graderPrompt = `## Original Prompt
|
|
53
|
-
|
|
54
|
-
${prompt}
|
|
55
|
-
|
|
56
|
-
## AI Output
|
|
57
|
-
|
|
58
|
-
${output}
|
|
59
|
-
|
|
60
|
-
## Expectations to Evaluate
|
|
61
|
-
|
|
62
|
-
${expectations.map((e, i) => `${i + 1}. ${e}`).join('\n')}
|
|
63
|
-
|
|
64
|
-
Grade the output against each expectation. Respond with ONLY valid JSON.`;
|
|
65
|
-
const result = await executeEval({
|
|
66
|
-
prompt: graderPrompt,
|
|
67
|
-
targetContent: GRADER_SYSTEM_PROMPT,
|
|
68
|
-
timeout,
|
|
69
|
-
model,
|
|
70
|
-
});
|
|
71
|
-
if (result.error) {
|
|
72
|
-
// Return a failed grading if the grader itself errors
|
|
73
|
-
return {
|
|
74
|
-
expectations: expectations.map((e) => ({
|
|
75
|
-
text: e,
|
|
76
|
-
passed: false,
|
|
77
|
-
evidence: `Grader error: ${result.error}`,
|
|
78
|
-
})),
|
|
79
|
-
summary: { passed: 0, failed: expectations.length, total: expectations.length, pass_rate: 0 },
|
|
80
|
-
claims: [],
|
|
81
|
-
eval_feedback: { suggestions: [], overall: `Grading failed: ${result.error}` },
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Parse the grader's JSON response
|
|
85
|
-
try {
|
|
86
|
-
// Extract JSON from the output (handle potential markdown wrapping)
|
|
87
|
-
let jsonStr = result.output.trim();
|
|
88
|
-
const jsonMatch = jsonStr.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
89
|
-
if (jsonMatch) {
|
|
90
|
-
jsonStr = jsonMatch[1].trim();
|
|
91
|
-
}
|
|
92
|
-
// Also try to find JSON object directly
|
|
93
|
-
const objMatch = jsonStr.match(/\{[\s\S]*\}/);
|
|
94
|
-
if (objMatch) {
|
|
95
|
-
jsonStr = objMatch[0];
|
|
96
|
-
}
|
|
97
|
-
const parsed = JSON.parse(jsonStr);
|
|
98
|
-
// Validate and ensure summary is correct
|
|
99
|
-
const passed = parsed.expectations.filter((e) => e.passed).length;
|
|
100
|
-
const total = parsed.expectations.length;
|
|
101
|
-
parsed.summary = {
|
|
102
|
-
passed,
|
|
103
|
-
failed: total - passed,
|
|
104
|
-
total,
|
|
105
|
-
pass_rate: total > 0 ? passed / total : 0,
|
|
106
|
-
};
|
|
107
|
-
return parsed;
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
// If we can't parse, return a best-effort result
|
|
111
|
-
return {
|
|
112
|
-
expectations: expectations.map((e) => ({
|
|
113
|
-
text: e,
|
|
114
|
-
passed: false,
|
|
115
|
-
evidence: 'Grader output was not valid JSON',
|
|
116
|
-
})),
|
|
117
|
-
summary: { passed: 0, failed: expectations.length, total: expectations.length, pass_rate: 0 },
|
|
118
|
-
claims: [],
|
|
119
|
-
eval_feedback: { suggestions: [], overall: `Grader returned unparseable output: ${result.output.slice(0, 200)}` },
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=eval-grader.js.map
|
|
1
|
+
import {
|
|
2
|
+
gradeEvalOutput
|
|
3
|
+
} from "../chunk-YNIH3KMU.js";
|
|
4
|
+
import "../chunk-QN34TGD3.js";
|
|
5
|
+
import "../chunk-NSBPE2FW.js";
|
|
6
|
+
export {
|
|
7
|
+
gradeEvalOutput
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=eval-grader.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|