@rulemetric/cli 0.7.19 → 0.7.21
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/{chunk-45VWQP4J.js → chunk-3IOCBGFR.js} +1 -1
- package/dist/{chunk-ECHJ4MBP.js → chunk-4Q7TAY3C.js} +1 -1
- package/dist/{chunk-5WY2WM4K.js → chunk-AIHLSF43.js} +1 -1
- package/dist/chunk-CHA5SX4Y.js +1 -0
- package/dist/chunk-CJRYYV76.js +1 -0
- package/dist/{chunk-P3O2OMGC.js → chunk-DMLAMJLV.js} +1 -1
- package/dist/{chunk-KC7IOPF6.js → chunk-FYJE2DWV.js} +1 -1
- package/dist/{chunk-HDU5QPEO.js → chunk-HQJQYBXB.js} +1 -1
- package/dist/{chunk-6KU6UUYJ.js → chunk-I5EKWKQH.js} +1 -1
- package/dist/{chunk-46IYYFYR.js → chunk-IR4G5CXR.js} +1 -1
- package/dist/chunk-ISDRKWGI.js +29 -0
- package/dist/chunk-KXW3IWKQ.js +1 -0
- package/dist/{chunk-EBSMTI3X.js → chunk-L4A3NYUV.js} +1 -1
- package/dist/{chunk-O3C5IV2Y.js → chunk-L6UAON7I.js} +1 -1
- package/dist/{chunk-KAF3CYRW.js → chunk-M3PXVKW7.js} +1 -1
- package/dist/{chunk-SONOLG6I.js → chunk-NZ7NZEQV.js} +1 -1
- package/dist/{chunk-DCLWFGEA.js → chunk-SJGLRC2R.js} +1 -1
- package/dist/{chunk-FKW6PVDG.js → chunk-V7PN6AU5.js} +1 -1
- package/dist/{chunk-RTWRHIKY.js → chunk-VKPDLPO6.js} +1 -1
- package/dist/{chunk-PI2VYOU7.js → chunk-WD5QPDSE.js} +1 -1
- package/dist/{chunk-357YFS2K.js → chunk-WXFFD4IV.js} +1 -1
- package/dist/chunk-ZGDKJZII.js +1 -0
- package/dist/commands/evals/agent.js +1 -1
- package/dist/commands/evals/auto-run.js +5 -0
- package/dist/commands/evals/benchmark.js +1 -1
- package/dist/commands/evals/optimize.js +1 -1
- package/dist/commands/evals/refine-cases.js +6 -0
- package/dist/commands/evals/run.js +3 -3
- package/dist/commands/hooks/install.js +1 -1
- package/dist/dashboard/Dashboard.js +1 -1
- package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
- package/dist/lib/agent-loop.js +1 -1
- package/dist/lib/auto-run.js +1 -0
- package/dist/lib/eval-benchmark.js +1 -1
- package/dist/lib/eval-case-generator.js +1 -1
- package/dist/lib/eval-conversation-handler.js +1 -1
- package/dist/lib/eval-run-batch.js +1 -0
- package/dist/lib/handlers/cron-refresh-pricing.js +1 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +1 -1
- package/dist/lib/handlers/distill-memories.js +1 -1
- package/dist/lib/handlers/process-announcement.js +1 -1
- package/dist/lib/handlers/process-changelog.js +1 -1
- package/dist/lib/handlers/process-conversation.js +1 -1
- package/dist/lib/handlers/process-eval.js +1 -1
- package/dist/lib/handlers/process-insights.js +1 -1
- package/dist/lib/handlers/process-memory-ab.js +1 -1
- package/dist/lib/handlers/process-run-cleanup.js +1 -1
- package/dist/lib/handlers/process-session-goal.js +1 -1
- package/dist/lib/llm-client.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/dist/lib/optimize-compare.js +1 -1
- package/oclif.manifest.json +149 -1
- package/package.json +6 -6
- package/dist/chunk-5XP7WWJR.js +0 -20
- package/dist/chunk-AP4TQRZJ.js +0 -1
- package/dist/chunk-RCI5MTZP.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as P,c as C}from"../../chunk-
|
|
1
|
+
import{b as P,c as C}from"../../chunk-DMLAMJLV.js";import{a as V}from"../../chunk-GQRCSR2A.js";import{a as N}from"../../chunk-IL35G6CK.js";import"../../chunk-S6B2R2LL.js";import"../../chunk-CHA5SX4Y.js";import{b as F}from"../../chunk-WQ2BJQYB.js";import{a as A}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{e as w,f as m,g as S}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as k}from"../../chunk-ZLLER3HP.js";import{createInterface as _}from"node:readline/promises";import{Args as q,Flags as g}from"@oclif/core";var $=class O extends A{static{k(this,"EvalOptimizeCommand")}static description="Iteratively optimize eval target content using eval results as feedback";static examples=["<%= config.bin %> evals optimize <target-id>","<%= config.bin %> evals optimize <target-id> --auto --max-iterations 3"];static args={targetId:q.string({description:"Eval target ID",required:!0})};static flags={auto:g.boolean({description:"Skip interactive review, apply suggestions automatically",default:!1}),"max-iterations":g.integer({description:"Maximum optimization iterations",default:5}),threshold:g.string({description:"Stop if pass rate reaches this threshold (0-1)",default:"0.95"}),model:g.string({description:"Model for eval execution"}),"analyzer-model":g.string({description:"Model for analysis/suggestions"}),timeout:g.integer({description:"Timeout per eval in ms",default:12e4})};async run(){let{args:n,flags:e}=await this.parse(O);this.requireAuth();let t=await w(`/api/eval-targets/${n.targetId}`),i=await w(`/api/eval-targets/${n.targetId}/evals`);i.length===0&&this.error("No evals found. Create some first with `rulemetric evals create`.");let s=[...i].sort(()=>Math.random()-.5),c=Math.ceil(s.length*.6),u=s.slice(0,c),d=s.slice(c);this.log(`Optimizing "${t.name}" v${t.version}`),this.log(`Evals: ${u.length} train, ${d.length} test`);let h=parseFloat(e.threshold);this.log(`Config: max ${e["max-iterations"]} iterations, threshold ${(h*100).toFixed(0)}%`),e.auto&&this.log("Mode: auto (no interactive review)"),this.log("");let T=t.version,f=0,x=0;for(let l=1;l<=e["max-iterations"];l++){this.log(`
|
|
2
2
|
=== Iteration ${l} ===`),this.log("Running train evals...");let b=await this.runEvalsOnTarget(t,u,e),p=this.computePassRate(b);if(this.log(`Train pass rate: ${(p*100).toFixed(1)}%`),p>=h){this.log(`Train score ${(p*100).toFixed(1)}% >= threshold ${(h*100).toFixed(0)}%. Stopping.`);let o=await this.runEvalsOnTarget(t,d,e),z=this.computePassRate(o);this.log(`Final test score: ${(z*100).toFixed(1)}%`),await m("/api/optimization-runs",{evalTargetId:t.id,type:"content",iteration:l,inputVersion:t.version,trainScore:p,testScore:z,analysis:{reason:"threshold_reached"},status:"completed"});break}this.log("Analyzing results...");let M=b.map(o=>({evalName:o.evalName,prompt:o.prompt,expectations:o.expectations,grading:o.grading})),a=await V({content:t.content,evalResults:M,model:e["analyzer-model"]??e.model,timeout:e.timeout});this.log(`
|
|
3
3
|
Assessment: ${a.overallAssessment}`),this.log(`Suggestions: ${a.suggestions.length}`);for(let o of a.suggestions)this.log(` - [${o.section}] ${o.reasoning}`);if(a.proposedContent===t.content){this.log("No changes proposed. Stopping."),await m("/api/optimization-runs",{evalTargetId:t.id,type:"content",iteration:l,inputVersion:t.version,trainScore:p,analysis:{reason:"no_changes"},status:"completed"});break}if(!e.auto&&!await this.confirm(`
|
|
4
4
|
Apply the proposed changes as a new version? [y/N] `)){this.log("Changes not applied. Stopping."),await m("/api/optimization-runs",{evalTargetId:t.id,type:"content",iteration:l,inputVersion:t.version,trainScore:p,analysis:{reason:"user_declined",suggestions:a.suggestions},status:"completed"});break}let r=await S(`/api/eval-targets/${t.id}`,{content:a.proposedContent});this.log(`Created v${r.version}`),this.log(`Running test evals on v${t.version} (baseline) and v${r.version}...`);let E=await this.runEvalsOnTarget(t,d,e),R=await this.runEvalsOnTarget(r,d,e),v=this.computePassRate(R),I=this.computePassRate(E);this.log(`Test pass rate: v${t.version} ${(I*100).toFixed(1)}% \u2192 v${r.version} ${(v*100).toFixed(1)}%`);let y=P(E,R);if(y&&this.log(C(y,t.version,r.version)),await m("/api/optimization-runs",{evalTargetId:t.id,type:"content",iteration:l,inputVersion:t.version,outputVersion:r.version,trainScore:p,testScore:v,analysis:{suggestions:a.suggestions,overallAssessment:a.overallAssessment,priorTestScore:I,verdict:y},status:"completed"}),v>f)f=v,T=r.version,x=0;else if(x++,x>=2){this.log("No improvement for 2 consecutive iterations. Stopping.");break}t=r}this.log(`
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{b as w}from"../../chunk-ISDRKWGI.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import{a as f}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{e as g,f as p,h as v}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Args as P,Flags as b}from"@oclif/core";var r=d(i=>i==null?"n/a":`${Math.round(i*100)}%`,"pct"),c=class i extends f{static{d(this,"EvalRefineCases")}static description="Retire non-discriminating eval cases and regenerate discriminating replacements (\xA76e)";static examples=["<%= config.bin %> evals refine-cases <target-id> # preview","<%= config.bin %> evals refine-cases <target-id> --yes # apply: retire + regenerate","<%= config.bin %> evals refine-cases <target-id> --yes --no-generate"];static args={targetId:P.string({description:"Eval target ID",required:!0})};static flags={yes:b.boolean({char:"y",description:"Apply (retire + regenerate). Without this, only previews."}),"no-generate":b.boolean({description:"Retire dead cases but do not regenerate replacements."})};async run(){let{args:$,flags:o}=await this.parse(i);this.requireAuth();let n=$.targetId,s=await g(`/api/eval-targets/${n}`),m=await g(`/api/eval-targets/${n}/judge-calibration`),t=m.caseDiscrimination;if(!t||t.cases.length===0&&t.unpairedCases.length===0){this.log("No case-discrimination data yet \u2014 run some evals with AND without the target first (`evals run` / the web Run Evals button), then refine.");return}let u=t.cases.filter(e=>!e.discriminating),a=[...u.map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate,withoutPassRate:e.withoutPassRate,reason:e.note}})),...t.unpairedCases.map(e=>({evalId:e.evalId,name:e.name,feedback:{name:e.name,withPassRate:e.withPassRate??0,withoutPassRate:e.withoutPassRate,reason:"runs in only one cohort (no with-vs-without comparison possible)"}}))];if(this.log(`Target "${s.name}" v${s.version} \u2014 judge ${m.judge.currentModel??"(unstamped)"}`),this.log(`${t.total} diagnosable case(s): ${t.discriminating} discriminate, ${t.nonDiscriminating} flat/wrong-sign, ${t.unpaired} unpaired.`),a.length===0){this.log("Every case discriminates \u2014 nothing to retire. \u{1F389}");return}this.log(`
|
|
2
|
+
Would retire ${a.length} non-discriminating case(s):`);for(let e of u)this.log(` \u2717 ${e.name} \u2014 ${r(e.withPassRate)} with vs ${r(e.withoutPassRate)} without (\u0394${(e.separation*100).toFixed(0)}pp) \u2014 ${e.note}`);for(let e of t.unpairedCases)this.log(` \u2717 ${e.name} \u2014 ${r(e.withPassRate)} with vs ${r(e.withoutPassRate)} without \u2014 unpaired`);if(!o.yes){this.log(`
|
|
3
|
+
Preview only. Re-run with --yes to retire ${a.length} case(s)${o["no-generate"]?"":" and generate replacements"}.`);return}for(let e of a)await v(`/api/eval-targets/${n}/evals/${e.evalId}`,{retire:!0,retiredReason:e.feedback.reason}),this.log(` retired ${e.name}`);if(o["no-generate"]){this.log(`
|
|
4
|
+
Retired ${a.length} case(s). Skipped regeneration (--no-generate).`);return}this.log(`
|
|
5
|
+
Generating discriminating replacements via local LLM\u2026`);let l=await w({content:s.content,name:s.name,feedback:a.map(e=>e.feedback)});if(l===null){this.warn("No local LLM backend available \u2014 cases retired but no replacements generated. Install the `claude` CLI (or set ANTHROPIC_API_KEY), then run `evals refine-cases` again or add cases with `evals create`.");return}for(let e of l){let h=await p(`/api/eval-targets/${n}/evals`,{name:e.name,prompt:e.prompt,expectations:e.expectations});this.log(` + ${h.name} (${h.id})`)}this.log(`
|
|
6
|
+
Done: retired ${a.length}, added ${l.length}. Run \`rulemetric evals run ${n}\` to build depth on the refreshed set, then review discrimination.`)}};export{c as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
${
|
|
3
|
-
Delta: ${
|
|
1
|
+
import{a as $}from"../../chunk-ZGDKJZII.js";import"../../chunk-IL35G6CK.js";import"../../chunk-S6B2R2LL.js";import"../../chunk-WQ2BJQYB.js";import{a as y}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{e as v,f as k}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as R}from"../../chunk-ZLLER3HP.js";import{Args as I,Flags as g}from"@oclif/core";var h=class _ extends y{static{R(this,"EvalRunCommand")}static description="Run evals against a target, optionally grade results, and post to API";static examples=["<%= config.bin %> evals run <target-id>","<%= config.bin %> evals run <target-id> --parallel 3 --runs-per-eval 2","<%= config.bin %> evals run <target-id> --skip-baseline --skip-grading"];static args={targetId:I.string({description:"Eval target ID",required:!0})};static flags={parallel:g.integer({description:"Number of parallel eval executions",default:1}),"runs-per-eval":g.integer({description:"Number of runs per eval for variance analysis",default:1}),iteration:g.integer({description:"Iteration number for tracking",default:1}),"skip-baseline":g.boolean({description:"Skip baseline (without_target) runs",default:!1}),"skip-grading":g.boolean({description:"Skip LLM grading step",default:!1}),model:g.string({description:"Model for eval execution (default: user configured)"}),"grader-model":g.string({description:"Model for grading (default: same as execution model)"}),timeout:g.integer({description:"Timeout per eval in ms",default:12e4})};async run(){let{args:c,flags:n}=await this.parse(_);this.requireAuth();let i=await v(`/api/eval-targets/${c.targetId}`),l=await v(`/api/eval-targets/${c.targetId}/evals`);l.length===0&&this.error(`No evals found for target "${i.name}". Create some with \`rulemetric evals create\`.`),this.log(`Running ${l.length} eval(s) for "${i.name}" v${i.version}`),this.log(`Config: ${n["runs-per-eval"]} run(s) per eval, parallel=${n.parallel}, iteration=${n.iteration}`),n["skip-baseline"]&&this.log("Skipping baseline runs"),n["skip-grading"]&&this.log("Skipping grading"),this.log("");let m=[{name:"with_target",content:i.content}];n["skip-baseline"]||m.push({name:"without_target"});let p=[];for(let r of l)for(let a of m)for(let t=1;t<=n["runs-per-eval"];t++)p.push({eval_:r,configuration:a.name,targetContent:a.content,runNumber:t});let u=[],b=n.parallel;for(let r=0;r<p.length;r+=b){let a=p.slice(r,r+b),t=await Promise.all(a.map(d=>this.executeAndGrade(d,i,n)));u.push(...t)}this.log(""),this.log("Posting results to API...");for(let r of u)await k("/api/eval-runs",r);this.log(""),this.log("=== Results Summary ===");for(let r of m){let a=u.filter(e=>e.configuration===r.name),t=a.filter(e=>e.status==="completed"),d=t.filter(e=>Object.keys(e.grading).length>0);if(this.log(`
|
|
2
|
+
${r.name}:`),this.log(` Runs: ${t.length}/${a.length} completed`),d.length>0){let e=d.map(o=>o.grading.summary?.pass_rate??0),s=e.reduce((o,f)=>o+f,0)/e.length;this.log(` Avg pass_rate: ${(s*100).toFixed(1)}%`)}for(let e of a){let s=l.find(x=>x.id===e.evalId)?.name??e.evalId,o=e.grading.summary?.pass_rate,f=o!==void 0?` pass_rate=${(o*100).toFixed(0)}%`:"",w=e.timing.duration_ms?` ${(e.timing.duration_ms/1e3).toFixed(1)}s`:"";this.log(` [${e.status}] ${s} run#${e.runNumber}${f}${w}`)}}if(!n["skip-baseline"]&&u.length>0){let r=u.filter(t=>t.configuration==="with_target"&&Object.keys(t.grading).length>0),a=u.filter(t=>t.configuration==="without_target"&&Object.keys(t.grading).length>0);if(r.length>0&&a.length>0){let t=r.map(s=>s.grading.summary?.pass_rate??0).reduce((s,o)=>s+o,0)/r.length,d=a.map(s=>s.grading.summary?.pass_rate??0).reduce((s,o)=>s+o,0)/a.length,e=t-d;this.log(`
|
|
3
|
+
Delta: ${e>0?"+":""}${(e*100).toFixed(1)}% (with_target vs without_target)`)}}}async executeAndGrade(c,n,i){return $(c,{targetId:n.id,targetVersion:n.version,iteration:i.iteration,timeout:i.timeout,model:i.model,graderModel:i["grader-model"],skipGrading:i["skip-grading"]},l=>this.log(l))}};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as pt}from"../../chunk-6XEC6474.js";import{B as ut,E as dt,H as gt,I as ht,e as z,f as Q,g as Z,i as tt,j as et,k as st,n as ot,p as it,q as rt,r as at,u as nt,v as lt,y as ct}from"../../chunk-2JRDG4LJ.js";import{a as q,b as W,c as m,d as J,g as A}from"../../chunk-I2DZGJRR.js";import"../../chunk-N7ODX6PO.js";import{a as f}from"../../chunk-67QCYUJU.js";import{c as s,g as X,h as D,i as F,k as O,l as V}from"../../chunk-MVM6OGAF.js";import{e as B}from"../../chunk-KKDHD4XA.js";import"../../chunk-SZ62CP55.js";import{a as Y}from"../../chunk-XICLXXRH.js";import{a as M}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import{c as N}from"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import{b as L}from"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-H2ORWIEY.js";import{a as G}from"../../chunk-O6C2UGBY.js";import{a as v}from"../../chunk-ZLLER3HP.js";import{Flags as w}from"@oclif/core";import{execFileSync as ft,spawnSync as l}from"node:child_process";import{existsSync as c}from"node:fs";import{homedir as mt}from"node:os";import{join as _,dirname as Ct}from"node:path";function vt(){try{let d=ft("/bin/sh",["-c","command -v rulemetric"],{encoding:"utf-8"}).trim();if(d&&c(d))return Ct(d)}catch{}}v(vt,"resolveHookBinDir");function wt(){try{return ft("launchctl",["list","com.rulemetric.gateway"],{stdio:["ignore","pipe","pipe"]}),!0}catch{return!1}}v(wt,"isGatewayLaunchdManaged");var o=_(mt(),".mitmproxy","mitmproxy-ca-cert.pem"),R=class d extends M{static{v(this,"HooksInstall")}static description="Install session tracking hooks and context capture proxy for Claude Code";static examples=["<%= config.bin %> hooks install","<%= config.bin %> hooks install --global","<%= config.bin %> hooks install --no-proxy"];static flags={"no-proxy":w.boolean({default:!1,description:"Skip proxy/gateway configuration (hooks only)"}),"project-dir":w.string({description:"Project directory to install hooks in (defaults to cwd)"}),global:w.boolean({char:"g",default:!1,description:"Install hooks globally (~/.claude/settings.json) so all projects are tracked"}),"statusline-usage":w.boolean({default:!1,description:"Install the statusline shim so Claude Code pushes live rate_limits on every refresh (makes /usage rings update in real time without needing the proxy)"})};async run(){let{flags:i}=await this.parse(d),r=i.global,n=r?mt():i["project-dir"]??process.cwd(),x=_(n,".claude"),y=st(x,r),K=r?"settings.json":"settings.local.json",k=i["no-proxy"],P=!1,g=k?"no_proxy_flag":void 0,h=!1,S=[];r&&this.log(`Installing hooks globally \u2192 ${y}`);let{settings:a,recoveredBackup:$}=z(y);if($&&this.log(`[!!] ${y} was not valid JSON \u2014 backed it up to ${$} and continued with a fresh file.`),!r){let e=ot(_(x,"settings.json"),s);e.migrated&&(this.log("[OK] Moved RuleMetric machine-local state out of the shared .claude/settings.json (it now lives in .claude/settings.local.json)"),e.backupPath&&this.log(` Previous shared settings backed up \u2192 ${e.backupPath}`),e.removedStatusline&&c(q)&&!A(a)&&(a.statusLine=m))}let I=G();(I.accessToken||process.env.RULEMETRIC_ACCESS_TOKEN)&&!I.apiKey&&!process.env.RULEMETRIC_API_KEY&&await Y(this.log.bind(this),this.warn.bind(this),this.config.version);let yt=tt(a),C=vt();if(Z(a,C),this.log(yt?`[OK] Refreshed RuleMetric Claude Code session hooks \u2192 .claude/${K}`:`[OK] Installed RuleMetric Claude Code session hooks \u2192 .claude/${K}`),!k){let e=!!f("mitmdump");if(e||(this.log(""),this.log("[!!] mitmproxy not found \u2014 installing..."),S=["brew","pipx","uv"].filter(t=>!!f(t)),e=this.installMitmproxy(),e||(this.log("[!!] Could not install mitmproxy. Skipping proxy config."),this.log(" Install manually: pipx install mitmproxy"),this.log(" Then re-run: rulemetric hooks install"))),c(o))this.log("[OK] CA certificate found");else{this.log("[..] Generating CA certificate...");let t=f("mitmdump");t&&(l(t,["--set","listen_port=0","-q"],{timeout:5e3,stdio:"ignore"}),c(o)?this.log(`[OK] CA certificate generated at ${o}`):this.log("[!!] Could not generate CA cert"))}let u=c(o);u&&!this.isCACertTrusted()?(this.log("[..] Installing CA certificate into system trust store (requires admin)..."),h=this.trustCACert(),h?this.log("[OK] CA certificate trusted by system"):(this.log("[!!] Could not install CA cert automatically."),process.platform==="darwin"?this.log(` Run manually: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${o}`):process.platform==="linux"&&this.log(` Run manually: sudo cp ${o} /usr/local/share/ca-certificates/mitmproxy-ca.crt && sudo update-ca-certificates`))):u&&(this.log("[OK] CA certificate already trusted"),h=!0);let p=wt(),b=await X(s);if(p)this.log("[OK] Gateway managed by launchd (com.rulemetric.gateway)");else if(b.status==="ours-live")this.log("[OK] Gateway already running");else if(b.status==="foreign"&&F()){this.log("[..] Restarting gateway (running build predates the identity handshake)..."),V(),await new Promise(t=>setTimeout(t,500));try{let t=O(this.config.version);this.log(`[OK] Gateway restarted (PID ${t})`)}catch(t){this.log(`[!!] Could not restart gateway: ${t.message}`)}}else if(b.status!=="foreign")try{let t=O(this.config.version);this.log(`[OK] Gateway started (PID ${t})`)}catch(t){this.log(`[!!] Could not start gateway: ${t.message}`)}let j=await D(s,{timeoutMs:4e3});if(!u)g=e?"ca_not_generated":S.length===0?"no_package_manager":"mitmproxy_install_failed",this.log("[!!] No CA certificate \u2014 NOT setting HTTPS_PROXY (capture stays hooks-only)."),this.log(" Install mitmproxy, then re-run: rulemetric hooks install");else if(j.status==="foreign"&&!p){g="gateway_port_foreign";let t=B(s);this.log(`[!!] Port :${s} is held by a process that is NOT the RuleMetric gateway \u2014 NOT setting HTTPS_PROXY.`),this.log(t?` Holding the port: ${t}`:` Could not identify the holder (try: lsof -nP -iTCP:${s} -sTCP:LISTEN)`),this.log(" Capture still works via hooks. Free the port, then re-run: rulemetric hooks install")}else if(j.status==="dead")g="gateway_not_live",this.log(`[!!] Gateway is not answering on :${s} \u2014 NOT setting HTTPS_PROXY.`),this.log(" Capture still works via hooks. To enable deep (proxy) capture later:"),this.log(" rulemetric proxy start && rulemetric hooks install");else{let t=a.env??{};t.HTTPS_PROXY=`http://localhost:${s}`,t.NO_PROXY=et,c(o)&&(t.NODE_EXTRA_CA_CERTS=o),a.env=t,P=!0,this.log(`[OK] HTTPS_PROXY set to gateway on :${s} (verified live)`),nt(n,s,o)&&this.log("[OK] Cursor proxy configured \u2192 .cursor/settings.json"),lt(n,s,o)&&this.log("[OK] VS Code workspace proxy configured \u2192 .vscode/settings.json"),ut(s)&&this.log("[OK] VS Code user proxy configured \u2192 ~/Library/Application Support/Code/User/settings.json"),dt(s)&&this.log("[OK] Cursor user proxy configured \u2192 ~/Library/Application Support/Cursor/User/settings.json"),h?ct(s,o)&&this.log("[OK] HTTPS_PROXY set for GUI apps (launchctl + LaunchAgent)"):(g="ca_untrusted",this.log("[!!] CA not trusted \u2014 skipping machine-wide GUI proxy (would break native-app TLS)."),this.log(" Claude Code capture is unaffected. Trust the CA + re-run to enable cross-app capture."))}}if(!r){let e=it(n,C);e&&this.log(`[OK] Cursor hooks configured \u2192 ${e}`);let u=at(n,C);u&&this.log(`[OK] Copilot Agent hooks configured \u2192 ${u}`);let p=gt(n);p&&this.log(`[OK] Antigravity workspace hooks configured \u2192 ${p}`)}let E=ht();E&&this.log(`[OK] Antigravity user hooks configured \u2192 ${E}`);let H=rt(C);if(H&&this.log(`[OK] Cursor user hooks configured \u2192 ${H}`),i["statusline-usage"])if(A(a))this.log("[OK] Statusline shim already installed");else{let e=J(a);W(e),a.statusLine=m,e?this.log(`[OK] Statusline shim installed \u2192 ${m.command} (chains to: ${e})`):this.log(`[OK] Statusline shim installed \u2192 ${m.command}`),this.log(" Rate-limit rings will now update on Claude Code's statusline refresh cadence")}let{backupPath:U}=Q(y,a);U&&this.log(`[OK] Backed up previous settings \u2192 ${U}`),this.log(""),this.log("Setup complete! Next steps:"),r?(this.log(" 1. Install always-on API: rulemetric service install"),this.log(" 2. Start Claude Code in any project \u2014 all sessions tracked automatically"),this.log(""),this.log("The API service starts on login and restarts on crash.")):k?(this.log(" 1. Start Claude Code \u2014 sessions are captured by the hooks just installed"),this.log(""),this.log("No proxy means no mitmproxy / CA cert needed. The hooks capture full"),this.log("sessions on their own; re-run without --no-proxy to also capture system"),this.log("prompts for instruction-effectiveness linking.")):(this.log(" 1. Start Claude Code \u2014 sessions are captured by hooks immediately"),P?this.log(" 2. Full-depth capture is ON \u2014 the proxy is live on :"+s+"."):this.log(" 2. Enable full depth (proxy not yet live): rulemetric proxy start"),this.log(""),this.log("Hooks capture every session (lifecycle + transcript). The proxy adds the"),this.log("rendered system prompt (instruction-effectiveness linking) + cross-tool capture."),this.log(""),this.log("To capture traffic from other clients (Python, curl, etc.):"),this.log(' eval "$(rulemetric proxy env --all)"')),await L(),N("hooks_installed",{proxy:P,caTrusted:h,reason:g,installers:S,global:r},this.config.version);let T=await pt();this.log(""),T.available?this.log(`[OK] tmux found${T.version?` (v${T.version})`:""} \u2014 live send enabled`):this.log("[!!] tmux not found \u2014 live send will fall back to opening Terminal. Install with: brew install tmux")}installMitmproxy(){for(let[i,r]of[["pipx",["install","mitmproxy"]],["uv",["tool","install","mitmproxy"]],["brew",["install","mitmproxy"]]]){let n=f(i);if(n&&(this.log(` Installing via ${i}...`),l(n,[...r],{stdio:"inherit"}).status===0))return!0}return!1}isCACertTrusted(){return process.platform==="darwin"?l("security",["verify-cert","-c",o],{stdio:"pipe"}).status===0:process.platform==="linux"?c("/usr/local/share/ca-certificates/mitmproxy-ca.crt"):process.platform==="win32"?l("certutil",["-verify",o],{stdio:"pipe"}).status===0:!1}trustCACert(){return process.platform==="darwin"?l("sudo",["security","add-trusted-cert","-d","-r","trustRoot","-k","/Library/Keychains/System.keychain",o],{stdio:"inherit"}).status===0:process.platform==="linux"?l("sudo",["cp",o,"/usr/local/share/ca-certificates/mitmproxy-ca.crt"],{stdio:"inherit"}).status!==0?!1:l("sudo",["update-ca-certificates"],{stdio:"inherit"}).status===0:process.platform==="win32"?l("certutil",["-addstore","-f","Root",o],{stdio:"inherit"}).status===0:!1}};export{R as default};
|
|
1
|
+
import{a as pt}from"../../chunk-6XEC6474.js";import{B as ut,E as dt,H as gt,I as ht,e as z,f as Q,g as Z,i as tt,j as et,k as st,n as ot,p as it,q as rt,r as at,u as nt,v as lt,y as ct}from"../../chunk-2JRDG4LJ.js";import{a as q,b as W,c as m,d as J,g as A}from"../../chunk-I2DZGJRR.js";import{a as f}from"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import{c as s,g as X,h as D,i as F,k as O,l as V}from"../../chunk-MVM6OGAF.js";import{e as B}from"../../chunk-KKDHD4XA.js";import"../../chunk-SZ62CP55.js";import{a as Y}from"../../chunk-XICLXXRH.js";import{a as M}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import{c as N}from"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import{b as L}from"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-H2ORWIEY.js";import{a as G}from"../../chunk-O6C2UGBY.js";import{a as v}from"../../chunk-ZLLER3HP.js";import{Flags as w}from"@oclif/core";import{execFileSync as ft,spawnSync as l}from"node:child_process";import{existsSync as c}from"node:fs";import{homedir as mt}from"node:os";import{join as _,dirname as Ct}from"node:path";function vt(){try{let d=ft("/bin/sh",["-c","command -v rulemetric"],{encoding:"utf-8"}).trim();if(d&&c(d))return Ct(d)}catch{}}v(vt,"resolveHookBinDir");function wt(){try{return ft("launchctl",["list","com.rulemetric.gateway"],{stdio:["ignore","pipe","pipe"]}),!0}catch{return!1}}v(wt,"isGatewayLaunchdManaged");var o=_(mt(),".mitmproxy","mitmproxy-ca-cert.pem"),R=class d extends M{static{v(this,"HooksInstall")}static description="Install session tracking hooks and context capture proxy for Claude Code";static examples=["<%= config.bin %> hooks install","<%= config.bin %> hooks install --global","<%= config.bin %> hooks install --no-proxy"];static flags={"no-proxy":w.boolean({default:!1,description:"Skip proxy/gateway configuration (hooks only)"}),"project-dir":w.string({description:"Project directory to install hooks in (defaults to cwd)"}),global:w.boolean({char:"g",default:!1,description:"Install hooks globally (~/.claude/settings.json) so all projects are tracked"}),"statusline-usage":w.boolean({default:!1,description:"Install the statusline shim so Claude Code pushes live rate_limits on every refresh (makes /usage rings update in real time without needing the proxy)"})};async run(){let{flags:i}=await this.parse(d),r=i.global,n=r?mt():i["project-dir"]??process.cwd(),x=_(n,".claude"),y=st(x,r),K=r?"settings.json":"settings.local.json",k=i["no-proxy"],P=!1,g=k?"no_proxy_flag":void 0,h=!1,S=[];r&&this.log(`Installing hooks globally \u2192 ${y}`);let{settings:a,recoveredBackup:$}=z(y);if($&&this.log(`[!!] ${y} was not valid JSON \u2014 backed it up to ${$} and continued with a fresh file.`),!r){let e=ot(_(x,"settings.json"),s);e.migrated&&(this.log("[OK] Moved RuleMetric machine-local state out of the shared .claude/settings.json (it now lives in .claude/settings.local.json)"),e.backupPath&&this.log(` Previous shared settings backed up \u2192 ${e.backupPath}`),e.removedStatusline&&c(q)&&!A(a)&&(a.statusLine=m))}let I=G();(I.accessToken||process.env.RULEMETRIC_ACCESS_TOKEN)&&!I.apiKey&&!process.env.RULEMETRIC_API_KEY&&await Y(this.log.bind(this),this.warn.bind(this),this.config.version);let yt=tt(a),C=vt();if(Z(a,C),this.log(yt?`[OK] Refreshed RuleMetric Claude Code session hooks \u2192 .claude/${K}`:`[OK] Installed RuleMetric Claude Code session hooks \u2192 .claude/${K}`),!k){let e=!!f("mitmdump");if(e||(this.log(""),this.log("[!!] mitmproxy not found \u2014 installing..."),S=["brew","pipx","uv"].filter(t=>!!f(t)),e=this.installMitmproxy(),e||(this.log("[!!] Could not install mitmproxy. Skipping proxy config."),this.log(" Install manually: pipx install mitmproxy"),this.log(" Then re-run: rulemetric hooks install"))),c(o))this.log("[OK] CA certificate found");else{this.log("[..] Generating CA certificate...");let t=f("mitmdump");t&&(l(t,["--set","listen_port=0","-q"],{timeout:5e3,stdio:"ignore"}),c(o)?this.log(`[OK] CA certificate generated at ${o}`):this.log("[!!] Could not generate CA cert"))}let u=c(o);u&&!this.isCACertTrusted()?(this.log("[..] Installing CA certificate into system trust store (requires admin)..."),h=this.trustCACert(),h?this.log("[OK] CA certificate trusted by system"):(this.log("[!!] Could not install CA cert automatically."),process.platform==="darwin"?this.log(` Run manually: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${o}`):process.platform==="linux"&&this.log(` Run manually: sudo cp ${o} /usr/local/share/ca-certificates/mitmproxy-ca.crt && sudo update-ca-certificates`))):u&&(this.log("[OK] CA certificate already trusted"),h=!0);let p=wt(),b=await X(s);if(p)this.log("[OK] Gateway managed by launchd (com.rulemetric.gateway)");else if(b.status==="ours-live")this.log("[OK] Gateway already running");else if(b.status==="foreign"&&F()){this.log("[..] Restarting gateway (running build predates the identity handshake)..."),V(),await new Promise(t=>setTimeout(t,500));try{let t=O(this.config.version);this.log(`[OK] Gateway restarted (PID ${t})`)}catch(t){this.log(`[!!] Could not restart gateway: ${t.message}`)}}else if(b.status!=="foreign")try{let t=O(this.config.version);this.log(`[OK] Gateway started (PID ${t})`)}catch(t){this.log(`[!!] Could not start gateway: ${t.message}`)}let j=await D(s,{timeoutMs:4e3});if(!u)g=e?"ca_not_generated":S.length===0?"no_package_manager":"mitmproxy_install_failed",this.log("[!!] No CA certificate \u2014 NOT setting HTTPS_PROXY (capture stays hooks-only)."),this.log(" Install mitmproxy, then re-run: rulemetric hooks install");else if(j.status==="foreign"&&!p){g="gateway_port_foreign";let t=B(s);this.log(`[!!] Port :${s} is held by a process that is NOT the RuleMetric gateway \u2014 NOT setting HTTPS_PROXY.`),this.log(t?` Holding the port: ${t}`:` Could not identify the holder (try: lsof -nP -iTCP:${s} -sTCP:LISTEN)`),this.log(" Capture still works via hooks. Free the port, then re-run: rulemetric hooks install")}else if(j.status==="dead")g="gateway_not_live",this.log(`[!!] Gateway is not answering on :${s} \u2014 NOT setting HTTPS_PROXY.`),this.log(" Capture still works via hooks. To enable deep (proxy) capture later:"),this.log(" rulemetric proxy start && rulemetric hooks install");else{let t=a.env??{};t.HTTPS_PROXY=`http://localhost:${s}`,t.NO_PROXY=et,c(o)&&(t.NODE_EXTRA_CA_CERTS=o),a.env=t,P=!0,this.log(`[OK] HTTPS_PROXY set to gateway on :${s} (verified live)`),nt(n,s,o)&&this.log("[OK] Cursor proxy configured \u2192 .cursor/settings.json"),lt(n,s,o)&&this.log("[OK] VS Code workspace proxy configured \u2192 .vscode/settings.json"),ut(s)&&this.log("[OK] VS Code user proxy configured \u2192 ~/Library/Application Support/Code/User/settings.json"),dt(s)&&this.log("[OK] Cursor user proxy configured \u2192 ~/Library/Application Support/Cursor/User/settings.json"),h?ct(s,o)&&this.log("[OK] HTTPS_PROXY set for GUI apps (launchctl + LaunchAgent)"):(g="ca_untrusted",this.log("[!!] CA not trusted \u2014 skipping machine-wide GUI proxy (would break native-app TLS)."),this.log(" Claude Code capture is unaffected. Trust the CA + re-run to enable cross-app capture."))}}if(!r){let e=it(n,C);e&&this.log(`[OK] Cursor hooks configured \u2192 ${e}`);let u=at(n,C);u&&this.log(`[OK] Copilot Agent hooks configured \u2192 ${u}`);let p=gt(n);p&&this.log(`[OK] Antigravity workspace hooks configured \u2192 ${p}`)}let E=ht();E&&this.log(`[OK] Antigravity user hooks configured \u2192 ${E}`);let H=rt(C);if(H&&this.log(`[OK] Cursor user hooks configured \u2192 ${H}`),i["statusline-usage"])if(A(a))this.log("[OK] Statusline shim already installed");else{let e=J(a);W(e),a.statusLine=m,e?this.log(`[OK] Statusline shim installed \u2192 ${m.command} (chains to: ${e})`):this.log(`[OK] Statusline shim installed \u2192 ${m.command}`),this.log(" Rate-limit rings will now update on Claude Code's statusline refresh cadence")}let{backupPath:U}=Q(y,a);U&&this.log(`[OK] Backed up previous settings \u2192 ${U}`),this.log(""),this.log("Setup complete! Next steps:"),r?(this.log(" 1. Install always-on API: rulemetric service install"),this.log(" 2. Start Claude Code in any project \u2014 all sessions tracked automatically"),this.log(""),this.log("The API service starts on login and restarts on crash.")):k?(this.log(" 1. Start Claude Code \u2014 sessions are captured by the hooks just installed"),this.log(""),this.log("No proxy means no mitmproxy / CA cert needed. The hooks capture full"),this.log("sessions on their own; re-run without --no-proxy to also capture system"),this.log("prompts for instruction-effectiveness linking.")):(this.log(" 1. Start Claude Code \u2014 sessions are captured by hooks immediately"),P?this.log(" 2. Full-depth capture is ON \u2014 the proxy is live on :"+s+"."):this.log(" 2. Enable full depth (proxy not yet live): rulemetric proxy start"),this.log(""),this.log("Hooks capture every session (lifecycle + transcript). The proxy adds the"),this.log("rendered system prompt (instruction-effectiveness linking) + cross-tool capture."),this.log(""),this.log("To capture traffic from other clients (Python, curl, etc.):"),this.log(' eval "$(rulemetric proxy env --all)"')),await L(),N("hooks_installed",{proxy:P,caTrusted:h,reason:g,installers:S,global:r},this.config.version);let T=await pt();this.log(""),T.available?this.log(`[OK] tmux found${T.version?` (v${T.version})`:""} \u2014 live send enabled`):this.log("[!!] tmux not found \u2014 live send will fall back to opening Terminal. Install with: brew install tmux")}installMitmproxy(){for(let[i,r]of[["pipx",["install","mitmproxy"]],["uv",["tool","install","mitmproxy"]],["brew",["install","mitmproxy"]]]){let n=f(i);if(n&&(this.log(` Installing via ${i}...`),l(n,[...r],{stdio:"inherit"}).status===0))return!0}return!1}isCACertTrusted(){return process.platform==="darwin"?l("security",["verify-cert","-c",o],{stdio:"pipe"}).status===0:process.platform==="linux"?c("/usr/local/share/ca-certificates/mitmproxy-ca.crt"):process.platform==="win32"?l("certutil",["-verify",o],{stdio:"pipe"}).status===0:!1}trustCACert(){return process.platform==="darwin"?l("sudo",["security","add-trusted-cert","-d","-r","trustRoot","-k","/Library/Keychains/System.keychain",o],{stdio:"inherit"}).status===0:process.platform==="linux"?l("sudo",["cp",o,"/usr/local/share/ca-certificates/mitmproxy-ca.crt"],{stdio:"inherit"}).status!==0?!1:l("sudo",["update-ca-certificates"],{stdio:"inherit"}).status===0:process.platform==="win32"?l("certutil",["-addstore","-f","Root",o],{stdio:"inherit"}).status===0:!1}};export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"../chunk-DVN7GFJG.js";import{a as M}from"../chunk-O2SDD2WW.js";import{a as E}from"../chunk-GBMF3TP6.js";import{a as O}from"../chunk-WSCK4WNK.js";import{a as D}from"../chunk-4Z5ECCJE.js";import"../chunk-ARNZQBMX.js";import{a as B,b as S,c as R}from"../chunk-G6XGDHGC.js";import{a as $}from"../chunk-
|
|
1
|
+
import{a as F}from"../chunk-DVN7GFJG.js";import{a as M}from"../chunk-O2SDD2WW.js";import{a as E}from"../chunk-GBMF3TP6.js";import{a as O}from"../chunk-WSCK4WNK.js";import{a as D}from"../chunk-4Z5ECCJE.js";import"../chunk-ARNZQBMX.js";import{a as B,b as S,c as R}from"../chunk-G6XGDHGC.js";import{a as $}from"../chunk-SJGLRC2R.js";import"../chunk-RDET7CKR.js";import"../chunk-NBTC5FNV.js";import"../chunk-TU2AR6XO.js";import{a as u,b as T,d as a,e as v}from"../chunk-NJ5UED3H.js";import"../chunk-ZR3MUNLS.js";import"../chunk-ZXF5NE54.js";import"../chunk-7DFNBRLY.js";import{a as X}from"../chunk-3AV3GTMP.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import{a as m}from"../chunk-ZLLER3HP.js";import{useState as w,useEffect as nt,useCallback as G,useRef as st}from"react";import{render as U,Box as c,Text as o,useInput as at,useApp as lt}from"ink";import{Fragment as ht,jsx as t,jsxs as h}from"react/jsx-runtime";var dt=90;function J(){let s=process.stdout.columns||80,n=Math.min(160,s),i=n>=dt,d=i?Math.floor(n/2):n,b=Math.max(6,Math.min(10,d-34));return{dashWidth:n,wide:i,halfWidth:d,barWidth:b}}m(J,"getLayout");function z({active:s,providerName:n}){return h(c,{justifyContent:"space-between",paddingX:1,children:[t(c,{gap:1,children:u.map(i=>t(o,{bold:s===i,color:s===i?a:v,children:s===i?`[ ${T[i]} ]`:` ${T[i]} `},i))}),n&&t(o,{color:a,bold:!0,children:n})]})}m(z,"PeriodTabs");function H({width:s,insightsFocused:n=!1}){return t(c,{borderStyle:"round",borderColor:v,width:s,justifyContent:"center",paddingX:1,children:h(o,{children:[t(o,{color:a,bold:!0,children:"<"}),t(o,{color:a,children:">"}),t(o,{dimColor:!0,children:" switch "}),t(o,{color:a,bold:!0,children:"q"}),t(o,{dimColor:!0,children:" quit "}),t(o,{color:a,bold:!0,children:"s"}),h(o,{dimColor:!0,children:[" ",n?"back":"suggestions"," "]}),t(o,{color:a,bold:!0,children:"1"}),t(o,{dimColor:!0,children:"-"}),t(o,{color:a,bold:!0,children:"5"}),t(o,{dimColor:!0,children:" period "}),t(o,{color:a,bold:!0,children:"r"}),t(o,{dimColor:!0,children:" refresh "}),t(o,{color:a,bold:!0,children:"n"}),t(o,{dimColor:!0,children:" new session "}),t(o,{color:a,bold:!0,children:"l"}),t(o,{dimColor:!0,children:" launcher"})]})})}m(H,"StatusBar");function ct({wide:s,width:n,children:i}){return s?t(c,{width:n,children:i}):t(ht,{children:i})}m(ct,"Row");function ut({initialLocal:s,initialApi:n,initialInstructions:i,initialPeriod:d,initialLauncherFocused:b=!1}){let{exit:j}=lt(),[e,L]=w(d),[K,Q]=w(s),[W,V]=w(n),[Z,tt]=w(i),[ot,k]=w(!1),[p,I]=w(!1),[Y,_]=w(b),et=X()?.orgSlug??null,y=st(null),it=J(),g=G(async()=>{k(!0);let[r,x,P]=await Promise.all([B(),S(),R()]);Q(r),V(x),tt(P),k(!1)},[]);nt(()=>{let r=setInterval(g,3e4);return()=>clearInterval(r)},[g]);let f=G(r=>{r!==e&&(L(r),y.current&&clearTimeout(y.current),y.current=setTimeout(g,300))},[e,g]);at((r,x)=>{if(Y)return;if(r==="q"){if(p){I(!1);return}j();return}if(r==="s"){I(A=>!A);return}if(x.escape&&p){I(!1);return}if(r==="l"&&!p){_(!0);return}if(p)return;if(r==="r"){g();return}if(r==="n"){import("../dist-FAVALJ5C.js").then(({getLauncher:A})=>{A("claude_code").launch({projectPath:process.cwd(),mode:"interactive"})});return}let P=u.indexOf(e);x.leftArrow?f(u[(P-1+u.length)%u.length]):x.rightArrow||x.tab?f(u[(P+1)%u.length]):r==="1"?f("today"):r==="2"?f("week"):r==="3"?f("30days"):r==="4"?f("month"):r==="5"&&f("all")});let{dashWidth:l,wide:q,halfWidth:rt,barWidth:C}=it,N=q?rt:l;return ot?h(c,{flexDirection:"column",width:l,children:[t(z,{active:e}),t(c,{borderStyle:"round",borderColor:a,paddingX:1,width:l,children:h(o,{dimColor:!0,children:["Loading ",T[e],"..."]})}),t(H,{width:l})]}):Y?t(c,{flexDirection:"column",width:l,children:t($,{onClose:()=>_(!1),activeOrg:et,defaultProjectPath:process.cwd(),width:l})}):h(c,{flexDirection:"column",width:l,children:[t(z,{active:e}),t(D,{local:K,api:W,label:T[e],width:l}),h(ct,{wide:q,width:l,children:[t(O,{api:W,width:N,barWidth:C}),t(F,{api:W,width:N,barWidth:C})]}),t(E,{instructions:Z,width:l,barWidth:C}),t(M,{api:W,width:l,focused:p}),t(H,{width:l,insightsFocused:p})]})}m(ut,"InteractiveDashboard");async function yt(s="week",n={}){let[i,d,b]=await Promise.all([B(),S(),R()]);if(process.stdin.isTTY&&process.stdout.isTTY){let{waitUntilExit:e}=U(t(ut,{initialLocal:i,initialApi:d,initialInstructions:b,initialPeriod:s,initialLauncherFocused:n.openLauncher??!1}));await e()}else{let e=J(),{unmount:L}=U(h(c,{flexDirection:"column",width:e.dashWidth,children:[t(D,{local:i,api:d,label:T[s],width:e.dashWidth}),t(O,{api:d,width:e.dashWidth,barWidth:e.barWidth}),t(F,{api:d,width:e.dashWidth,barWidth:e.barWidth}),t(E,{instructions:b,width:e.dashWidth,barWidth:e.barWidth}),t(M,{api:d,width:e.dashWidth})]}),{patchConsole:!1});L()}}m(yt,"renderDashboard");export{yt as renderDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-SJGLRC2R.js";import"../../chunk-RDET7CKR.js";import"../../chunk-NBTC5FNV.js";import"../../chunk-TU2AR6XO.js";import"../../chunk-NJ5UED3H.js";import"../../chunk-ZR3MUNLS.js";import"../../chunk-ZXF5NE54.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as LauncherOverlay};
|
package/dist/lib/agent-loop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-WD5QPDSE.js";import"../chunk-TIOKY2IA.js";import"../chunk-HQJQYBXB.js";import"../chunk-W2MOTOQE.js";import"../chunk-I5EKWKQH.js";import"../chunk-L4A3NYUV.js";import"../chunk-6QKI756T.js";import"../chunk-RSKQRVPJ.js";import"../chunk-IR4G5CXR.js";import"../chunk-QFVGUZDO.js";import"../chunk-M3PXVKW7.js";import"../chunk-UF6US7VU.js";import"../chunk-L6UAON7I.js";import"../chunk-4Q7TAY3C.js";import"../chunk-AIHLSF43.js";import"../chunk-ZL4MZMUK.js";import"../chunk-N7TGRFVZ.js";import"../chunk-KXW3IWKQ.js";import"../chunk-V7PN6AU5.js";import"../chunk-FYJE2DWV.js";import"../chunk-5RBLIVBF.js";import"../chunk-GTOEWPIM.js";import"../chunk-6V4WM73L.js";import"../chunk-3IOCBGFR.js";import"../chunk-TDD7IOV2.js";import"../chunk-7DFNBRLY.js";import"../chunk-MODXEGCU.js";import"../chunk-GQRCSR2A.js";import"../chunk-ISDRKWGI.js";import"../chunk-VKPDLPO6.js";import"../chunk-67QCYUJU.js";import"../chunk-N7ODX6PO.js";import"../chunk-IL35G6CK.js";import"../chunk-S6B2R2LL.js";import"../chunk-CHA5SX4Y.js";import"../chunk-WQ2BJQYB.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import"../chunk-ZLLER3HP.js";export{b as CAPABILITIES,a as HANDLERS,c as availableCapabilities,d as pollForWork,e as runAgentLoop};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-CJRYYV76.js";import"../chunk-ZLLER3HP.js";export{a as decideAutoRunStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-WXFFD4IV.js";import"../chunk-CHA5SX4Y.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import"../chunk-ZLLER3HP.js";export{b as aggregateBenchmark,c as postBenchmark,a as summarizeRuns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-ISDRKWGI.js";import"../chunk-VKPDLPO6.js";import"../chunk-67QCYUJU.js";import"../chunk-N7ODX6PO.js";import"../chunk-ZLLER3HP.js";export{a as buildFeedbackBlock,b as generateEvalCases};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-3IOCBGFR.js";import"../chunk-GQRCSR2A.js";import"../chunk-ISDRKWGI.js";import"../chunk-VKPDLPO6.js";import"../chunk-67QCYUJU.js";import"../chunk-N7ODX6PO.js";import"../chunk-IL35G6CK.js";import"../chunk-S6B2R2LL.js";import"../chunk-WQ2BJQYB.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import"../chunk-ZLLER3HP.js";export{a as processConversationJob};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../chunk-ZGDKJZII.js";import"../chunk-IL35G6CK.js";import"../chunk-S6B2R2LL.js";import"../chunk-WQ2BJQYB.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import"../chunk-ZLLER3HP.js";export{a as executeAndGradeCase,b as runBatchAndPost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-M3PXVKW7.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as cronRefreshPricing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-L6UAON7I.js";import"../../chunk-ZL4MZMUK.js";import"../../chunk-TDD7IOV2.js";import"../../chunk-MODXEGCU.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as cronSuggestInstructions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-4Q7TAY3C.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-ZLLER3HP.js";export{b as distillMemories,a as selectNewMemories};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-AIHLSF43.js";import"../../chunk-N7TGRFVZ.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-ZLLER3HP.js";export{a as processAnnouncement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-NZ7NZEQV.js";import"../../chunk-ZL4MZMUK.js";import"../../chunk-N7TGRFVZ.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-ZLLER3HP.js";export{a as processChangelog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-V7PN6AU5.js";import"../../chunk-3IOCBGFR.js";import"../../chunk-GQRCSR2A.js";import"../../chunk-ISDRKWGI.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-IL35G6CK.js";import"../../chunk-S6B2R2LL.js";import"../../chunk-WQ2BJQYB.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as processConversation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-FYJE2DWV.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-GTOEWPIM.js";import"../../chunk-6V4WM73L.js";import"../../chunk-ISDRKWGI.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-IL35G6CK.js";import"../../chunk-S6B2R2LL.js";import"../../chunk-WQ2BJQYB.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as processEval};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-HQJQYBXB.js";import"../../chunk-QFVGUZDO.js";import"../../chunk-ZL4MZMUK.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as processInsights};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-I5EKWKQH.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-IL35G6CK.js";import"../../chunk-S6B2R2LL.js";import"../../chunk-CHA5SX4Y.js";import"../../chunk-WQ2BJQYB.js";import"../../chunk-ZLLER3HP.js";export{a as processMemoryAb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-L4A3NYUV.js";import"../../chunk-6QKI756T.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-7DFNBRLY.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-ZLLER3HP.js";export{a as processRunCleanup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-IR4G5CXR.js";import"../../chunk-KXW3IWKQ.js";import"../../chunk-VKPDLPO6.js";import"../../chunk-67QCYUJU.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-ZLLER3HP.js";export{a as processSessionGoal};
|
package/dist/lib/llm-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-VKPDLPO6.js";import"../chunk-67QCYUJU.js";import"../chunk-N7ODX6PO.js";import"../chunk-ZLLER3HP.js";export{d as detectLlmBackend,b as getToolCli,e as resetLlmBackendCache,a as resolveToolBin,f as runLlmPrompt,c as runToolPrompt};
|
package/dist/lib/manual-tasks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"../chunk-
|
|
1
|
+
import{a as l}from"../chunk-NZ7NZEQV.js";import{a as u}from"../chunk-UF6US7VU.js";import{a as g}from"../chunk-L6UAON7I.js";import"../chunk-ZL4MZMUK.js";import"../chunk-N7TGRFVZ.js";import"../chunk-KXW3IWKQ.js";import"../chunk-TDD7IOV2.js";import"../chunk-MODXEGCU.js";import"../chunk-VKPDLPO6.js";import"../chunk-67QCYUJU.js";import"../chunk-N7ODX6PO.js";import{a as i}from"../chunk-GY5IJ4RS.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import{a as o}from"../chunk-ZLLER3HP.js";var c={cron_check_changelog:o(async(r,e)=>{let s=await l({logger:{info:o(t=>e.logger.info(t),"info"),warn:o(t=>e.logger.warn(t),"warn")}});e.logger.info(`[cron_check_changelog] result: created=${s.createdCount} skipped=${s.skippedCount}`)},"cron_check_changelog"),cron_suggest_instructions:o((r,e)=>g(r,e),"cron_suggest_instructions"),cron_refresh_skills:o((r,e)=>u(r,e),"cron_refresh_skills")},p=i.map(r=>{let e=c[r.name];if(!e)throw new Error(`manual-tasks: no handler registered for "${r.name}"`);return{...r,handler:e}});async function m(r){let e=p.find(n=>n.name===r);if(!e)return{name:r,durationMs:0,ok:!1,error:`Unknown task: ${r}`,logs:[]};let s=[],t={logger:{info:o(n=>s.push({level:"info",message:n}),"info"),warn:o(n=>s.push({level:"warn",message:n}),"warn"),error:o(n=>s.push({level:"error",message:n}),"error")},job:{attempts:0}},a=Date.now();try{return await e.handler({},t),{name:r,durationMs:Date.now()-a,ok:!0,logs:s}}catch(n){return{name:r,durationMs:Date.now()-a,ok:!1,error:n instanceof Error?n.message:String(n),logs:s}}}o(m,"runManualTask");export{p as MANUAL_TASKS,m as runManualTask};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-DMLAMJLV.js";import"../chunk-CHA5SX4Y.js";import"../chunk-ZLLER3HP.js";export{b as buildVersionVerdict,c as formatVersionVerdict,a as pairVersionResults};
|
package/oclif.manifest.json
CHANGED
|
@@ -1095,6 +1095,99 @@
|
|
|
1095
1095
|
"agent.js"
|
|
1096
1096
|
]
|
|
1097
1097
|
},
|
|
1098
|
+
"evals:auto-run": {
|
|
1099
|
+
"aliases": [],
|
|
1100
|
+
"args": {
|
|
1101
|
+
"targetId": {
|
|
1102
|
+
"description": "Eval target ID",
|
|
1103
|
+
"name": "targetId",
|
|
1104
|
+
"required": true
|
|
1105
|
+
}
|
|
1106
|
+
},
|
|
1107
|
+
"description": "Run evals in a loop until the effect verdict is statistically powered (§6f auto-run-to-power)",
|
|
1108
|
+
"examples": [
|
|
1109
|
+
"<%= config.bin %> evals auto-run <target-id> # preview (cost + plan)",
|
|
1110
|
+
"<%= config.bin %> evals auto-run <target-id> --yes # run until powered / budget",
|
|
1111
|
+
"<%= config.bin %> evals auto-run <target-id> --yes --max-runs 120 --batch-parallel 4"
|
|
1112
|
+
],
|
|
1113
|
+
"flags": {
|
|
1114
|
+
"api-url": {
|
|
1115
|
+
"description": "Override API base URL",
|
|
1116
|
+
"env": "RULEMETRIC_API_URL",
|
|
1117
|
+
"hidden": true,
|
|
1118
|
+
"name": "api-url",
|
|
1119
|
+
"hasDynamicHelp": false,
|
|
1120
|
+
"multiple": false,
|
|
1121
|
+
"type": "option"
|
|
1122
|
+
},
|
|
1123
|
+
"yes": {
|
|
1124
|
+
"char": "y",
|
|
1125
|
+
"description": "Actually run. Without this, only previews the plan + cost.",
|
|
1126
|
+
"name": "yes",
|
|
1127
|
+
"allowNo": false,
|
|
1128
|
+
"type": "boolean"
|
|
1129
|
+
},
|
|
1130
|
+
"max-runs": {
|
|
1131
|
+
"description": "Hard ceiling on completed runs",
|
|
1132
|
+
"name": "max-runs",
|
|
1133
|
+
"default": 200,
|
|
1134
|
+
"hasDynamicHelp": false,
|
|
1135
|
+
"multiple": false,
|
|
1136
|
+
"type": "option"
|
|
1137
|
+
},
|
|
1138
|
+
"batch-parallel": {
|
|
1139
|
+
"description": "Concurrent executions within a batch",
|
|
1140
|
+
"name": "batch-parallel",
|
|
1141
|
+
"default": 3,
|
|
1142
|
+
"hasDynamicHelp": false,
|
|
1143
|
+
"multiple": false,
|
|
1144
|
+
"type": "option"
|
|
1145
|
+
},
|
|
1146
|
+
"timeout": {
|
|
1147
|
+
"description": "Timeout per eval in ms",
|
|
1148
|
+
"name": "timeout",
|
|
1149
|
+
"default": 120000,
|
|
1150
|
+
"hasDynamicHelp": false,
|
|
1151
|
+
"multiple": false,
|
|
1152
|
+
"type": "option"
|
|
1153
|
+
},
|
|
1154
|
+
"model": {
|
|
1155
|
+
"description": "Model for eval execution",
|
|
1156
|
+
"name": "model",
|
|
1157
|
+
"hasDynamicHelp": false,
|
|
1158
|
+
"multiple": false,
|
|
1159
|
+
"type": "option"
|
|
1160
|
+
},
|
|
1161
|
+
"grader-model": {
|
|
1162
|
+
"description": "Model for grading",
|
|
1163
|
+
"name": "grader-model",
|
|
1164
|
+
"hasDynamicHelp": false,
|
|
1165
|
+
"multiple": false,
|
|
1166
|
+
"type": "option"
|
|
1167
|
+
},
|
|
1168
|
+
"skip-baseline": {
|
|
1169
|
+
"description": "Skip without_target runs (no delta — not recommended)",
|
|
1170
|
+
"name": "skip-baseline",
|
|
1171
|
+
"allowNo": false,
|
|
1172
|
+
"type": "boolean"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
"hasDynamicHelp": false,
|
|
1176
|
+
"hiddenAliases": [],
|
|
1177
|
+
"id": "evals:auto-run",
|
|
1178
|
+
"pluginAlias": "@rulemetric/cli",
|
|
1179
|
+
"pluginName": "@rulemetric/cli",
|
|
1180
|
+
"pluginType": "core",
|
|
1181
|
+
"strict": true,
|
|
1182
|
+
"enableJsonFlag": false,
|
|
1183
|
+
"isESM": true,
|
|
1184
|
+
"relativePath": [
|
|
1185
|
+
"dist",
|
|
1186
|
+
"commands",
|
|
1187
|
+
"evals",
|
|
1188
|
+
"auto-run.js"
|
|
1189
|
+
]
|
|
1190
|
+
},
|
|
1098
1191
|
"evals:benchmark": {
|
|
1099
1192
|
"aliases": [],
|
|
1100
1193
|
"args": {
|
|
@@ -1449,6 +1542,61 @@
|
|
|
1449
1542
|
"optimize.js"
|
|
1450
1543
|
]
|
|
1451
1544
|
},
|
|
1545
|
+
"evals:refine-cases": {
|
|
1546
|
+
"aliases": [],
|
|
1547
|
+
"args": {
|
|
1548
|
+
"targetId": {
|
|
1549
|
+
"description": "Eval target ID",
|
|
1550
|
+
"name": "targetId",
|
|
1551
|
+
"required": true
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1554
|
+
"description": "Retire non-discriminating eval cases and regenerate discriminating replacements (§6e)",
|
|
1555
|
+
"examples": [
|
|
1556
|
+
"<%= config.bin %> evals refine-cases <target-id> # preview",
|
|
1557
|
+
"<%= config.bin %> evals refine-cases <target-id> --yes # apply: retire + regenerate",
|
|
1558
|
+
"<%= config.bin %> evals refine-cases <target-id> --yes --no-generate"
|
|
1559
|
+
],
|
|
1560
|
+
"flags": {
|
|
1561
|
+
"api-url": {
|
|
1562
|
+
"description": "Override API base URL",
|
|
1563
|
+
"env": "RULEMETRIC_API_URL",
|
|
1564
|
+
"hidden": true,
|
|
1565
|
+
"name": "api-url",
|
|
1566
|
+
"hasDynamicHelp": false,
|
|
1567
|
+
"multiple": false,
|
|
1568
|
+
"type": "option"
|
|
1569
|
+
},
|
|
1570
|
+
"yes": {
|
|
1571
|
+
"char": "y",
|
|
1572
|
+
"description": "Apply (retire + regenerate). Without this, only previews.",
|
|
1573
|
+
"name": "yes",
|
|
1574
|
+
"allowNo": false,
|
|
1575
|
+
"type": "boolean"
|
|
1576
|
+
},
|
|
1577
|
+
"no-generate": {
|
|
1578
|
+
"description": "Retire dead cases but do not regenerate replacements.",
|
|
1579
|
+
"name": "no-generate",
|
|
1580
|
+
"allowNo": false,
|
|
1581
|
+
"type": "boolean"
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
"hasDynamicHelp": false,
|
|
1585
|
+
"hiddenAliases": [],
|
|
1586
|
+
"id": "evals:refine-cases",
|
|
1587
|
+
"pluginAlias": "@rulemetric/cli",
|
|
1588
|
+
"pluginName": "@rulemetric/cli",
|
|
1589
|
+
"pluginType": "core",
|
|
1590
|
+
"strict": true,
|
|
1591
|
+
"enableJsonFlag": false,
|
|
1592
|
+
"isESM": true,
|
|
1593
|
+
"relativePath": [
|
|
1594
|
+
"dist",
|
|
1595
|
+
"commands",
|
|
1596
|
+
"evals",
|
|
1597
|
+
"refine-cases.js"
|
|
1598
|
+
]
|
|
1599
|
+
},
|
|
1452
1600
|
"evals:run": {
|
|
1453
1601
|
"aliases": [],
|
|
1454
1602
|
"args": {
|
|
@@ -4077,5 +4225,5 @@
|
|
|
4077
4225
|
]
|
|
4078
4226
|
}
|
|
4079
4227
|
},
|
|
4080
|
-
"version": "0.7.
|
|
4228
|
+
"version": "0.7.21"
|
|
4081
4229
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulemetric/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"postgres": "^3.4.0",
|
|
75
75
|
"react": "^19.0.0",
|
|
76
76
|
"zod": "^3.24.0",
|
|
77
|
-
"@rulemetric/
|
|
78
|
-
"@rulemetric/
|
|
79
|
-
"@rulemetric/
|
|
77
|
+
"@rulemetric/skills-registry": "0.7.21",
|
|
78
|
+
"@rulemetric/proxy": "0.7.21",
|
|
79
|
+
"@rulemetric/hooks": "0.7.21"
|
|
80
80
|
},
|
|
81
81
|
"//deps": "Worker (`evals agent`) runtime deps: the @opentelemetry/* set, @sentry/node, and postgres are STATIC top-level imports loaded at worker startup (via bundled @rulemetric/{telemetry,db}) — they MUST be runtime deps or a clean `npm i -g` crashes with ModuleLoadError. `better-sqlite3` is optionalDependencies (below): it's a native module, lazy `require()`'d inside a try/catch (packages/session providers cursor/opencode) so a missing binary degrades gracefully — making it a hard dep would break `npm i -g` on platforms without prebuilt binaries. `resend` stays a devDep: lazy `await import('resend')` guarded by RESEND_API_KEY, which end-user workers never set (provider falls back to noop). Classification verified via import-graph scan of dist/commands/evals/agent.js + per-importer static/lazy check.",
|
|
82
82
|
"optionalDependencies": {
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
"tsx": "^4.19.0",
|
|
95
95
|
"typescript": "^5.9.0",
|
|
96
96
|
"vitest": "^3.2.0",
|
|
97
|
-
"@rulemetric/api": "0.0.1",
|
|
98
97
|
"@rulemetric/core": "0.0.1",
|
|
99
98
|
"@rulemetric/db": "0.0.1",
|
|
100
99
|
"@rulemetric/effectiveness": "0.0.1",
|
|
101
100
|
"@rulemetric/email": "0.0.1",
|
|
102
101
|
"@rulemetric/session": "0.2.1",
|
|
103
102
|
"@rulemetric/telemetry": "0.0.1",
|
|
104
|
-
"@rulemetric/typescript-config": "0.0.0"
|
|
103
|
+
"@rulemetric/typescript-config": "0.0.0",
|
|
104
|
+
"@rulemetric/api": "0.0.1"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
107
107
|
"build": "node scripts/build.mjs",
|
package/dist/chunk-5XP7WWJR.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{f as r}from"./chunk-RTWRHIKY.js";import{a as o}from"./chunk-ZLLER3HP.js";var i=5,g=`You are designing eval test cases for an AI-coding-agent instruction (a CLAUDE.md rule, skill, or prompt). Your cases will be executed by running the prompt through an agent WITH and WITHOUT the instruction, then grading the outputs \u2014 so every case must be able to tell those two conditions apart.
|
|
2
|
-
|
|
3
|
-
Requirements for the set:
|
|
4
|
-
- Each case: a realistic task prompt a developer would give an agent, plus 1-3 expectations.
|
|
5
|
-
- Expectations must be DISCRIMINATING: they should pass when the instruction is followed and fail when it is not. An expectation that passes for any reasonable output is worthless.
|
|
6
|
-
- Prefer DETERMINISTIC expectations wherever the outcome is objectively checkable, using these exact prefixes (they are graded programmatically, not by an LLM judge):
|
|
7
|
-
- "contains: <substring>" \u2014 output must contain the substring (case-sensitive)
|
|
8
|
-
- "icontains: <substring>" \u2014 case-insensitive contains
|
|
9
|
-
- "not-contains: <substring>" \u2014 output must NOT contain the substring
|
|
10
|
-
- "regex: <pattern>" \u2014 output must match the pattern
|
|
11
|
-
- "json-valid" \u2014 output must parse as JSON
|
|
12
|
-
Use plain free-text expectations only for genuinely subjective outcomes.
|
|
13
|
-
- Include exactly ONE "violation-attempt" case: a prompt that subtly encourages breaking the instruction's strongest prohibition; expectations assert the instruction still holds. Name it starting with "violation-attempt:".
|
|
14
|
-
- Name compliance cases starting with "compliance:".
|
|
15
|
-
- At most ${i} cases.
|
|
16
|
-
|
|
17
|
-
Respond with ONLY a valid JSON object:
|
|
18
|
-
{"cases": [{"name": "...", "prompt": "...", "expectations": ["..."]}]}`;async function d(c){let{content:p,name:l}=c,u=`## Instruction under test: ${l}
|
|
19
|
-
|
|
20
|
-
${p}`,e=await r(g,u,4e3);if(e===null)return null;let n=e.cases;if(!Array.isArray(n))throw new Error(`Case generator returned invalid shape (no cases array): ${JSON.stringify(e).slice(0,200)}`);let s=[];for(let m of n){let t=m;typeof t.name=="string"&&t.name.length>0&&typeof t.prompt=="string"&&t.prompt.length>0&&Array.isArray(t.expectations)&&t.expectations.length>0&&t.expectations.every(a=>typeof a=="string"&&a.length>0)&&s.push({name:t.name,prompt:t.prompt,expectations:t.expectations})}if(s.length===0)throw new Error(`Case generator produced no usable cases (${n.length} row(s), all malformed or empty)`);return s.slice(0,i)}o(d,"generateEvalCases");export{d as a};
|