@rulemetric/cli 0.7.36 → 0.7.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-C5PSIJ7S.js → chunk-5KP66L7P.js} +1 -1
- package/dist/{chunk-TVHT6H42.js → chunk-7SI6KWSX.js} +1 -1
- package/dist/chunk-GIRPEMTW.js +1 -0
- package/dist/chunk-GPTPK6QX.js +38 -0
- package/dist/{chunk-6NML7IVJ.js → chunk-IYDADY62.js} +1 -1
- package/dist/chunk-SNJ2NIIE.js +1 -0
- package/dist/commands/evals/agent.js +1 -1
- package/dist/lib/agent-loop.js +1 -1
- package/dist/lib/detect-languages.js +1 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +1 -1
- package/dist/lib/handlers/process-changelog.js +1 -1
- package/dist/lib/handlers/process-insights.js +1 -1
- package/dist/lib/manual-tasks.js +1 -1
- package/oclif.manifest.json +338 -338
- package/package.json +6 -6
- package/dist/chunk-DKGKOSW3.js +0 -1
- package/dist/chunk-TDD7IOV2.js +0 -1
- package/dist/chunk-ZL4MZMUK.js +0 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as m,e as p}from"./chunk-GPTPK6QX.js";import{a as C}from"./chunk-N7TGRFVZ.js";import{f as c,i as f}from"./chunk-JGLVVIEM.js";import{a as r}from"./chunk-ZLLER3HP.js";import*as a from"node:fs/promises";import*as g from"node:path";import{eq as b}from"drizzle-orm";async function v(e){let n=e;for(let t=0;t<50;t++){try{return await a.stat(g.join(n,"pnpm-workspace.yaml")),n}catch{}let i=g.dirname(n);if(i===n)return null;n=i}return null}r(v,"findRepoRoot");async function k(e){if(e)try{return await a.readFile(e,"utf-8")}catch{return null}let n=await v(process.cwd())??process.cwd(),t=g.join(n,"CHANGELOG.md");try{return await a.readFile(t,"utf-8")}catch{return null}}r(k,"readChangelog");var _="https://rulemetric.com";function D(e){let n=e.date??new Date().toISOString().slice(0,10),t=C({version:e.version,date:n,sections:e.sections,unsubscribeUrl:"{{unsubscribe_url}}",recipientName:"{{recipient_name}}",productUrl:_});return{version:e.version,releaseDate:n,subject:t.subject,htmlBody:t.html,textBody:t.text,sections:e.sections}}r(D,"renderRow");async function R(e={}){let n=e.db??f(),t=e.logger??{info:r(s=>console.log(s),"info"),warn:r(s=>console.warn(s),"warn")},i=await k(e.changelogPath);if(i===null)return t.info("[cron_check_changelog] CHANGELOG.md not found; nothing to do"),{createdCount:0,skippedCount:0};let y=m(i),h=p(y);if(h.length===0)return t.info("[cron_check_changelog] No announceable entries; nothing to do"),{createdCount:0,skippedCount:0};let d=0,l=0;for(let s of h){if((await n.select({id:c.id}).from(c).where(b(c.version,s.version)).limit(1)).length>0){l++;continue}let o=D(s);try{await n.insert(c).values({version:o.version,releaseDate:o.releaseDate,subject:o.subject,htmlBody:o.htmlBody,textBody:o.textBody,sections:o.sections,status:"draft"}),d++,t.info(`[cron_check_changelog] Created draft announcement for ${o.version}`)}catch(u){let w=u instanceof Error?u.message:String(u);if(/duplicate key|unique/i.test(w)){l++;continue}throw u}}return t.info(`[cron_check_changelog] Done: created ${d}, skipped ${l}`),{createdCount:d,skippedCount:l}}r(R,"processChangelog");export{R as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as S,b as z,c as T}from"./chunk-QFVGUZDO.js";import{a as j}from"./chunk-5RBLIVBF.js";import{a as O}from"./chunk-
|
|
1
|
+
import{a as S,b as z,c as T}from"./chunk-QFVGUZDO.js";import{a as j}from"./chunk-5RBLIVBF.js";import{a as O}from"./chunk-GPTPK6QX.js";import{c as A,d as C,f as b}from"./chunk-B3BHB26P.js";import{e as _,f as I,h as u}from"./chunk-H2ORWIEY.js";import{a as $}from"./chunk-ZLLER3HP.js";async function D(f,m){let{mirrorId:o,projectPath:s,projectId:i,config:p}=f,e=$(n=>m.logger.info(n),"log");if(p?.sessionId)return M({mirrorId:o,sessionId:p.sessionId},e);e(`Processing insights job ${o}...`),await u(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"reading_data"}});try{let{repaired:n}=await I("/api/sessions/repair-analyzed-at",{});n>0&&e(` Repaired analyzed_at on ${n} orphan session(s).`)}catch(n){e(` Warning: analyzed_at repair failed: ${n instanceof Error?n.message:String(n)}`)}let a=await J(s,i);if(!a)throw new j("No session data found \u2014 ensure sessions are captured and enriched.");e(` Found ${a.stats.sessions} sessions, generating recommendations...`);let w=20,c=200;if(C()!=="none"){let n=0,t=0;try{for(;n<c;){let l=await _(`/api/sessions?hasAnalysis=false&limit=${w}&offset=${t}`);if(l.length===0)break;e(` Generating facets for ${l.length} un-analyzed sessions (drained ${n} so far)...`);for(let g of l){if(n>=c)break;try{let d=await _(`/api/sessions/${g.id}/events?limit=100`);if(d.length<2){n++,t++;continue}let P=d.filter(h=>h.eventType==="user_message"||h.eventType==="human").map(h=>h.content?.slice(0,200)??"").filter(Boolean).join(`
|
|
2
2
|
---
|
|
3
3
|
`);if(!P){n++,t++;continue}let E=await b(T,P,4096);if(E){let h=d.filter(R=>R.eventType==="user_message"||R.eventType==="human").length;await u(`/api/sessions/${g.id}/enrich`,{analysis:{source:"generated_facets",...E},analyzedEventCount:d.length,analyzedTurnCount:h}),e(` Generated facets for session ${g.id} (${g.tool})`)}else t++;n++}catch(d){e(` Failed to generate facets for session ${g.id}: ${d instanceof Error?d.message:String(d)}`),n++,t++}}if(l.length<w)break}}catch(l){e(` Warning: facet generation failed after ${n} sessions: ${l instanceof Error?l.message:String(l)}`)}}let r={},y=S.length+1;for(let n=0;n<S.length;n++){let t=S[n];e(` [${n+1}/${y}] Generating ${t.name}...`);try{await u(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:t.name,current:n+1,total:y,partial:{...r}}})}catch(g){e(` Warning: progress update failed for ${t.name}: ${g instanceof Error?g.message:String(g)}`)}e(` Running LLM prompt for ${t.name}...`);let l=await b(t.prompt,a.summary,t.maxTokens);l?(r[t.name]=l,e(` Got result for ${t.name}`)):e(` No result for ${t.name} (LLM returned null)`)}e(` [${y}/${y}] Generating at_a_glance...`),await u(`/api/insights-jobs/${o}/progress`,{status:"running",progress:{step:"at_a_glance",current:y,total:y,partial:{...r}}});let N=[a.summary,r.what_works?`
|
|
4
4
|
## What Works
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-ZLLER3HP.js";import{existsSync as h,statSync as y,readdirSync as m}from"node:fs";import g from"node:path";var l=new Set(["node_modules",".git","dist","build",".next",".turbo",".worktrees","target","venv","__pycache__",".cache","Library","Applications","Movies","Music","Pictures","Photos"]),p=3,P=1e4;function v(n,u={}){if(!h(n))return[];let t=new Set,a=u.maxEntries??P,d=o((c,r)=>{if(r>p||a<=0)return;let s;try{s=m(c)}catch{return}a-=s.length;for(let e of s)e==="package.json"&&t.add("JavaScript/TypeScript"),e==="tsconfig.json"&&t.add("TypeScript-config"),e==="pyproject.toml"&&t.add("Python-pyproject"),e==="setup.py"&&t.add("Python-setup"),e==="requirements.txt"&&t.add("Python-requirements"),e==="Pipfile"&&t.add("Python-pipfile"),e==="Cargo.toml"&&t.add("Rust-cargo"),e==="go.mod"&&t.add("Go-mod"),e==="pom.xml"&&t.add("Java-pom"),(e==="build.gradle"||e==="build.gradle.kts")&&t.add("Java-gradle"),e==="Gemfile"&&t.add("Ruby-gemfile"),e==="composer.json"&&t.add("PHP-composer"),(e.endsWith(".ts")||e.endsWith(".tsx"))&&t.add("TypeScript-source"),e.endsWith(".py")&&t.add("Python-source"),e.endsWith(".rs")&&t.add("Rust-source"),e.endsWith(".go")&&t.add("Go-source");if(!(r>=p))for(let e of s){if(a<=0)return;if(l.has(e)||e.startsWith("."))continue;let f=g.join(c,e);try{y(f).isDirectory()&&d(f,r+1)}catch{}}},"walk");d(n,0);let i=new Set;return t.has("TypeScript-source")||t.has("TypeScript-config")?i.add("TypeScript"):t.has("JavaScript/TypeScript")&&i.add("JavaScript"),(t.has("Python-pyproject")||t.has("Python-setup")||t.has("Python-requirements")||t.has("Python-pipfile")||t.has("Python-source"))&&i.add("Python"),(t.has("Rust-cargo")||t.has("Rust-source"))&&i.add("Rust"),(t.has("Go-mod")||t.has("Go-source"))&&i.add("Go"),(t.has("Java-pom")||t.has("Java-gradle"))&&i.add("Java"),t.has("Ruby-gemfile")&&i.add("Ruby"),t.has("PHP-composer")&&i.add("PHP"),t.size<2?[]:[...i]}o(v,"detectLanguages");export{P as a,v as b};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{a as e}from"./chunk-ZLLER3HP.js";function b(n){if(!n||typeof n!="object")return n;let c=n,r=c.project_areas;if(r!==void 0&&!Array.isArray(r)){let o=r&&typeof r=="object"?r.areas:void 0;c.project_areas=Array.isArray(o)?o:void 0}return n}e(b,"normalizeRecommendations");import{z as i}from"zod";var w=["org","team","project","personal"],v=i.object({name:i.string().min(1),description:i.string().min(1),type:i.literal("instruction").default("instruction"),scope:i.enum(w),version:i.string().min(1),tags:i.array(i.string()).optional(),compatibility:i.array(i.string()).optional(),slots:i.record(i.string(),i.string()).optional(),metadata:i.record(i.string(),i.unknown()).optional()});import{z as a}from"zod";var y=a.object({name:a.string().min(1),description:a.string().min(1),type:a.literal("prompt"),version:a.string().min(1),tags:a.array(a.string()).optional(),variables:a.array(a.string()).optional(),metadata:a.record(a.string(),a.unknown()).optional()});function f(n,c){let r=c.map(o=>`- ID: ${o.id}
|
|
2
|
+
Name: ${o.name}
|
|
3
|
+
Description: ${o.description}
|
|
4
|
+
Tags: ${o.tags.join(", ")}
|
|
5
|
+
Preview: ${o.contentPreview}`).join(`
|
|
6
|
+
|
|
7
|
+
`);return`You are an expert at matching AI coding instructions to software projects.
|
|
8
|
+
|
|
9
|
+
## Project
|
|
10
|
+
- Name: ${n.name}
|
|
11
|
+
- Description: ${n.description??"No description"}
|
|
12
|
+
- Languages: ${n.languages.join(", ")||"Unknown"}
|
|
13
|
+
- Topics: ${n.topics.join(", ")||"None"}
|
|
14
|
+
- Dependencies: ${n.dependencies.join(", ")||"None"}
|
|
15
|
+
|
|
16
|
+
## Available Instructions
|
|
17
|
+
|
|
18
|
+
${r}
|
|
19
|
+
|
|
20
|
+
## Task
|
|
21
|
+
|
|
22
|
+
Analyze the project and recommend which instructions would be most useful. Consider:
|
|
23
|
+
1. Language and framework alignment
|
|
24
|
+
2. Project purpose and what standards/practices would help
|
|
25
|
+
3. Security, testing, and quality needs based on the project type
|
|
26
|
+
|
|
27
|
+
Return your response as JSON in this exact format:
|
|
28
|
+
{
|
|
29
|
+
"recommendations": [
|
|
30
|
+
{ "instructionId": "<id>", "score": <0.0-1.0>, "reason": "<one sentence explanation>" }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Only include instructions with a relevance score >= 0.5. Order by score descending. Return valid JSON only, no markdown fences.`}e(f,"buildRecommendationPrompt");var x=32e3,k={name:"x".repeat(64),description:"x".repeat(256),languages:["TypeScript","Python","Go"],topics:["x".repeat(32)],dependencies:["x".repeat(32)]};function _(n,c={}){if(n.length===0)return[];let r=c.charBudget??x,o=f(k,[]).length,l=[],s=[],d=0;for(let u of n){let p=T(u);s.length>0&&o+d+p>r&&(l.push(s),s=[],d=0),s.push(u),d+=p}return s.length>0&&l.push(s),l}e(_,"batchCandidatesForPrompt");function T(n){return`- ID: ${n.id}
|
|
35
|
+
Name: ${n.name}
|
|
36
|
+
Description: ${n.description}
|
|
37
|
+
Tags: ${n.tags.join(", ")}
|
|
38
|
+
Preview: ${n.contentPreview}`.length+2}e(T,"renderedSize");var C=["Added","Changed","Fixed","Removed","Deprecated","Security"],S=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,I=/^###\s+(.+?)\s*$/,P=/^[-*]\s+(.*\S)\s*$/,L=/^ {2,}(\S.*)$/;function O(n){let c=n.split(/\r?\n/),r=[],o=null,l=null,s=null;for(let d of c){let u=d.match(S);if(u){o&&r.push(o);let m=u[1].trim();o={version:m,date:u[2]??null,unreleased:m.toLowerCase()==="unreleased",sections:{}},l=null,s=null;continue}if(!o)continue;let p=d.match(I);if(p){let m=p[1].trim();C.includes(m)?(l=m,o.sections[l]||(o.sections[l]=[]),s=o.sections[l]):(l=null,s=null);continue}if(!l||!s)continue;let h=d.match(P);if(h){s.push(h[1]);continue}let g=d.match(L);if(g&&s.length>0){s[s.length-1]+=" "+g[1].trim();continue}}return o&&r.push(o),{entries:r}}e(O,"parseChangelog");function j(n){return n.entries.filter(c=>c.unreleased?!1:Object.values(c.sections).some(r=>r&&r.length>0))}e(j,"announceableEntries");import ue from"gray-matter";import{z as R}from"zod";var he=R.object({type:R.enum(["instruction","prompt"])});export{b as a,f as b,_ as c,O as d,j as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as C}from"./chunk-TIOKY2IA.js";import{a as H}from"./chunk-ZYVWALMS.js";import{a as A}from"./chunk-NKPLTT7J.js";import{a as E}from"./chunk-HUADECKZ.js";import{a as I}from"./chunk-
|
|
1
|
+
import{c as C}from"./chunk-TIOKY2IA.js";import{a as H}from"./chunk-ZYVWALMS.js";import{a as A}from"./chunk-NKPLTT7J.js";import{a as E}from"./chunk-HUADECKZ.js";import{a as I}from"./chunk-7SI6KWSX.js";import{a as x}from"./chunk-H7J27U4P.js";import{b as S}from"./chunk-BUWWFHGO.js";import{a as M}from"./chunk-IQTSUAGM.js";import{a as L}from"./chunk-CRIFP3QP.js";import{a as y}from"./chunk-RSKQRVPJ.js";import{a as P}from"./chunk-SWSGNEVO.js";import{a as N}from"./chunk-BPQ66YTY.js";import{a as k}from"./chunk-UF6US7VU.js";import{b as _}from"./chunk-SNJ2NIIE.js";import{b as R}from"./chunk-IXLDCX7M.js";import{a as T}from"./chunk-JIJKIPE6.js";import{b as h}from"./chunk-5RBLIVBF.js";import{j as b}from"./chunk-ZYI66XKV.js";import{d as w}from"./chunk-NTKO4H2K.js";import{b as f,e as v,f as p}from"./chunk-H2ORWIEY.js";import{a as s}from"./chunk-ZLLER3HP.js";var W={process_eval:E,process_insights:I,process_launch:S,process_send_message:y,process_conversation:A,process_session_goal:H,distill_memories:R,memory_ab:M,process_announcement:T,process_run_cleanup:L,cron_suggest_instructions:_,cron_refresh_skills:k,cron_refresh_pricing:N,cron_eval_autorun:P,cron_instruction_evolution:b,process_judge_review:x},D=Object.keys(W),F=new Set(["process_announcement","process_run_cleanup","memory_ab"]);function J(e=process.env){return e.DATABASE_URL?D:D.filter(n=>!F.has(n))}s(J,"availableCapabilities");var U=3e4,K=3e4,G=3e4,V=250,B=5e3,q=`thin-agent-${process.pid}`,g=null;function Q(e,n,r,l){let c;try{let d=w();c={claude:d.claudeBin!=null,codex:d.codexBin!=null,codexModel:d.codexConfiguredModel}}catch{}let i=s(d=>{p("/api/workers/heartbeat",{workerType:"cli-worker",clientName:q,clientVersion:l,workerVersion:"0.1.0",currentJobId:null,inFlightCount:0,lastError:null,status:d,metadata:{capabilities:e,mode:"thin-agent",llmEngines:c}}).then(u=>{let t=u?.advisory;t&&t.message!==g?(g=t.message,a(r,{event:"worker_advisory",code:t.code,message:t.message})):t||(g=null)}).catch(u=>{a(r,{event:"presence_heartbeat_error",error:u instanceof Error?u.message:String(u)})})},"send");i("alive");let o=setInterval(()=>i("alive"),G);n.addEventListener("abort",()=>{clearInterval(o),i("shutting_down")},{once:!0})}s(Q,"startPresenceHeartbeat");function a(e,n){try{e(JSON.stringify({ts:new Date().toISOString(),...n}))}catch{e(`[agent-loop] log_error event=${n.event}`)}}s(a,"structuredLog");function O(e,n){return n.aborted?Promise.resolve(!1):e<=0?Promise.resolve(!0):new Promise(r=>{let l=setTimeout(()=>{n.removeEventListener("abort",c),r(!0)},e),c=s(()=>{clearTimeout(l),n.removeEventListener("abort",c),r(!1)},"onAbort");n.addEventListener("abort",c,{once:!0})})}s(O,"abortableSleep");async function X(e,n){let r=`capabilities=${encodeURIComponent(e.join(","))}&waitMs=${n}`,l=await v(`/api/work/next?${r}`);return l==null||typeof l=="string"?null:l}s(X,"pollForWork");function z(e,n){return{logger:{info:s(r=>n(r),"info"),warn:s(r=>n(r),"warn"),error:s(r=>n(r),"error")},job:{attempts:e}}}s(z,"makeHelpers");async function Y(e,n,r){let l=W[e.kind],c=Date.now();if(a(r,{event:"claim",jobId:e.id,kind:e.kind,attempts:e.attempts}),!l){let o=`unknown kind: ${e.kind}`;a(r,{event:"fail",jobId:e.id,kind:e.kind,terminal:!0,error:o}),await p(`/api/work/${e.id}/fail`,{leaseToken:e.leaseToken,error:o,terminal:!0}).catch(()=>{});return}let i=setInterval(()=>{a(r,{event:"heartbeat",jobId:e.id}),p(`/api/work/${e.id}/heartbeat`,{leaseToken:e.leaseToken}).catch(o=>{a(r,{event:"heartbeat_error",jobId:e.id,error:o instanceof Error?o.message:String(o)})})},n);try{let o=z(e.attempts,r),d=await l(e.payload,o)??{};clearInterval(i),a(r,{event:"complete",jobId:e.id,kind:e.kind,durationMs:Date.now()-c}),await p(`/api/work/${e.id}/complete`,{leaseToken:e.leaseToken,result:d})}catch(o){clearInterval(i);let d=h(o),u=o instanceof Error?o.message:String(o);a(r,{event:"fail",jobId:e.id,kind:e.kind,durationMs:Date.now()-c,terminal:d,error:u}),await p(`/api/work/${e.id}/fail`,{leaseToken:e.leaseToken,error:u,terminal:d}).catch(t=>{a(r,{event:"fail_post_error",jobId:e.id,error:t instanceof Error?t.message:String(t)})})}}s(Y,"runOne");async function we(e){let n=e.log??(()=>{}),r=e.pollWaitMs??U,l=e.heartbeatIntervalMs??K,c=e.capabilities??J(),i=V;a(n,{event:"agent_start",capabilities:c,pollWaitMs:r,heartbeatIntervalMs:l}),Q(c,e.signal,n,e.version),C({signal:e.signal,log:n}).catch(t=>{a(n,{event:"tt_heartbeat_fatal",error:t instanceof Error?t.message:String(t)})});let o=5*6e4,d=0,u=s(()=>{if(!e.readInstalledVersion||!e.version)return!1;let t=Date.now();if(t-d<o)return!1;d=t;let m=e.readInstalledVersion();return!!(m&&m!==e.version)},"versionDrifted");for(;!e.signal.aborted;){if(u()){a(n,{event:"agent_version_drift",bootVersion:e.version,installedVersion:e.readInstalledVersion?.()??null}),e.onVersionDrift?.();break}let t=null;try{t=await X(c,r)}catch(m){let $=m instanceof f?m.statusCode:void 0;if(a(n,{event:"poll_error",status:$,error:m instanceof Error?m.message:String(m)}),!await O(i,e.signal))break;i=Math.min(i*2,B);continue}if(!t){if(a(n,{event:"poll_204"}),!await O(i,e.signal))break;i=Math.min(i*2,B);continue}i=V,await Y(t,l,n)}a(n,{event:"agent_stop"})}s(we,"runAgentLoop");export{W as a,D as b,J as c,X as d,we as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as E,c as C}from"./chunk-GPTPK6QX.js";import{b as N}from"./chunk-GIRPEMTW.js";import{a as R}from"./chunk-MODXEGCU.js";import{d as I,f as _}from"./chunk-B3BHB26P.js";import{e as c,f as w}from"./chunk-H2ORWIEY.js";import{a as m}from"./chunk-ZLLER3HP.js";import{readFileSync as M,realpathSync as v}from"node:fs";import g from"node:path";import y from"node:os";function O(l){let o=g.resolve(l);if(o===g.resolve(y.homedir()))return!1;let r=g.parse(o).root;if(o===r)return!1;try{let s=v(y.tmpdir());if(v(o)===s)return!1}catch{}return!0}m(O,"isScorableProjectPath");var A=5,F=Number(process.env.RULEMETRIC_MAX_SUGGESTION_PROJECTS??10),H=48,U=.5,S=400;async function B(){let l=g.join(y.homedir(),".config","rulemetric","skills-registry.json");try{let o=M(l,"utf-8"),r=JSON.parse(o);return Date.now()-new Date(r.generatedAt).getTime()>H*60*60*1e3}catch{return!0}}m(B,"checkSkillsRegistryStale");var W=m(async(l,o)=>{let r=I();if(r==="none"){o.logger.warn("No LLM backend available (claude CLI missing and ANTHROPIC_API_KEY unset); skipping suggestion compute");return}o.logger.info(`Scoring backend: ${r}`);let s;try{s=(await c("/api/sessions/project-paths?limit="+F)).projectPaths}catch(e){o.logger.warn(`Failed to fetch project paths: ${e instanceof Error?e.message:String(e)}`);return}if(s.length===0){o.logger.info("No recent project paths; nothing to score");return}let u=new Map;try{let e=await c("/api/projects?limit=200");for(let t of e.projects??[])t.primaryCheckoutPath&&u.set(R(t.primaryCheckoutPath),t.id)}catch(e){o.logger.warn(`Failed to fetch projects for id resolution: ${e instanceof Error?e.message:String(e)}`)}let f=new Map;try{let e=await c(`/api/catalog?limit=200&contentPreview=${S}`);for(let t of e)f.set(t.id,{id:t.id,name:t.name,description:t.description??"",tags:t.tags??[],contentPreview:(t.contentPreview??"").slice(0,S)})}catch(e){o.logger.warn(`Failed to fetch catalog: ${e instanceof Error?e.message:String(e)}`)}try{let e=await c("/api/instructions?limit=100");for(let t of e.instructions??[])f.has(t.id)||f.set(t.id,{id:t.id,name:t.name,description:t.description??"",tags:t.tags??[],contentPreview:(t.content??"").slice(0,S)})}catch(e){o.logger.warn(`Failed to fetch personal instructions: ${e instanceof Error?e.message:String(e)}`)}let d=[...f.values()];if(d.length===0){o.logger.info("No candidate instructions; nothing to score");return}o.logger.info(`Scoring ${d.length} candidates across ${s.length} project(s)`);let j=0;for(let e of s)try{let t=R(e);if(!O(t)){o.logger.info(`Skipping ${t}: not a project directory (home/root)`);continue}let $=N(t);if($.length===0){o.logger.info(`Skipping ${t}: insufficient language signals`);continue}let L={name:g.basename(t),description:null,languages:$,topics:[],dependencies:[]},h=C(d);o.logger.info(`Scoring ${d.length} candidates for ${t} in ${h.length} batch(es)`);let P=[],p=0;for(let n of h)try{let i=await _(E(L,n),"",4096);if(!i){p++;continue}let T=i.recommendations??[];for(let a of T)typeof a.instructionId=="string"&&typeof a.score=="number"&&typeof a.reason=="string"&&P.push({instructionId:a.instructionId,score:a.score,reason:a.reason})}catch(i){p++,o.logger.warn(`Batch failed for ${t}: ${i instanceof Error?i.message:String(i)}`)}if(p>0&&o.logger.warn(`${p}/${h.length} batch(es) failed for ${t} (backend ${r}); suggestions are partial`),P.length===0){o.logger.warn(`No usable LLM output for ${t} (backend ${r})`);continue}let b=P.filter(n=>n.score>=U).sort((n,i)=>i.score-n.score).slice(0,A);if(b.length===0){o.logger.info(`No suggestions over threshold for ${t}`);continue}let k=u.get(t);await w("/api/instruction-suggestions/batch-upsert",{projectPath:t,...k?{projectId:k}:{},suggestions:b.map(n=>({instructionId:n.instructionId,score:n.score,reason:n.reason}))}),j++}catch(t){o.logger.warn(`Failed to score ${e}: ${t instanceof Error?t.message:String(t)}`)}if(await B())try{await w("/api/instruction-suggestions/mark-stale",{}),o.logger.warn("Skills registry is stale (>48h); marked all suggestions stale")}catch{}o.logger.info(`Done: scored ${j}/${s.length} projects`)},"cronSuggestInstructions");export{O as a,W as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as C,b as L,c as D}from"../../chunk-3HSEVXMQ.js";import{e as I}from"../../chunk-
|
|
1
|
+
import{a as C,b as L,c as D}from"../../chunk-3HSEVXMQ.js";import{e as I}from"../../chunk-IYDADY62.js";import"../../chunk-TIOKY2IA.js";import"../../chunk-ZYVWALMS.js";import"../../chunk-NKPLTT7J.js";import"../../chunk-HUADECKZ.js";import"../../chunk-7SI6KWSX.js";import"../../chunk-QFVGUZDO.js";import"../../chunk-H7J27U4P.js";import"../../chunk-BUWWFHGO.js";import"../../chunk-IQTSUAGM.js";import"../../chunk-CRIFP3QP.js";import"../../chunk-MDPN46EY.js";import"../../chunk-RSKQRVPJ.js";import"../../chunk-SWSGNEVO.js";import"../../chunk-BPQ66YTY.js";import"../../chunk-UF6US7VU.js";import"../../chunk-SNJ2NIIE.js";import"../../chunk-IXLDCX7M.js";import"../../chunk-JIJKIPE6.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-GPTPK6QX.js";import"../../chunk-N7TGRFVZ.js";import{j as d}from"../../chunk-JGLVVIEM.js";import"../../chunk-Q4APAZUC.js";import"../../chunk-YQ56FQEO.js";import"../../chunk-GIRPEMTW.js";import"../../chunk-MODXEGCU.js";import"../../chunk-5DIOZDDZ.js";import"../../chunk-4VZLIGMS.js";import"../../chunk-CNOD6HWU.js";import"../../chunk-X64R6JCJ.js";import"../../chunk-6UEFCMR2.js";import"../../chunk-ZYI66XKV.js";import"../../chunk-RMDLJN4L.js";import"../../chunk-BL4BN6RU.js";import"../../chunk-2ZAKZEXW.js";import"../../chunk-NTKO4H2K.js";import"../../chunk-CJRYYV76.js";import"../../chunk-KQCAELPN.js";import"../../chunk-L2CFSMBC.js";import"../../chunk-Z72VHGV7.js";import"../../chunk-4L2ZEIRE.js";import"../../chunk-CDY7TQFZ.js";import"../../chunk-XRTZU7IZ.js";import"../../chunk-B3BHB26P.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-PJ3WHQ67.js";import"../../chunk-G5BXZT6F.js";import"../../chunk-HMMO27U4.js";import{b as k,d as h,e as A}from"../../chunk-VX2GJCQ4.js";import{a as O}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{f as b}from"../../chunk-H2ORWIEY.js";import{e as P,l as f}from"../../chunk-O6C2UGBY.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{trace as se,context as ie}from"@opentelemetry/api";import{NodeSDK as j}from"@opentelemetry/sdk-node";import{OTLPTraceExporter as q}from"@opentelemetry/exporter-trace-otlp-http";import{BatchSpanProcessor as F,ConsoleSpanExporter as U,SimpleSpanProcessor as X}from"@opentelemetry/sdk-trace-node";import{Resource as B}from"@opentelemetry/resources";import{ATTR_SERVICE_NAME as H,ATTR_SERVICE_VERSION as K}from"@opentelemetry/semantic-conventions";function $(t){if(!t)return{};let r={};for(let n of t.split(",")){let s=n.indexOf("=");if(s===-1)continue;let i=n.slice(0,s).trim(),a=n.slice(s+1).trim();i&&(r[i]=a)}return r}e($,"parseOtlpHeaders");var p=null;function y(){return process.env.TELEMETRY_ENABLED!=="false"}e(y,"isTelemetryEnabled");function S(t){if(!y()||p!==null)return"off";let r=new B({[H]:t.serviceName,[K]:t.serviceVersion??"0.1.0"}),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT,s,i;if(n){let a=$(process.env.OTEL_EXPORTER_OTLP_HEADERS),l=new q({url:`${n}/v1/traces`,headers:a});i=new F(l),s="otlp"}else if(process.env.OTEL_SPAN_EXPORT==="none")i=void 0,s="silent";else{let a=new U;i=new X(a),s="console"}return p=new j({resource:r,spanProcessors:i?[i]:[]}),p.start(),s}e(S,"initTelemetry");async function m(){p&&(await p.shutdown(),p=null)}e(m,"shutdownTelemetry");import{SpanKind as he,SpanStatusCode as ye}from"@opentelemetry/api";import{trace as ve,context as we}from"@opentelemetry/api";import*as u from"@sentry/node";var E=!1;function T(t){if(E)return!1;let r=process.env.SENTRY_DSN;return r?(u.init({dsn:r,serverName:t.serviceName,environment:process.env.NODE_ENV??"development",tracesSampleRate:0}),E=!0,!0):!1}e(T,"initSentry");async function g(t){E&&await u.flush(t)}e(g,"flushSentry");import{existsSync as J,mkdirSync as W,readFileSync as R,unlinkSync as V,writeFileSync as M}from"node:fs";import{dirname as z,join as v}from"node:path";import{execFileSync as Q}from"node:child_process";var c=v(f(),"evals-agent.lock");function Z(t){try{return process.kill(t,0),!0}catch(r){return r.code==="EPERM"}}e(Z,"pidAlive");function ee(t){if(!Z(t))return!1;try{let r=Q("ps",["-p",String(t),"-o","command="],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]});return/run\.js\s+evals\s+agent|evals\s+agent/.test(r)}catch{return!0}}e(ee,"isLiveAgent");function te(){try{W(z(c),{recursive:!0})}catch{}for(let t=0;t<2;t++)try{return M(c,String(process.pid),{flag:"wx"}),{ok:!0}}catch(r){if(r.code!=="EEXIST")throw r;let n=0;try{n=Number(R(c,"utf-8").trim())}catch{}if(n&&n!==process.pid&&ee(n))return{ok:!1,holder:n};try{V(c)}catch{}}try{M(c,String(process.pid))}catch{}return{ok:!0}}e(te,"acquireAgentLock");function x(){try{J(c)&&Number(R(c,"utf-8").trim())===process.pid&&V(c)}catch{}}e(x,"releaseAgentLock");var w=class t extends O{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(t),this.requireAuth();let r=te();if(!r.ok){this.log(`Another rulemetric evals agent is already running (pid ${r.holder}). Refusing to start a second instance.`);return}process.env.PG_APPLICATION_NAME||="rulemetric-agent",T({serviceName:"rulemetric-agent"})&&this.log("[sentry] error capture enabled");let s=S({serviceName:"rulemetric-agent"});s==="otlp"?this.log(`[otel] traces exporting to ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT}`):s==="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)"),!P()&&!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 a=new AbortController,l=await k({configDir:f()});if(this.log(`[transcript-sync] Codex capture: ${h(l)}`),l.error)this.log(`[transcript-sync] WARNING: ${l.error}`);else if(l.mode==="allowlist")for(let o of l.roots)this.log(`[transcript-sync] \u2022 ${o}`);let G=new C({providers:[L(void 0,void 0,A({configDir:f(),onChange:e(o=>this.log(`[transcript-sync] Codex capture changed: ${h(o)}`),"onChange")}))],statePath:v(f(),"transcript-sync-state.json"),importTranscript:e(o=>b("/api/sessions/import",o),"importTranscript"),log:e(o=>this.log(`[transcript-sync] ${o}`),"log")});D(G,{signal:a.signal,log:e(o=>this.log(`[transcript-sync] ${o}`),"log")});let N=e(async o=>{this.log(`
|
|
3
3
|
[${o}] shutting down agent...`),a.abort(),await Promise.allSettled([g(2e3),m(),d()]),x(),process.exit(0)},"shutdown");process.on("SIGINT",()=>{N("SIGINT")}),process.on("SIGTERM",()=>{N("SIGTERM")});let _=!1;try{await I({signal:a.signal,log:e(o=>this.log(o),"log"),version:this.config.version,readInstalledVersion:e(()=>{try{return JSON.parse(R(v(this.config.root,"package.json"),"utf-8")).version??null}catch{return null}},"readInstalledVersion"),onVersionDrift:e(()=>{_=!0},"onVersionDrift")}),_&&(this.log("[upgrade] Installed CLI version changed \u2014 restarting worker onto the new code."),await Promise.allSettled([g(2e3),m(),d()]),x(),process.exit(1))}finally{x(),await d()}}};export{w as default};
|
package/dist/lib/agent-loop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-IYDADY62.js";import"../chunk-TIOKY2IA.js";import"../chunk-ZYVWALMS.js";import"../chunk-NKPLTT7J.js";import"../chunk-HUADECKZ.js";import"../chunk-7SI6KWSX.js";import"../chunk-QFVGUZDO.js";import"../chunk-H7J27U4P.js";import"../chunk-BUWWFHGO.js";import"../chunk-IQTSUAGM.js";import"../chunk-CRIFP3QP.js";import"../chunk-MDPN46EY.js";import"../chunk-RSKQRVPJ.js";import"../chunk-SWSGNEVO.js";import"../chunk-BPQ66YTY.js";import"../chunk-UF6US7VU.js";import"../chunk-SNJ2NIIE.js";import"../chunk-IXLDCX7M.js";import"../chunk-JIJKIPE6.js";import"../chunk-5RBLIVBF.js";import"../chunk-GPTPK6QX.js";import"../chunk-N7TGRFVZ.js";import"../chunk-JGLVVIEM.js";import"../chunk-Q4APAZUC.js";import"../chunk-YQ56FQEO.js";import"../chunk-GIRPEMTW.js";import"../chunk-MODXEGCU.js";import"../chunk-5DIOZDDZ.js";import"../chunk-4VZLIGMS.js";import"../chunk-CNOD6HWU.js";import"../chunk-X64R6JCJ.js";import"../chunk-6UEFCMR2.js";import"../chunk-ZYI66XKV.js";import"../chunk-RMDLJN4L.js";import"../chunk-BL4BN6RU.js";import"../chunk-2ZAKZEXW.js";import"../chunk-NTKO4H2K.js";import"../chunk-CJRYYV76.js";import"../chunk-KQCAELPN.js";import"../chunk-L2CFSMBC.js";import"../chunk-Z72VHGV7.js";import"../chunk-4L2ZEIRE.js";import"../chunk-CDY7TQFZ.js";import"../chunk-XRTZU7IZ.js";import"../chunk-B3BHB26P.js";import"../chunk-N7ODX6PO.js";import"../chunk-PJ3WHQ67.js";import"../chunk-G5BXZT6F.js";import"../chunk-HMMO27U4.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import"../chunk-ZLLER3HP.js";export{b as CAPABILITIES,a as HANDLERS,c as availableCapabilities,d as pollForWork,e as runAgentLoop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-GIRPEMTW.js";import"../chunk-ZLLER3HP.js";export{a as DEFAULT_WALK_BUDGET,b as detectLanguages};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-SNJ2NIIE.js";import"../../chunk-GPTPK6QX.js";import"../../chunk-GIRPEMTW.js";import"../../chunk-MODXEGCU.js";import"../../chunk-B3BHB26P.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-PJ3WHQ67.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{b as cronSuggestInstructions,a as isScorableProjectPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-5KP66L7P.js";import"../../chunk-GPTPK6QX.js";import"../../chunk-N7TGRFVZ.js";import"../../chunk-JGLVVIEM.js";import"../../chunk-ZLLER3HP.js";export{a as processChangelog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-7SI6KWSX.js";import"../../chunk-QFVGUZDO.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-GPTPK6QX.js";import"../../chunk-B3BHB26P.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-PJ3WHQ67.js";import"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import"../../chunk-ZLLER3HP.js";export{a as processInsights};
|
package/dist/lib/manual-tasks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as l}from"../chunk-
|
|
1
|
+
import{a as l}from"../chunk-5KP66L7P.js";import{a as u}from"../chunk-UF6US7VU.js";import{b as g}from"../chunk-SNJ2NIIE.js";import"../chunk-GPTPK6QX.js";import"../chunk-N7TGRFVZ.js";import"../chunk-JGLVVIEM.js";import"../chunk-GIRPEMTW.js";import"../chunk-MODXEGCU.js";import"../chunk-B3BHB26P.js";import"../chunk-N7ODX6PO.js";import"../chunk-PJ3WHQ67.js";import{a as i}from"../chunk-GY5IJ4RS.js";import"../chunk-H2ORWIEY.js";import"../chunk-O6C2UGBY.js";import{a as o}from"../chunk-ZLLER3HP.js";var c={cron_check_changelog:o(async(r,e)=>{let s=await l({logger:{info:o(t=>e.logger.info(t),"info"),warn:o(t=>e.logger.warn(t),"warn")}});e.logger.info(`[cron_check_changelog] result: created=${s.createdCount} skipped=${s.skippedCount}`)},"cron_check_changelog"),cron_suggest_instructions:o((r,e)=>g(r,e),"cron_suggest_instructions"),cron_refresh_skills:o((r,e)=>u(r,e),"cron_refresh_skills")},p=i.map(r=>{let e=c[r.name];if(!e)throw new Error(`manual-tasks: no handler registered for "${r.name}"`);return{...r,handler:e}});async function m(r){let e=p.find(n=>n.name===r);if(!e)return{name:r,durationMs:0,ok:!1,error:`Unknown task: ${r}`,logs:[]};let s=[],t={logger:{info:o(n=>s.push({level:"info",message:n}),"info"),warn:o(n=>s.push({level:"warn",message:n}),"warn"),error:o(n=>s.push({level:"error",message:n}),"error")},job:{attempts:0}},a=Date.now();try{return await e.handler({},t),{name:r,durationMs:Date.now()-a,ok:!0,logs:s}}catch(n){return{name:r,durationMs:Date.now()-a,ok:!1,error:n instanceof Error?n.message:String(n),logs:s}}}o(m,"runManualTask");export{p as MANUAL_TASKS,m as runManualTask};
|
package/oclif.manifest.json
CHANGED
|
@@ -487,82 +487,6 @@
|
|
|
487
487
|
"backfill.js"
|
|
488
488
|
]
|
|
489
489
|
},
|
|
490
|
-
"capture:scope": {
|
|
491
|
-
"aliases": [],
|
|
492
|
-
"args": {},
|
|
493
|
-
"description": "Show or set which projects the worker sweeps for Codex transcripts",
|
|
494
|
-
"examples": [
|
|
495
|
-
"<%= config.bin %> <%= command.id %>",
|
|
496
|
-
"<%= config.bin %> <%= command.id %> --add ~/work/client-a --add ~/work/client-b",
|
|
497
|
-
"<%= config.bin %> <%= command.id %> --remove ~/work/client-a",
|
|
498
|
-
"<%= config.bin %> <%= command.id %> --off",
|
|
499
|
-
"<%= config.bin %> <%= command.id %> --all"
|
|
500
|
-
],
|
|
501
|
-
"flags": {
|
|
502
|
-
"api-url": {
|
|
503
|
-
"description": "Override API base URL",
|
|
504
|
-
"env": "RULEMETRIC_API_URL",
|
|
505
|
-
"hidden": true,
|
|
506
|
-
"name": "api-url",
|
|
507
|
-
"hasDynamicHelp": false,
|
|
508
|
-
"multiple": false,
|
|
509
|
-
"type": "option"
|
|
510
|
-
},
|
|
511
|
-
"add": {
|
|
512
|
-
"description": "Capture Codex sessions under this path (repeatable). Implies an allowlist.",
|
|
513
|
-
"name": "add",
|
|
514
|
-
"hasDynamicHelp": false,
|
|
515
|
-
"multiple": true,
|
|
516
|
-
"type": "option"
|
|
517
|
-
},
|
|
518
|
-
"remove": {
|
|
519
|
-
"description": "Stop capturing under this path (repeatable).",
|
|
520
|
-
"name": "remove",
|
|
521
|
-
"hasDynamicHelp": false,
|
|
522
|
-
"multiple": true,
|
|
523
|
-
"type": "option"
|
|
524
|
-
},
|
|
525
|
-
"off": {
|
|
526
|
-
"description": "Skip the Codex sweep entirely.",
|
|
527
|
-
"exclusive": [
|
|
528
|
-
"all"
|
|
529
|
-
],
|
|
530
|
-
"name": "off",
|
|
531
|
-
"allowNo": false,
|
|
532
|
-
"type": "boolean"
|
|
533
|
-
},
|
|
534
|
-
"all": {
|
|
535
|
-
"description": "Capture every project (the default).",
|
|
536
|
-
"exclusive": [
|
|
537
|
-
"off"
|
|
538
|
-
],
|
|
539
|
-
"name": "all",
|
|
540
|
-
"allowNo": false,
|
|
541
|
-
"type": "boolean"
|
|
542
|
-
},
|
|
543
|
-
"clear": {
|
|
544
|
-
"description": "Remove the codex scope, restoring the default.",
|
|
545
|
-
"name": "clear",
|
|
546
|
-
"allowNo": false,
|
|
547
|
-
"type": "boolean"
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
"hasDynamicHelp": false,
|
|
551
|
-
"hiddenAliases": [],
|
|
552
|
-
"id": "capture:scope",
|
|
553
|
-
"pluginAlias": "@rulemetric/cli",
|
|
554
|
-
"pluginName": "@rulemetric/cli",
|
|
555
|
-
"pluginType": "core",
|
|
556
|
-
"strict": true,
|
|
557
|
-
"enableJsonFlag": false,
|
|
558
|
-
"isESM": true,
|
|
559
|
-
"relativePath": [
|
|
560
|
-
"dist",
|
|
561
|
-
"commands",
|
|
562
|
-
"capture",
|
|
563
|
-
"scope.js"
|
|
564
|
-
]
|
|
565
|
-
},
|
|
566
490
|
"auth:create-key": {
|
|
567
491
|
"aliases": [],
|
|
568
492
|
"args": {},
|
|
@@ -835,6 +759,82 @@
|
|
|
835
759
|
"status.js"
|
|
836
760
|
]
|
|
837
761
|
},
|
|
762
|
+
"capture:scope": {
|
|
763
|
+
"aliases": [],
|
|
764
|
+
"args": {},
|
|
765
|
+
"description": "Show or set which projects the worker sweeps for Codex transcripts",
|
|
766
|
+
"examples": [
|
|
767
|
+
"<%= config.bin %> <%= command.id %>",
|
|
768
|
+
"<%= config.bin %> <%= command.id %> --add ~/work/client-a --add ~/work/client-b",
|
|
769
|
+
"<%= config.bin %> <%= command.id %> --remove ~/work/client-a",
|
|
770
|
+
"<%= config.bin %> <%= command.id %> --off",
|
|
771
|
+
"<%= config.bin %> <%= command.id %> --all"
|
|
772
|
+
],
|
|
773
|
+
"flags": {
|
|
774
|
+
"api-url": {
|
|
775
|
+
"description": "Override API base URL",
|
|
776
|
+
"env": "RULEMETRIC_API_URL",
|
|
777
|
+
"hidden": true,
|
|
778
|
+
"name": "api-url",
|
|
779
|
+
"hasDynamicHelp": false,
|
|
780
|
+
"multiple": false,
|
|
781
|
+
"type": "option"
|
|
782
|
+
},
|
|
783
|
+
"add": {
|
|
784
|
+
"description": "Capture Codex sessions under this path (repeatable). Implies an allowlist.",
|
|
785
|
+
"name": "add",
|
|
786
|
+
"hasDynamicHelp": false,
|
|
787
|
+
"multiple": true,
|
|
788
|
+
"type": "option"
|
|
789
|
+
},
|
|
790
|
+
"remove": {
|
|
791
|
+
"description": "Stop capturing under this path (repeatable).",
|
|
792
|
+
"name": "remove",
|
|
793
|
+
"hasDynamicHelp": false,
|
|
794
|
+
"multiple": true,
|
|
795
|
+
"type": "option"
|
|
796
|
+
},
|
|
797
|
+
"off": {
|
|
798
|
+
"description": "Skip the Codex sweep entirely.",
|
|
799
|
+
"exclusive": [
|
|
800
|
+
"all"
|
|
801
|
+
],
|
|
802
|
+
"name": "off",
|
|
803
|
+
"allowNo": false,
|
|
804
|
+
"type": "boolean"
|
|
805
|
+
},
|
|
806
|
+
"all": {
|
|
807
|
+
"description": "Capture every project (the default).",
|
|
808
|
+
"exclusive": [
|
|
809
|
+
"off"
|
|
810
|
+
],
|
|
811
|
+
"name": "all",
|
|
812
|
+
"allowNo": false,
|
|
813
|
+
"type": "boolean"
|
|
814
|
+
},
|
|
815
|
+
"clear": {
|
|
816
|
+
"description": "Remove the codex scope, restoring the default.",
|
|
817
|
+
"name": "clear",
|
|
818
|
+
"allowNo": false,
|
|
819
|
+
"type": "boolean"
|
|
820
|
+
}
|
|
821
|
+
},
|
|
822
|
+
"hasDynamicHelp": false,
|
|
823
|
+
"hiddenAliases": [],
|
|
824
|
+
"id": "capture:scope",
|
|
825
|
+
"pluginAlias": "@rulemetric/cli",
|
|
826
|
+
"pluginName": "@rulemetric/cli",
|
|
827
|
+
"pluginType": "core",
|
|
828
|
+
"strict": true,
|
|
829
|
+
"enableJsonFlag": false,
|
|
830
|
+
"isESM": true,
|
|
831
|
+
"relativePath": [
|
|
832
|
+
"dist",
|
|
833
|
+
"commands",
|
|
834
|
+
"capture",
|
|
835
|
+
"scope.js"
|
|
836
|
+
]
|
|
837
|
+
},
|
|
838
838
|
"catalog": {
|
|
839
839
|
"aliases": [],
|
|
840
840
|
"args": {},
|
|
@@ -1014,6 +1014,139 @@
|
|
|
1014
1014
|
"run.js"
|
|
1015
1015
|
]
|
|
1016
1016
|
},
|
|
1017
|
+
"eval-targets:create": {
|
|
1018
|
+
"aliases": [],
|
|
1019
|
+
"args": {},
|
|
1020
|
+
"description": "Create an eval target (instruction, skill, prompt, or plan to test)",
|
|
1021
|
+
"examples": [
|
|
1022
|
+
"<%= config.bin %> eval-targets create --name my-rules --type instruction --file ./CLAUDE.md",
|
|
1023
|
+
"<%= config.bin %> eval-targets create --name my-prompt --type prompt --content \"Always use TypeScript\""
|
|
1024
|
+
],
|
|
1025
|
+
"flags": {
|
|
1026
|
+
"api-url": {
|
|
1027
|
+
"description": "Override API base URL",
|
|
1028
|
+
"env": "RULEMETRIC_API_URL",
|
|
1029
|
+
"hidden": true,
|
|
1030
|
+
"name": "api-url",
|
|
1031
|
+
"hasDynamicHelp": false,
|
|
1032
|
+
"multiple": false,
|
|
1033
|
+
"type": "option"
|
|
1034
|
+
},
|
|
1035
|
+
"name": {
|
|
1036
|
+
"char": "n",
|
|
1037
|
+
"description": "Name for the eval target",
|
|
1038
|
+
"name": "name",
|
|
1039
|
+
"required": true,
|
|
1040
|
+
"hasDynamicHelp": false,
|
|
1041
|
+
"multiple": false,
|
|
1042
|
+
"type": "option"
|
|
1043
|
+
},
|
|
1044
|
+
"type": {
|
|
1045
|
+
"char": "t",
|
|
1046
|
+
"description": "Target type",
|
|
1047
|
+
"name": "type",
|
|
1048
|
+
"required": true,
|
|
1049
|
+
"hasDynamicHelp": false,
|
|
1050
|
+
"multiple": false,
|
|
1051
|
+
"options": [
|
|
1052
|
+
"instruction",
|
|
1053
|
+
"skill",
|
|
1054
|
+
"prompt",
|
|
1055
|
+
"plan"
|
|
1056
|
+
],
|
|
1057
|
+
"type": "option"
|
|
1058
|
+
},
|
|
1059
|
+
"file": {
|
|
1060
|
+
"char": "f",
|
|
1061
|
+
"description": "Path to content file",
|
|
1062
|
+
"name": "file",
|
|
1063
|
+
"hasDynamicHelp": false,
|
|
1064
|
+
"multiple": false,
|
|
1065
|
+
"type": "option"
|
|
1066
|
+
},
|
|
1067
|
+
"content": {
|
|
1068
|
+
"char": "c",
|
|
1069
|
+
"description": "Content string (alternative to --file)",
|
|
1070
|
+
"name": "content",
|
|
1071
|
+
"hasDynamicHelp": false,
|
|
1072
|
+
"multiple": false,
|
|
1073
|
+
"type": "option"
|
|
1074
|
+
},
|
|
1075
|
+
"description": {
|
|
1076
|
+
"char": "d",
|
|
1077
|
+
"description": "Description of the target",
|
|
1078
|
+
"name": "description",
|
|
1079
|
+
"default": "",
|
|
1080
|
+
"hasDynamicHelp": false,
|
|
1081
|
+
"multiple": false,
|
|
1082
|
+
"type": "option"
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
"hasDynamicHelp": false,
|
|
1086
|
+
"hiddenAliases": [],
|
|
1087
|
+
"id": "eval-targets:create",
|
|
1088
|
+
"pluginAlias": "@rulemetric/cli",
|
|
1089
|
+
"pluginName": "@rulemetric/cli",
|
|
1090
|
+
"pluginType": "core",
|
|
1091
|
+
"strict": true,
|
|
1092
|
+
"enableJsonFlag": false,
|
|
1093
|
+
"isESM": true,
|
|
1094
|
+
"relativePath": [
|
|
1095
|
+
"dist",
|
|
1096
|
+
"commands",
|
|
1097
|
+
"eval-targets",
|
|
1098
|
+
"create.js"
|
|
1099
|
+
]
|
|
1100
|
+
},
|
|
1101
|
+
"eval-targets:list": {
|
|
1102
|
+
"aliases": [],
|
|
1103
|
+
"args": {},
|
|
1104
|
+
"description": "List eval targets",
|
|
1105
|
+
"examples": [
|
|
1106
|
+
"<%= config.bin %> eval-targets list",
|
|
1107
|
+
"<%= config.bin %> eval-targets list --type instruction"
|
|
1108
|
+
],
|
|
1109
|
+
"flags": {
|
|
1110
|
+
"api-url": {
|
|
1111
|
+
"description": "Override API base URL",
|
|
1112
|
+
"env": "RULEMETRIC_API_URL",
|
|
1113
|
+
"hidden": true,
|
|
1114
|
+
"name": "api-url",
|
|
1115
|
+
"hasDynamicHelp": false,
|
|
1116
|
+
"multiple": false,
|
|
1117
|
+
"type": "option"
|
|
1118
|
+
},
|
|
1119
|
+
"type": {
|
|
1120
|
+
"char": "t",
|
|
1121
|
+
"description": "Filter by type",
|
|
1122
|
+
"name": "type",
|
|
1123
|
+
"hasDynamicHelp": false,
|
|
1124
|
+
"multiple": false,
|
|
1125
|
+
"options": [
|
|
1126
|
+
"instruction",
|
|
1127
|
+
"skill",
|
|
1128
|
+
"prompt",
|
|
1129
|
+
"plan"
|
|
1130
|
+
],
|
|
1131
|
+
"type": "option"
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
"hasDynamicHelp": false,
|
|
1135
|
+
"hiddenAliases": [],
|
|
1136
|
+
"id": "eval-targets:list",
|
|
1137
|
+
"pluginAlias": "@rulemetric/cli",
|
|
1138
|
+
"pluginName": "@rulemetric/cli",
|
|
1139
|
+
"pluginType": "core",
|
|
1140
|
+
"strict": true,
|
|
1141
|
+
"enableJsonFlag": false,
|
|
1142
|
+
"isESM": true,
|
|
1143
|
+
"relativePath": [
|
|
1144
|
+
"dist",
|
|
1145
|
+
"commands",
|
|
1146
|
+
"eval-targets",
|
|
1147
|
+
"list.js"
|
|
1148
|
+
]
|
|
1149
|
+
},
|
|
1017
1150
|
"evals:agent": {
|
|
1018
1151
|
"aliases": [],
|
|
1019
1152
|
"args": {},
|
|
@@ -1717,157 +1850,24 @@
|
|
|
1717
1850
|
"multiple": false,
|
|
1718
1851
|
"type": "option"
|
|
1719
1852
|
},
|
|
1720
|
-
"timeout": {
|
|
1721
|
-
"description": "Timeout per re-grade in ms",
|
|
1722
|
-
"name": "timeout",
|
|
1723
|
-
"default": 120000,
|
|
1724
|
-
"hasDynamicHelp": false,
|
|
1725
|
-
"multiple": false,
|
|
1726
|
-
"type": "option"
|
|
1727
|
-
},
|
|
1728
|
-
"json": {
|
|
1729
|
-
"description": "Emit the full report as JSON",
|
|
1730
|
-
"name": "json",
|
|
1731
|
-
"allowNo": false,
|
|
1732
|
-
"type": "boolean"
|
|
1733
|
-
}
|
|
1734
|
-
},
|
|
1735
|
-
"hasDynamicHelp": false,
|
|
1736
|
-
"hiddenAliases": [],
|
|
1737
|
-
"id": "evals:validate-judge",
|
|
1738
|
-
"pluginAlias": "@rulemetric/cli",
|
|
1739
|
-
"pluginName": "@rulemetric/cli",
|
|
1740
|
-
"pluginType": "core",
|
|
1741
|
-
"strict": true,
|
|
1742
|
-
"enableJsonFlag": false,
|
|
1743
|
-
"isESM": true,
|
|
1744
|
-
"relativePath": [
|
|
1745
|
-
"dist",
|
|
1746
|
-
"commands",
|
|
1747
|
-
"evals",
|
|
1748
|
-
"validate-judge.js"
|
|
1749
|
-
]
|
|
1750
|
-
},
|
|
1751
|
-
"eval-targets:create": {
|
|
1752
|
-
"aliases": [],
|
|
1753
|
-
"args": {},
|
|
1754
|
-
"description": "Create an eval target (instruction, skill, prompt, or plan to test)",
|
|
1755
|
-
"examples": [
|
|
1756
|
-
"<%= config.bin %> eval-targets create --name my-rules --type instruction --file ./CLAUDE.md",
|
|
1757
|
-
"<%= config.bin %> eval-targets create --name my-prompt --type prompt --content \"Always use TypeScript\""
|
|
1758
|
-
],
|
|
1759
|
-
"flags": {
|
|
1760
|
-
"api-url": {
|
|
1761
|
-
"description": "Override API base URL",
|
|
1762
|
-
"env": "RULEMETRIC_API_URL",
|
|
1763
|
-
"hidden": true,
|
|
1764
|
-
"name": "api-url",
|
|
1765
|
-
"hasDynamicHelp": false,
|
|
1766
|
-
"multiple": false,
|
|
1767
|
-
"type": "option"
|
|
1768
|
-
},
|
|
1769
|
-
"name": {
|
|
1770
|
-
"char": "n",
|
|
1771
|
-
"description": "Name for the eval target",
|
|
1772
|
-
"name": "name",
|
|
1773
|
-
"required": true,
|
|
1774
|
-
"hasDynamicHelp": false,
|
|
1775
|
-
"multiple": false,
|
|
1776
|
-
"type": "option"
|
|
1777
|
-
},
|
|
1778
|
-
"type": {
|
|
1779
|
-
"char": "t",
|
|
1780
|
-
"description": "Target type",
|
|
1781
|
-
"name": "type",
|
|
1782
|
-
"required": true,
|
|
1783
|
-
"hasDynamicHelp": false,
|
|
1784
|
-
"multiple": false,
|
|
1785
|
-
"options": [
|
|
1786
|
-
"instruction",
|
|
1787
|
-
"skill",
|
|
1788
|
-
"prompt",
|
|
1789
|
-
"plan"
|
|
1790
|
-
],
|
|
1791
|
-
"type": "option"
|
|
1792
|
-
},
|
|
1793
|
-
"file": {
|
|
1794
|
-
"char": "f",
|
|
1795
|
-
"description": "Path to content file",
|
|
1796
|
-
"name": "file",
|
|
1797
|
-
"hasDynamicHelp": false,
|
|
1798
|
-
"multiple": false,
|
|
1799
|
-
"type": "option"
|
|
1800
|
-
},
|
|
1801
|
-
"content": {
|
|
1802
|
-
"char": "c",
|
|
1803
|
-
"description": "Content string (alternative to --file)",
|
|
1804
|
-
"name": "content",
|
|
1805
|
-
"hasDynamicHelp": false,
|
|
1806
|
-
"multiple": false,
|
|
1807
|
-
"type": "option"
|
|
1808
|
-
},
|
|
1809
|
-
"description": {
|
|
1810
|
-
"char": "d",
|
|
1811
|
-
"description": "Description of the target",
|
|
1812
|
-
"name": "description",
|
|
1813
|
-
"default": "",
|
|
1814
|
-
"hasDynamicHelp": false,
|
|
1815
|
-
"multiple": false,
|
|
1816
|
-
"type": "option"
|
|
1817
|
-
}
|
|
1818
|
-
},
|
|
1819
|
-
"hasDynamicHelp": false,
|
|
1820
|
-
"hiddenAliases": [],
|
|
1821
|
-
"id": "eval-targets:create",
|
|
1822
|
-
"pluginAlias": "@rulemetric/cli",
|
|
1823
|
-
"pluginName": "@rulemetric/cli",
|
|
1824
|
-
"pluginType": "core",
|
|
1825
|
-
"strict": true,
|
|
1826
|
-
"enableJsonFlag": false,
|
|
1827
|
-
"isESM": true,
|
|
1828
|
-
"relativePath": [
|
|
1829
|
-
"dist",
|
|
1830
|
-
"commands",
|
|
1831
|
-
"eval-targets",
|
|
1832
|
-
"create.js"
|
|
1833
|
-
]
|
|
1834
|
-
},
|
|
1835
|
-
"eval-targets:list": {
|
|
1836
|
-
"aliases": [],
|
|
1837
|
-
"args": {},
|
|
1838
|
-
"description": "List eval targets",
|
|
1839
|
-
"examples": [
|
|
1840
|
-
"<%= config.bin %> eval-targets list",
|
|
1841
|
-
"<%= config.bin %> eval-targets list --type instruction"
|
|
1842
|
-
],
|
|
1843
|
-
"flags": {
|
|
1844
|
-
"api-url": {
|
|
1845
|
-
"description": "Override API base URL",
|
|
1846
|
-
"env": "RULEMETRIC_API_URL",
|
|
1847
|
-
"hidden": true,
|
|
1848
|
-
"name": "api-url",
|
|
1849
|
-
"hasDynamicHelp": false,
|
|
1850
|
-
"multiple": false,
|
|
1851
|
-
"type": "option"
|
|
1852
|
-
},
|
|
1853
|
-
"type": {
|
|
1854
|
-
"char": "t",
|
|
1855
|
-
"description": "Filter by type",
|
|
1856
|
-
"name": "type",
|
|
1853
|
+
"timeout": {
|
|
1854
|
+
"description": "Timeout per re-grade in ms",
|
|
1855
|
+
"name": "timeout",
|
|
1856
|
+
"default": 120000,
|
|
1857
1857
|
"hasDynamicHelp": false,
|
|
1858
1858
|
"multiple": false,
|
|
1859
|
-
"options": [
|
|
1860
|
-
"instruction",
|
|
1861
|
-
"skill",
|
|
1862
|
-
"prompt",
|
|
1863
|
-
"plan"
|
|
1864
|
-
],
|
|
1865
1859
|
"type": "option"
|
|
1860
|
+
},
|
|
1861
|
+
"json": {
|
|
1862
|
+
"description": "Emit the full report as JSON",
|
|
1863
|
+
"name": "json",
|
|
1864
|
+
"allowNo": false,
|
|
1865
|
+
"type": "boolean"
|
|
1866
1866
|
}
|
|
1867
1867
|
},
|
|
1868
1868
|
"hasDynamicHelp": false,
|
|
1869
1869
|
"hiddenAliases": [],
|
|
1870
|
-
"id": "
|
|
1870
|
+
"id": "evals:validate-judge",
|
|
1871
1871
|
"pluginAlias": "@rulemetric/cli",
|
|
1872
1872
|
"pluginName": "@rulemetric/cli",
|
|
1873
1873
|
"pluginType": "core",
|
|
@@ -1877,8 +1877,8 @@
|
|
|
1877
1877
|
"relativePath": [
|
|
1878
1878
|
"dist",
|
|
1879
1879
|
"commands",
|
|
1880
|
-
"
|
|
1881
|
-
"
|
|
1880
|
+
"evals",
|
|
1881
|
+
"validate-judge.js"
|
|
1882
1882
|
]
|
|
1883
1883
|
},
|
|
1884
1884
|
"gateway:ensure": {
|
|
@@ -2587,6 +2587,121 @@
|
|
|
2587
2587
|
"versions.js"
|
|
2588
2588
|
]
|
|
2589
2589
|
},
|
|
2590
|
+
"org:current": {
|
|
2591
|
+
"aliases": [],
|
|
2592
|
+
"args": {},
|
|
2593
|
+
"description": "Show the current active organization",
|
|
2594
|
+
"examples": [
|
|
2595
|
+
"<%= config.bin %> org current"
|
|
2596
|
+
],
|
|
2597
|
+
"flags": {
|
|
2598
|
+
"api-url": {
|
|
2599
|
+
"description": "Override API base URL",
|
|
2600
|
+
"env": "RULEMETRIC_API_URL",
|
|
2601
|
+
"hidden": true,
|
|
2602
|
+
"name": "api-url",
|
|
2603
|
+
"hasDynamicHelp": false,
|
|
2604
|
+
"multiple": false,
|
|
2605
|
+
"type": "option"
|
|
2606
|
+
}
|
|
2607
|
+
},
|
|
2608
|
+
"hasDynamicHelp": false,
|
|
2609
|
+
"hiddenAliases": [],
|
|
2610
|
+
"id": "org:current",
|
|
2611
|
+
"pluginAlias": "@rulemetric/cli",
|
|
2612
|
+
"pluginName": "@rulemetric/cli",
|
|
2613
|
+
"pluginType": "core",
|
|
2614
|
+
"strict": true,
|
|
2615
|
+
"enableJsonFlag": false,
|
|
2616
|
+
"isESM": true,
|
|
2617
|
+
"relativePath": [
|
|
2618
|
+
"dist",
|
|
2619
|
+
"commands",
|
|
2620
|
+
"org",
|
|
2621
|
+
"current.js"
|
|
2622
|
+
]
|
|
2623
|
+
},
|
|
2624
|
+
"org:list": {
|
|
2625
|
+
"aliases": [],
|
|
2626
|
+
"args": {},
|
|
2627
|
+
"description": "List organizations the current user is a member of",
|
|
2628
|
+
"examples": [
|
|
2629
|
+
"<%= config.bin %> org list"
|
|
2630
|
+
],
|
|
2631
|
+
"flags": {
|
|
2632
|
+
"api-url": {
|
|
2633
|
+
"description": "Override API base URL",
|
|
2634
|
+
"env": "RULEMETRIC_API_URL",
|
|
2635
|
+
"hidden": true,
|
|
2636
|
+
"name": "api-url",
|
|
2637
|
+
"hasDynamicHelp": false,
|
|
2638
|
+
"multiple": false,
|
|
2639
|
+
"type": "option"
|
|
2640
|
+
}
|
|
2641
|
+
},
|
|
2642
|
+
"hasDynamicHelp": false,
|
|
2643
|
+
"hiddenAliases": [],
|
|
2644
|
+
"id": "org:list",
|
|
2645
|
+
"pluginAlias": "@rulemetric/cli",
|
|
2646
|
+
"pluginName": "@rulemetric/cli",
|
|
2647
|
+
"pluginType": "core",
|
|
2648
|
+
"strict": true,
|
|
2649
|
+
"enableJsonFlag": false,
|
|
2650
|
+
"isESM": true,
|
|
2651
|
+
"relativePath": [
|
|
2652
|
+
"dist",
|
|
2653
|
+
"commands",
|
|
2654
|
+
"org",
|
|
2655
|
+
"list.js"
|
|
2656
|
+
]
|
|
2657
|
+
},
|
|
2658
|
+
"org:switch": {
|
|
2659
|
+
"aliases": [],
|
|
2660
|
+
"args": {
|
|
2661
|
+
"slug": {
|
|
2662
|
+
"description": "Organization slug to switch to",
|
|
2663
|
+
"name": "slug",
|
|
2664
|
+
"required": false
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
"description": "Switch the active organization",
|
|
2668
|
+
"examples": [
|
|
2669
|
+
"<%= config.bin %> org switch acme",
|
|
2670
|
+
"<%= config.bin %> org switch --clear"
|
|
2671
|
+
],
|
|
2672
|
+
"flags": {
|
|
2673
|
+
"api-url": {
|
|
2674
|
+
"description": "Override API base URL",
|
|
2675
|
+
"env": "RULEMETRIC_API_URL",
|
|
2676
|
+
"hidden": true,
|
|
2677
|
+
"name": "api-url",
|
|
2678
|
+
"hasDynamicHelp": false,
|
|
2679
|
+
"multiple": false,
|
|
2680
|
+
"type": "option"
|
|
2681
|
+
},
|
|
2682
|
+
"clear": {
|
|
2683
|
+
"description": "Clear the active organization (personal mode)",
|
|
2684
|
+
"name": "clear",
|
|
2685
|
+
"allowNo": false,
|
|
2686
|
+
"type": "boolean"
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
"hasDynamicHelp": false,
|
|
2690
|
+
"hiddenAliases": [],
|
|
2691
|
+
"id": "org:switch",
|
|
2692
|
+
"pluginAlias": "@rulemetric/cli",
|
|
2693
|
+
"pluginName": "@rulemetric/cli",
|
|
2694
|
+
"pluginType": "core",
|
|
2695
|
+
"strict": true,
|
|
2696
|
+
"enableJsonFlag": false,
|
|
2697
|
+
"isESM": true,
|
|
2698
|
+
"relativePath": [
|
|
2699
|
+
"dist",
|
|
2700
|
+
"commands",
|
|
2701
|
+
"org",
|
|
2702
|
+
"switch.js"
|
|
2703
|
+
]
|
|
2704
|
+
},
|
|
2590
2705
|
"packs:add-instruction": {
|
|
2591
2706
|
"aliases": [],
|
|
2592
2707
|
"args": {
|
|
@@ -2935,121 +3050,6 @@
|
|
|
2935
3050
|
"remove-instruction.js"
|
|
2936
3051
|
]
|
|
2937
3052
|
},
|
|
2938
|
-
"org:current": {
|
|
2939
|
-
"aliases": [],
|
|
2940
|
-
"args": {},
|
|
2941
|
-
"description": "Show the current active organization",
|
|
2942
|
-
"examples": [
|
|
2943
|
-
"<%= config.bin %> org current"
|
|
2944
|
-
],
|
|
2945
|
-
"flags": {
|
|
2946
|
-
"api-url": {
|
|
2947
|
-
"description": "Override API base URL",
|
|
2948
|
-
"env": "RULEMETRIC_API_URL",
|
|
2949
|
-
"hidden": true,
|
|
2950
|
-
"name": "api-url",
|
|
2951
|
-
"hasDynamicHelp": false,
|
|
2952
|
-
"multiple": false,
|
|
2953
|
-
"type": "option"
|
|
2954
|
-
}
|
|
2955
|
-
},
|
|
2956
|
-
"hasDynamicHelp": false,
|
|
2957
|
-
"hiddenAliases": [],
|
|
2958
|
-
"id": "org:current",
|
|
2959
|
-
"pluginAlias": "@rulemetric/cli",
|
|
2960
|
-
"pluginName": "@rulemetric/cli",
|
|
2961
|
-
"pluginType": "core",
|
|
2962
|
-
"strict": true,
|
|
2963
|
-
"enableJsonFlag": false,
|
|
2964
|
-
"isESM": true,
|
|
2965
|
-
"relativePath": [
|
|
2966
|
-
"dist",
|
|
2967
|
-
"commands",
|
|
2968
|
-
"org",
|
|
2969
|
-
"current.js"
|
|
2970
|
-
]
|
|
2971
|
-
},
|
|
2972
|
-
"org:list": {
|
|
2973
|
-
"aliases": [],
|
|
2974
|
-
"args": {},
|
|
2975
|
-
"description": "List organizations the current user is a member of",
|
|
2976
|
-
"examples": [
|
|
2977
|
-
"<%= config.bin %> org list"
|
|
2978
|
-
],
|
|
2979
|
-
"flags": {
|
|
2980
|
-
"api-url": {
|
|
2981
|
-
"description": "Override API base URL",
|
|
2982
|
-
"env": "RULEMETRIC_API_URL",
|
|
2983
|
-
"hidden": true,
|
|
2984
|
-
"name": "api-url",
|
|
2985
|
-
"hasDynamicHelp": false,
|
|
2986
|
-
"multiple": false,
|
|
2987
|
-
"type": "option"
|
|
2988
|
-
}
|
|
2989
|
-
},
|
|
2990
|
-
"hasDynamicHelp": false,
|
|
2991
|
-
"hiddenAliases": [],
|
|
2992
|
-
"id": "org:list",
|
|
2993
|
-
"pluginAlias": "@rulemetric/cli",
|
|
2994
|
-
"pluginName": "@rulemetric/cli",
|
|
2995
|
-
"pluginType": "core",
|
|
2996
|
-
"strict": true,
|
|
2997
|
-
"enableJsonFlag": false,
|
|
2998
|
-
"isESM": true,
|
|
2999
|
-
"relativePath": [
|
|
3000
|
-
"dist",
|
|
3001
|
-
"commands",
|
|
3002
|
-
"org",
|
|
3003
|
-
"list.js"
|
|
3004
|
-
]
|
|
3005
|
-
},
|
|
3006
|
-
"org:switch": {
|
|
3007
|
-
"aliases": [],
|
|
3008
|
-
"args": {
|
|
3009
|
-
"slug": {
|
|
3010
|
-
"description": "Organization slug to switch to",
|
|
3011
|
-
"name": "slug",
|
|
3012
|
-
"required": false
|
|
3013
|
-
}
|
|
3014
|
-
},
|
|
3015
|
-
"description": "Switch the active organization",
|
|
3016
|
-
"examples": [
|
|
3017
|
-
"<%= config.bin %> org switch acme",
|
|
3018
|
-
"<%= config.bin %> org switch --clear"
|
|
3019
|
-
],
|
|
3020
|
-
"flags": {
|
|
3021
|
-
"api-url": {
|
|
3022
|
-
"description": "Override API base URL",
|
|
3023
|
-
"env": "RULEMETRIC_API_URL",
|
|
3024
|
-
"hidden": true,
|
|
3025
|
-
"name": "api-url",
|
|
3026
|
-
"hasDynamicHelp": false,
|
|
3027
|
-
"multiple": false,
|
|
3028
|
-
"type": "option"
|
|
3029
|
-
},
|
|
3030
|
-
"clear": {
|
|
3031
|
-
"description": "Clear the active organization (personal mode)",
|
|
3032
|
-
"name": "clear",
|
|
3033
|
-
"allowNo": false,
|
|
3034
|
-
"type": "boolean"
|
|
3035
|
-
}
|
|
3036
|
-
},
|
|
3037
|
-
"hasDynamicHelp": false,
|
|
3038
|
-
"hiddenAliases": [],
|
|
3039
|
-
"id": "org:switch",
|
|
3040
|
-
"pluginAlias": "@rulemetric/cli",
|
|
3041
|
-
"pluginName": "@rulemetric/cli",
|
|
3042
|
-
"pluginType": "core",
|
|
3043
|
-
"strict": true,
|
|
3044
|
-
"enableJsonFlag": false,
|
|
3045
|
-
"isESM": true,
|
|
3046
|
-
"relativePath": [
|
|
3047
|
-
"dist",
|
|
3048
|
-
"commands",
|
|
3049
|
-
"org",
|
|
3050
|
-
"switch.js"
|
|
3051
|
-
]
|
|
3052
|
-
},
|
|
3053
3053
|
"proxy:env": {
|
|
3054
3054
|
"aliases": [],
|
|
3055
3055
|
"args": {},
|
|
@@ -4438,5 +4438,5 @@
|
|
|
4438
4438
|
]
|
|
4439
4439
|
}
|
|
4440
4440
|
},
|
|
4441
|
-
"version": "0.7.
|
|
4441
|
+
"version": "0.7.37"
|
|
4442
4442
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulemetric/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.37",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"postgres": "^3.4.0",
|
|
78
78
|
"react": "^19.0.0",
|
|
79
79
|
"zod": "^3.24.0",
|
|
80
|
-
"@rulemetric/hooks": "0.7.
|
|
81
|
-
"@rulemetric/proxy": "0.7.
|
|
82
|
-
"@rulemetric/skills-registry": "0.7.
|
|
80
|
+
"@rulemetric/hooks": "0.7.37",
|
|
81
|
+
"@rulemetric/proxy": "0.7.37",
|
|
82
|
+
"@rulemetric/skills-registry": "0.7.37"
|
|
83
83
|
},
|
|
84
84
|
"//deps": "Worker (`evals agent`) runtime deps: the @opentelemetry/* set, @sentry/node, and postgres are STATIC top-level imports loaded at worker startup (via bundled @rulemetric/{telemetry,db}) — they MUST be runtime deps or a clean `npm i -g` crashes with ModuleLoadError. `better-sqlite3` is optionalDependencies (below): it's a native module, lazy `require()`'d inside a try/catch (packages/session providers cursor/opencode) so a missing binary degrades gracefully — making it a hard dep would break `npm i -g` on platforms without prebuilt binaries. `resend` stays a devDep: lazy `await import('resend')` guarded by RESEND_API_KEY, which end-user workers never set (provider falls back to noop). Classification verified via import-graph scan of dist/commands/evals/agent.js + per-importer static/lazy check.",
|
|
85
85
|
"optionalDependencies": {
|
|
@@ -97,14 +97,14 @@
|
|
|
97
97
|
"tsx": "^4.19.0",
|
|
98
98
|
"typescript": "^5.9.0",
|
|
99
99
|
"vitest": "^3.2.0",
|
|
100
|
-
"@rulemetric/
|
|
100
|
+
"@rulemetric/core": "0.0.1",
|
|
101
101
|
"@rulemetric/db": "0.0.1",
|
|
102
102
|
"@rulemetric/effectiveness": "0.0.1",
|
|
103
103
|
"@rulemetric/email": "0.0.1",
|
|
104
104
|
"@rulemetric/session": "0.2.1",
|
|
105
105
|
"@rulemetric/telemetry": "0.0.1",
|
|
106
106
|
"@rulemetric/typescript-config": "0.0.0",
|
|
107
|
-
"@rulemetric/
|
|
107
|
+
"@rulemetric/api": "0.0.1"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
110
|
"build": "node scripts/build.mjs",
|
package/dist/chunk-DKGKOSW3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as j}from"./chunk-ZL4MZMUK.js";import{a as k}from"./chunk-TDD7IOV2.js";import{a as p}from"./chunk-MODXEGCU.js";import{d as y,f as S}from"./chunk-B3BHB26P.js";import{e as i,f as l}from"./chunk-H2ORWIEY.js";import{a as g}from"./chunk-ZLLER3HP.js";import{readFileSync as b}from"node:fs";import E from"node:path";import $ from"node:os";var N=5,L=Number(process.env.RULEMETRIC_MAX_SUGGESTION_PROJECTS??10),T=48,M=.5,d=400;async function O(){let m=E.join($.homedir(),".config","rulemetric","skills-registry.json");try{let o=b(m,"utf-8"),s=JSON.parse(o);return Date.now()-new Date(s.generatedAt).getTime()>T*60*60*1e3}catch{return!0}}g(O,"checkSkillsRegistryStale");var X=g(async(m,o)=>{let s=y();if(s==="none"){o.logger.warn("No LLM backend available (claude CLI missing and ANTHROPIC_API_KEY unset); skipping suggestion compute");return}o.logger.info(`Scoring backend: ${s}`);let r;try{r=(await i("/api/sessions/project-paths?limit="+L)).projectPaths}catch(e){o.logger.warn(`Failed to fetch project paths: ${e instanceof Error?e.message:String(e)}`);return}if(r.length===0){o.logger.info("No recent project paths; nothing to score");return}let u=new Map;try{let e=await i("/api/projects?limit=200");for(let t of e.projects??[])t.primaryCheckoutPath&&u.set(p(t.primaryCheckoutPath),t.id)}catch(e){o.logger.warn(`Failed to fetch projects for id resolution: ${e instanceof Error?e.message:String(e)}`)}let a=new Map;try{let e=await i(`/api/catalog?limit=200&contentPreview=${d}`);for(let t of e)a.set(t.id,{id:t.id,name:t.name,description:t.description??"",tags:t.tags??[],contentPreview:(t.contentPreview??"").slice(0,d)})}catch(e){o.logger.warn(`Failed to fetch catalog: ${e instanceof Error?e.message:String(e)}`)}try{let e=await i("/api/instructions?limit=100");for(let t of e.instructions??[])a.has(t.id)||a.set(t.id,{id:t.id,name:t.name,description:t.description??"",tags:t.tags??[],contentPreview:(t.content??"").slice(0,d)})}catch(e){o.logger.warn(`Failed to fetch personal instructions: ${e instanceof Error?e.message:String(e)}`)}let c=[...a.values()];if(c.length===0){o.logger.info("No candidate instructions; nothing to score");return}o.logger.info(`Scoring ${c.length} candidates across ${r.length} project(s)`);let f=0;for(let e of r)try{let t=p(e),w=k(t);if(w.length===0){o.logger.info(`Skipping ${t}: insufficient language signals`);continue}let C={name:E.basename(t),description:null,languages:w,topics:[],dependencies:[]},I=j(C,c),P=await S(I,"",4096);if(!P){o.logger.warn(`LLM returned null for ${t} (backend ${s})`);continue}let h=(P.recommendations??[]).filter(n=>typeof n.instructionId=="string"&&typeof n.score=="number"&&typeof n.reason=="string").map(n=>({instructionId:n.instructionId,score:n.score,reason:n.reason})).filter(n=>n.score>=M).sort((n,_)=>_.score-n.score).slice(0,N);if(h.length===0){o.logger.info(`No suggestions over threshold for ${t}`);continue}let R=u.get(t);await l("/api/instruction-suggestions/batch-upsert",{projectPath:t,...R?{projectId:R}:{},suggestions:h.map(n=>({instructionId:n.instructionId,score:n.score,reason:n.reason}))}),f++}catch(t){o.logger.warn(`Failed to score ${e}: ${t instanceof Error?t.message:String(t)}`)}if(await O())try{await l("/api/instruction-suggestions/mark-stale",{}),o.logger.warn("Skills registry is stale (>48h); marked all suggestions stale")}catch{}o.logger.info(`Done: scored ${f}/${r.length} projects`)},"cronSuggestInstructions");export{X as a};
|
package/dist/chunk-TDD7IOV2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-ZLLER3HP.js";import{existsSync as p,statSync as u,readdirSync as h}from"node:fs";import y from"node:path";var g=new Set(["node_modules",".git","dist","build",".next",".turbo",".worktrees","target","venv","__pycache__",".cache"]),f=3;function P(r){if(!p(r))return[];let t=new Set,d=o((n,s)=>{if(s>f)return;let a;try{a=h(n)}catch{return}for(let e of a)e==="package.json"&&t.add("JavaScript/TypeScript"),e==="tsconfig.json"&&t.add("TypeScript-config"),e==="pyproject.toml"&&t.add("Python-pyproject"),e==="setup.py"&&t.add("Python-setup"),e==="requirements.txt"&&t.add("Python-requirements"),e==="Pipfile"&&t.add("Python-pipfile"),e==="Cargo.toml"&&t.add("Rust-cargo"),e==="go.mod"&&t.add("Go-mod"),e==="pom.xml"&&t.add("Java-pom"),(e==="build.gradle"||e==="build.gradle.kts")&&t.add("Java-gradle"),e==="Gemfile"&&t.add("Ruby-gemfile"),e==="composer.json"&&t.add("PHP-composer"),(e.endsWith(".ts")||e.endsWith(".tsx"))&&t.add("TypeScript-source"),e.endsWith(".py")&&t.add("Python-source"),e.endsWith(".rs")&&t.add("Rust-source"),e.endsWith(".go")&&t.add("Go-source");if(!(s>=f))for(let e of a){if(g.has(e))continue;let c=y.join(n,e);try{u(c).isDirectory()&&d(c,s+1)}catch{}}},"walk");d(r,0);let i=new Set;return t.has("TypeScript-source")||t.has("TypeScript-config")?i.add("TypeScript"):t.has("JavaScript/TypeScript")&&i.add("JavaScript"),(t.has("Python-pyproject")||t.has("Python-setup")||t.has("Python-requirements")||t.has("Python-pipfile")||t.has("Python-source"))&&i.add("Python"),(t.has("Rust-cargo")||t.has("Rust-source"))&&i.add("Rust"),(t.has("Go-mod")||t.has("Go-source"))&&i.add("Go"),(t.has("Java-pom")||t.has("Java-gradle"))&&i.add("Java"),t.has("Ruby-gemfile")&&i.add("Ruby"),t.has("PHP-composer")&&i.add("PHP"),t.size<2?[]:[...i]}o(P,"detectLanguages");export{P as a};
|
package/dist/chunk-ZL4MZMUK.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-ZLLER3HP.js";function R(r){if(!r||typeof r!="object")return r;let a=r,i=a.project_areas;if(i!==void 0&&!Array.isArray(i)){let n=i&&typeof i=="object"?i.areas:void 0;a.project_areas=Array.isArray(n)?n:void 0}return r}e(R,"normalizeRecommendations");import{z as o}from"zod";var g=["org","team","project","personal"],w=o.object({name:o.string().min(1),description:o.string().min(1),type:o.literal("instruction").default("instruction"),scope:o.enum(g),version:o.string().min(1),tags:o.array(o.string()).optional(),compatibility:o.array(o.string()).optional(),slots:o.record(o.string(),o.string()).optional(),metadata:o.record(o.string(),o.unknown()).optional()});import{z as s}from"zod";var v=s.object({name:s.string().min(1),description:s.string().min(1),type:s.literal("prompt"),version:s.string().min(1),tags:s.array(s.string()).optional(),variables:s.array(s.string()).optional(),metadata:s.record(s.string(),s.unknown()).optional()});function y(r,a){let i=a.map(n=>`- ID: ${n.id}
|
|
2
|
-
Name: ${n.name}
|
|
3
|
-
Description: ${n.description}
|
|
4
|
-
Tags: ${n.tags.join(", ")}
|
|
5
|
-
Preview: ${n.contentPreview}`).join(`
|
|
6
|
-
|
|
7
|
-
`);return`You are an expert at matching AI coding instructions to software projects.
|
|
8
|
-
|
|
9
|
-
## Project
|
|
10
|
-
- Name: ${r.name}
|
|
11
|
-
- Description: ${r.description??"No description"}
|
|
12
|
-
- Languages: ${r.languages.join(", ")||"Unknown"}
|
|
13
|
-
- Topics: ${r.topics.join(", ")||"None"}
|
|
14
|
-
- Dependencies: ${r.dependencies.join(", ")||"None"}
|
|
15
|
-
|
|
16
|
-
## Available Instructions
|
|
17
|
-
|
|
18
|
-
${i}
|
|
19
|
-
|
|
20
|
-
## Task
|
|
21
|
-
|
|
22
|
-
Analyze the project and recommend which instructions would be most useful. Consider:
|
|
23
|
-
1. Language and framework alignment
|
|
24
|
-
2. Project purpose and what standards/practices would help
|
|
25
|
-
3. Security, testing, and quality needs based on the project type
|
|
26
|
-
|
|
27
|
-
Return your response as JSON in this exact format:
|
|
28
|
-
{
|
|
29
|
-
"recommendations": [
|
|
30
|
-
{ "instructionId": "<id>", "score": <0.0-1.0>, "reason": "<one sentence explanation>" }
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
Only include instructions with a relevance score >= 0.5. Order by score descending. Return valid JSON only, no markdown fences.`}e(y,"buildRecommendationPrompt");var x=["Added","Changed","Fixed","Removed","Deprecated","Security"],M=/^##\s+\[([^\]]+)\](?:\s*[-–]\s*(\d{4}-\d{2}-\d{2}))?\s*$/,b=/^###\s+(.+?)\s*$/,k=/^[-*]\s+(.*\S)\s*$/,S=/^ {2,}(\S.*)$/;function T(r){let a=r.split(/\r?\n/),i=[],n=null,l=null,c=null;for(let u of a){let p=u.match(M);if(p){n&&i.push(n);let d=p[1].trim();n={version:d,date:p[2]??null,unreleased:d.toLowerCase()==="unreleased",sections:{}},l=null,c=null;continue}if(!n)continue;let m=u.match(b);if(m){let d=m[1].trim();x.includes(d)?(l=d,n.sections[l]||(n.sections[l]=[]),c=n.sections[l]):(l=null,c=null);continue}if(!l||!c)continue;let f=u.match(k);if(f){c.push(f[1]);continue}let h=u.match(S);if(h&&c.length>0){c[c.length-1]+=" "+h[1].trim();continue}}return n&&i.push(n),{entries:i}}e(T,"parseChangelog");function I(r){return r.entries.filter(a=>a.unreleased?!1:Object.values(a.sections).some(i=>i&&i.length>0))}e(I,"announceableEntries");import re from"gray-matter";import{z as _}from"zod";var ce=_.object({type:_.enum(["instruction","prompt"])});export{R as a,y as b,T as c,I as d};
|