@rulemetric/cli 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.js +1 -1
- package/dist/{chunk-4Q72B377.js → chunk-2B7Y6JNB.js} +1 -1
- package/dist/{chunk-Z2MZOQCD.js → chunk-3AZV7ZPJ.js} +1 -1
- package/dist/chunk-3DGL2ZY3.js +1 -0
- package/dist/chunk-3PUOJ6F2.js +45 -0
- package/dist/{chunk-5ZACMVV3.js → chunk-5EDINFHF.js} +1 -1
- package/dist/{chunk-FAXV5AAG.js → chunk-6M74HH6Y.js} +1 -1
- package/dist/chunk-7FZB65VH.js +1 -0
- package/dist/{chunk-4VZLIGMS.js → chunk-AFYZYXQ3.js} +1 -1
- package/dist/{chunk-TU2AR6XO.js → chunk-B22HYCBV.js} +1 -1
- package/dist/{chunk-RJLAAKEN.js → chunk-BPP7AEFW.js} +1 -1
- package/dist/{chunk-MOAJLSYV.js → chunk-C2275MFP.js} +1 -1
- package/dist/{chunk-T4ZIK6RS.js → chunk-CBUTNIJA.js} +1 -1
- package/dist/{chunk-ULMEKK7C.js → chunk-CDDICCY2.js} +1 -1
- package/dist/chunk-DZ3FBQYD.js +17 -0
- package/dist/{chunk-5KD2N2MH.js → chunk-E2NVNLFD.js} +1 -1
- package/dist/{chunk-NIRD7ETU.js → chunk-EQHKCGSX.js} +1 -1
- package/dist/chunk-FP6QAPNK.js +1 -0
- package/dist/chunk-FWTYR36W.js +1 -0
- package/dist/chunk-G7V4ZZZ3.js +1 -0
- package/dist/chunk-GF76D2DU.js +1 -0
- package/dist/chunk-HOQPVOMF.js +2 -0
- package/dist/{chunk-MBHDTW3M.js → chunk-HYDGERWD.js} +1 -1
- package/dist/chunk-IVDTORX5.js +1 -0
- package/dist/{chunk-4L2ZEIRE.js → chunk-JPUH3V67.js} +1 -1
- package/dist/chunk-K4B24SMJ.js +1 -0
- package/dist/chunk-KGURGIZ2.js +1 -0
- package/dist/{chunk-LWI5K6T4.js → chunk-KHWG7ZG4.js} +1 -1
- package/dist/{chunk-KGQ5W54Y.js → chunk-KWNIKGAE.js} +1 -1
- package/dist/{chunk-H7VP4SDO.js → chunk-L54TWWBY.js} +1 -1
- package/dist/{chunk-5XUN743A.js → chunk-LLIHRQPH.js} +1 -1
- package/dist/chunk-MMPZIZYZ.js +10 -0
- package/dist/chunk-MO57LGGK.js +1 -0
- package/dist/{chunk-LLNQZ4SZ.js → chunk-PKLXZYBY.js} +1 -1
- package/dist/{chunk-5RUEROLC.js → chunk-PQN2GAG4.js} +1 -1
- package/dist/chunk-QAV4HW7D.js +1 -0
- package/dist/{chunk-YW3JQKGY.js → chunk-QTZPLAYC.js} +1 -1
- package/dist/chunk-QWPWY3SW.js +1 -0
- package/dist/{chunk-ZE2PGHJQ.js → chunk-R6JXE273.js} +1 -1
- package/dist/chunk-RZTVYUX4.js +11 -0
- package/dist/{chunk-HXZM2UHO.js → chunk-S62MK372.js} +1 -1
- package/dist/{chunk-BLCMXTIK.js → chunk-SANYAPBK.js} +1 -1
- package/dist/{chunk-AI6FMGKM.js → chunk-SYTQDPPN.js} +1 -1
- package/dist/chunk-TZA4HAVF.js +1 -0
- package/dist/{chunk-6VKQT2J3.js → chunk-UUZB4IKU.js} +1 -1
- package/dist/{chunk-QY3UKLDE.js → chunk-VA5DPQB4.js} +1 -1
- package/dist/{chunk-CF7FUQQ4.js → chunk-VFYT3SC5.js} +2 -2
- package/dist/{chunk-O2BKBW7Z.js → chunk-WKDXH7NO.js} +1 -1
- package/dist/{chunk-NBTC5FNV.js → chunk-X23L2MF6.js} +1 -1
- package/dist/{chunk-W76EQSEV.js → chunk-X3RTCN6S.js} +1 -1
- package/dist/{chunk-EN43UYBN.js → chunk-X3VL5H24.js} +1 -1
- package/dist/{chunk-YQ56FQEO.js → chunk-XFAFMYIP.js} +1 -1
- package/dist/{chunk-IQCE4VBP.js → chunk-YFQ4FOAS.js} +1 -1
- package/dist/commands/antigravity/backfill.js +1 -1
- package/dist/commands/auth/create-key.js +1 -1
- package/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/revoke-key.js +1 -1
- package/dist/commands/auth/signup.js +1 -1
- package/dist/commands/auth/status.js +1 -1
- package/dist/commands/capture/scope.js +1 -1
- package/dist/commands/catalog/index.js +1 -1
- package/dist/commands/catalog/recommend.js +1 -1
- package/dist/commands/convert.js +1 -1
- package/dist/commands/converters.js +1 -1
- package/dist/commands/crons/list.js +1 -1
- package/dist/commands/crons/run.js +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/diagnostics.js +1 -1
- package/dist/commands/eval-targets/create.js +1 -1
- package/dist/commands/eval-targets/list.js +1 -1
- package/dist/commands/evals/agent.js +1 -1
- package/dist/commands/evals/auto-run.js +1 -1
- package/dist/commands/evals/benchmark.js +1 -1
- package/dist/commands/evals/compare.js +1 -1
- package/dist/commands/evals/create.js +1 -1
- package/dist/commands/evals/optimize-description.js +1 -1
- package/dist/commands/evals/optimize.js +1 -1
- package/dist/commands/evals/refine-cases.js +1 -1
- package/dist/commands/evals/run.js +1 -1
- package/dist/commands/evals/validate-judge.js +1 -1
- package/dist/commands/experiments/list.js +1 -1
- package/dist/commands/gateway/ensure.js +1 -1
- package/dist/commands/hooks/install.js +1 -1
- package/dist/commands/hooks/run.js +1 -1
- package/dist/commands/hooks/uninstall.js +1 -1
- package/dist/commands/import.js +1 -1
- package/dist/commands/instructions/create.js +1 -1
- package/dist/commands/instructions/delete.js +1 -1
- package/dist/commands/instructions/fork.js +1 -1
- package/dist/commands/instructions/get.js +1 -1
- package/dist/commands/instructions/list.js +1 -1
- package/dist/commands/instructions/promote.js +1 -1
- package/dist/commands/instructions/pull.js +1 -1
- package/dist/commands/instructions/restore.js +1 -1
- package/dist/commands/instructions/retract.js +1 -1
- package/dist/commands/instructions/upstream.js +1 -1
- package/dist/commands/instructions/versions.js +1 -1
- package/dist/commands/launcher.js +1 -1
- package/dist/commands/local/down.js +1 -1
- package/dist/commands/local/up.js +1 -1
- package/dist/commands/org/current.js +1 -1
- package/dist/commands/org/list.js +1 -1
- package/dist/commands/org/switch.js +1 -1
- package/dist/commands/packs/add-instruction.js +1 -1
- package/dist/commands/packs/apply.js +1 -1
- package/dist/commands/packs/create.js +1 -1
- package/dist/commands/packs/fork.js +1 -1
- package/dist/commands/packs/get.js +1 -1
- package/dist/commands/packs/list.js +1 -1
- package/dist/commands/packs/remove-instruction.js +1 -1
- package/dist/commands/proxy/env.js +1 -1
- package/dist/commands/proxy/logs.js +1 -1
- package/dist/commands/proxy/restart.js +1 -1
- package/dist/commands/proxy/setup.js +1 -1
- package/dist/commands/proxy/start.js +1 -1
- package/dist/commands/proxy/status.js +1 -1
- package/dist/commands/proxy/stop.js +1 -1
- package/dist/commands/research/backfill.js +1 -1
- package/dist/commands/research/tail-transcript.js +1 -1
- package/dist/commands/service/install.js +6 -6
- package/dist/commands/service/status.js +1 -1
- package/dist/commands/service/uninstall.js +1 -1
- package/dist/commands/sessions/analyze.js +1 -1
- package/dist/commands/sessions/delete.js +1 -1
- package/dist/commands/sessions/end.js +1 -1
- package/dist/commands/sessions/import.js +1 -1
- package/dist/commands/sessions/list.js +1 -1
- package/dist/commands/sessions/start.js +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/skills/export-approved.js +1 -1
- package/dist/commands/skills/install.js +1 -1
- package/dist/commands/skills/list.js +1 -1
- package/dist/commands/skills/publish.js +1 -1
- package/dist/commands/skills/search.js +1 -1
- package/dist/commands/skills/update.js +1 -1
- package/dist/commands/suggestions/accept.js +1 -11
- package/dist/commands/suggestions/auto.js +1 -0
- package/dist/commands/suggestions/dismiss.js +1 -1
- package/dist/commands/suggestions/list.js +1 -1
- package/dist/commands/suggestions/refresh.js +1 -1
- package/dist/commands/suggestions/undo.js +1 -0
- package/dist/dashboard/Dashboard.js +1 -1
- package/dist/dashboard/data.js +1 -1
- package/dist/dashboard/launcher/ActiveJobsList.js +1 -1
- package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
- package/dist/dashboard/launcher/NewLaunchForm.js +1 -1
- package/dist/dashboard/launcher/api.js +1 -1
- package/dist/dashboard/launcher/useLaunchJobs.js +1 -1
- package/dist/lib/active-org-refresh.js +1 -1
- package/dist/lib/agent-loop.js +1 -1
- package/dist/lib/antigravity-transcript.js +1 -1
- package/dist/lib/api-client.js +1 -1
- package/dist/lib/ensure-api-key.js +1 -1
- package/dist/lib/ensure-fresh-token.js +1 -1
- package/dist/lib/eval-analyzer.js +1 -1
- package/dist/lib/eval-benchmark.js +1 -1
- package/dist/lib/eval-candidate-run.js +1 -1
- package/dist/lib/eval-conversation-handler.js +1 -1
- package/dist/lib/eval-executor.js +1 -1
- package/dist/lib/eval-failure-classifier.js +1 -0
- package/dist/lib/eval-grader.js +1 -1
- package/dist/lib/eval-meta-judge.js +1 -1
- package/dist/lib/eval-quota-gate.js +1 -0
- package/dist/lib/eval-resume.js +1 -0
- package/dist/lib/eval-run-batch.js +1 -1
- package/dist/lib/eval-trigger-tester.js +1 -1
- package/dist/lib/evolution-enrolment.js +1 -0
- package/dist/lib/handlers/cron-auto-accept-suggestions.js +1 -0
- package/dist/lib/handlers/cron-eval-autorun.js +1 -1
- package/dist/lib/handlers/cron-instruction-evolution.js +1 -1
- package/dist/lib/handlers/cron-instruction-training.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-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-judge-review.js +1 -1
- package/dist/lib/handlers/process-launch.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/instruction-proposer.js +1 -1
- package/dist/lib/judge-review-runner.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/dist/lib/project-context.js +1 -0
- package/dist/lib/research-client.js +1 -1
- package/dist/lib/retraction.js +1 -1
- package/dist/lib/setup-steps.js +1 -1
- package/dist/lib/suggestion-accept.js +1 -0
- package/dist/lib/telemetry.js +1 -1
- package/dist/lib/terminal-target-heartbeat.js +1 -1
- package/oclif.manifest.json +438 -336
- package/package.json +8 -7
- package/dist/chunk-7QQSYEPT.js +0 -1
- package/dist/chunk-A4FYFRN7.js +0 -1
- package/dist/chunk-ATL4WZBF.js +0 -1
- package/dist/chunk-BAVLNWO4.js +0 -1
- package/dist/chunk-DBELYMDA.js +0 -1
- package/dist/chunk-EVAQBD5V.js +0 -1
- package/dist/chunk-FAZMKMTC.js +0 -45
- package/dist/chunk-HMMO27U4.js +0 -1
- package/dist/chunk-KLEF5D3A.js +0 -1
- package/dist/chunk-UKN2YVY4.js +0 -17
- package/dist/chunk-XJYNMJHH.js +0 -9
- package/dist/index.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as c,c as d}from"./chunk-IZTIYR5Q.js";import{d as u}from"./chunk-
|
|
1
|
+
import{a as c,c as d}from"./chunk-IZTIYR5Q.js";import{d as u}from"./chunk-UUZB4IKU.js";import{a}from"./chunk-EQHKCGSX.js";import{a as n}from"./chunk-VA5DPQB4.js";import{b as i}from"./chunk-QAV4HW7D.js";import{g as r}from"./chunk-JZ5Z2BRO.js";import{a as s}from"./chunk-ZLLER3HP.js";import{Command as f,Flags as h}from"@oclif/core";function p(t){return t instanceof i?t.statusCode>=500||t.statusCode===408||t.statusCode===0:/fetch failed|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EAI_AGAIN|bad gateway|timed out/i.test(t.message??"")}s(p,"isAvailabilityError");var m=class extends f{static{s(this,"BaseCommand")}static baseFlags={"api-url":h.string({description:"Override API base URL",env:"RULEMETRIC_API_URL",hidden:!0})};async init(){await super.init();let{flags:e}=await this.parse(this.constructor);e["api-url"]&&(process.env.RULEMETRIC_API_URL=e["api-url"]);let o=d(this.config.version);o&&!this.argv.includes("--quiet")&&!process.env.RULEMETRIC_QUIET&&process.stderr.write(`
|
|
2
2
|
${o}
|
|
3
3
|
|
|
4
4
|
`),c();try{await a()}catch{}}requireAuth(){r()||this.error("Not logged in. Run `rulemetric auth login` to authenticate."),n()}async catch(e){throw p(e)&&await u({command:this.id,statusCode:e instanceof i?e.statusCode:void 0,message:e.message,cliVersion:this.config.version}),e instanceof i&&(e.statusCode===401&&this.error("Session expired. Run `rulemetric auth login` to re-authenticate."),this.error(e.message)),(e.message?.includes("fetch failed")||e.message?.includes("ECONNREFUSED"))&&this.error("Could not connect to the API server. Is it running?"),e}};export{m as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T}from"./chunk-5RBLIVBF.js";import{a as S}from"./chunk-
|
|
1
|
+
import{a as T}from"./chunk-5RBLIVBF.js";import{a as S}from"./chunk-XFAFMYIP.js";import{b as A}from"./chunk-CNOD6HWU.js";import{e as x}from"./chunk-L2CFSMBC.js";import{a as C}from"./chunk-JPUH3V67.js";import{d as M}from"./chunk-TZA4HAVF.js";import{e as k,f as E,h as p}from"./chunk-QAV4HW7D.js";import{a as w}from"./chunk-ZLLER3HP.js";async function W(v,f){let{mirrorId:i,evalTargetId:g,config:o}=v,a=w(e=>f.logger.info(e),"log"),s=await k(`/api/eval-targets/${g}`),$=await k(`/api/eval-targets/${g}/evals`);if($.length===0&&o.generateIfEmpty){a("No eval cases on target \u2014 generating from content via local LLM...");let e=await A({content:s.content,name:s.name});if(e===null)throw new Error("Case generation requires an LLM backend (claude CLI on PATH or ANTHROPIC_API_KEY) \u2014 none available on this worker.");let n=[];for(let t of e)n.push(await E(`/api/eval-targets/${g}/evals`,t));$=n,a(`Generated ${n.length} eval case(s)`)}if($.length===0)throw new T("No evals defined for target");let G=o.runsPerEval??1,R=o.timeout??12e4,j=o.iteration??1,y=new Set;if(f.job.attempts>1)for(let n=0;;n+=100){let t=await k(`/api/eval-targets/${g}/runs?jobId=${i}&limit=100&offset=${n}`);for(let r of t)y.add(`${r.evalId}|${r.configuration}|${r.runNumber}|${r.iteration}`);if(t.length<100)break}let _=[{name:"with_target",content:s.content}];o.skipBaseline||_.push({name:"without_target"});let d=[];for(let e of $)for(let n of _)for(let t=1;t<=G;t++)y.has(`${e.id}|${n.name}|${t}|${j}`)||d.push({eval_:e,configuration:n.name,targetContent:n.content,runNumber:t});y.size>0&&a(`Resuming attempt ${f.job.attempts}: ${y.size} run(s) already persisted, ${d.length} remaining`);let l=d.length,u=0,m=Math.min(o.parallel??1,4);await p(`/api/eval-jobs/${i}/progress`,{status:"running",progress:{total:l,completed:0,current:null,message:`Starting ${l} eval runs (concurrency: ${m})...`}});let b=[];async function I(e){let n=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;a(`[${u+1}/${l}] ${n}`);let t=x({targetType:s.type,targetContent:e.targetContent,targetName:s.name});t.leakedFiles.length&&a(`\u26A0 CONTAMINATED ${n}: ${t.leakedFiles.join(", ")} survived the strip`);try{let r=await M({prompt:e.eval_.prompt,targetContent:t.systemPrompt,workDir:t.workDir,timeout:R,model:o.model}),c={};return!o.skipGrading&&e.eval_.expectations.length>0&&!r.error&&(c=await C({prompt:e.eval_.prompt,output:r.output,expectations:e.eval_.expectations,model:o.graderModel??o.model,timeout:R})),{jobId:i,evalId:e.eval_.id,evalTargetId:s.id,evalTargetVersion:s.version,configuration:e.configuration,runNumber:e.runNumber,iteration:j,status:r.error?"failed":"completed",outputs:{...r.error?{error:r.error}:{transcript:r.output,...r.model?{model:r.model}:{}},methodology:t.methodology,delivery:t.delivery,isolated:t.isWorktree,...t.leakedFiles.length?{leakedFiles:t.leakedFiles}:{}},timing:{duration_ms:r.durationMs,total_tokens:r.totalTokens},grading:c,worktree:t.isWorktree?!0:void 0}}finally{t.cleanup()}}if(w(I,"processItem"),m<=1)for(let e of d){let n=`${e.configuration} \xB7 ${e.eval_.name} \xB7 run#${e.runNumber}`;await p(`/api/eval-jobs/${i}/progress`,{status:"running",progress:{total:l,completed:u,current:n,message:`Executing ${n}...`}});let t=await I(e);await E("/api/eval-runs",t),b.push(t),u++,await p(`/api/eval-jobs/${i}/progress`,{status:"running",progress:{total:l,completed:u,current:n,message:`Completed ${n}`}})}else{a(`Running ${l} evals with concurrency=${m} (worktree isolation)`);for(let e=0;e<d.length;e+=m){let n=d.slice(e,e+m),t=`batch ${Math.floor(e/m)+1}/${Math.ceil(d.length/m)}`;await p(`/api/eval-jobs/${i}/progress`,{status:"running",progress:{total:l,completed:u,current:t,message:`Executing ${t} (${n.length} parallel)...`}});let r=await Promise.all(n.map(I));for(let c of r)await E("/api/eval-runs",c),b.push(c),u++;await p(`/api/eval-jobs/${i}/progress`,{status:"running",progress:{total:l,completed:u,current:t,message:`Completed ${t}`}})}}let P=J(b),h;if(!o.skipGrading&&b.some(e=>e.grading&&Object.keys(e.grading).length>0))try{a(`Running meta-judge for job ${i}...`);let e=$.map(n=>{let r=b.filter(c=>c.evalId===n.id&&c.configuration==="with_target")[0];return{evalName:n.name,prompt:n.prompt,expectations:n.expectations,grading:r?.grading?r.grading:null,output:r?.outputs?.transcript?.slice(0,500)}});h=await S({targetName:s.name,evalResults:e,model:o.graderModel??o.model,timeout:6e4}),a(`Meta-judge: quality=${h.quality_score}/5, issues=${h.issues.length}`)}catch(e){a(`Meta-judge failed (non-fatal): ${e instanceof Error?e.message:String(e)}`)}let N=h?{...P,meta_judgement:h}:P;return a(`Job ${i} completed: ${u}/${l} runs`),await p(`/api/eval-jobs/${i}/state`,{result:N}).catch(e=>{a(`result persist failed: ${e instanceof Error?e.message:String(e)}`)}),N}w(W,"processEval");function J(v){let f=v.filter(a=>a.status==="completed"),i=v.filter(a=>a.status==="failed"),g=f.filter(a=>{let s=a.grading;return s&&Object.keys(s).length>0}),o=g.length>0?g.reduce((a,s)=>a+(s.grading?.summary?.pass_rate??0),0)/g.length:null;return{total:v.length,completed:f.length,failed:i.length,avgPassRate:o}}w(J,"buildSummary");export{W as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as p}from"./chunk-TZA4HAVF.js";import{a as l}from"./chunk-ZLLER3HP.js";var k=[{name:"git-commit-helper",description:"Writes conventional commit messages and PR descriptions from a diff"},{name:"sql-query-optimizer",description:"Analyzes slow SQL queries and proposes indexes and rewrites"},{name:"i18n-string-extractor",description:"Finds hardcoded UI strings and extracts them into translation files"}],T=`You are an AI coding assistant with access to a set of optional skills. When a user request matches a skill's description, you invoke that skill before answering; when no skill applies, you answer directly without one. Descriptions are your ONLY information about each skill.
|
|
2
2
|
|
|
3
3
|
{{CATALOG}}
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as g,c as m}from"./chunk-N7ODX6PO.js";import{e as s,h as c}from"./chunk-
|
|
1
|
+
import{b as g,c as m}from"./chunk-N7ODX6PO.js";import{e as s,h as c}from"./chunk-QAV4HW7D.js";import{a as i}from"./chunk-ZLLER3HP.js";var u=6e4;function o(t,e){try{t(JSON.stringify({ts:new Date().toISOString(),...e}))}catch{t(`[tt-heartbeat] log_error event=${e.event}`)}}i(o,"structuredLog");function d(t,e){return e.aborted?Promise.resolve(!1):t<=0?Promise.resolve(!0):new Promise(r=>{let a=setTimeout(()=>{e.removeEventListener("abort",n),r(!0)},t),n=i(()=>{clearTimeout(a),e.removeEventListener("abort",n),r(!1)},"onAbort");e.addEventListener("abort",n,{once:!0})})}i(d,"abortableSleep");async function l(t,e){if(t.kind!=="tmux")return;let a=(await g(m(t.target))).code===0?"active":"missing";try{await c(`/api/terminal-targets/${t.id}/status`,{status:a,lastSeenAt:new Date().toISOString()}),o(e,{event:"tt_heartbeat",targetId:t.id,target:t.target,status:a})}catch(n){o(e,{event:"tt_heartbeat_error",targetId:t.id,target:t.target,error:n instanceof Error?n.message:String(n)})}}i(l,"probeAndReport");async function b(t){let e;try{e=await s("/api/terminal-targets?status=active")}catch(r){o(t,{event:"tt_heartbeat_list_error",error:r instanceof Error?r.message:String(r)});return}for(let r of e.targets??[])try{await l(r,t)}catch(a){o(t,{event:"tt_heartbeat_probe_error",targetId:r.id,error:a instanceof Error?a.message:String(a)})}}i(b,"runOneHeartbeatCycle");async function p(t){let e=t.log??(()=>{}),r=t.intervalMs??u;for(o(e,{event:"tt_heartbeat_start",intervalMs:r});!t.signal.aborted&&(await b(e),!!await d(r,t.signal)););o(e,{event:"tt_heartbeat_stop"})}i(p,"startTerminalTargetHeartbeat");export{l as a,b,p as c};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{e as m,f as l,i as p}from"./chunk-QAV4HW7D.js";import{a as c}from"./chunk-ZLLER3HP.js";import*as s from"node:fs";import*as g from"node:path";function y(e,t,n){let i=g.join(e,"CLAUDE.md"),r=`<!-- rulemetric:start ${t} -->`,a=`<!-- rulemetric:end ${t} -->`,o=s.existsSync(i)?s.readFileSync(i,"utf8"):"";if(o.includes(r))return!1;let u=`${o.length>0&&!o.endsWith(`
|
|
2
|
+
`)?`
|
|
3
|
+
|
|
4
|
+
`:o.length>0?`
|
|
5
|
+
`:""}
|
|
6
|
+
${r}
|
|
7
|
+
${n}
|
|
8
|
+
${a}
|
|
9
|
+
`;return s.writeFileSync(i,o+u,"utf8"),!0}c(y,"appendToCLAUDEmd");function A(e,t){let n=g.join(e,"CLAUDE.md");if(!s.existsSync(n))return!1;let i=`<!-- rulemetric:start ${t} -->`,r=`<!-- rulemetric:end ${t} -->`,a=s.readFileSync(n,"utf8"),o=a.indexOf(i);if(o===-1)return!1;let d=a.indexOf(r,o);if(d===-1)return!1;let u=a.slice(0,o),h=a.slice(d+r.length),I=(u.replace(/\n+$/,"")+`
|
|
10
|
+
`+h.replace(/^\n+/,"")).replace(/^\n+/,"");return s.writeFileSync(n,I,"utf8"),!0}c(A,"removeFromCLAUDEmd");function $(e){return m(`/api/instruction-suggestions/${encodeURIComponent(e)}`)}c($,"fetchSuggestion");async function f(e,t,n,i){await l(`/api/instruction-suggestions/${encodeURIComponent(e)}/events`,{eventType:"accepted",projectPath:t,instructionId:n,actor:i})}c(f,"logAccepted");async function b(e){let t=e.suggestion??await $(e.suggestionId);if(t.kind==="remove")return x(e,t);if(t.kind==="trim")return w(e,t);let n=t.instructionId;t.instructionScope==="public"&&(n=(await l(`/api/instructions/${encodeURIComponent(t.instructionId)}/promote-from-public`,{targetScope:"personal"})).instructionId);let i=await m(`/api/instructions/${encodeURIComponent(n)}`),r=y(e.dir,n,i.content);return await f(e.suggestionId,e.projectPath,n,e.actor),{action:r?"added":"already-present",instructionId:n,name:i.name,fileModified:r,messages:r?[`Accepted: added ${i.name} to CLAUDE.md. It will be active starting in your next session.`]:[`Already present: ${i.name} is already in CLAUDE.md (block id: ${n}).`]}}c(b,"acceptSuggestion");async function w(e,t){let n=t.estimatedTokens?` It currently costs roughly ${t.estimatedTokens} tokens per session (estimated).`:"";return await f(e.suggestionId,e.projectPath,t.instructionId,e.actor),{action:"acknowledged",instructionId:t.instructionId,name:t.name,fileModified:!1,messages:[`Noted: ${t.name} is measured neutral, not harmful.${n}`,"Nothing was changed \u2014 trimming is a judgement call about which parts carry the value,","and the measurement only found the absence of a detectable effect, not which half to cut.",` View it: rulemetric instructions get ${t.instructionId}`," Then edit CLAUDE.md (or the instruction) and let the next measurement cycle re-check it.","This suggestion will stop re-surfacing."]}}c(w,"acknowledgeTrim");async function x(e,t){let n=A(e.dir,t.instructionId);await p(`/api/instructions/${encodeURIComponent(t.instructionId)}`);let i=t.estimatedTokens?` Frees roughly ${t.estimatedTokens} tokens of context per session (estimated).`:"",r=n?[`Retired: removed ${t.name} from CLAUDE.md and archived it.${i}`]:[`Archived ${t.name}.${i}`,"CLAUDE.md was not modified \u2014 no rulemetric-managed block for this instruction was found in this directory. If you added it by hand, remove it yourself."];return r.push("Undo with: rulemetric instructions restore "+t.instructionId),await f(e.suggestionId,e.projectPath,t.instructionId,e.actor),{action:n?"retired":"archived-only",instructionId:t.instructionId,name:t.name,fileModified:n,messages:r}}c(x,"acceptRemoval");export{y as a,A as b,$ as c,b as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as k}from"./chunk-L2CFSMBC.js";import{a as f}from"./chunk-KGURGIZ2.js";import{a as $}from"./chunk-JPUH3V67.js";import{d as v}from"./chunk-TZA4HAVF.js";import{f as p}from"./chunk-QAV4HW7D.js";import{a as c}from"./chunk-ZLLER3HP.js";async function x(m,t,s=()=>{}){let{eval_:r,configuration:i,targetContent:g,runNumber:o}=m;s(`[${i}] ${r.name} run#${o} \u2014 executing...`);let a=k({targetType:t.targetType,targetContent:g,targetName:t.targetName}),d={methodology:a.methodology,delivery:a.delivery,isolated:a.isWorktree,...t.candidateContentHash?{candidateContentHash:t.candidateContentHash}:{},...a.leakedFiles.length?{leakedFiles:a.leakedFiles}:{}};a.isWorktree||s(`[${i}] ${r.name} run#${o} \u2014 \u26A0 no git worktree; running without repo context`),a.leakedFiles.length&&s(`[${i}] ${r.name} run#${o} \u2014 \u26A0 CONTAMINATED: ${a.leakedFiles.join(", ")} survived the strip`);try{let n=await v({prompt:r.prompt,targetContent:a.systemPrompt,workDir:a.workDir,timeout:t.timeout,model:t.model});if(n.error){let e=f(n.error);return s(`[${i}] ${r.name} run#${o} \u2014 FAILED (${e.kind}): ${n.error}`),{evalId:r.id,evalTargetId:t.targetId,evalTargetVersion:t.targetVersion,configuration:i,runNumber:o,iteration:t.iteration,status:"failed",outputs:{error:n.error,failureKind:e.kind,failureClass:e.class,...d},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens},grading:{},failure:e}}s(`[${i}] ${r.name} run#${o} \u2014 completed in ${(n.durationMs/1e3).toFixed(1)}s`);let u={};if(!t.skipGrading&&r.expectations.length>0){s(`[${i}] ${r.name} run#${o} \u2014 grading...`);let e=await $({prompt:r.prompt,output:n.output,expectations:r.expectations,model:t.graderModel??t.model,timeout:t.timeout});u=e,s(`[${i}] ${r.name} run#${o} \u2014 grading done: pass_rate=${e.summary.pass_rate==null?"n/a (all assertions errored)":`${(e.summary.pass_rate*100).toFixed(0)}%`}`)}return{evalId:r.id,evalTargetId:t.targetId,evalTargetVersion:t.targetVersion,configuration:i,runNumber:o,iteration:t.iteration,status:"completed",outputs:{transcript:n.output,...d},timing:{duration_ms:n.durationMs,total_tokens:n.totalTokens,total_duration_seconds:n.durationMs/1e3},grading:u}}finally{a.cleanup()}}c(x,"executeAndGradeCase");async function R(m){let{cases:t,targetContent:s,concurrency:r,runNumber:i,opts:g,skipBaseline:o,onLog:a=c(()=>{},"onLog")}=m,d=o?["with_target"]:["with_target","without_target"],n=[];for(let e of t)for(let l of d)n.push({eval_:e,configuration:l,targetContent:l==="with_target"?s:void 0,runNumber:i});let u=[];for(let e=0;e<n.length;e+=Math.max(1,r)){let l=n.slice(e,e+Math.max(1,r)),h=await Promise.all(l.map(b=>x(b,g,a)));u.push(...h)}for(let e of u)try{await p("/api/eval-runs",e)}catch(l){a(` \u26A0 failed to post a run result: ${l instanceof Error?l.message:String(l)}`)}try{await p(`/api/eval-targets/${g.targetId}/label-state`,{})}catch(e){a(` \u26A0 label-state notification skipped: ${e instanceof Error?e.message:String(e)}`)}return{completed:u.filter(e=>e.status==="completed").length,failed:u.filter(e=>e.status==="failed").length,results:u}}c(R,"runBatchAndPost");export{x as a,R as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,f as a}from"./chunk-
|
|
1
|
+
import{b as o,f as a}from"./chunk-QAV4HW7D.js";import{a as n}from"./chunk-ZLLER3HP.js";function c(e){return e==null?e??null:e instanceof Date?e.toISOString():e}n(c,"serializeDate");async function d(e){let r={provider:e.provider,plan:e.plan,limitType:e.limitType,value:e.value,unit:e.unit,comparator:e.comparator,resetsAt:c(e.resetsAt),sourceType:e.sourceType,sourceUrl:e.sourceUrl,sourceEvidence:e.sourceEvidence,confidence:e.confidence,observedAt:c(e.observedAt)};return a("/api/internal/research/observe",r)}n(d,"postObservation");async function f(e){let r=0,i=0,s=[];for(let u of e)try{await d(u),r++}catch(t){i++;let p=t instanceof o?`HTTP ${t.statusCode}: ${t.message}`:String(t);s.length<5&&s.push(p)}return{posted:r,failed:i,errors:s}}n(f,"postObservations");export{d as a,f as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-QAV4HW7D.js";import{a as e}from"./chunk-ZLLER3HP.js";function i(){return process.env.RULEMETRIC_API_URL??a}e(i,"apiUrl");function u(){let n=process.env.RULEMETRIC_API_KEY??process.env.RULEMETRIC_ACCESS_TOKEN;if(!n)throw new Error("not signed in \u2014 run `rulemetric auth login`");return n}e(u,"authToken");async function t(n,o){let r=await fetch(`${i()}${n}`,{...o,headers:{Authorization:`Bearer ${u()}`,"Content-Type":"application/json",...o?.headers??{}},signal:AbortSignal.timeout(1e4)});if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);return await r.json()}e(t,"request");function c({limit:n}){return t(`/api/launch-jobs?limit=${n}`)}e(c,"fetchLaunchJobs");function h(n){return t("/api/launch-jobs",{method:"POST",body:JSON.stringify(n)})}e(h,"createLaunchJob");function l(n){return t(`/api/launch-jobs/${n}/cancel`,{method:"POST"})}e(l,"cancelLaunchJob");function p(){return t("/api/launchers")}e(p,"listLaunchers");export{c as a,h as b,l as c,p as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as E}from"./chunk-3PUOJ6F2.js";import{a as p,e as w}from"./chunk-JZ5Z2BRO.js";import{a as o}from"./chunk-ZLLER3HP.js";import{fileURLToPath as v}from"node:url";import{existsSync as A,readFileSync as b}from"node:fs";import{dirname as L,join as x}from"node:path";function C(){let t=L(v(import.meta.url));for(let e=0;e<8;e++){let s=x(t,"package.json");if(A(s))try{let i=JSON.parse(b(s,"utf8"));if(i.name==="@rulemetric/cli"&&i.version)return i.version}catch{}let n=L(t);if(n===t)break;t=n}return"0.0.0"}o(C,"readCliVersion");var O=C(),I="https://rulemetric.com",l=class extends Error{constructor(s,n){super(n);this.statusCode=s;this.name="ApiError"}static{o(this,"ApiError")}};function S(){let t=p(),e=process.env.RULEMETRIC_API_URL??t.apiUrl;if(!e){if(process.env.RULEMETRIC_STRICT_LOCAL==="1"||t.strictLocal==="1")throw new Error("RULEMETRIC_STRICT_LOCAL is set but no RULEMETRIC_API_URL is configured \u2014 refusing the cloud default. Set RULEMETRIC_API_URL in the environment or ~/.config/rulemetric/env.");e=I}let s=new URL(e);if(s.protocol==="http:"&&s.hostname!=="localhost"&&s.hostname!=="127.0.0.1")throw new Error(`API URL must use HTTPS for non-localhost hosts: ${e}`);return e}o(S,"getBaseUrl");async function a(t,e={}){let n=`${S()}${t}`,i={"Content-Type":"application/json","User-Agent":`rulemetric-cli/${O}`,...e.headers},m=p(),d=process.env.RULEMETRIC_API_KEY||m.apiKey||w()?.accessToken||m.accessToken;d&&(i.Authorization=`Bearer ${d}`);let h=new URL(n),f=h.hostname==="localhost"||h.hostname==="127.0.0.1",P=process.env.HTTPS_PROXY,R=process.env.HTTP_PROXY;f&&(delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY);let u=e.timeoutMs?new AbortController:void 0,g=!1,y=u?setTimeout(()=>{g=!0,u.abort()},e.timeoutMs):void 0,r;try{r=await fetch(n,{method:e.method??"GET",headers:i,body:e.body?JSON.stringify(e.body):void 0,signal:u?.signal})}catch(T){if(g){let U=new URL(n).host,_=Math.round(e.timeoutMs/1e3);throw new l(408,`Request to ${U} timed out after ${_}s. This is usually transient or a local proxy/gateway issue \u2014 retry, and if it persists check HTTPS_PROXY / the RuleMetric gateway (:8787).`)}throw T}finally{y&&clearTimeout(y),f&&(P!==void 0&&(process.env.HTTPS_PROXY=P),R!==void 0&&(process.env.HTTP_PROXY=R))}let c;if(r.headers.get("content-type")?.includes("application/json")?c=await r.json():c=await r.text(),!r.ok){let{message:T}=E(r.status,c);throw new l(r.status,T)}return c}o(a,"api");var j=o(t=>a(t),"apiGet"),F=o((t,e)=>a(t,{method:"POST",body:e}),"apiPost"),B=o((t,e)=>a(t,{method:"PUT",body:e}),"apiPut"),D=o((t,e)=>a(t,{method:"PATCH",body:e}),"apiPatch"),G=o(t=>a(t,{method:"DELETE"}),"apiDelete");export{I as a,l as b,S as c,a as d,j as e,F as f,B as g,D as h,G as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as E}from"./chunk-B3BHB26P.js";import{b,e as y,f as k,h as M}from"./chunk-
|
|
1
|
+
import{f as E}from"./chunk-B3BHB26P.js";import{b,e as y,f as k,h as M}from"./chunk-QAV4HW7D.js";import{a as u}from"./chunk-ZLLER3HP.js";var v=50,I=24e3,P=3,R=3,C=40,N=4e3,x=new Set(["fact","decision","correction","convention"]),L=`You are distilling DURABLE, PROJECT-SPECIFIC knowledge from an AI coding session so a future agent working on the SAME project starts smarter.
|
|
2
2
|
|
|
3
3
|
Extract ONLY facts / decisions / corrections / conventions that will STILL be true and useful in FUTURE sessions \u2014 architecture facts, deliberate design decisions, corrections of a wrong approach, or project conventions.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as g}from"./chunk-MMPZIZYZ.js";import{e as p}from"./chunk-QAV4HW7D.js";import{a as d}from"./chunk-ZLLER3HP.js";import{existsSync as f,statSync as $}from"node:fs";async function A(l,m){let n=d(t=>m?.logger?.info?.(t)??console.log(t),"log"),{projectPath:s}=l,o=`[cron_auto_accept_suggestions] ${s}`;if(!s)return{skipped:"no-project-path"};if(!f(s)||!$(s).isDirectory())return n(`${o}: project directory no longer exists on this machine \u2014 skipping`),{skipped:"project-path-missing"};let e=await p(`/api/instruction-suggestions/auto-acceptable?projectPath=${encodeURIComponent(s)}`);if(!e.consent.allowed)return n(`${o}: ${e.consent.reason??"no consent"} (${e.consent.source})`),{skipped:"no-consent",reason:e.consent.reason};for(let t of e.refused)n(`${o}: refused "${t.name}" \u2014 ${t.reason}`);if(e.eligible.length===0)return n(`${o}: nothing to adopt`+(e.budget?` (${e.budget.used}/${e.budget.max} used in ${e.budget.windowDays}d)`:"")),{skipped:"nothing-eligible",refused:e.refused.length,adopted:0};let i=0,a=0,c=0,u=[];for(let t of e.eligible)try{let r=await g({suggestionId:t.id,dir:s,projectPath:s,actor:"auto"});r.action==="added"?(i+=1,u.push(r.name),n(`${o}: adopted "${r.name}" (score ${t.score.toFixed(2)})`)):(a+=1,n(`${o}: "${r.name}" was already in CLAUDE.md`))}catch(r){c+=1,n(`${o}: failed to adopt "${t.name}" \u2014 ${r instanceof Error?r.message:String(r)}`)}return n(`${o}: ${i} adopted, ${a} already present, ${c} failed, ${e.refused.length} refused. Undo any of them with \`rulemetric suggestions undo <instruction-id>\`.`),{adopted:i,alreadyPresent:a,failed:c,refused:e.refused.length,names:u}}d(A,"cronAutoAcceptSuggestions");export{A as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as g,g as f,h as p,i as m,j as k}from"./chunk-
|
|
1
|
+
import{f as g,g as f,h as p,i as m,j as k}from"./chunk-3PUOJ6F2.js";import{a as o}from"./chunk-ZLLER3HP.js";import{existsSync as d,readFileSync as u,writeFileSync as _,copyFileSync as v,rmSync as S,statSync as P,readdirSync as x,mkdirSync as R}from"node:fs";import{join as i,dirname as $}from"node:path";import{homedir as c}from"node:os";var j=["/plugins/cache/","/plugins/marketplaces/","/node_modules/","/.git/"];function h(e){return j.some(t=>e.includes(t))}o(h,"isUnownedPath");function K(e,t){let n=i(c(),".config","rulemetric","retraction-backups",t),r=e.replace(/^\/+/,"").replace(/\//g,"__");return i(n,r)}o(K,"backupPathFor");function y(e){return e.split(`
|
|
2
2
|
`).slice(0,40).map(t=>`- ${t}`).join(`
|
|
3
3
|
`)}o(y,"shortDiff");function a(e,t,n){return{kind:e,path:t,ok:!1,refusal:n,preview:"",warnings:[]}}o(a,"refuse");function M(e){let[t,...n]=e.split("::"),r=n.join("::");if(!r)return null;switch(t){case"claude_md":return{kind:"claude_md_section",target:r};case"memory":return{kind:"memory_section",target:r};case"skill":return{kind:"skill_file",target:r};default:return null}}o(M,"pathFromContextIdentity");function F(e,t){let n=e.replace(/^skills--/,"");return[...[i(t,".claude","skills",n,"SKILL.md"),i(t,".claude","skills",`${n}.md`),i(c(),".claude","skills",n,"SKILL.md"),i(c(),".claude","skills",`${n}.md`)],...I(n)]}o(F,"candidateSkillPaths");function I(e){let t=i(c(),".claude","plugins","marketplaces");if(!d(t))return[];let n=[];try{for(let r of x(t))n.push(i(t,r,"skills",e,"SKILL.md"),i(t,r,"plugins",e,"SKILL.md"),i(t,r,"skills",`${e}.md`))}catch{}return n}o(I,"pluginSkillPaths");function O(e){switch(e.kind){case"claude_md_section":case"memory_section":case"claude_md_block":return C(e);case"skill_file":return D(e);case"settings_hook":case"mcp_server":return L(e)}}o(O,"planRetraction");function C(e){let t=e.target;if(!d(t))return a(e.kind,t,`File does not exist: ${t}`);if(h(t))return a(e.kind,t,`Refusing to edit a path this tool does not own: ${t}`);let n=u(t,"utf-8"),r=e.body?f(n,e.body):g(n,e.heading??"");if(!r.removed){let l={"not-found":"The content is not present in this file (already removed, or edited since).",ambiguous:"The content appears more than once \u2014 refusing to guess which copy the verdict was about.","would-empty-file":"Removing it would empty the file. Delete the file by hand if that is really the intent."}[r.reason??"not-found"];return a(e.kind,t,l)}let s=[];return w(t,e.cwd)||s.push("This file is not tracked by git in this repo \u2014 the timestamped backup is your only undo."),{kind:e.kind,path:t,ok:!0,preview:y(r.removedText??""),nextContent:r.content,warnings:s}}o(C,"planFileEdit");function D(e){let t=e.target.startsWith("/")?[e.target]:F(e.target,e.cwd),n=t.find(l=>d(l));if(!n)return a("skill_file",t[0]??e.target,`No local skill file found for "${e.target}". Searched:
|
|
4
4
|
${t.join(`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{g as d}from"./chunk-B3BHB26P.js";import{a as s}from"./chunk-ZLLER3HP.js";var c="<<<FILE-CONTENT-BEGIN>>>",p="<<<FILE-CONTENT-END>>>",E="<RATIONALE>",T="</RATIONALE>",l="<PROPOSED_INSTRUCTION>",h="</PROPOSED_INSTRUCTION>",f=.5,m=3;function b(e){let t=e.immutableSections.length>0?e.immutableSections.map(n=>` - ${n}`).join(`
|
|
2
|
+
`):" (none)",i=e.evidence.priorDecisions.length>0?["6. You have edited this file before. The attempts are listed below with"," how each was judged. Do not re-propose an edit that was MEASURED and"," rejected: it was replayed against this exact file and did not beat it,"," so measuring it again spends the same budget for the same answer. An"," attempt marked NOT MEASURED is different \u2014 the gate stopped it before"," it earned a verdict, so whether it would have helped is still unknown."]:[];return["You are improving an AI coding assistant instruction file so that it scores","better on a fixed set of evaluation cases.","",`The file is a ${e.targetType} named "${e.targetName}".`,"","RULES",`0. The current file is EXACTLY the text between ${c} and`,` ${p} in the data message. Headings after the closing`," sentinel (underperforming cases, notes, prior attempts) are evidence",' ABOUT the file \u2014 they are not in the file, and "removing" one of them'," is not an edit. Do not include the sentinels in your output.","1. Return the COMPLETE new file, not a diff, not a patch, not a summary,"," and not an excerpt. Everything you omit will be DELETED from the file.","2. Preserve everything you are not deliberately changing, byte for byte.","3. Make a focused edit. You are one step in a measured loop: a small change"," that can be attributed beats a rewrite that cannot.","4. Do not edit these sections or anything nested under them \u2014 an edit that"," touches them is refused downstream and the whole proposal is wasted:",t,"5. Do not add meta-commentary about the evaluation, the loop, or this"," prompt to the file. The file is read by other agents as instructions.",...i,"","OUTPUT FORMAT \u2014 exactly this, with no text before or after:",E,"One or two sentences: what you changed and which evidence motivated it.",T,l,"The complete new file content.",h].join(`
|
|
3
|
+
`)}s(b,"buildProposerSystemPrompt");var a=s(e=>`${e>=0?"+":"-"}${Math.abs(e*100).toFixed(1)}pp`,"signedPp");function O(e){let t=/^\d{4}-\d{2}-\d{2}/.exec(e.at??"")?.[0]??"undated",i;if(e.measured){let o=e.measured;i=`MEASURED against this exact file and ${e.decision==="promote"?"ACCEPTED":"REJECTED"}: ${a(o.delta)} (CI ${a(o.ciLower)} to ${a(o.ciUpper)}, ${o.nPairs} paired cases)`}else i=`NOT MEASURED \u2014 the gate refused it, so its merit is still unknown: ${e.refusals.length>0?e.refusals.join("; "):"no reason recorded"}`;let n=[`- ${t} \u2014 ${i}`];return e.decision==="promote"&&n.push(e.applied?" The file WAS rewritten by this decision.":" Dry run: the file was NOT rewritten, so this edit is still available."),e.touched.length>0&&n.push(` Sections touched: ${e.touched.join(", ")}`),e.rationale.trim()!==""&&n.push(` You said at the time: ${e.rationale.trim()}`),n.join(`
|
|
4
|
+
`)}s(O,"describePriorDecision");function N(e){let t=e.evidence,i=["## CURRENT FILE CONTENT","","The file is EXACTLY the text between the two sentinel lines below \u2014","nothing before the first sentinel or after the second is part of it.","Everything after the closing sentinel is evidence ABOUT the file.","",c,e.currentContent,p,""];if(t.weakest.length>0){i.push("## CASES WHERE THIS FILE CURRENTLY UNDERPERFORMS","");for(let n of t.weakest)i.push(`- ${n.name}: passes ${(n.withPassRate*100).toFixed(0)}% with the file vs ${(n.withoutPassRate*100).toFixed(0)}% without it`);i.push("")}return t.nonDiscriminating.length>0&&i.push("## CASES THAT CARRY NO SIGNAL EITHER WAY","","These score the same with and without the file. Changing the file to chase","them is unlikely to move anything.","",...t.nonDiscriminating.map(n=>`- ${n}`),""),t.priorDecisions.length>0&&i.push("## WHAT YOU ALREADY PROPOSED FOR THIS FILE, AND HOW IT WAS JUDGED","","Newest first. Every attempt listed here was made against the file above,","byte for byte. Attempts against a different version of the file are not","shown, because a verdict earned by different text says nothing about this","one.","",...t.priorDecisions.map(O),""),t.notes.length>0&&i.push("## NOTES","",...t.notes.map(n=>`- ${n}`),""),i.join(`
|
|
5
|
+
`)}s(N,"buildProposerData");function g(e,t,i){let n=e.lastIndexOf(i);if(n<0)return null;let o=e.lastIndexOf(t,n);return o<0?null:e.slice(o+t.length,n)}s(g,"between");function R(e){let t=e.split(`
|
|
6
|
+
`);for(;t.length>0&&t[0].trim()==="";)t.shift();for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();if(t.length<2)return t.join(`
|
|
7
|
+
`);let i=t[0].trim(),n=t[t.length-1].trim(),o=/^(`{3,}|~{3,})[a-zA-Z0-9_-]*$/.test(i),r=/^(`{3,}|~{3,})$/.test(n);return o&&r?t.slice(1,-1).join(`
|
|
8
|
+
`):t.join(`
|
|
9
|
+
`)}s(R,"stripWrappingFence");function P(e,t){if(!e||e.trim()==="")return{ok:!1,reason:"proposer returned nothing"};let i=g(e,l,h);if(i==null)return{ok:!1,reason:`proposer reply had no ${l}\u2026${h} block`};let n=R(i).split(`
|
|
10
|
+
`).filter(w=>{let u=w.trim();return u!==c&&u!==p}).join(`
|
|
11
|
+
`).trim();if(n==="")return{ok:!1,reason:"proposed content was empty"};if(n===t.trim())return{ok:!1,reason:"proposal is identical to the current version"};let o=n.length/Math.max(1,t.trim().length);if(o<f)return{ok:!1,reason:`proposal retains only ${(o*100).toFixed(0)}% of the predecessor's length (floor ${(f*100).toFixed(0)}%) \u2014 treating it as a truncated or summarised reply rather than an edit`};if(o>m)return{ok:!1,reason:`proposal is ${o.toFixed(1)}x the predecessor's length (ceiling ${m}x) \u2014 treating it as runaway generation`};let r=(g(e,E,T)??"").trim();return{ok:!0,proposal:{candidateContent:n,rationale:r===""?"(proposer supplied no rationale)":r}}}s(P,"parseProposalResponse");async function y(e,t=16e3){let i=await d(b(e),N(e),t);return i==null?{ok:!1,reason:"no LLM backend available, or the proposer call failed"}:P(i,e.currentContent)}s(y,"proposeInstructionEdit");export{c as a,p as b,f as c,m as d,b as e,O as f,N as g,P as h,y as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f}from"./chunk-B3BHB26P.js";import{b as S,e as a,h as y}from"./chunk-
|
|
1
|
+
import{f}from"./chunk-B3BHB26P.js";import{b as S,e as a,h as y}from"./chunk-QAV4HW7D.js";import{a as p}from"./chunk-ZLLER3HP.js";var _=1800*1e3,G=300*1e3,T=10,h=`Given these messages from an AI coding session, write a 1-2 sentence summary of what the user is trying to accomplish. Focus on the goal, not the steps. No preamble.
|
|
2
2
|
|
|
3
3
|
Return strict JSON in the form: {"goalSummary": "..."}`;async function k(n,e={}){let d=e.llm??f,o=e.now??Date.now,w=e.getSession??(async s=>{try{return await a(`/api/sessions/${s}`)}catch(t){if(t instanceof S&&t.statusCode===404)return null;throw t}}),m=e.getEvents??((s,t)=>a(`/api/sessions/${s}/events?limit=${t.limit}&sort=${t.sort}`)),v=e.saveGoal??(async(s,t)=>{await y(`/api/sessions/${s}/enrich`,{analysis:t})}),i=await w(n.sessionId);if(!i)return{skipped:"not_found"};let[P]=await m(n.sessionId,{limit:1,sort:"desc"}),A=new Date(P?.timestamp??i.startedAt).getTime();if(o()-A>_)return{skipped:"stale"};let l=i.analysis??{},c=l.goalSummaryAt?new Date(l.goalSummaryAt).getTime():0;if(c&&o()-c<G)return{skipped:"recent"};let g=(await m(n.sessionId,{limit:T*2,sort:"asc"})).filter(s=>s.content&&(s.eventType==="user_message"||s.eventType==="assistant_response")).map(s=>`${s.eventType==="user_message"?"USER":"ASSISTANT"}: ${s.content}`).join(`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as l}from"./chunk-6QKI756T.js";import{a as p}from"./chunk-5RBLIVBF.js";import{h}from"./chunk-
|
|
1
|
+
import{b as l}from"./chunk-6QKI756T.js";import{a as p}from"./chunk-5RBLIVBF.js";import{h}from"./chunk-QAV4HW7D.js";import{a as c}from"./chunk-ZLLER3HP.js";async function g(t){if(!t.worktree?.create)return t;let{branch:e,baseRef:s}=t.worktree,n=await l({repoRoot:t.projectPath,branch:e,baseRef:s});return{...t,projectPath:n.path,gitBranch:n.branch}}c(g,"resolveWorktreeForLaunch");async function L(t,e){let{mirrorId:s,tool:n}=t,{config:r}=t,a=c(o=>e.logger.info(o),"log");if(e.job.attempts>1)throw new p(`process_launch is not safe to retry (attempt ${e.job.attempts}). Re-launch manually.`);r=await g(r),r.worktree?.create&&a(`Worktree resolved: ${r.projectPath} (branch ${r.gitBranch})`),a(`Launching ${n}...`);let{getLauncher:f}=await import("./dist-FAVALJ5C.js"),i=await f(n).launch(r);a(`Launch completed: sessionId=${i.sessionId}`);let u={...i,worktreePath:r.worktree?.create?r.projectPath:void 0,runId:r.runId};return await h(`/api/launch-jobs/${s}/state`,{result:u}).catch(o=>{a(`result persist failed: ${o instanceof Error?o.message:String(o)}`)}),u}c(L,"processLaunch");export{g as a,L as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as D,c as j}from"./chunk-6UEFCMR2.js";import{b as B,c as R,d as N,e as z}from"./chunk-NTKO4H2K.js";import{a as G}from"./chunk-
|
|
1
|
+
import{b as D,c as j}from"./chunk-6UEFCMR2.js";import{b as B,c as R,d as N,e as z}from"./chunk-NTKO4H2K.js";import{a as G}from"./chunk-JPUH3V67.js";import{c as J}from"./chunk-XRTZU7IZ.js";import{e as f,g as T}from"./chunk-QAV4HW7D.js";import{a as p}from"./chunk-ZLLER3HP.js";function W(r,a,s){return s?r.reviewerModel===s||r.reviewerModel===`${a}:${s}`:r.reviewerEngine===a}p(W,"reviewMatchesReviewer");var C=100;function Z(r){let a=new Set;return r.forEach((s,d)=>{s.method!=="deterministic"&&a.add(d)}),a}p(Z,"llmExpectationIndexes");var w=class extends Error{constructor(s,d){super(d);this.reason=s}static{p(this,"JudgeReviewSkip")}};async function oe(r){let a=r.log??(()=>{}),s=r.warn??a,d=r.targetId,K=r.parallel??3,U=r.timeoutMs??12e4,v=await f(`/api/eval-targets/${d}`),u=(await f(`/api/eval-targets/${d}/annotations?limit=500`)).filter(e=>e.judgeMethod==="llm");if(u.length===0)throw new w("no-labels",`No human labels on "${v.name}" yet \u2014 label some runs in the Review tab first.`);let n;try{n=z({engineFlag:r.engineFlag??"auto",modelFlag:r.modelFlag,availability:N(),judgeModels:[...new Set(u.map(e=>e.judgeModel).filter(e=>e!=null))]})}catch(e){throw new w("no-engine",e instanceof Error?e.message:String(e))}a(`Reviewer: ${n.rationale}`);let c=0,b=u;if(r.skipReviewed){let e=await f(`/api/eval-targets/${d}/judge-reviews`),t=new Set(e.filter(i=>W(i,n.engine,r.modelFlag)).map(i=>`${i.evalRunId}:${i.expectationIndex}`));if(b=u.filter(i=>!t.has(`${i.evalRunId}:${i.expectationIndex}`)),c=u.length-b.length,b.length===0)return{targetName:v.name,reviewer:n,judgeModels:[],reviewerModel:n.model??`${n.engine} (CLI default)`,report:j([],0),persisted:0,alreadyReviewed:c,deferredPartialRuns:0}}let y=new Map;for(let e=0;;e+=C){let t=await f(`/api/eval-targets/${d}/runs?limit=${C}&offset=${e}`);for(let i of t)y.set(i.id,i);if(t.length<C)break}let q=await f(`/api/eval-targets/${d}/evals`),X=new Map(q.map(e=>[e.id,e.prompt])),o=new Map;for(let e of b){let t=o.get(e.evalRunId)??[];t.push(e),o.set(e.evalRunId,t)}let P=new Map;for(let e of u){let t=P.get(e.evalRunId)??new Set;t.add(e.expectationIndex),P.set(e.evalRunId,t)}let x=0;for(let[e]of[...o]){let t=y.get(e)?.grading?.expectations;if(!t)continue;let i=Z(t),g=P.get(e)??new Set;[...i].every(h=>g.has(h))||(o.delete(e),x+=1)}if(x>0&&a(`${x} partially-labeled run(s) deferred \u2014 a run is re-graded once, after all its assertions are labeled.`),o.size===0)return{targetName:v.name,reviewer:n,judgeModels:[],reviewerModel:n.model??`${n.engine} (CLI default)`,report:j([],0),persisted:0,alreadyReviewed:c,deferredPartialRuns:x};if(n.engine==="codex"&&n.model){let e=await J({prompt:"Reply with exactly: OK",model:n.model,timeout:6e4});if(e.error&&B(e.error)){if(n.model===R)throw new w("preflight-failed",`Codex fallback model ${R} is also unrunnable: ${e.error}`);s(`Your codex model "${n.model}" can't run on the installed CLI/account \u2014 falling back to ${R}.`),n={...n,model:R}}else if(e.error)throw new w("preflight-failed",`Codex preflight failed: ${e.error}`)}let S=[...o.values()].flat(),Y=[...new Set(S.map(e=>e.judgeModel).filter(e=>e!=null))];a(`Re-grading ${o.size} annotated run(s) / ${S.length} assertion(s) on "${v.name}"`+(c?` (${c} already reviewed \u2014 skipped)`:"")+".");let $=[],I=0,k=new Set,m=r.limit!=null?[...o.entries()].slice(0,Math.max(1,r.limit)):[...o.entries()];m.length<o.size&&a(`Sampling ${m.length} of ${o.size} annotated runs (limit).`);let H=0,Q=p(async()=>{for(;;){let e=H++;if(e>=m.length)return;let[t,i]=m[e],g=y.get(t),h=g?.grading?.expectations,O=g?.outputs?.transcript,F=g?X.get(g.evalId):void 0;if(!g||!h?.length||!O||!F){I+=i.length,s(`run ${t.slice(0,8)}: missing output/expectations/prompt \u2014 skipped`);continue}let M=await G({prompt:F,output:O,expectations:h.map(l=>l.text),model:n.model??void 0,timeout:U,engine:n.engine});M.judge_model&&k.add(M.judge_model);for(let l of i){let L=h[l.expectationIndex],A=M.expectations[l.expectationIndex];if(!L||!A||L.text!==l.expectationText){I+=1;continue}if(M.judge_model==null&&A.method==="llm"){I+=1;continue}$.push({runId:t,expectationIndex:l.expectationIndex,text:l.expectationText,humanPassed:D(l.verdict,l.judgePassed),judgeAPassed:l.judgePassed,judgeBPassed:A.passed})}a(` ${e+1}/${m.length} re-graded`)}},"workerFn");await Promise.all(Array.from({length:Math.max(1,Math.min(K,m.length))},Q));let V=j($,I),_=[...k][0]??n.model??`${n.engine} (CLI default)`,E=0;if($.length>0)try{E=(await T(`/api/eval-targets/${d}/judge-reviews`,{reviewerEngine:n.engine,reviewerModel:_,verdicts:$.map(t=>({evalRunId:t.runId,expectationIndex:t.expectationIndex,expectationText:t.text,judgePassed:t.judgeAPassed,humanPassed:t.humanPassed,reviewerPassed:t.judgeBPassed}))})).upserted,a(`Persisted ${E} reviewer verdict(s) \u2014 disagreements appear on the Review tab.`)}catch(e){s(`Could not persist reviewer verdicts: ${e instanceof Error?e.message:e}`)}return{targetName:v.name,reviewer:n,judgeModels:Y,reviewerModel:_,report:V,persisted:E,alreadyReviewed:c,deferredPartialRuns:x}}p(oe,"runJudgeReviewPass");export{W as a,Z as b,w as c,oe as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-ZLLER3HP.js";import{spawn as y}from"node:child_process";function O(o){try{let t=JSON.parse(o),s=t.result??t.content??o,u=t.usage?.total_tokens??(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0),r;if(t.modelUsage&&typeof t.modelUsage=="object"){let n=-1;for(let[i,m]of Object.entries(t.modelUsage)){let a=typeof m?.outputTokens=="number"?m.outputTokens:0;a>n&&(n=a,r=i)}}return{output:s,totalTokens:u,model:r}}catch{return{output:o,totalTokens:0}}}c(O,"parseClaudeJsonOutput");function D(o){let{prompt:t,targetContent:s,systemPrompt:u,model:r}=o,n=["-p",t,"--output-format","json","--settings",JSON.stringify({disableAllHooks:!0})],i=s??u;return i&&n.push("--system-prompt",i),r&&n.push("--model",r),n}c(D,"buildClaudeArgs");function v(o,t,s,u){let r=t.trim()||s.trim()||u.trim()||"(no output on stderr or stdout)";return`Exit code ${o}: ${r.slice(0,1e3)}`}c(v,"describeExitFailure");async function h(o){let{prompt:t,targetContent:s,systemPrompt:u,workDir:r=process.cwd(),timeout:n=12e4,model:i}=o,m=D({prompt:t,targetContent:s,systemPrompt:u,model:i}),a=Date.now();return new Promise(g=>{let l={...process.env};delete l.CLAUDECODE,delete l.HTTPS_PROXY;let b=["/opt/homebrew/bin","/usr/local/bin"],f=(l.PATH??"").split(":").filter(Boolean),T=b.filter(e=>!f.includes(e));T.length&&(l.PATH=[...f,...T].join(":"));let p=y("claude",m,{cwd:r,env:l,stdio:["ignore","pipe","pipe"]}),d="",x="";p.stdout.on("data",e=>{d+=e.toString()}),p.stderr.on("data",e=>{x+=e.toString()});let k=setTimeout(()=>{p.kill("SIGTERM"),g({output:d,exitCode:null,durationMs:Date.now()-a,totalTokens:0,error:`Timed out after ${n}ms`})},n);p.on("close",e=>{clearTimeout(k);let P=Date.now()-a,{output:E,totalTokens:C,model:w}=O(d);g({output:E,exitCode:e,durationMs:P,totalTokens:C,model:w,error:e!==0?v(e,x,E,d):void 0})}),p.on("error",e=>{clearTimeout(k),g({output:"",exitCode:null,durationMs:Date.now()-a,totalTokens:0,error:`Failed to spawn claude: ${e.message}`})})})}c(h,"executeEval");export{O as a,D as b,v as c,h as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,d as m}from"./chunk-
|
|
1
|
+
import{a as d,d as m}from"./chunk-QAV4HW7D.js";import{a as c,l as a}from"./chunk-JZ5Z2BRO.js";import{a as o}from"./chunk-ZLLER3HP.js";import{createHash as g,randomUUID as v}from"node:crypto";import{hostname as y,platform as p}from"node:os";import{existsSync as P,mkdirSync as _,readFileSync as h,writeFileSync as R}from"node:fs";import{join as E}from"node:path";var O="device-id";function u(){let e=o(t=>t==="1"||t==="true","off");return e(process.env.RULEMETRIC_NO_TELEMETRY)||e(process.env.DO_NOT_TRACK)}o(u,"telemetryDisabled");function l(){let e=a(),t=E(e,O);try{if(P(t)){let r=h(t,"utf-8").trim();if(r)return r}}catch{}let n=g("sha256").update(`${v()}:${y()}`).digest("hex").slice(0,32);try{_(e,{recursive:!0}),R(t,n,{mode:384})}catch{}return n}o(l,"getDeviceId");async function U(e,t={},n){if(!u())try{await m("/api/telemetry/cli-events",{method:"POST",body:{event:e,deviceId:l(),cliVersion:n,os:p(),props:t},timeoutMs:5e3})}catch{}}o(U,"emitSetupEvent");async function w(e){if(u())return;let n=`${process.env.RULEMETRIC_API_URL??c().apiUrl??d}/api/telemetry/cli-error`,r=process.env.HTTPS_PROXY,s=process.env.HTTP_PROXY,T=r!==void 0||s!==void 0;delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY;let i=new AbortController,f=setTimeout(()=>i.abort(),4e3);try{await globalThis.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`rulemetric-cli/${e.cliVersion??"unknown"}`},body:JSON.stringify({event:e.event??"onboarding_error",deviceId:l(),command:e.command,statusCode:e.statusCode,message:e.message?e.message.slice(0,500):void 0,cliVersion:e.cliVersion,os:p(),nodeVersion:process.version,proxied:T,props:e.props}),signal:i.signal})}catch{}finally{clearTimeout(f),r!==void 0&&(process.env.HTTPS_PROXY=r),s!==void 0&&(process.env.HTTP_PROXY=s)}}o(w,"emitErrorBeacon");export{u as a,l as b,U as c,w as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as n,c as a,d as g}from"./chunk-3AV3GTMP.js";import{e as o}from"./chunk-
|
|
1
|
+
import{a as s,b as n,c as a,d as g}from"./chunk-3AV3GTMP.js";import{e as o}from"./chunk-QAV4HW7D.js";import{a as e}from"./chunk-ZLLER3HP.js";var i=!1;async function c(){if(process.env.RULEMETRIC_ORG_ID)return;let r=s();if(!(r&&!g(r)))try{let t=await o("/api/profile");if(!t.activeOrgId){a();return}if(r&&t.activeOrgId===r.orgId){n({orgId:r.orgId,orgSlug:r.orgSlug,syncedAt:Date.now()});return}let d=(await o("/api/orgs")).find(l=>l.id===t.activeOrgId);n({orgId:t.activeOrgId,orgSlug:d?.slug,syncedAt:Date.now()})}catch{}}e(c,"syncActiveOrgFromServer");async function p(){i||(i=!0,await c())}e(p,"maybeRefreshActiveOrg");async function v(){i=!0,await c()}e(v,"bootstrapActiveOrg");function O(){i=!1}e(O,"_resetRefreshAttempt");export{p as a,v as b,O as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,b as
|
|
1
|
+
import{a as h,b as D}from"./chunk-FP6QAPNK.js";import{d as _,e as C}from"./chunk-3PUOJ6F2.js";import{a as o}from"./chunk-ZLLER3HP.js";import*as m from"node:fs/promises";import*as x from"node:path";import{eq as z}from"drizzle-orm";import{randomBytes as H}from"node:crypto";var A="#0d9488",g="#1a1a1a",y="#666666",M="#f5f5f7",k="#ffffff",I="#e5e5e9",O=["Added","Changed","Fixed","Removed","Deprecated","Security"];function U(e){let t=["January","February","March","April","May","June","July","August","September","October","November","December"],[n,r,a]=e.split("-").map(p=>parseInt(p,10));return!n||!r||!a||r<1||r>12?e:`${t[r-1]} ${a}, ${n}`}o(U,"formatIsoDate");function l(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}o(l,"escapeHtml");function P(e){let t=[];for(let n of O){let r=e[n];r&&r.length>0&&t.push({name:n,items:r})}return t}o(P,"orderedSections");function v(e){let{version:t,date:n,sections:r,unsubscribeUrl:a,productUrl:p,recipientName:u}=e,c=U(n),s=`What's new in RuleMetric \u2014 ${c}`,b=u?`Hi ${u},`:"Hi there,",i=P(r),d=new Date().getUTCFullYear(),E=i.map(({name:$,items:R})=>{let w=R.map(S=>` <li style="margin:0 0 6px 0;font-size:15px;line-height:1.5;color:${g};">${l(S)}</li>`).join(`
|
|
2
2
|
`);return` <h3 style="margin:24px 0 8px 0;font-size:16px;line-height:1.3;font-weight:600;color:${g};">${$}</h3>
|
|
3
3
|
<ul style="margin:0 0 8px 0;padding-left:20px;">
|
|
4
4
|
${w}
|
|
@@ -63,4 +63,4 @@ ${E}
|
|
|
63
63
|
</table>
|
|
64
64
|
</body>
|
|
65
65
|
</html>`,f=[`What's new in RuleMetric \u2014 ${c}`,`Release ${t}`,"",b,"","Here's what shipped in the latest RuleMetric release.",""];for(let{name:$,items:R}of i){f.push(`${$}:`);for(let w of R)f.push(` - ${w}`);f.push("")}f.push("--","You're receiving this because you signed up for RuleMetric product updates.",`Unsubscribe: ${a}`,"",`RuleMetric \u2022 ${d}`);let N=f.join(`
|
|
66
|
-
`);return{subject:s,html:T,text:N}}o(v,"renderChangelogAnnouncement");async function L(e){let t=e;for(let n=0;n<50;n++){try{return await m.stat(x.join(t,"pnpm-workspace.yaml")),t}catch{}let r=x.dirname(t);if(r===t)return null;t=r}return null}o(L,"findRepoRoot");async function j(e){if(e)try{return await m.readFile(e,"utf-8")}catch{return null}let t=await L(process.cwd())??process.cwd(),n=x.join(t,"CHANGELOG.md");try{return await m.readFile(n,"utf-8")}catch{return null}}o(j,"readChangelog");var B="https://rulemetric.com";function F(e){let t=e.date??new Date().toISOString().slice(0,10),n=v({version:e.version,date:t,sections:e.sections,unsubscribeUrl:"{{unsubscribe_url}}",recipientName:"{{recipient_name}}",productUrl:B});return{version:e.version,releaseDate:t,subject:n.subject,htmlBody:n.html,textBody:n.text,sections:e.sections}}o(F,"renderRow");async function me(e={}){let t=e.db??
|
|
66
|
+
`);return{subject:s,html:T,text:N}}o(v,"renderChangelogAnnouncement");async function L(e){let t=e;for(let n=0;n<50;n++){try{return await m.stat(x.join(t,"pnpm-workspace.yaml")),t}catch{}let r=x.dirname(t);if(r===t)return null;t=r}return null}o(L,"findRepoRoot");async function j(e){if(e)try{return await m.readFile(e,"utf-8")}catch{return null}let t=await L(process.cwd())??process.cwd(),n=x.join(t,"CHANGELOG.md");try{return await m.readFile(n,"utf-8")}catch{return null}}o(j,"readChangelog");var B="https://rulemetric.com";function F(e){let t=e.date??new Date().toISOString().slice(0,10),n=v({version:e.version,date:t,sections:e.sections,unsubscribeUrl:"{{unsubscribe_url}}",recipientName:"{{recipient_name}}",productUrl:B});return{version:e.version,releaseDate:t,subject:n.subject,htmlBody:n.html,textBody:n.text,sections:e.sections}}o(F,"renderRow");async function me(e={}){let t=e.db??D(),n=e.logger??{info:o(s=>console.log(s),"info"),warn:o(s=>console.warn(s),"warn")},r=await j(e.changelogPath);if(r===null)return n.info("[cron_check_changelog] CHANGELOG.md not found; nothing to do"),{createdCount:0,skippedCount:0};let a=_(r),p=C(a);if(p.length===0)return n.info("[cron_check_changelog] No announceable entries; nothing to do"),{createdCount:0,skippedCount:0};let u=0,c=0;for(let s of p){if((await t.select({id:h.id}).from(h).where(z(h.version,s.version)).limit(1)).length>0){c++;continue}let i=F(s);try{await t.insert(h).values({version:i.version,releaseDate:i.releaseDate,subject:i.subject,htmlBody:i.htmlBody,textBody:i.textBody,sections:i.sections,status:"draft"}),u++,n.info(`[cron_check_changelog] Created draft announcement for ${i.version}`)}catch(d){let E=d instanceof Error?d.message:String(d);if(/duplicate key|unique/i.test(E)){c++;continue}throw d}}return n.info(`[cron_check_changelog] Done: created ${u}, skipped ${c}`),{createdCount:u,skippedCount:c}}o(me,"processChangelog");export{me as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-E2NVNLFD.js";import{h as s}from"./chunk-QAV4HW7D.js";import{a as n}from"./chunk-ZLLER3HP.js";async function l(a,c){let{mirrorId:g,evalTargetId:p,config:r}=a,e=n(o=>c.logger.info(o),"log");await i(r,p,e);let t={type:"conversation",conversationId:r.conversationId};return await s(`/api/eval-jobs/${g}/state`,{result:t}).catch(o=>{e(`result persist failed: ${o instanceof Error?o.message:String(o)}`)}),t}n(l,"processConversation");export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i,e as n,g,h as m}from"./chunk-NJ5UED3H.js";import{
|
|
1
|
+
import{b as f}from"./chunk-ZXF5NE54.js";import{d as i,e as n,g,h as m}from"./chunk-NJ5UED3H.js";import{a as s}from"./chunk-ZLLER3HP.js";import{Box as u,Text as t}from"ink";import{jsx as l,jsxs as e}from"react/jsx-runtime";var y={pending:{glyph:"\u25CC",color:n},queued:{glyph:"\u25CC",color:n},running:{glyph:"\u25CF",color:i},completed:{glyph:"\u2713",color:g},failed:{glyph:"\u2717",color:m},cancelled:{glyph:"\u2298",color:n}};function b(c){let p=Date.now()-new Date(c).getTime(),r=Math.floor(p/6e4);if(r<1)return"now";if(r<60)return`${r}m`;let o=Math.floor(r/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}s(b,"ago");function w({jobs:c,selectedIndex:p,focused:r}){return c.length===0?e(u,{flexDirection:"column",paddingX:1,children:[l(t,{bold:!0,color:i,children:"\u25BC Active jobs"}),l(t,{dimColor:!0,children:" (no jobs yet \u2014 press tab to focus the form below)"})]}):e(u,{flexDirection:"column",paddingX:1,children:[e(t,{bold:!0,color:i,children:["\u25BC Active jobs (last ",c.length,")"]}),c.map((o,h)=>{let d=r&&h===p,a=y[o.status]??{glyph:"?",color:n},x=o.config?.projectPath??"",T=(o.config?.prompt??"").slice(0,30);return e(t,{wrap:"truncate-end",children:[l(t,{color:d?i:n,children:d?"\u25B6 ":" "}),e(t,{color:a.color,children:[a.glyph," "]}),l(t,{dimColor:!0,children:o.status.padEnd(10)}),l(t,{children:f(o.tool).padEnd(14)}),l(t,{dimColor:!0,children:x.padEnd(28)}),e(t,{children:['"',T,'"']}),e(t,{dimColor:!0,children:[" ",b(o.createdAt)]})]},o.id)})]})}s(w,"ActiveJobsList");export{w as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as f}from"./chunk-6QKI756T.js";import{a as l}from"./chunk-5RBLIVBF.js";import{b as g,e as k}from"./chunk-
|
|
1
|
+
import{c as f}from"./chunk-6QKI756T.js";import{a as l}from"./chunk-5RBLIVBF.js";import{b as g,e as k}from"./chunk-QAV4HW7D.js";import{a as m}from"./chunk-ZLLER3HP.js";async function C(w,i={}){let R=i.removeWorktreeFn??f,t=i.log??(e=>process.stderr.write(`[process_run_cleanup] ${e}
|
|
2
2
|
`)),j=i.getRunDetail??(async e=>{try{return await k(`/api/runs/${e}`)}catch(r){if(r instanceof g&&r.statusCode===404)return null;throw r}}),{runId:o}=w,n=await j(o);if(!n)throw new l(`Run ${o} not found`);if(!n.run.projectPath)throw new l(`Run ${o} has no projectPath; cannot resolve a repo root for worktree cleanup`);let a=n.run.projectPath,$=n.sessions.filter(e=>e.endedAt!=null),s=[],u=0,c=0,p=0,d=0,h=new Set;for(let e of $)if(!(!e.projectPath||e.projectPath===a)&&!h.has(e.projectPath)){h.add(e.projectPath);try{let r=await R({repoRoot:a,worktreePath:e.projectPath});r.removed?(u++,s.push({sessionId:e.id,worktreePath:e.projectPath,status:"removed"}),t(`removed worktree ${e.projectPath} (session ${e.id})`)):r.reason==="dirty"?(c++,s.push({sessionId:e.id,worktreePath:e.projectPath,status:"skipped-dirty"}),t(`skipped dirty worktree ${e.projectPath} (session ${e.id}) \u2014 uncommitted changes`)):(p++,s.push({sessionId:e.id,worktreePath:e.projectPath,status:"absent"}),t(`worktree absent ${e.projectPath} (session ${e.id})`))}catch(r){let P=r instanceof Error?r.message:String(r);d++,s.push({sessionId:e.id,worktreePath:e.projectPath,status:"error",error:P.slice(0,1e3)}),t(`error removing worktree ${e.projectPath} (session ${e.id}): ${P}`)}}return t(`run ${o} cleanup: removed=${u} skippedDirty=${c} absent=${p} errored=${d}`),{runId:o,repoRoot:a,removed:u,skippedDirty:c,absent:p,errored:d,worktrees:s}}m(C,"processRunCleanup");export{C as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./chunk-CJRYYV76.js";import{b as u}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-CJRYYV76.js";import{b as u}from"./chunk-MO57LGGK.js";import{e as o}from"./chunk-QAV4HW7D.js";import{a as c}from"./chunk-ZLLER3HP.js";async function w(e,g){let i=c(a=>g?.logger?.info?.(a)??console.log(a),"log"),{evalTargetId:n}=e,s=await o(`/api/eval-targets/${n}/judge-calibration`),t=d({powered:s.powerCheck.powered,mde:s.powerCheck.mde??Number.POSITIVE_INFINITY},s.caseDiscrimination??{total:0,discriminating:0,nonDiscriminating:0,unpaired:0},{runsCompleted:0,maxRuns:e.maxRuns??24,batchesRun:0,maxBatches:1});if(t.action==="stop")return i(`[cron_eval_autorun] ${n}: ${t.reason}`),{skipped:t.code,reason:t.reason};let r=await o(`/api/eval-targets/${n}`),l=(await o(`/api/eval-targets/${n}/evals`)).filter(a=>!a.retiredAt);if(l.length===0)return{skipped:"no-live-cases"};let{completed:m,failed:p}=await u({cases:l,targetContent:r.content,concurrency:2,runNumber:1,opts:{targetId:n,targetVersion:r.version??1,iteration:1,timeout:e.timeout??24e4,model:e.model,graderModel:e.graderModel,skipGrading:!1,targetType:r.type,targetName:r.name},onLog:i});return i(`[cron_eval_autorun] ${r.name}: ${m} completed, ${p} failed`),{ranRuns:m,reason:t.reason}}c(w,"cronEvalAutorun");export{w as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as u}from"./chunk-TZA4HAVF.js";import{a as o}from"./chunk-ZLLER3HP.js";var l=`You are a meta-judge evaluating the quality of an eval run \u2014 not the code output, but whether the test cases and grading themselves are rigorous and meaningful.
|
|
2
2
|
|
|
3
3
|
You will receive a summary of eval cases, their expectations, and grading results.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as E,d as R}from"./chunk-
|
|
1
|
+
import{b as E,d as R}from"./chunk-QAV4HW7D.js";import{a as o}from"./chunk-ZLLER3HP.js";import{createHash as C}from"node:crypto";import{existsSync as A,mkdirSync as I,readFileSync as p,renameSync as L,rmdirSync as M,writeFileSync as m}from"node:fs";import{homedir as U,tmpdir as x}from"node:os";import{join as c}from"node:path";var $=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function v(t){return $.test(t)?t:`antigravity-${C("sha256").update(t).digest("hex").slice(0,16)}`}o(v,"hookSessionKey");var _=100,F=new Set(["RUN_COMMAND","VIEW_FILE","LIST_DIRECTORY","CODE_ACTION","GREP_SEARCH","SEARCH_WEB"]),H=new Set(["CONVERSATION_HISTORY","KNOWLEDGE_ARTIFACTS","CHECKPOINT"]);function T(){return process.env.RULEMETRIC_CONFIG_DIR??c(U(),".config","rulemetric")}o(T,"configDir");function O(){return c(T(),"antigravity-state")}o(O,"stateDir");function P(t){return c(O(),`${t}.json`)}o(P,"stateFile");function k(){let t=c(T(),"env");if(A(t))try{let n=p(t,"utf-8");for(let r of n.split(/\r?\n/)){let e=r.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);if(!e)continue;let i=e[1];if(process.env[i]!==void 0)continue;let s=e[2];(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1)),process.env[i]=s}}catch{}}o(k,"loadEnvFile");function b(t){try{let n=p(P(t),"utf-8"),r=JSON.parse(n);if(r&&typeof r=="object"&&"lastStepIdx"in r){let e=r.lastStepIdx;if(typeof e=="number"&&Number.isFinite(e))return{lastStepIdx:e}}}catch{}return null}o(b,"loadState");function g(t,n){I(O(),{recursive:!0});let r=P(t),e=`${r}.tmp`;m(e,JSON.stringify(n),{mode:384});try{L(e,r)}catch{m(r,JSON.stringify(n),{mode:384})}}o(g,"saveState");function N(t){let n=process.env.TMPDIR??x(),r=c(n,"rulemetric"),e=c(r,v(t));try{return p(e,"utf-8").trim()||null}catch{return null}}o(N,"resolveRwSessionId");function W(t){let n=process.env.TMPDIR??x(),r=c(n,"rulemetric"),e=v(t),i=c(r,`${e}.seq`),s=c(r,`${e}.seqlock`),l=Date.now()+5e3;for(;Date.now()<l;)try{I(s);break}catch{}let a=1;try{a=parseInt(p(i,"utf-8").trim(),10)+1,(!Number.isFinite(a)||a<1)&&(a=1)}catch{a=1}try{m(i,String(a))}catch{}try{M(s)}catch{}return a}o(W,"nextSequence");function Y(t,n){let r;try{r=p(t,"utf-8")}catch{return[]}let e=[];for(let i of r.split(/\r?\n/))if(i.trim())try{let s=JSON.parse(i);typeof s.step_index=="number"&&s.step_index>n&&e.push(s)}catch{}return e.sort((i,s)=>i.step_index-s.step_index),e}o(Y,"readNewRecords");function G(t){let n;try{n=p(t,"utf-8")}catch{return-1}let r=-1;for(let e of n.split(/\r?\n/))if(e.trim())try{let i=JSON.parse(e);typeof i.step_index=="number"&&i.step_index>r&&(r=i.step_index)}catch{}return r}o(G,"findMaxStepIndex");function J(t){let n=t.match(/<USER_REQUEST>\s*([\s\S]*?)\s*<\/USER_REQUEST>/);return n?n[1].trim():t.trim()}o(J,"extractUserPrompt");function j(t,n){let r=t.created_at??new Date().toISOString(),e={antigravityStepIndex:t.step_index,antigravitySource:t.source,antigravityType:t.type};if(H.has(t.type)||F.has(t.type))return null;if(t.source==="USER_EXPLICIT"&&t.type==="USER_INPUT")return{sequence:n,eventType:"user_message",content:J(t.content??""),timestamp:r,metadata:e};if(t.source==="MODEL"&&t.type==="PLANNER_RESPONSE"){let i=[];return t.thinking&&t.thinking.trim()&&i.push(`[thinking]
|
|
2
2
|
${t.thinking.trim()}`),t.content&&t.content.trim()&&i.push(t.content.trim()),t.tool_calls&&t.tool_calls.length>0&&(e.antigravityToolCalls=t.tool_calls.map(s=>s.name).filter(Boolean)),{sequence:n,eventType:"assistant_response",content:i.join(`
|
|
3
3
|
|
|
4
4
|
`)||null,timestamp:r,metadata:e}}return t.source==="MODEL"&&t.type==="GENERIC"?{sequence:n,eventType:"tool_result",content:t.content??null,timestamp:r,metadata:e}:t.source==="SYSTEM"&&(t.type==="SYSTEM_MESSAGE"||t.type==="ERROR_MESSAGE")?null:{sequence:n,eventType:`antigravity_${t.type.toLowerCase()}`,content:t.content??null,timestamp:r,metadata:e}}o(j,"classifyRecord");function q(t){try{let n=JSON.parse(t);return n&&typeof n=="object"?n:null}catch{return null}}o(q,"parseHookPayload");async function K(t,n,r,e,i={}){let s=i.errorSink??(u=>process.stderr.write(u)),l=0,a=0,d=0,S=0,f=e;for(let u of t){l++,i.onProgress?.({attempted:l,total:t.length,record:u});let w=W(r),y=j(u,w);if(!y)S++;else try{await R(`/api/sessions/${n}/events`,{method:"POST",body:y}),a++}catch(h){d++;let D=h instanceof E?h.statusCode:"unknown";s(`[antigravity-tailer] failed step=${u.step_index} type=${u.type} status=${D}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as v,b as u,e as y,g as d}from"../../chunk-
|
|
1
|
+
import{a as v,b as u,e as y,g as d}from"../../chunk-YFQ4FOAS.js";import{a as h}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a as p}from"../../chunk-ZLLER3HP.js";import{Args as k,Flags as o}from"@oclif/core";import{existsSync as T}from"node:fs";import{homedir as P}from"node:os";import{join as I}from"node:path";var A=I(P(),".gemini","antigravity-ide","brain"),g=class x extends h{static{p(this,"AntigravityBackfill")}static description="Backfill historical events from an Antigravity conversation transcript into a RuleMetric session. Useful for seeding a conversation that existed before hooks were installed \u2014 the live hook intentionally only captures forward.";static examples=["<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --session 158db9aa-68ee-43fc-961b-f3a180578694","<%= config.bin %> antigravity backfill 26fd215d-f43b-4ea5-b177-dc2c0e696f97 --dry-run"];static args={conversationId:k.string({description:"Antigravity conversationId (UUID) \u2014 the directory name under ~/.gemini/antigravity-ide/brain/",required:!0})};static flags={session:o.string({char:"s",description:"RuleMetric session UUID to POST events into. If omitted, resolved from the hook tmp file ($TMPDIR/rulemetric/<conversationId>) \u2014 fails if neither is present."}),transcript:o.string({description:"Path to the transcript.jsonl file. Defaults to ~/.gemini/antigravity-ide/brain/<conversationId>/.system_generated/logs/transcript.jsonl"}),"after-step":o.integer({description:"Only emit records with step_index > this value. Default: read from existing state file, else -1 (everything)."}),limit:o.integer({description:"Cap on the number of records to process this run."}),"dry-run":o.boolean({default:!1,description:"Classify records without POSTing. Reports counts only."}),"save-state":o.boolean({default:!0,allowNo:!0,description:"After backfill, persist the highest step_index so the live hook resumes from there."})};async run(){let{args:b,flags:e}=await this.parse(x),t=b.conversationId;d.loadEnvFile(),process.env.RULEMETRIC_API_URL||this.error("RULEMETRIC_API_URL is not set. Configure it via env or ~/.config/rulemetric/env.");let l=e.transcript??I(A,t,".system_generated","logs","transcript.jsonl");T(l)||this.error(`Transcript not found: ${l}`);let m=e.session??d.resolveRwSessionId(t);m||this.error(`No RuleMetric session resolved. Pass --session <uuid>, or run the Antigravity hook at least once so $TMPDIR/rulemetric/${t} is populated.`);let n=e["after-step"];n===void 0&&(n=d.load(t)?.lastStepIdx??-1);let i=v(l,n);e.limit!==void 0&&i.length>e.limit&&(i=i.slice(0,e.limit));let R=u(l);if(this.log(`Conversation ${t}: transcript max step = ${R}, after-step = ${n}, records to process = ${i.length}`),i.length===0){this.log("Nothing to backfill.");return}if(e["dry-run"]){let r=0,a=0,c={};for(let S of i){let f=(await import("../../lib/antigravity-transcript.js")).classifyRecord(S,0);f?(r++,c[f.eventType]=(c[f.eventType]??0)+1):a++}this.log(`Dry run: would emit ${r}, skip ${a}. By eventType: ${JSON.stringify(c)}`);return}let w=Date.now(),s=await y(i,m,t,n,{onProgress:p(({attempted:r,total:a})=>{(r%100===0||r===a)&&process.stderr.write(` \u2026${r}/${a}
|
|
2
2
|
`)},"onProgress")}),$=((Date.now()-w)/1e3).toFixed(1);this.log(`Backfill complete in ${$}s. attempted=${s.attempted} emitted=${s.emitted} skipped=${s.skipped} failed=${s.failed} highestStepIdx=${s.highestStepIdx}`),e["save-state"]?(d.save(t,{lastStepIdx:s.highestStepIdx}),this.log(`State saved \u2192 live hook will resume from step_index > ${s.highestStepIdx}.`)):this.log("State NOT saved (--no-save-state). Live hook will re-emit any new records from after-step.")}};export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"../../chunk-
|
|
1
|
+
import{a as n}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{f as r}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{i as o,l as s}from"../../chunk-JZ5Z2BRO.js";import{a}from"../../chunk-ZLLER3HP.js";import*as c from"node:path";import{Flags as l}from"@oclif/core";var t=class g extends n{static{a(this,"AuthCreateKey")}static description="Create a long-lived API key for CLI and proxy authentication";static examples=['<%= config.bin %> auth create-key --name "laptop"','<%= config.bin %> auth create-key --name "ci token" --no-save'];static flags={name:l.string({char:"n",description:"Name for this key",required:!0}),save:l.boolean({char:"s",description:"Save key to ~/.config/rulemetric/env for hooks/proxy",default:!0,allowNo:!0})};async run(){let{flags:i}=await this.parse(g),e=await r("/api/auth/api-keys",{name:i.name});this.log(""),this.log("API key created successfully:"),this.log(""),this.log(` Name: ${e.name}`),this.log(` Key: ${e.key}`),this.log(` Prefix: ${e.keyPrefix}`),this.log(""),this.warn("Save this key now \u2014 it will not be shown again."),i.save&&(o(e.key,process.env.RULEMETRIC_API_URL),this.log(""),this.log(`Key saved to ${c.join(s(),"env")} (RULEMETRIC_API_KEY)`),this.log("Hooks and proxy will use this key automatically."))}};export{t as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"../../chunk-
|
|
1
|
+
import{a as f}from"../../chunk-BPP7AEFW.js";import{a as w}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import{c}from"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import{b as n}from"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{b as r,d as a}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{b as m,d,h as u,i as g}from"../../chunk-JZ5Z2BRO.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{Flags as p}from"@oclif/core";var h=class y extends w{static{l(this,"AuthLogin")}static description="Log in to RuleMetric";static examples=["<%= config.bin %> auth login","<%= config.bin %> auth login -e user@example.com"];static flags={email:p.string({char:"e",description:"Email address"}),password:p.string({char:"p",description:"Password (for non-interactive use)"}),"api-key":p.string({description:"Authenticate with an API key from https://rulemetric.com/connect (required for Google/GitHub sign-ins, which have no password)",exclusive:["password"]})};async run(){let{flags:s}=await this.parse(y);if(s["api-key"]){await this.loginWithApiKey(s["api-key"]);return}let e=s.email,t=s.password;if(!e||!t){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p, or set RULEMETRIC_API_KEY (create a key at https://rulemetric.com/connect).");let{input:o,password:k}=await import("@inquirer/prompts");this.log("Signed up with Google or GitHub? You have no password \u2014 press Ctrl-C and run:"),this.log(" rulemetric auth login --api-key <key> (create one at https://rulemetric.com/connect)"),this.log(""),e||(e=await o({message:"Email:"})),t||(t=await k({message:"Password:"}))}let i;try{i=await a("/auth/login",{method:"POST",body:{email:e,password:t},timeoutMs:2e4})}catch(o){throw o instanceof r&&o.statusCode===401&&this.error(`Invalid email or password.
|
|
2
2
|
|
|
3
3
|
If you signed up with Google or GitHub, you have no password \u2014 that is why this cannot work. Create an API key at https://rulemetric.com/connect, then run:
|
|
4
4
|
rulemetric auth login --api-key <key>`),o}let v=i.expiresAt??new Date(Date.now()+3600*1e3).toISOString();d({accessToken:i.accessToken,refreshToken:i.refreshToken,expiresAt:v,email:i.email}),u(i.accessToken,process.env.RULEMETRIC_API_URL),await n(),await f(this.log.bind(this),this.warn.bind(this),this.config.version),c("auth_login",{},this.config.version),this.log(`Logged in as ${i.email}`)}async loginWithApiKey(s){let e=s.trim();e||this.error("Empty --api-key. Create one at https://rulemetric.com/connect"),process.env.RULEMETRIC_API_KEY=e;try{await a("/api/setup/status",{timeoutMs:2e4})}catch(t){throw delete process.env.RULEMETRIC_API_KEY,t instanceof r&&(t.statusCode===401||t.statusCode===403)&&this.error("That API key was rejected. Check you copied it whole (it is shown only once at creation) or mint a new one at https://rulemetric.com/connect"),t}g(e,process.env.RULEMETRIC_API_URL),m(),await n(),c("auth_login",{method:"api_key"},this.config.version),this.log(`Authenticated with API key ${e.slice(0,11)}...`),this.log("Verify any time with: rulemetric auth status")}};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../../chunk-
|
|
1
|
+
import{a as s}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{f as i,j as r}from"../../chunk-JZ5Z2BRO.js";import{a as o}from"../../chunk-ZLLER3HP.js";var e=class t extends s{static{o(this,"AuthLogout")}static description="Log out of RuleMetric";static examples=["<%= config.bin %> auth logout"];async run(){await this.parse(t),i(),r(),this.log("Logged out successfully.")}};export{e as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"../../chunk-
|
|
1
|
+
import{a as k}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{e as n,i as c}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Args as y}from"@oclif/core";var a=class m extends k{static{s(this,"AuthRevokeKey")}static description="Revoke an API key (run with no argument to list active keys)";static examples=["<%= config.bin %> auth revoke-key","<%= config.bin %> auth revoke-key rm_abc12345",'<%= config.bin %> auth revoke-key "my-laptop (auto)"'];static args={id:y.string({description:"API key ID, prefix (rm_xxxxxxxx), or name"})};async run(){let{args:o}=await this.parse(m),r=(await n("/api/auth/api-keys")).filter(e=>!e.revokedAt);if(!o.id){if(r.length===0){this.log("No active API keys.");return}this.log(`Active API keys \u2014 pass an id, prefix, or name to revoke one:
|
|
2
2
|
`);for(let e of r)this.log(` ${e.id} ${e.keyPrefix}... ${e.name}`);return}let i=o.id,t=r.filter(e=>e.id===i||e.name===i||i.startsWith("rm_")&&i.startsWith(e.keyPrefix));t.length===0&&this.error(`No active API key matches "${i}". Run \`rulemetric auth revoke-key\` with no argument to list keys.`),t.length>1&&this.error(`"${i}" matches ${t.length} keys \u2014 use the exact key ID:
|
|
3
3
|
`+t.map(e=>` ${e.id} ${e.keyPrefix}... ${e.name}`).join(`
|
|
4
4
|
`)),await c(`/api/auth/api-keys/${t[0].id}`),this.log(`API key ${t[0].keyPrefix}... ("${t[0].name}") revoked.`)}};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"../../chunk-
|
|
1
|
+
import{a as g}from"../../chunk-BPP7AEFW.js";import{a as h}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import{c as d}from"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import{b as l}from"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{b as m,d as p}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{d as n,h as c}from"../../chunk-JZ5Z2BRO.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as u}from"@oclif/core";var t=class f extends h{static{o(this,"AuthSignup")}static description="Create a RuleMetric account from the CLI";static examples=["<%= config.bin %> auth signup","<%= config.bin %> auth signup -e user@example.com"];static flags={email:u.string({char:"e",description:"Email address"}),password:u.string({char:"p",description:"Password (min 8 chars; for non-interactive use)"})};async run(){let{flags:a}=await this.parse(f),i=a.email,r=a.password;if(!i||!r){process.stdin.isTTY||this.error("Missing credentials in a non-interactive shell. Pass --email/-e and --password/-p.");let{input:s,password:v}=await import("@inquirer/prompts");i||(i=await s({message:"Email:"})),r||(r=await v({message:"Password (min 8 chars):"}))}let e;try{e=await p("/auth/signup",{method:"POST",body:{email:i,password:r},timeoutMs:2e4})}catch(s){throw s instanceof m&&s.statusCode===409&&this.error(`An account with ${i} already exists. Run: rulemetric auth login -e ${i}`),s}if(e.confirmationRequired||!e.accessToken||!e.refreshToken){this.log(`Account created for ${e.email}.`),this.log("Check your email and click the confirmation link, then run:"),this.log(` rulemetric auth login -e ${e.email}`);return}let w=e.expiresAt??new Date(Date.now()+3600*1e3).toISOString();n({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:w,email:e.email}),c(e.accessToken,process.env.RULEMETRIC_API_URL),await l(),await g(this.log.bind(this),this.warn.bind(this),this.config.version),d("auth_signup",{},this.config.version),this.log(`Signed up and logged in as ${e.email}`)}};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-W2MV25SB.js";import{a as g}from"../../chunk-
|
|
1
|
+
import{a as c}from"../../chunk-W2MV25SB.js";import{a as g}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{a,e as l,l as t}from"../../chunk-JZ5Z2BRO.js";import{a as r}from"../../chunk-ZLLER3HP.js";import*as u from"node:path";var o=class h extends g{static{r(this,"AuthStatus")}static description="Show current authentication status";static examples=["<%= config.bin %> auth status"];async run(){await this.parse(h);let e=l(),i=process.env.RULEMETRIC_API_KEY,s=a().apiKey;if(i||s){let m=i||s,p=i?"RULEMETRIC_API_KEY env var":u.join(t(),"env");this.log(`Authenticated via API key ${m.slice(0,11)}... (${p})`),e&&this.log(`Logged in as: ${e.email}`),this.log(`Config: ${t()}`);return}if(!e){this.log("Not logged in. Run `rulemetric auth login` to authenticate.");return}let n=new Date(e.expiresAt).getTime();if(Number.isNaN(n)||Date.now()>=n){this.log("Session expired. Run `rulemetric auth login` to re-authenticate.");return}this.log(`Logged in as: ${e.email}`),this.log(`Session expires: ${c(e.expiresAt)}`),this.log(`Config: ${t()}`)}};export{o as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f,b as k,c as S,d as x,e as R,f as n,g as y}from"../../chunk-SHYP27B7.js";import{b as C,c as w,f as v,g as b}from"../../chunk-QXPYGN7I.js";import{a as u}from"../../chunk-
|
|
1
|
+
import{a as f,b as k,c as S,d as x,e as R,f as n,g as y}from"../../chunk-SHYP27B7.js";import{b as C,c as w,f as v,g as b}from"../../chunk-QXPYGN7I.js";import{a as u}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import{l as m}from"../../chunk-JZ5Z2BRO.js";import{a as h}from"../../chunk-ZLLER3HP.js";import{existsSync as O}from"node:fs";import{Flags as c}from"@oclif/core";var g=class E extends u{static{h(this,"CaptureScope")}static description="Show or set which projects RuleMetric captures \u2014 the Codex sweep and hook-driven sessions each have their own scope";static examples=["<%= config.bin %> <%= command.id %>","<%= config.bin %> <%= command.id %> --add ~/work/client-a --add ~/work/client-b","<%= config.bin %> <%= command.id %> --tool hooks --add ~/work/client-a","<%= config.bin %> <%= command.id %> --tool hooks --off","<%= config.bin %> <%= command.id %> --remove ~/work/client-a","<%= config.bin %> <%= command.id %> --off","<%= config.bin %> <%= command.id %> --all"];static flags={tool:c.string({description:'Which capture path to edit: "codex" (the worker transcript sweep, the default) or "hooks" (Claude Code / Cursor / Copilot / Antigravity hook sessions).',options:["codex","hooks"],default:"codex"}),add:c.string({description:"Capture sessions under this path (repeatable). Implies an allowlist.",multiple:!0}),remove:c.string({description:"Stop capturing under this path (repeatable).",multiple:!0}),off:c.boolean({description:"Turn this capture path off entirely.",exclusive:["all"]}),all:c.boolean({description:"Capture every project (the default).",exclusive:["off"]}),clear:c.boolean({description:"Remove this scope, restoring the default."})};async run(){let{flags:o}=await this.parse(E),s=m(),d=f(s);if(!((o.add?.length??0)>0||(o.remove?.length??0)>0||o.off||o.all||o.clear)){await this.show(s,d);return}for(let t of[...o.add??[],...o.remove??[]])R(t)||this.error(`Not an absolute path: ${t}
|
|
2
2
|
Use an absolute path or ~/\u2026 \u2014 relative paths cannot be matched against a session's cwd.`);for(let t of o.add??[]){let a=x(t);O(a)||this.warn(`${a} does not exist yet \u2014 added anyway, but nothing will match until it does.`)}let e;try{e=k(s)}catch(t){o.clear||this.error(t instanceof Error?t.message:String(t));let a=y(s);this.warn(`${f(s)} was not valid JSON \u2014 saved it to ${a} and starting fresh.`),e={}}let i=o.tool??"codex",r=void 0,l=!1;if(o.clear&&({config:e}=n(e,{op:"clear"},r,i)),o.off&&({config:e}=n(e,{op:"mode",mode:"off"},r,i)),o.all&&({config:e}=n(e,{op:"mode",mode:"all"},r,i)),o.remove?.length){let t=n(e,{op:"remove",roots:o.remove},r,i);e=t.config,l=t.emptiedToOff}o.add?.length&&({config:e}=n(e,{op:"add",roots:o.add},r,i)),S(s,e),l&&(this.log(`Removed the last root \u2014 ${i==="hooks"?"hook":"Codex"} capture is now OFF rather than silently capturing everything.`),this.log("Use --all to go back to capturing every project.")),await this.show(s,d),this.log(""),this.log(i==="hooks"?"Takes effect on the next hook fire. No restart needed.":"Takes effect on the next sweep (within ~30s). No restart needed.")}async show(o,s){let d=await C({configDir:o}),p=await w({configDir:o}),e=h((i,r,l,t)=>{if(this.log(`${i}: ${l}`),r.roots.length)for(let a of r.roots)this.log(` \u2022 ${a}`);r.error&&(this.log(" This scope is FAILING CLOSED \u2014 nothing is being captured on this path."),this.log(` Fix the file, or run \`rulemetric capture scope ${i==="Hook capture"?"--tool hooks ":""}--clear\` to start over.`)),r.source==="env"&&this.log(` Set by environment variable, which outranks the config file (${t}).`)},"print");e("Codex capture",d,v(d),"RULEMETRIC_CODEX_CAPTURE / RULEMETRIC_CODEX_ROOTS"),e("Hook capture",p,b(p),"RULEMETRIC_HOOKS_CAPTURE / RULEMETRIC_HOOKS_ROOTS"),this.log(`Config: ${s}`)}};export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g,b as d,c as p}from"../../chunk-W2MV25SB.js";import{a as c}from"../../chunk-
|
|
1
|
+
import{a as g,b as d,c as p}from"../../chunk-W2MV25SB.js";import{a as c}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as i}from"@oclif/core";var o=class m extends c{static{a(this,"Catalog")}static description="Browse the org instruction catalog";static flags={badge:i.string({description:"Filter by badge",options:["recommended","required"]}),scope:i.string({description:"Filter by scope",options:["org","team"]}),search:i.string({description:"Search by name or description"})};async run(){let{flags:e}=await this.parse(m);this.requireAuth();let s=new URLSearchParams;e.badge&&s.set("badge",e.badge),e.scope&&s.set("scope",e.scope),e.search&&s.set("search",e.search);let r=await n(`/api/catalog?${s.toString()}`);if(r.length===0){this.log("No instructions found in catalog.");return}for(let t of r){let l=t.badge?` [${t.badge}]`:"",f=t.tags?.length?` (${t.tags.join(", ")})`:"";this.log(` ${d(t.name,40)} \u2014 ${p(t.scope)}${l} v${t.version}${f} ${g(t.updatedAt)}`)}this.log(`
|
|
2
2
|
${r.length} instruction(s) found.`)}};export{o as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as i}from"../../chunk-
|
|
1
|
+
import{a as i}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import{f as n}from"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a as t}from"../../chunk-ZLLER3HP.js";import{Args as c}from"@oclif/core";var o=class s extends i{static{t(this,"CatalogRecommend")}static description="Get AI-powered instruction recommendations for a project";static args={projectId:c.string({description:"ID of the project",required:!0})};async run(){let{args:a}=await this.parse(s);this.requireAuth(),this.log(`Analyzing project and generating recommendations...
|
|
2
2
|
`);let r=await n(`/api/projects/${a.projectId}/recommendations`,{});if(r.error&&this.warn(`Note: ${r.error}`),r.recommendations.length===0){this.log("No recommendations found.");return}for(let e of r.recommendations)this.log(` ${(e.score*100).toFixed(0)}% \u2014 ${e.instructionId}`),this.log(` ${e.reason}
|
|
3
3
|
`)}};export{o as default};
|
package/dist/commands/convert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"../chunk-WLVQJH4E.js";import{a as u}from"../chunk-
|
|
1
|
+
import{a as l}from"../chunk-WLVQJH4E.js";import{a as u}from"../chunk-KHWG7ZG4.js";import"../chunk-IZTIYR5Q.js";import"../chunk-UUZB4IKU.js";import"../chunk-EQHKCGSX.js";import"../chunk-VA5DPQB4.js";import"../chunk-3AV3GTMP.js";import{a as n,f as c}from"../chunk-QAV4HW7D.js";import"../chunk-3PUOJ6F2.js";import"../chunk-JZ5Z2BRO.js";import{a}from"../chunk-ZLLER3HP.js";import*as d from"node:fs";import{Args as p,Flags as i}from"@oclif/core";var e=class f extends u{static{a(this,"Convert")}static description="Convert an instruction to a target format";static examples=["<%= config.bin %> convert <id> --format claude-md","<%= config.bin %> convert <id> -f cursorrules --score","<%= config.bin %> convert <id> -f copilot -o .github/copilot-instructions.md"];static args={id:p.string({description:"Instruction ID",required:!0})};static flags={format:i.string({char:"f",description:"Target format (e.g., claude-md, cursorrules)",required:!0}),score:i.boolean({description:"Include quality score",default:!1}),output:i.string({char:"o",description:"Write output to file"})};async run(){let{args:s,flags:t}=await this.parse(f);this.requireAuth(),l(s.id,"instruction ID");let o=new URL(`${process.env.RULEMETRIC_API_URL??n}/api/instructions/${encodeURIComponent(s.id)}/convert`);o.searchParams.set("format",t.format),o.searchParams.set("score",String(t.score));let r=await c(`${o.pathname}${o.search}`,{});t.output?(d.writeFileSync(t.output,r.output,"utf-8"),this.log(`Written to ${t.output}`)):this.log(r.output),t.score&&r.score&&(this.log(""),this.log(`Quality Score: ${r.score.overall}/100`)),r.warnings.length>0&&this.warn(`Warnings: ${r.warnings.join(", ")}`)}};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../chunk-
|
|
1
|
+
import{a as s}from"../chunk-KHWG7ZG4.js";import"../chunk-IZTIYR5Q.js";import"../chunk-UUZB4IKU.js";import"../chunk-EQHKCGSX.js";import"../chunk-VA5DPQB4.js";import"../chunk-3AV3GTMP.js";import{e as a}from"../chunk-QAV4HW7D.js";import"../chunk-3PUOJ6F2.js";import"../chunk-JZ5Z2BRO.js";import{a as o}from"../chunk-ZLLER3HP.js";import{Flags as m}from"@oclif/core";import{printTable as c}from"@oclif/table";var e=class n extends s{static{o(this,"Converters")}static description="List all supported conversion formats";static examples=["<%= config.bin %> converters","<%= config.bin %> converters --tier 1"];static enableJsonFlag=!0;static flags={tier:m.string({char:"t",description:"Filter by tier",options:["1","2","3"]})};async run(){let{flags:i}=await this.parse(n);this.requireAuth();let r=await a("/api/converters");if(i.tier){let t=Number.parseInt(i.tier,10);r=r.filter(p=>p.tier===t)}return c({data:r.map(t=>({ID:t.id,Name:t.name,Tier:String(t.tier),"Output Path":t.outputPath})),columns:["ID","Name","Tier","Output Path"]}),r}};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../../chunk-GY5IJ4RS.js";import{a as n}from"../../chunk-
|
|
1
|
+
import{a as o}from"../../chunk-GY5IJ4RS.js";import{a as n}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a as i}from"../../chunk-ZLLER3HP.js";import{printTable as t}from"@oclif/table";var a=class s extends n{static{i(this,"CronsList")}static description="List manually-runnable maintenance tasks";static examples=["<%= config.bin %> crons list"];async run(){await this.parse(s),t({data:o.map(e=>({Name:e.name,"Scheduled by":e.scheduledBy,Description:e.description})),columns:["Name","Scheduled by","Description"]}),this.log(""),this.log("Scheduled crons run in Supabase pg_cron \u2014 audit them with:"),this.log(` psql "$DATABASE_URL" -c 'select jobname, schedule, active from cron.job;'`),this.log("Run any task above on demand with: rulemetric crons run <name>")}};export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"../../chunk-GY5IJ4RS.js";import{a as c}from"../../chunk-
|
|
1
|
+
import{a as u}from"../../chunk-GY5IJ4RS.js";import{a as c}from"../../chunk-KHWG7ZG4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-UUZB4IKU.js";import"../../chunk-EQHKCGSX.js";import"../../chunk-VA5DPQB4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-QAV4HW7D.js";import"../../chunk-3PUOJ6F2.js";import"../../chunk-JZ5Z2BRO.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{Args as g,Flags as f}from"@oclif/core";var i=class m extends c{static{l(this,"CronsRun")}static description="Run a maintenance task synchronously, right now";static examples=["<%= config.bin %> crons run cron_check_changelog","<%= config.bin %> crons run cron_suggest_instructions --quiet"];static args={name:g.string({description:"Task name (run `rulemetric crons list` to see all)",required:!0})};static flags={quiet:f.boolean({char:"q",description:"Suppress per-line log output; print summary only"})};async run(){let{args:s,flags:d}=await this.parse(m);this.requireAuth();let n=u.find(e=>e.name===s.name);n||this.error(`Unknown task: ${s.name}
|
|
2
2
|
Run \`rulemetric crons list\` to see available tasks.`);let o;try{({runManualTask:o}=await import("../../lib/manual-tasks.js"))}catch(e){let r=e?.code;throw(r==="ERR_MODULE_NOT_FOUND"||r==="MODULE_NOT_FOUND")&&this.error("`crons run` needs the worker runtime, which isn't available in this install.\nThese maintenance tasks connect to the database directly \u2014 run them from a full RuleMetric checkout with DATABASE_URL and the worker dependencies installed."),e}this.log(`\u25B6 Running ${n.name} \u2026`);let h=Date.now(),t=await o(s.name);if(!d.quiet)for(let e of t.logs){let r=e.level==="error"||e.level==="warn"?`[${e.level}]`:"";this.log(` ${r} ${e.message}`)}let a=((t.durationMs??Date.now()-h)/1e3).toFixed(1);t.ok?this.log(`\u2713 ${n.name} completed in ${a}s (${t.logs.length} log line${t.logs.length===1?"":"s"})`):this.error(`\u2717 ${n.name} failed after ${a}s: ${t.error}`)}};export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-KHWG7ZG4.js";import"../chunk-IZTIYR5Q.js";import"../chunk-UUZB4IKU.js";import"../chunk-EQHKCGSX.js";import"../chunk-VA5DPQB4.js";import"../chunk-3AV3GTMP.js";import"../chunk-QAV4HW7D.js";import"../chunk-3PUOJ6F2.js";import"../chunk-JZ5Z2BRO.js";import{a as i}from"../chunk-ZLLER3HP.js";import{Flags as r}from"@oclif/core";var a=class s extends o{static{i(this,"Dashboard")}static description="Interactive TUI dashboard showing session analytics, outcomes, friction, and insights";static examples=["<%= config.bin %> dashboard","<%= config.bin %> dashboard --period 30days","<%= config.bin %> dashboard --launcher"];static flags={period:r.string({char:"p",default:"week",options:["today","week","30days","month","all"],description:"Initial time period"}),launcher:r.boolean({char:"l",default:!1,description:"Open the launcher overlay immediately"})};async run(){let{flags:e}=await this.parse(s),{renderDashboard:t}=await import("../dashboard/Dashboard.js");await t(e.period,{openLauncher:e.launcher})}};export{a as default};
|