@rulemetric/cli 0.19.1 → 0.21.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/bin/dev.js +0 -0
- package/dist/base-command.js +1 -1
- package/dist/{chunk-6WX3AXMI.js → chunk-254I3NH2.js} +1 -1
- package/dist/{chunk-Z7LBSVG3.js → chunk-4EGU65H4.js} +1 -1
- package/dist/chunk-4K3MVOVQ.js +2 -0
- package/dist/{chunk-B5FBLLKT.js → chunk-4RC2SYZX.js} +1 -1
- package/dist/{chunk-PD4BUQ2X.js → chunk-5JYK5HWH.js} +1 -1
- package/dist/{chunk-75H3CKWA.js → chunk-7F3S6JQ2.js} +1 -1
- package/dist/chunk-A4YGEMXC.js +1 -0
- package/dist/{chunk-K2PI3OGV.js → chunk-D6B2DJE6.js} +1 -1
- package/dist/{chunk-EA3X4TAE.js → chunk-FG5EISSP.js} +1 -1
- package/dist/chunk-GJLZWEMQ.js +1 -0
- package/dist/{chunk-Q37D6V2G.js → chunk-GKWZ2DSE.js} +1 -1
- package/dist/{chunk-LQRXWLFJ.js → chunk-GWQ24FQP.js} +1 -1
- package/dist/{chunk-2RZDFKX4.js → chunk-JXUSXDS6.js} +1 -1
- package/dist/{chunk-ONDOPTSL.js → chunk-KIXBBZL5.js} +1 -1
- package/dist/chunk-LAJ4RBRB.js +1 -0
- package/dist/{chunk-35NZJWFC.js → chunk-LVAIQTYA.js} +1 -1
- package/dist/chunk-MJAIG2EY.js +7 -0
- package/dist/chunk-MN4GOU3T.js +1 -0
- package/dist/{chunk-YRGNBYZZ.js → chunk-NNUZ4CG4.js} +1 -1
- package/dist/{chunk-XQEI7NOC.js → chunk-NXQUM2GW.js} +1 -1
- package/dist/{chunk-ZVCKDNBT.js → chunk-OGMQEA3L.js} +1 -1
- package/dist/chunk-PWZY2P65.js +1 -0
- package/dist/{chunk-6XCD343D.js → chunk-QFHWFULY.js} +1 -1
- package/dist/{chunk-PRC5N4NB.js → chunk-SWCM7IHC.js} +1 -1
- package/dist/{chunk-EYRM7BT4.js → chunk-UJTMT6Z7.js} +1 -1
- package/dist/{chunk-OT7ZUHJF.js → chunk-UQJNUESP.js} +1 -1
- package/dist/chunk-W67OZWQV.js +1 -0
- package/dist/{chunk-RR5EE23Q.js → chunk-WGPFOHV3.js} +1 -1
- package/dist/{chunk-KCX2YDC3.js → chunk-XQ5ENDKO.js} +1 -1
- package/dist/chunk-YUSY3IHE.js +1 -0
- 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/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/admissions.js +1 -0
- package/dist/commands/experiments/enroll.js +1 -1
- package/dist/commands/experiments/list.js +1 -1
- package/dist/commands/experiments/reuse.js +1 -0
- 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/instructions/create.js +1 -1
- package/dist/commands/instructions/dedupe.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/resume-scoped-outcomes.js +1 -1
- package/dist/commands/research/tail-transcript.js +1 -1
- package/dist/commands/service/install.js +1 -1
- package/dist/commands/service/status.js +1 -1
- package/dist/commands/service/uninstall.js +1 -1
- package/dist/commands/service/updates.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 -1
- package/dist/commands/suggestions/auto.js +1 -1
- 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 -1
- package/dist/dashboard/Dashboard.js +1 -1
- package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
- package/dist/harbor/cost_delta.py +0 -0
- package/dist/harbor/rm-batch-task/solution/solve.sh +0 -0
- package/dist/harbor/rm-batch-task/tests/test.sh +0 -0
- package/dist/harbor/rm-locality-task/solution/solve.sh +0 -0
- package/dist/harbor/rm-locality-task/tests/test.sh +0 -0
- package/dist/harbor/rm-migrations-task/solution/solve.sh +0 -0
- package/dist/harbor/rm-migrations-task/tests/test.sh +0 -0
- package/dist/harbor/rm-pagination-task/solution/solve.sh +0 -0
- package/dist/harbor/rm-pagination-task/tests/test.sh +0 -0
- package/dist/harbor/run.sh +0 -0
- package/dist/lib/agent-loop.js +1 -1
- package/dist/lib/agent-presence.js +1 -1
- package/dist/lib/discovery-repository.js +1 -1
- package/dist/lib/eval-case-generator.js +1 -1
- package/dist/lib/eval-conversation-handler.js +1 -1
- package/dist/lib/experiment-reuse.js +1 -0
- package/dist/lib/gateway-entry.js +0 -0
- package/dist/lib/instruction-proposer.js +1 -1
- package/dist/lib/instructions/acceptance/accept-hook.js +1 -1
- package/dist/lib/instructions/acceptance/suggestion-accept.js +1 -1
- package/dist/lib/jobs/handlers/cron-auto-accept-suggestions.js +1 -1
- package/dist/lib/jobs/handlers/cron-instruction-training.js +1 -1
- package/dist/lib/jobs/handlers/cron-refine-cases.js +1 -1
- package/dist/lib/jobs/handlers/cron-refresh-pricing.js +1 -1
- package/dist/lib/jobs/handlers/cron-suggest-instructions.js +1 -1
- package/dist/lib/jobs/handlers/distill-memories.js +1 -1
- package/dist/lib/jobs/handlers/prepare-isolated-launch.js +1 -1
- package/dist/lib/jobs/handlers/prepare-suggestion-live.js +1 -1
- package/dist/lib/jobs/handlers/process-conversation.js +1 -1
- package/dist/lib/jobs/handlers/process-eval.js +1 -1
- package/dist/lib/jobs/handlers/process-insights.js +1 -1
- package/dist/lib/jobs/handlers/process-launch.js +1 -1
- package/dist/lib/jobs/handlers/process-session-goal.js +1 -1
- package/dist/lib/jobs/handlers/process-suggestion-adoption.js +1 -1
- package/dist/lib/jobs/handlers/process-suggestion-discovery.js +1 -1
- package/dist/lib/jobs/handlers/process-suggestion-eval.js +1 -1
- package/dist/lib/llm-client.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/dist/lib/study-fixture.js +1 -1
- package/dist/lib/suggestion-discovery.js +1 -1
- package/oclif.manifest.json +924 -818
- package/package.json +28 -28
- package/dist/chunk-E6O2IFOK.js +0 -1
- package/dist/chunk-FD272ZXG.js +0 -2
- package/dist/chunk-FKUFJWII.js +0 -1
- package/dist/chunk-IQOBKWVY.js +0 -5
- package/dist/chunk-JU5ZNXPK.js +0 -1
- package/dist/chunk-JVTSJFFI.js +0 -1
- package/dist/chunk-NX3PF3EQ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"../../chunk-NJKPUZNM.js";import{a as w}from"../../chunk-
|
|
1
|
+
import{a as f}from"../../chunk-NJKPUZNM.js";import{a as w}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import{c}from"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import{b as n}from"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{b as r,d as a}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{b as m,d,h as u,i as g}from"../../chunk-PZNWH4VQ.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-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{f as i,j as r}from"../../chunk-PZNWH4VQ.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-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as n,i as c}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.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-NJKPUZNM.js";import{a as h}from"../../chunk-
|
|
1
|
+
import{a as g}from"../../chunk-NJKPUZNM.js";import{a as h}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import{c as d}from"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import{b as l}from"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{b as m,d as p}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{d as n,h as c}from"../../chunk-PZNWH4VQ.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-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{a,e as l,l as t}from"../../chunk-PZNWH4VQ.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-VALRPZXH.js";import{b as C,c as w,g as v,h as b}from"../../chunk-QI3FJKGK.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-VALRPZXH.js";import{b as C,c as w,g as v,h as b}from"../../chunk-QI3FJKGK.js";import{a as u}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{l as m}from"../../chunk-PZNWH4VQ.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-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.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-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as n}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../../chunk-4VN5PG2S.js";import{a as n}from"../../chunk-
|
|
1
|
+
import{a as o}from"../../chunk-4VN5PG2S.js";import{a as n}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.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 $}from"../../chunk-4VN5PG2S.js";import{a as k}from"../../chunk-
|
|
1
|
+
import{a as $}from"../../chunk-4VN5PG2S.js";import{a as k}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as b}from"../../chunk-E5FI5YHO.js";import{A as f,B as g,z as h}from"../../chunk-I2U5GNNM.js";import{f as p}from"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Args as _,Flags as y}from"@oclif/core";var l=class w extends k{static{d(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:_.string({description:"Task name (run `rulemetric crons list` to see all)",required:!0})};static flags={"dry-run":y.boolean({description:"For Harbor, print the saved engine/model and supported tasks without running them"}),quiet:y.boolean({char:"q",description:"Suppress per-line log output; print summary only"})};async run(){let{args:s,flags:a}=await this.parse(w);this.requireAuth();let o=$.find(e=>e.name===s.name);o||this.error(`Unknown task: ${s.name}
|
|
2
2
|
Run \`rulemetric crons list\` to see available tasks.`);let t=null;if(s.name==="harbor_ab"){let e=await b("/api/settings/measurement");t=e.execution.harbor?p.parse(e.execution.harbor):null;for(let r of h("proven")){let m=f(r,t);if(m){this.log(`Unsupported: ${m}`);continue}let i=g(r,"manual",t);this.log(`${r.task}: ${t?.engine??"claude"} / ${i.model}, ${i.class}, ${i.nTrials} trials per arm`)}if(a["dry-run"])return}else a["dry-run"]&&this.error("--dry-run is currently supported only for harbor_ab");let u;try{({runManualTask:u}=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.\nReinstall the CLI and verify that its runtime dependencies are present. A database credential is not required for end-user maintenance tasks."),e}this.log(`\u25B6 Running ${o.name} \u2026`);let v=Date.now(),n=await u(s.name,{measurement:t});if(!a.quiet)for(let e of n.logs){let r=e.level==="error"||e.level==="warn"?`[${e.level}]`:"";this.log(` ${r} ${e.message}`)}let c=((n.durationMs??Date.now()-v)/1e3).toFixed(1);n.ok?this.log(`\u2713 ${o.name} completed in ${c}s (${n.logs.length} log line${n.logs.length===1?"":"s"})`):this.error(`\u2717 ${o.name} failed after ${c}s: ${n.error}`)}};export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-4EGU65H4.js";import"../chunk-IZTIYR5Q.js";import"../chunk-KTLRSRHF.js";import"../chunk-RFLO7L5X.js";import"../chunk-7CQBFCHP.js";import"../chunk-3AV3GTMP.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.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"];static flags={period:r.string({char:"p",default:"week",options:["today","week","30days","month","all"],description:"Initial time period"})};async run(){let{flags:e}=await this.parse(s),{renderDashboard:t}=await import("../dashboard/Dashboard.js");await t(e.period)}};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as q,d as K}from"../chunk-TYFEWLYZ.js";import{b as E,c as F}from"../chunk-V5U3E4BZ.js";import{a as J}from"../chunk-2TJ7Q2OU.js";import{e as _,f as C,g as M}from"../chunk-QWCEZEDO.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import{d as W}from"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{a as V}from"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import{a as B,b as Y,c as D,g as j,h as G}from"../chunk-QI3FJKGK.js";import{a as U}from"../chunk-
|
|
1
|
+
import{c as q,d as K}from"../chunk-TYFEWLYZ.js";import{b as E,c as F}from"../chunk-V5U3E4BZ.js";import{a as J}from"../chunk-2TJ7Q2OU.js";import{e as _,f as C,g as M}from"../chunk-QWCEZEDO.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import{d as W}from"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{a as V}from"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import{a as B,b as Y,c as D,g as j,h as G}from"../chunk-QI3FJKGK.js";import{a as U}from"../chunk-4EGU65H4.js";import"../chunk-IZTIYR5Q.js";import"../chunk-KTLRSRHF.js";import"../chunk-RFLO7L5X.js";import"../chunk-7CQBFCHP.js";import"../chunk-3AV3GTMP.js";import{a as X,e as N}from"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import{a as I,g as f,l as x}from"../chunk-PZNWH4VQ.js";import{a as T}from"../chunk-ZLLER3HP.js";import{spawnSync as oe}from"node:child_process";import{existsSync as te,readFileSync as ne}from"node:fs";import{join as z}from"node:path";var L=class p extends U{static{T(this,"Diagnostics")}static description='Diagnose capture / proxy / connectivity problems (e.g. a client-side "502 Bad Gateway")';static examples=["<%= config.bin %> diagnostics"];baseUrl(){return process.env.RULEMETRIC_API_URL??I().apiUrl??X}async checkDirect(){let n=process.env.HTTPS_PROXY,s=process.env.HTTP_PROXY;delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY;let l=new AbortController,c=setTimeout(()=>l.abort(),8e3);try{return(await globalThis.fetch(`${this.baseUrl()}/health`,{signal:l.signal})).ok}catch{return!1}finally{clearTimeout(c),n!==void 0&&(process.env.HTTPS_PROXY=n),s!==void 0&&(process.env.HTTP_PROXY=s)}}configuredProxy(){if(process.env.HTTPS_PROXY)return process.env.HTTPS_PROXY;for(let n of["settings.local.json","settings.json"]){let s=z(process.cwd(),".claude",n);if(te(s))try{let l=JSON.parse(ne(s,"utf8"));if(l.env?.HTTPS_PROXY)return l.env.HTTPS_PROXY}catch{}}return null}checkThroughProxy(n){let s=oe("curl",["-sS","-x",n,"--max-time","8","-o","/dev/null","-w","%{http_code}",`${this.baseUrl()}/health`],{encoding:"utf8",stdio:["ignore","pipe","ignore"]});return s.error||typeof s.stdout!="string"?null:s.stdout.trim()==="200"}async run(){await this.parse(p);let n=process.version,s=this.configuredProxy(),l=s!=null,[c,m,A]=await Promise.all([this.checkDirect(),M(_),M(C)]),k=l&&s?this.checkThroughProxy(s):null,t=T((e,r,b)=>{let a=r===null?"\u2013":r?"[OK]":"[!!]";this.log(` ${a} ${e.padEnd(22)} ${b}`)},"line");this.log("RuleMetric diagnostics"),this.log(""),t("Node",!E(n),`${n}${E(n)?" (< 20.11 \u2014 breaks the bundled proxy)":""}`),t("API (direct)",c,`${this.baseUrl()}/health ${c?"reachable":"UNREACHABLE"}`),t("Authenticated",f(),f()?"yes":"no \u2014 run `rulemetric auth login`"),t("Proxy configured",l?!0:null,l?s:"no HTTPS_PROXY set"),l&&(t("Gateway :"+_,m,m?"listening":"NOT listening"),t("mitmproxy :"+C,A,A?"listening":"not listening (gateway should route direct)"),t("API (via proxy)",k,k===null?"inconclusive (curl unavailable)":k?"reachable":"FAILED \u2014 502/blocked through your proxy"));let d=W();t("claude CLI",d.claudeBin!=null,d.claudeBin??"not found \u2014 LLM features (grading, distill) will no-op"),t("codex CLI",d.codexBin!=null?!0:null,d.codexBin?`${d.codexBin}${d.codexConfiguredModel?` (model ${d.codexConfiguredModel})`:""}`:"not found \u2014 optional; enables the cross-vendor reviewer (evals validate-judge)");let o=null;if(f()&&c)try{o=await N("/api/workers/health")}catch{o=null}if(o){let e=o.worker;t("Worker",!!e.active,e.present?e.active?`online (last heartbeat ${e.ageSeconds??"?"}s ago${e.clientVersion?`, v${e.clientVersion}`:""})`:`NOT RUNNING \u2014 last heartbeat ${S(e.ageSeconds)} ago`:"never connected \u2014 no worker has ever reported in");let r=o.worker.engines;if(r!=null){let a=[r.claude&&"claude",r.codex&&"codex"].filter(Boolean);t("LLM engine",a.length>0,a.length>0?`${a.join(" + ")} available to the worker`:"NONE \u2014 the worker found no `claude` and no `codex`. LLM jobs will complete with empty output rather than failing.")}let b=o.pending.reduce((a,P)=>a+P.count,0);if(b>0){let a=o.verdict.stuck.reduce((h,g)=>h+g.count,0),P=o.verdict.unclaimable.reduce((h,g)=>h+g.count,0),O=(o.verdict.engineBlocked??[]).reduce((h,g)=>h+g.count,0);t("Job queue",a===0&&O===0,`${b} pending`+(a>0?` \u2014 ${a} waiting on this worker`:"")+(O>0?` \u2014 ${O} need a local LLM engine`:"")+(P>0?` \u2014 ${P} need a worker with DATABASE_URL`:""))}else t("Job queue",!0,"empty")}else f()&&c&&t("Worker",null,"could not read /workers/health (older API?)");let i=o?.worker.machine;if(i){let e=i.suspends+i.stalls,r=i.lastPause;t("Worker pauses",e===0?!0:null,e===0?`none since ${i.since} \u2014 no sleep or stall seen by the worker`:`${i.suspends} suspend${i.suspends===1?"":"s"}`+(i.stalls>0?` + ${i.stalls} event-loop stall${i.stalls===1?"":"s"}`:"")+` since ${i.since}, ${S(Math.round(i.pausedMs/1e3))} paused total`+(r?`; last: ${r.kind} of ${S(Math.round(r.wallGapMs/1e3))} ending ${r.detectedAt}`:"")+" \u2014 jobs in flight during a suspend lose their lease and are redone on wake")}let v=await q();if(v){t("Machine sleep (pmset)",v.sleeps===0?!0:null,K(v));for(let e of v.recent.slice(-3)){let r=e.seconds!=null?` (${S(e.seconds)})`:"";this.log(` \u21B3 ${e.at.toISOString()} ${e.kind}${r}: ${e.reason.slice(0,80)}`)}}let R=V(process.cwd()),u=await Y({configDir:x()}),Q=await D({configDir:x()}),$=` \u2014 ${G(Q)}`,w=J(process.cwd()),H=[w.user&&`user hooks (${w.user})`,w.workspace&&`workspace hooks (${w.workspace})`].filter(Boolean),Z={claude_code:`session hooks (+ proxy for instruction linking)${$}`,codex:`worker transcript sync of ~/.codex/sessions \u2014 ${j(u)}`,cursor:`user hooks (~/.cursor/hooks.json)${$}`,copilot_agent:`workspace hooks${$}`,antigravity:H.length>0?`${H.join(" + ")}${$}`:"NOT CAPTURED \u2014 no rulemetric block in ~/.gemini/config/hooks.json or .agents/hooks.json; run `rulemetric hooks install` (user hooks are on by default)"};this.log(""),this.log(" Capture coverage (agents found on this machine):");for(let e of R)this.log(` \u2022 ${e.padEnd(15)} ${Z[e]??"captured"}`);if(R.includes("codex"))if(u.error)this.log(` ! ${u.error}`);else if(u.mode==="allowlist")for(let e of u.roots)this.log(` \u21B3 ${e}`);else u.mode==="all"&&this.log(` \u21B3 scope it with ${z(x(),B)} ({"codex":{"roots":["/path/to/repo"]}}) or RULEMETRIC_CODEX_CAPTURE=off`);o&&!o.worker.active&&R.includes("codex")&&u.mode!=="off"&&this.log(" ! Codex capture runs INSIDE the worker \u2014 it is stopped while the worker is down.");let y=F({nodeVersion:n,directApiOk:c,httpsProxySet:l,gatewayAlive:m,mitmproxyAlive:A,proxyPathOk:k});this.log("");let ee=y.severity==="ok"?"[OK]":y.severity==="warn"?"[!!]":"[XX]";this.log(`${ee} ${y.headline}`);for(let e of y.hints)this.log(` \u2022 ${e}`);if(o&&o.verdict.severity!=="ok"){let e=o.verdict.severity==="warn"?"[!!]":"[XX]";this.log(""),this.log(`${e} ${o.verdict.headline}`);for(let r of o.verdict.hints)this.log(` \u2022 ${r}`)}}};function S(p){if(p===null)return"never";if(p<90)return`${Math.round(p)}s`;let n=Math.round(p/60);return n<90?`${n}m`:`${Math.round(n/60)}h`}T(S,"formatAge");export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as s}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as e}from"@oclif/core";import{readFileSync as p}from"node:fs";var n=class c extends a{static{o(this,"EvalTargetCreate")}static description="Create an eval target (instruction, skill, prompt, or plan to test)";static examples=["<%= config.bin %> eval-targets create --name my-rules --type instruction --file ./CLAUDE.md",'<%= config.bin %> eval-targets create --name my-prompt --type prompt --content "Always use TypeScript"'];static flags={name:e.string({char:"n",description:"Name for the eval target",required:!0}),type:e.string({char:"t",description:"Target type",options:["instruction","skill","prompt","plan"],required:!0}),file:e.string({char:"f",description:"Path to content file"}),content:e.string({char:"c",description:"Content string (alternative to --file)"}),description:e.string({char:"d",description:"Description of the target",default:""})};async run(){let{flags:t}=await this.parse(c);this.requireAuth();let i;t.file?i=p(t.file,"utf-8"):t.content?i=t.content:this.error("Provide either --file or --content");let r=await s("/api/eval-targets",{name:t.name,type:t.type,content:i,description:t.description});this.log(`Created eval target: ${r.name} (${r.id}) v${r.version}`)}};export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as e}from"../../chunk-W2MV25SB.js";import{a as o}from"../../chunk-
|
|
1
|
+
import{a as p,b as e}from"../../chunk-W2MV25SB.js";import{a as o}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Flags as m}from"@oclif/core";import{printTable as d}from"@oclif/table";var r=class l extends o{static{s(this,"EvalTargetList")}static description="List eval targets";static examples=["<%= config.bin %> eval-targets list","<%= config.bin %> eval-targets list --type instruction"];static flags={type:m.string({char:"t",description:"Filter by type",options:["instruction","skill","prompt","plan"]})};async run(){let{flags:i}=await this.parse(l);this.requireAuth();let c=i.type?`?type=${i.type}`:"",a=await n(`/api/eval-targets${c}`);if(a.length===0){this.log("No eval targets found. Create one with `rulemetric eval-targets create`.");return}d({data:a.map(t=>({Name:e(t.name,30),Type:t.type,Version:`v${t.version}`,Description:e(t.description,40),Updated:p(t.updatedAt)})),columns:["Name","Type","Version","Description","Updated"]})}};export{r as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as j,b as q,c as F,d as X}from"../../chunk-DRX65ZLX.js";import{b as W}from"../../chunk-GH4EZK2O.js";import{c as g}from"../../chunk-HRU6WGCG.js";import{e as U}from"../../chunk-
|
|
1
|
+
import{a as j,b as q,c as F,d as X}from"../../chunk-DRX65ZLX.js";import{b as W}from"../../chunk-GH4EZK2O.js";import{c as g}from"../../chunk-HRU6WGCG.js";import{e as U}from"../../chunk-W67OZWQV.js";import"../../chunk-RYMQMJ7O.js";import"../../chunk-IEQDLURA.js";import"../../chunk-KINIFUZQ.js";import"../../chunk-XQ5ENDKO.js";import"../../chunk-UFRJ75FW.js";import"../../chunk-NNUZ4CG4.js";import"../../chunk-ID47WFUP.js";import"../../chunk-5JYK5HWH.js";import"../../chunk-2EXQM3UF.js";import"../../chunk-ZYGBABMZ.js";import"../../chunk-WGPFOHV3.js";import"../../chunk-D6B2DJE6.js";import"../../chunk-A4YGEMXC.js";import"../../chunk-MJAIG2EY.js";import"../../chunk-JE2JX7IJ.js";import"../../chunk-MOJY6S5J.js";import"../../chunk-254I3NH2.js";import"../../chunk-HEO56SKT.js";import"../../chunk-OGMQEA3L.js";import"../../chunk-KIXBBZL5.js";import"../../chunk-LVAIQTYA.js";import"../../chunk-6Z4JNHBO.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-PWZY2P65.js";import"../../chunk-GJLZWEMQ.js";import"../../chunk-ZFIGOHQ6.js";import"../../chunk-4RC2SYZX.js";import"../../chunk-7F3S6JQ2.js";import"../../chunk-SW24KZ5C.js";import"../../chunk-2WRP6ZJF.js";import"../../chunk-3ZHVP3KE.js";import"../../chunk-JXUSXDS6.js";import"../../chunk-HOQPVOMF.js";import"../../chunk-SWCM7IHC.js";import"../../chunk-NXQUM2GW.js";import"../../chunk-ICULHHNZ.js";import"../../chunk-Q42RXJ4R.js";import"../../chunk-M7QSC64D.js";import"../../chunk-B56GMANB.js";import"../../chunk-NI6RDOZ5.js";import"../../chunk-77FH6UZP.js";import"../../chunk-LKOUL3IF.js";import"../../chunk-SFZSHNZZ.js";import"../../chunk-UJTMT6Z7.js";import"../../chunk-PX2E644Q.js";import"../../chunk-NBTH6ZKD.js";import"../../chunk-WLLSWFAJ.js";import"../../chunk-VZYNZS5U.js";import"../../chunk-U2NT5OSQ.js";import"../../chunk-KGURGIZ2.js";import"../../chunk-GIRPEMTW.js";import"../../chunk-ONSRPEUQ.js";import"../../chunk-GRTEWHXU.js";import"../../chunk-3UKZJAFS.js";import"../../chunk-GKWZ2DSE.js";import"../../chunk-RBSEE2Z6.js";import"../../chunk-DQYYHX6K.js";import"../../chunk-MN4GOU3T.js";import"../../chunk-45CCW25C.js";import"../../chunk-PIVEJTNF.js";import"../../chunk-FG5EISSP.js";import"../../chunk-QFHWFULY.js";import"../../chunk-G2UGWEMO.js";import"../../chunk-PCSSIYH6.js";import"../../chunk-GYNZ3OZF.js";import"../../chunk-OLOECA5V.js";import"../../chunk-WUDHDZOG.js";import"../../chunk-XFOG2PDJ.js";import"../../chunk-SIGZEQ3K.js";import{h as V,i as G}from"../../chunk-YMIO3CVV.js";import"../../chunk-EBGVDX3Z.js";import"../../chunk-UPFH72PF.js";import"../../chunk-MHVHGKDK.js";import"../../chunk-LJRE3LZ2.js";import"../../chunk-G2MRNA45.js";import"../../chunk-UQJNUESP.js";import"../../chunk-FLXWL4F4.js";import"../../chunk-V6L25LFD.js";import"../../chunk-GWQ24FQP.js";import"../../chunk-PPAHIVG5.js";import"../../chunk-CT7FWSIU.js";import"../../chunk-5MXZJWQS.js";import"../../chunk-K4LO27GG.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-CLPIN7TY.js";import"../../chunk-6UEFCMR2.js";import"../../chunk-3HJT572X.js";import"../../chunk-CDY7TQFZ.js";import"../../chunk-FLP6WIJV.js";import"../../chunk-JP6ULOEX.js";import"../../chunk-SVZYRGO5.js";import"../../chunk-WULEBQPI.js";import"../../chunk-MODXEGCU.js";import"../../chunk-4K3MVOVQ.js";import"../../chunk-S7ZQTZNB.js";import"../../chunk-GPBN4ROE.js";import"../../chunk-6XTLP2G7.js";import"../../chunk-PJ3WHQ67.js";import"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{b as L,d as D,g as v,i as x,j as $,k as M}from"../../chunk-QI3FJKGK.js";import{a as C}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as E}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import{e as A,l as c}from"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{trace as he,context as ye}from"@opentelemetry/api";import{NodeSDK as z}from"@opentelemetry/sdk-node";import{OTLPTraceExporter as Q}from"@opentelemetry/exporter-trace-otlp-http";import{BatchSpanProcessor as Z,ConsoleSpanExporter as ee,SimpleSpanProcessor as te}from"@opentelemetry/sdk-trace-node";import{Resource as re}from"@opentelemetry/resources";import{ATTR_SERVICE_NAME as oe,ATTR_SERVICE_VERSION as ne}from"@opentelemetry/semantic-conventions";function K(r){if(!r)return{};let o={};for(let n of r.split(",")){let i=n.indexOf("=");if(i===-1)continue;let a=n.slice(0,i).trim(),s=n.slice(i+1).trim();a&&(o[a]=s)}return o}e(K,"parseOtlpHeaders");var f=null;function R(){return process.env.TELEMETRY_ENABLED!=="false"}e(R,"isTelemetryEnabled");function w(r){if(!R()||f!==null)return"off";let o=new re({[oe]:r.serviceName,[ne]:r.serviceVersion??"0.1.0"}),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT,i,a;if(n){let s=K(process.env.OTEL_EXPORTER_OTLP_HEADERS),p=new Q({url:`${n}/v1/traces`,headers:s});a=new Z(p),i="otlp"}else if(process.env.OTEL_SPAN_EXPORT==="none")a=void 0,i="silent";else{let s=new ee;a=new te(s),i="console"}return f=new z({resource:o,spanProcessors:a?[a]:[]}),f.start(),i}e(w,"initTelemetry");async function h(){f&&(await f.shutdown(),f=null)}e(h,"shutdownTelemetry");import{SpanKind as Ne,SpanStatusCode as _e}from"@opentelemetry/api";import{trace as Ce,context as Le}from"@opentelemetry/api";import*as d from"@sentry/node";var P=!1;function k(r){if(P)return!1;let o=process.env.SENTRY_DSN;return o?(d.init({dsn:o,serverName:r.serviceName,environment:process.env.NODE_ENV??"development",tracesSampleRate:0}),P=!0,!0):!1}e(k,"initSentry");async function y(r){P&&await d.flush(r)}e(y,"flushSentry");import{existsSync as ie,mkdirSync as ae,readFileSync as b,unlinkSync as H,writeFileSync as B}from"node:fs";import{dirname as ce,join as N}from"node:path";import{execFileSync as le}from"node:child_process";var l=N(c(),"evals-agent.lock");function pe(r){try{return process.kill(r,0),!0}catch(o){return o.code==="EPERM"}}e(pe,"pidAlive");function ue(r){if(!pe(r))return!1;try{let o=le("ps",["-p",String(r),"-o","command="],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]});return/run\.js\s+evals\s+agent|evals\s+agent/.test(o)}catch{return!0}}e(ue,"isLiveAgent");function fe(){try{ae(ce(l),{recursive:!0})}catch{}for(let r=0;r<2;r++)try{return B(l,String(process.pid),{flag:"wx"}),{ok:!0}}catch(o){if(o.code!=="EEXIST")throw o;let n=0;try{n=Number(b(l,"utf-8").trim())}catch{}if(n&&n!==process.pid&&ue(n))return{ok:!1,holder:n};try{H(l)}catch{}}try{B(l,String(process.pid))}catch{}return{ok:!0}}e(fe,"acquireAgentLock");function T(){try{ie(l)&&Number(b(l,"utf-8").trim())===process.pid&&H(l)}catch{}}e(T,"releaseAgentLock");var _=class r extends C{static{e(this,"EvalAgentCommand")}static description="The worker daemon: long-polls /api/work/next, claims jobs, and runs them locally. Installed as a launchd service by `rulemetric service install`.";static examples=["<%= config.bin %> evals agent"];async run(){await this.parse(r),this.requireAuth();let o=fe();if(!o.ok){this.log(`Another rulemetric evals agent is already running (pid ${o.holder}). Refusing to start a second instance.`);return}process.env.PG_APPLICATION_NAME||="rulemetric-agent",k({serviceName:"rulemetric-agent"})&&this.log("[sentry] error capture enabled");let i=w({serviceName:"rulemetric-agent"});i==="otlp"?this.log(`[otel] traces exporting to ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT}`):i==="console"?this.log("[otel] cron spans printing to stdout (set OTEL_EXPORTER_OTLP_ENDPOINT to ship to a backend)"):this.log("[otel] disabled (TELEMETRY_ENABLED=false)"),!A()&&!process.env.RULEMETRIC_API_KEY&&this.error("No auth token found. Run `rulemetric auth login` first."),this.log("Starting thin agent (Phase 4b parallel-run)..."),this.log(`Long-polling /api/work/next. Press Ctrl+C to stop.
|
|
2
2
|
`);let s=new AbortController,p=await L({configDir:c()});if(this.log(`[transcript-sync] Codex capture: ${v(p)}`),p.error)this.log(`[transcript-sync] WARNING: ${p.error}`);else if(p.mode==="allowlist")for(let t of p.roots)this.log(`[transcript-sync] \u2022 ${t}`);let m=await D({configDir:c()});if(this.log(`[transcript-sync] Pi capture: ${x(m)}`),m.error)this.log(`[transcript-sync] WARNING: ${m.error}`);else if(m.mode==="allowlist")for(let t of m.roots)this.log(`[transcript-sync] \u2022 ${t}`);let Y=new W({postSnapshot:e((t,u)=>E(`/api/sessions/${t}/context-snapshots`,u),"postSnapshot"),linkInstructions:e(t=>E("/api/sessions/link-instructions",{sessionId:t}),"linkInstructions"),log:e(t=>this.log(`[transcript-sync] ${t}`),"log")}),J=new j({providers:[q(void 0,void 0,$({configDir:c(),onChange:e(t=>this.log(`[transcript-sync] Codex capture changed: ${v(t)}`),"onChange")})),F(void 0,void 0,M({configDir:c(),onChange:e(t=>this.log(`[transcript-sync] Pi capture changed: ${x(t)}`),"onChange")}))],statePath:N(c(),"transcript-sync-state.json"),importTranscript:e(t=>E("/api/sessions/import",t),"importTranscript"),emitInstructions:e(t=>Y.emit(t),"emitInstructions"),log:e(t=>this.log(`[transcript-sync] ${t}`),"log")});X(J,{signal:s.signal,log:e(t=>this.log(`[transcript-sync] ${t}`),"log")});let I=e(async t=>{this.log(`
|
|
3
3
|
[${t}] shutting down agent...`),s.abort(),await Promise.allSettled([y(2e3),h(),g()]),T(),process.exit(0)},"shutdown");process.on("SIGINT",()=>{I("SIGINT")}),process.on("SIGTERM",()=>{I("SIGTERM")});let O=!1,S=V({configDir:c(),packageRoot:this.config.root,version:this.config.version,managed:process.env.RULEMETRIC_MANAGED_WORKER==="1",signal:s.signal,log:e(t=>this.log(`[update] ${t}`),"log")});try{await U({signal:s.signal,log:e(u=>this.log(u),"log"),version:this.config.version,shouldDrain:e(()=>S.target()!==void 0,"shouldDrain"),readInstalledVersion:e(()=>{try{return JSON.parse(b(N(this.config.root,"package.json"),"utf-8")).version??null}catch{return null}},"readInstalledVersion"),onVersionDrift:e(()=>{O=!0},"onVersionDrift")});let t=S.target();t&&!s.signal.aborted&&(s.abort(),S.stop(),await Promise.allSettled([y(2e3),h(),g()]),await G({configDir:c(),packageRoot:this.config.root,currentVersion:this.config.version,targetVersion:t,log:e(u=>this.log(`[update] ${u}`),"log")}),T(),process.exit(1)),O&&(this.log("[upgrade] Installed CLI version changed \u2014 restarting worker onto the new code."),await Promise.allSettled([y(2e3),h(),g()]),T(),process.exit(1))}finally{S.stop(),T(),await g()}}};export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"../../chunk-
|
|
1
|
+
import{a as i}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as t}from"../../chunk-ZLLER3HP.js";import{Args as o,Flags as e}from"@oclif/core";var r=class extends i{static{t(this,"EvalAutoRun")}static description="Retired adaptive loop; use evals run for one bounded experiment";static examples=["<%= config.bin %> evals run <target-id>"];static args={targetId:o.string({description:"Eval target ID",required:!0})};static flags={yes:e.boolean({char:"y",description:"Actually run. Without this, only previews the plan + cost."}),"max-runs":e.integer({description:"Hard ceiling on completed runs",default:200}),"batch-parallel":e.integer({description:"Concurrent executions within a batch",default:3}),timeout:e.integer({description:"Timeout per eval in ms",default:12e4}),model:e.string({description:"Model for eval execution"}),"grader-model":e.string({description:"Model for grading"}),"skip-baseline":e.boolean({description:"Skip without_target runs (no delta \u2014 not recommended)",default:!1})};async run(){this.error("Adaptive auto-run is retired. Use evals run for one bounded experiment, or enable the target schedule.")}};export{r as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as h,c as f}from"../../chunk-T7DAU6DV.js";import"../../chunk-S7ZQTZNB.js";import{a as m}from"../../chunk-
|
|
1
|
+
import{b as h,c as f}from"../../chunk-T7DAU6DV.js";import"../../chunk-S7ZQTZNB.js";import{a as m}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as c}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as u}from"../../chunk-ZLLER3HP.js";import{Args as p,Flags as v}from"@oclif/core";var d=class b extends m{static{u(this,"EvalBenchmarkCommand")}static description="Aggregate eval runs into a benchmark for a target";static examples=["<%= config.bin %> evals benchmark <target-id>","<%= config.bin %> evals benchmark <target-id> --iteration 2"];static args={targetId:p.string({description:"Eval target ID",required:!0})};static flags={iteration:v.integer({description:"Filter runs by iteration",default:1})};async run(){let{args:o,flags:l}=await this.parse(b);this.requireAuth();let g=await c(`/api/eval-targets/${o.targetId}`);this.log(`Aggregating benchmark for "${g.name}" v${g.version}, iteration ${l.iteration}`);let a=await h(o.targetId,l.iteration);a.totalRuns===0&&this.error("No completed runs found. Run evals first with `rulemetric evals run`."),this.log(`
|
|
2
2
|
Aggregated ${a.totalRuns} runs
|
|
3
3
|
`);for(let[e,n]of Object.entries(a.runSummary)){this.log(`${e}:`);for(let[r,i]of Object.entries(n)){let s=i;this.log(` ${r}: mean=${s.mean} stddev=${s.stddev} [${s.min}, ${s.max}]`)}}let t=a.verdict;if(t)if(this.log(`
|
|
4
4
|
Verdict (${t.mode}, baseline=${t.baseline}):`),!t.sufficient)this.log(` ${t.insufficientReason??"insufficient data"} \u2014 no effect claimed`);else{let e=t.delta>=0?"+":"";this.log(` pass-rate delta: ${e}${(t.delta*100).toFixed(0)}% (n=${t.nWith} paired)`),this.log(` 95% CI: ${(t.ci.lower*100).toFixed(0)}\u2013${(t.ci.upper*100).toFixed(0)}%`),t.pValue!=null&&this.log(` McNemar p: ${t.pValue.toFixed(4)}`),this.log(` significant: ${t.significant?"YES":"no"}`)}if(a.notes.length>0){this.log(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"../../chunk-
|
|
1
|
+
import{a as t}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Args as i,Flags as s}from"@oclif/core";var e=class extends t{static{r(this,"EvalCompareCommand")}static description="Retired blind comparison; use evals run for recorded task outcomes";static examples=["<%= config.bin %> evals run <target-id>"];static args={targetA:i.string({description:"First eval target ID",required:!0}),targetB:i.string({description:"Second eval target ID",required:!0})};static flags={model:s.string({description:"Model for execution and comparison"}),timeout:s.integer({description:"Timeout per eval in ms",default:12e4})};async run(){this.error("Blind preference comparisons are archived. Use evals run to create an experiment with recorded task outcomes.")}};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"../../chunk-
|
|
1
|
+
import{a as c}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as i}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as m}from"../../chunk-ZLLER3HP.js";import{Args as f,Flags as r}from"@oclif/core";import{readFileSync as g}from"node:fs";var s=class d extends c{static{m(this,"EvalCreate")}static description="Create test cases (evals) for an eval target";static examples=['<%= config.bin %> evals create <target-id> --name "ts-check" --prompt "Write a function to add two numbers"',"<%= config.bin %> evals create <target-id> --from-file evals.json"];static args={targetId:f.string({description:"Eval target ID",required:!0})};static flags={name:r.string({char:"n",description:"Eval name"}),prompt:r.string({char:"p",description:"Test prompt"}),expectations:r.string({char:"e",description:"Assertion (repeatable)",multiple:!0}),"from-file":r.string({description:"Bulk create from JSON file"})};async run(){let{args:n,flags:e}=await this.parse(d);if(this.requireAuth(),e["from-file"]){let a=JSON.parse(g(e["from-file"],"utf-8")),p=Array.isArray(a)?a:a.evals;for(let t of p){let l=await i(`/api/eval-targets/${n.targetId}/evals`,{name:t.name,prompt:t.prompt,expectations:t.expectations??[],files:t.files??[]});this.log(`Created eval: ${l.name} (${l.id})`)}this.log(`Created ${p.length} evals.`);return}(!e.name||!e.prompt)&&this.error("Provide --name and --prompt, or use --from-file for bulk creation");let o=await i(`/api/eval-targets/${n.targetId}/evals`,{name:e.name,prompt:e.prompt,expectations:e.expectations??[]});this.log(`Created eval: ${o.name} (${o.id})`)}};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"../../chunk-
|
|
1
|
+
import{a as t}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as i}from"../../chunk-ZLLER3HP.js";import{Args as o,Flags as e}from"@oclif/core";var r=class extends t{static{i(this,"EvalOptimizeDescriptionCommand")}static description="Retired optimization workflow; use canonical experiments";static examples=["<%= config.bin %> evals run <target-id>"];static args={targetId:o.string({description:"Eval target ID",required:!0})};static flags={"max-iterations":e.integer({description:"Maximum optimization iterations",default:5}),model:e.string({description:"Model for trigger testing and improvement"}),queries:e.integer({description:"Number of trigger queries to generate",default:20}),"runs-per-query":e.integer({description:"Runs per query for reliability",default:3}),"poll-interval":e.integer({description:"Ms between approval polls",default:5e3}),timeout:e.integer({description:"Timeout per eval in ms",default:12e4})};async run(){this.error("This optimization workflow is retired. Use evals run for recorded experiments; review and edit target content explicitly.")}};export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"../../chunk-
|
|
1
|
+
import{a as r}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as t}from"../../chunk-ZLLER3HP.js";import{Args as o,Flags as e}from"@oclif/core";var i=class extends r{static{t(this,"EvalOptimizeCommand")}static description="Retired optimization workflow; use canonical experiments";static examples=["<%= config.bin %> evals run <target-id>"];static args={targetId:o.string({description:"Eval target ID",required:!0})};static flags={auto:e.boolean({description:"Skip interactive review, apply suggestions automatically",default:!1}),"max-iterations":e.integer({description:"Maximum optimization iterations",default:5}),threshold:e.string({description:"Stop if pass rate reaches this threshold (0-1)",default:"0.95"}),model:e.string({description:"Model for eval execution"}),"analyzer-model":e.string({description:"Model for analysis/suggestions"}),timeout:e.integer({description:"Timeout per eval in ms",default:12e4})};async run(){this.error("This optimization workflow is retired. Use evals run for recorded experiments; review and edit target content explicitly.")}};export{i as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as w,c as $}from"../../chunk-G2MRNA45.js";import{b as v}from"../../chunk-
|
|
1
|
+
import{b as w,c as $}from"../../chunk-G2MRNA45.js";import{b as v}from"../../chunk-UQJNUESP.js";import"../../chunk-FLXWL4F4.js";import"../../chunk-V6L25LFD.js";import"../../chunk-GWQ24FQP.js";import"../../chunk-PPAHIVG5.js";import"../../chunk-CT7FWSIU.js";import"../../chunk-5MXZJWQS.js";import"../../chunk-K4LO27GG.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-FLP6WIJV.js";import"../../chunk-JP6ULOEX.js";import"../../chunk-SVZYRGO5.js";import"../../chunk-WULEBQPI.js";import"../../chunk-GPBN4ROE.js";import"../../chunk-6XTLP2G7.js";import"../../chunk-PJ3WHQ67.js";import{a as f}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as d,f as p,h}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Args as P,Flags as y}from"@oclif/core";var c=a(s=>s==null?"n/a":`${Math.round(s*100)}%`,"pct"),g=class s extends f{static{a(this,"EvalRefineCases")}static description="Retire non-discriminating eval cases and regenerate discriminating replacements (\xA76e)";static examples=["<%= config.bin %> evals refine-cases <target-id> # preview","<%= config.bin %> evals refine-cases <target-id> --yes # apply: retire + regenerate","<%= config.bin %> evals refine-cases <target-id> --yes --no-generate"];static args={targetId:P.string({description:"Eval target ID",required:!0})};static flags={yes:y.boolean({char:"y",description:"Apply (retire + regenerate). Without this, only previews."}),"no-generate":y.boolean({description:"Retire dead cases but do not regenerate replacements."})};async run(){let{args:b,flags:l}=await this.parse(s);this.requireAuth();let n=b.targetId,o=await d(`/api/eval-targets/${n}`),m=await d(`/api/eval-targets/${n}/judge-calibration`),i=m.caseDiscrimination,t=w(i);if(this.log(`Target "${o.name}" v${o.version} \u2014 judge ${m.judge.currentModel??"(unstamped)"}`),t.refused==="no-discrimination-data"){this.log("No case-discrimination data yet \u2014 run some evals with AND without the target first (`evals run` / the web Run Evals button), then refine.");return}if(this.log(`${i.total} diagnosable case(s): ${i.discriminating} discriminate, ${i.nonDiscriminating} flat/wrong-sign, ${i.unpaired} unpaired.`),t.refused==="all-discriminating"){this.log("Every case discriminates \u2014 nothing to retire. \u{1F389}");return}let C=i.cases.filter(e=>!e.discriminating),u=new Set(t.retire.map(e=>e.evalId));this.log(`
|
|
2
2
|
Would retire ${t.retire.length} non-discriminating case(s):`);for(let e of C)u.has(e.evalId)&&this.log(` \u2717 ${e.name} \u2014 ${c(e.withPassRate)} with vs ${c(e.withoutPassRate)} without (\u0394${(e.separation*100).toFixed(0)}pp) \u2014 ${e.note}`);for(let e of i.unpairedCases)u.has(e.evalId)&&this.log(` \u2717 ${e.name} \u2014 ${c(e.withPassRate)} with vs ${c(e.withoutPassRate)} without \u2014 unpaired`);if(t.replacementsRequired&&this.log(`
|
|
3
3
|
${t.summary}. Replacements are generated and created BEFORE anything is retired \u2014 a target left under the floor drops out of the nightly evolution rotation with no error anywhere.`),!l.yes){this.log(`
|
|
4
4
|
Preview only. Re-run with --yes to retire ${t.retire.length} case(s)${l["no-generate"]?"":" and generate replacements"}.`);return}let r=await $(t,{generate:a(e=>l["no-generate"]?Promise.resolve([]):v({content:o.content,name:o.name,feedback:e}),"generate"),createCase:a(e=>p(`/api/eval-targets/${n}/evals`,{name:e.name,prompt:e.prompt,expectations:e.expectations}),"createCase"),retireCase:a(async(e,R)=>{await h(`/api/eval-targets/${n}/evals/${e}`,{retire:!0,retiredReason:R})},"retireCase"),log:a(e=>this.log(e),"log")});if(r.skipped==="no-llm-backend"){this.warn(r.summary+" Install the `claude` CLI (or set ANTHROPIC_API_KEY), then run `evals refine-cases` again.");return}if(r.skipped==="no-replacements-generated"){this.warn(r.summary);return}this.log(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"../../chunk-
|
|
1
|
+
import{a as s}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as n}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Args as d,Flags as r}from"@oclif/core";var t=class o extends s{static{a(this,"EvalRunCommand")}static description="Queue an experiment against a target using the configured worker";static examples=["<%= config.bin %> evals run <target-id>","<%= config.bin %> evals run <target-id> --parallel 3 --runs-per-eval 2","<%= config.bin %> evals run <target-id> --skip-baseline --skip-grading"];static args={targetId:d.string({description:"Eval target ID",required:!0})};static flags={parallel:r.integer({description:"Number of parallel eval executions",default:1}),"runs-per-eval":r.integer({description:"Number of runs per eval for variance analysis",default:1}),iteration:r.integer({description:"Iteration number for tracking",default:1}),"skip-baseline":r.boolean({description:"Skip baseline (without_target) runs",default:!1}),"skip-grading":r.boolean({description:"Skip LLM grading step",default:!1}),model:r.string({description:"Model for eval execution (default: user configured)"}),"grader-model":r.string({description:"Model for grading (default: same as execution model)"}),timeout:r.integer({description:"Timeout per eval in ms",default:12e4})};async run(){let{args:l,flags:e}=await this.parse(o);this.requireAuth();let i=await n("/api/experiments",{executor:"replay",targetId:l.targetId,config:{parallel:e.parallel,runsPerEval:e["runs-per-eval"],iteration:e.iteration,skipBaseline:e["skip-baseline"],skipGrading:e["skip-grading"],model:e.model,graderModel:e["grader-model"],timeout:e.timeout}});this.log(`Experiment ${i.id} queued (job ${i.jobId}).`),this.log(i.href),i.noLiveWorker&&this.log("Start rulemetric evals agent to execute this experiment.")}};export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,d as m}from"../../chunk-CLPIN7TY.js";import"../../chunk-6UEFCMR2.js";import"../../chunk-3HJT572X.js";import"../../chunk-CDY7TQFZ.js";import"../../chunk-FLP6WIJV.js";import"../../chunk-JP6ULOEX.js";import"../../chunk-SVZYRGO5.js";import"../../chunk-WULEBQPI.js";import"../../chunk-GPBN4ROE.js";import"../../chunk-6XTLP2G7.js";import"../../chunk-PJ3WHQ67.js";import{a as u}from"../../chunk-
|
|
1
|
+
import{c,d as m}from"../../chunk-CLPIN7TY.js";import"../../chunk-6UEFCMR2.js";import"../../chunk-3HJT572X.js";import"../../chunk-CDY7TQFZ.js";import"../../chunk-FLP6WIJV.js";import"../../chunk-JP6ULOEX.js";import"../../chunk-SVZYRGO5.js";import"../../chunk-WULEBQPI.js";import"../../chunk-GPBN4ROE.js";import"../../chunk-6XTLP2G7.js";import"../../chunk-PJ3WHQ67.js";import{a as u}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Args as p,Flags as s}from"@oclif/core";var o=r(n=>n==null?"\u2014":`${(n*100).toFixed(0)}%`,"pct"),g=class n extends u{static{r(this,"EvalValidateJudge")}static description="Score a second model against your human judge-review labels (\xA76g validation pass)";static examples=["<%= config.bin %> evals validate-judge <target-id> # auto-detect installed CLIs","<%= config.bin %> evals validate-judge <target-id> --engine codex --model gpt-5.5","<%= config.bin %> evals validate-judge <target-id> --model claude-sonnet-5 --json","<%= config.bin %> evals validate-judge <target-id> --limit 5 # quick sample"];static args={targetId:p.string({description:"Eval target ID",required:!0})};static flags={model:s.string({description:"Second reviewer model. Default: resolved from your installed tooling (codex: your ~/.codex/config.toml model; claude: a tier that differs from the original judge)."}),engine:s.string({description:"CLI that runs the second reviewer. `auto` prefers your installed codex for a cross-vendor reviewer \u2014 two Claude models share a training lineage, so their agreement overstates independence.",options:["auto","claude","codex"],default:"auto"}),limit:s.integer({description:"Sample only the N most-recently-annotated runs (cost control / smoke)"}),"skip-reviewed":s.boolean({description:"Only re-grade assertions this reviewer model has not ruled on yet",default:!1}),parallel:s.integer({description:"Concurrent re-grades",default:3}),timeout:s.integer({description:"Timeout per re-grade in ms",default:12e4}),json:s.boolean({description:"Emit the full report as JSON"})};async run(){let{args:h,flags:i}=await this.parse(n);this.requireAuth();let a;try{a=await m({targetId:h.targetId,engineFlag:i.engine,modelFlag:i.model,limit:i.limit,parallel:i.parallel,timeoutMs:i.timeout,skipReviewed:i["skip-reviewed"],log:r(t=>this.log(t),"log"),warn:r(t=>this.warn(t),"warn")})}catch(t){throw t instanceof c&&this.error(t.message),t}let{report:e,judgeModels:l,reviewerModel:d}=a;if(l.length===1&&l[0]===d&&this.warn(`Second reviewer resolved to the SAME model as the original judge (${l[0]}) \u2014 this measures self-consistency, not independent review.`),i.json){this.log(JSON.stringify({target:a.targetName,judgeA:l,judgeB:d,persisted:a.persisted,alreadyReviewed:a.alreadyReviewed,...e},null,2));return}if(e.pairs===0&&a.alreadyReviewed>0){this.log(`All ${a.alreadyReviewed} labeled assertion(s) already reviewed by ${d} \u2014 nothing new to grade.`);return}if(this.log(""),this.log(`Second reviewer: ${d} \u2014 scored against ${e.pairs} human-labeled assertion(s)`+(e.skipped?` (${e.skipped} skipped)`:"")),this.log(""),this.log(` reviewer vs HUMAN: ${o(e.bVsHuman.overall.rate)} overall \xB7 ${o(e.bVsHuman.onJudgePass.rate)} where judge passed \xB7 ${o(e.bVsHuman.onJudgeFail.rate)} where judge failed`),this.log(` original judge vs human: ${o(e.aVsHuman.overall.rate)} (your approve rate)`),this.log(` reviewer vs judge: ${o(e.bVsA.overall.rate)} (inter-model, not truth)`),this.log(` Cohen's \u03BA (reviewer vs human): ${e.kappaBvsHuman==null?"undefined (degenerate marginals)":e.kappaBvsHuman.toFixed(2)}`),this.log(""),e.suggestedAnchorWeight!=null&&this.log(` suggested \xA76g anchor weight if used as a passive label source: ${e.suggestedAnchorWeight.toFixed(2)} (misclassification attenuation (2\xB7acc\u22121)\xB2; validated:false either way)`),e.disagreements.length>0){this.log(""),this.log(` ${e.disagreements.length} disagreement(s) with your labels \u2014 flagged on the Review tab:`);for(let t of e.disagreements.slice(0,10))this.log(` run ${t.runId.slice(0,8)} #${t.expectationIndex}: human=${t.humanPassed?"pass":"fail"} reviewer=${t.judgeBPassed?"pass":"fail"} \u2014 ${t.text.slice(0,80)}`);e.disagreements.length>10&&this.log(` \u2026 and ${e.disagreements.length-10} more (use --json for all)`)}}};export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as n}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as a}from"@oclif/core";var e=class l extends r{static{o(this,"ExperimentAdmissions")}static description="Show automatic captured-task admission, exclusions and experiment links";static flags={project:a.string({description:"Canonical project checkout path"}),offset:a.integer({min:0,default:0,description:"Receipt pagination offset"})};async run(){let{flags:i}=await this.parse(l);this.requireAuth();let t=await n("/api/experiments/admissions?"+new URLSearchParams({projectPath:i.project??process.cwd(),offset:String(i.offset)}));this.log(`Captured-task admissions: ${t.admissions.length} shown / ${t.total} total`);for(let s of t.admissions)this.log(`${s.status}: ${s.id} \u2014 captured session ${s.sessionId??"removed"}`),s.reason&&this.log(` ${s.reason}`),s.experimentId&&this.log(` Evidence: /evaluations/experiment/${s.experimentId}`);t.nextOffset!==null&&this.log(`More receipts: --offset ${t.nextOffset}`)}};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"../../chunk-MODXEGCU.js";import{a as c}from"../../chunk-
|
|
1
|
+
import{a as p}from"../../chunk-MODXEGCU.js";import{a as c}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as a}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Flags as e}from"@oclif/core";import{readFileSync as f}from"node:fs";function m(o,i,t,r){if(!i.trim())throw new Error("A task family is required.");if(!t.trim()||t.length>32e3)throw new Error("Supply a fresh work request between 1 and 32000 characters.");return{tool:"claude_code",config:{projectPath:p(o),studyTaskFamily:i.trim(),prompt:t.trim(),mode:"headless",...r?{model:r}:{}}}}s(m,"freshTaskLaunch");var n=class o extends c{static{s(this,"ExperimentsEnroll")}static description="Submit a fresh work request to an eligible project experiment";static examples=["<%= config.bin %> experiments enroll --project /repo --family parser-repair --prompt-file task.txt"];static flags={project:e.string({char:"p",description:"Project path (defaults to current directory)"}),family:e.string({required:!0,description:"Task family shown by the waiting experiment"}),"prompt-file":e.string({required:!0,description:"UTF-8 file containing a real, fresh work request"}),model:e.string({description:"Optional model constraint; must match the experiment pin"})};async run(){let{flags:i}=await this.parse(o);this.requireAuth();let t=m(i.project??process.cwd(),i.family,f(i["prompt-file"],"utf8"),i.model),r=await a("/api/launch-jobs",t);this.log(`Queued fresh task: ${r.id}`),r.config.scopedConfirmation&&this.log(`Experiment ${r.config.scopedConfirmation.id}; task ${r.config.scopedConfirmation.taskId}`),r.noLiveWorker&&this.log("Waiting for a compatible worker. See RuleMetric activity for progress."),this.log(`Activity: /loop/jobs/launch-job/${r.id}`)}};export{n as default,m as freshTaskLaunch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f}from"../../chunk-MODXEGCU.js";import{a as
|
|
1
|
+
import{a as p,b as d,c as g,d as f,e as b,g as h,h as x}from"../../chunk-LAJ4RBRB.js";import{a as m}from"../../chunk-MODXEGCU.js";import{a as u}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as l}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{Flags as v}from"@oclif/core";import{printTable as P}from"@oclif/table";import{z as e}from"zod";var n=p,O=n.options,y={positive:"improved",negative:"worsened",not_useful:"no_useful_difference"},E=d,U=e.object({source:n.optional(),outcome:e.preprocess(t=>typeof t=="string"?y[t]??t:t,g.optional()),status:E.optional(),search:e.string().trim().max(200).default(""),project:e.string().max(4096).optional(),offset:e.coerce.number().int().min(0).max(1e6).default(0),limit:e.coerce.number().int().min(1).max(100).default(25)}),A=e.object({id:e.string(),source:n,name:e.string(),projectPath:e.string().nullable(),targetId:e.string().nullable(),createdAt:e.string(),finishedAt:e.string().nullable(),status:E,result:f.nullable(),applicationCounts:h,model:e.string().nullable(),engine:e.string().nullable(),evidenceScope:e.string(),href:e.string()}).strict(),S=e.object({rows:e.array(A),total:e.number(),nextOffset:e.number().nullable(),counts:e.object({all:e.number(),improved:e.number(),running:e.number(),failed:e.number()}).strict()}).strict(),_=e.object({id:e.string(),source:e.enum(["harbor","target"]),name:e.string(),description:e.string(),projectPath:e.string().nullable(),cases:e.number(),plannedCalls:e.number().nullable(),href:e.string(),runnable:e.boolean(),blockedReason:e.string().nullable(),schedule:e.string()}).strict(),C=e.object({suites:e.array(_),total:e.number(),nextOffset:e.number().nullable()}).strict(),L=e.discriminatedUnion("source",[e.object({source:e.literal("harbor"),id:e.string().min(1).max(100)}).strict(),e.object({source:e.literal("target"),id:e.string().uuid()}).strict(),e.object({source:e.literal("study"),id:e.string().uuid()}).strict()]);var o=class t extends u{static{c(this,"ExperimentsList")}static description="List experiments with execution, metric finding, and application separately";static examples=["<%= config.bin %> experiments list","<%= config.bin %> experiments list --all"];static flags={project:v.string({char:"p",description:"Project path (defaults to current directory)"}),all:v.boolean({description:"Every project",default:!1})};async run(){let{flags:s}=await this.parse(t);this.requireAuth();let a=new URLSearchParams({limit:"50"});s.all||a.set("project",m(s.project??process.cwd()));let r=S.parse(await l(`/api/evaluations?${a}`));if(!r.rows.length){this.log("No experiments found.");return}P({data:r.rows.map(i=>({Experiment:i.name,Execution:i.status,Metric:i.result?.metrics.find(j=>j.key===i.result?.primaryMetric)?.label??"Unassessed",Finding:b(i.result??null).replaceAll("_"," "),Actions:x(i.applicationCounts)})),columns:["Experiment","Execution","Metric","Finding","Actions"]}),this.log(`Showing ${r.rows.length} of ${r.total} experiments. Findings describe the named metric; application requires its own receipt.`)}};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"../../chunk-YUSY3IHE.js";import{f as x}from"../../chunk-LAJ4RBRB.js";import{b as g,h}from"../../chunk-4K3MVOVQ.js";import{a as f}from"../../chunk-6XTLP2G7.js";import"../../chunk-PJ3WHQ67.js";import{a as m}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as p,f as l}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{Args as b,Flags as i}from"@oclif/core";import{execFileSync as I}from"node:child_process";import{createHash as w}from"node:crypto";var o=class v extends m{static{c(this,"ExperimentsReuse")}static description="Run selected previously measured fixture tasks with a new bounded exploratory budget";static args={id:b.string({required:!0,description:"Completed source experiment UUID"})};static flags={task:i.string({required:!0,multiple:!0,description:"Source task ID to reuse (repeat for multiple tasks)"}),reason:i.string({required:!0,description:"Why this additional exploratory execution is useful (at least 20 characters)"}),"request-id":i.string({description:"Explicit UUID for a new budget; identical arguments otherwise recover the same request"})};async run(){let{args:y,flags:r}=await this.parse(v);this.requireAuth();let e=x.parse(await p(`/api/experiments/${encodeURIComponent(y.id)}`));(e.executor!=="fixture"||e.status!=="completed")&&this.error("Choose a completed fixture experiment.");let s=h.parse(e.protocol);for(let u of r.task){let d=s.tasks.find(q=>q.taskId===u);d||this.error(`Source task not found: ${u}`),g(d)}let a=f("claude");a||this.error("Claude is required for fixture execution.");let n=k(e.id,{sourceProtocolHash:w("sha256").update(JSON.stringify(s)).digest("hex"),taskIds:r.task,rationale:r.reason,harnessVersion:I(a,["--version"],{encoding:"utf8",timeout:1e4}).trim(),requestId:r["request-id"]});this.log(`Request ${n.requestId}: previously exposed tasks, exploratory only; no automatic adoption.`);let t=await l(`/api/experiments/${e.id}/reuse`,n);this.log(`${t.existing?"Recovered existing":"Queued"} experiment ${t.id}; job ${t.jobId}`),t.noLiveWorker&&this.log("Waiting for a compatible worker."),this.log(`Evidence: ${t.href}`)}};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as y,c as h}from"../../chunk-NVABG3AO.js";import{e,i as p,k as m,m as f}from"../../chunk-QWCEZEDO.js";import"../../chunk-KKDHD4XA.js";import{b as d,d as u}from"../../chunk-SZ62CP55.js";import{B as l,E as g}from"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{a as c}from"../../chunk-
|
|
1
|
+
import{b as y,c as h}from"../../chunk-NVABG3AO.js";import{e,i as p,k as m,m as f}from"../../chunk-QWCEZEDO.js";import"../../chunk-KKDHD4XA.js";import{b as d,d as u}from"../../chunk-SZ62CP55.js";import{B as l,E as g}from"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{a as c}from"../../chunk-4EGU65H4.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{spawn as S}from"node:child_process";import{existsSync as v,readFileSync as R,statSync as C,writeFileSync as M}from"node:fs";import{homedir as T}from"node:os";import{join as o}from"node:path";var s=o(T(),".config","rulemetric"),x=o(s,"proxy-addon.version"),_=o(s,"proxy.pid"),w=o(s,"proxy-drift-restart.at"),E=10*6e4,n=class P extends c{static{a(this,"GatewayEnsure")}static description="Ensure the gateway proxy is running (called by hooks, not for direct use)";static hidden=!0;async run(){await this.parse(P),this.maybeRestartStaleProxy();let t=await p(e);if(t.status==="ours-live"){let r=h(i=>{i==="vscode"?l(e):g(e)});r.length>0&&console.error(`[RuleMetric] Gateway healthy again \u2014 restored ${r.join(", ")} proxy settings.`);return}if(t.status==="foreign"){if(m())return;let r=y(e);console.error(`[RuleMetric] A non-RuleMetric process holds :${e} \u2014 cannot start gateway. `+(r.length>0?`Unpinned ${r.join(", ")} proxy settings so editors are not routed through it. `:"")+"Run `rulemetric diagnostics` if Claude Code HTTPS requests fail.");return}try{f(this.config.version)}catch(r){console.error(`[RuleMetric] Could not start gateway: ${r.message}`)}}maybeRestartStaleProxy(){try{if(!v(x))return;let t=R(x,"utf-8").trim();if(!t||t===this.config.version)return;let r=R(_,"utf-8").trim(),i=Number(r);if(!Number.isFinite(i)||!u(i,d))return;try{if(Date.now()-C(w).mtimeMs<E)return}catch{}M(w,new Date().toISOString()),S(process.execPath,[process.argv[1],"proxy","restart"],{detached:!0,stdio:"ignore"}).unref(),console.error(`[RuleMetric] Capture proxy is running CLI ${t} but ${this.config.version} is installed \u2014 restarting it in the background.`)}catch{}}};export{n as default};
|