@reddb-io/red-skills 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.bundle.min.mjs
CHANGED
|
@@ -803,7 +803,7 @@ requeued to ready-for-agent${e.activeBlocker?` (cleared active blocker: ${e.acti
|
|
|
803
803
|
`);let n;try{let i=await Zt("git",["branch","--show-current"],{cwd:t});n=i.code===0&&i.stdout.trim()||void 0}catch{}let o=Lmr(e)??(n?U4(n):void 0);return!o||!n?(process.stderr.write(`[afk] /ship alias: could not infer issue or branch.
|
|
804
804
|
Run manually: red-skills-dev requeue #ISSUE --adopt-branch BRANCH --guidance 'reason'
|
|
805
805
|
`),1):(process.stderr.write(`[afk] /ship alias: routing to requeue #${o} --adopt-branch ${n}
|
|
806
|
-
`),L4([String(o),"--adopt-branch",n,"--guidance","Adopted via deprecated /ship alias (ADR 0081). Update guidance if needed."],t,r))}import{existsSync as ghr,statSync as Ahr}from"node:fs";import{join as tdt,basename as yhr}from"node:path";function q4(e){let t={app:e,version:Umr(aR("__RED_BUILD_VERSION__",()=>"2.
|
|
806
|
+
`),L4([String(o),"--adopt-branch",n,"--guidance","Adopted via deprecated /ship alias (ADR 0081). Update guidance if needed."],t,r))}import{existsSync as ghr,statSync as Ahr}from"node:fs";import{join as tdt,basename as yhr}from"node:path";function q4(e){let t={app:e,version:Umr(aR("__RED_BUILD_VERSION__",()=>"2.8.0")??"0.0.0-dev"),gitSha:aR("__RED_BUILD_GIT_SHA__",()=>"a080233a4625516558a56adbaa2c78cf71809c32")??"unknown",buildTime:aR("__RED_BUILD_TIME__",()=>"2026-07-08T16:13:41-03:00")??"unknown",bundleAsset:aR("__RED_BUNDLE_ASSET__",()=>"dev.bundle.min.mjs")??"unknown"},r=aR("__REDDB_SDK_VERSION__",()=>""),n=aR("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function Umr(e){return e.startsWith("v")?e.slice(1):e}function Wlt(e){return`${e.app} ${e.version} ${e.gitSha}`}function aR(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}function G4(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.floor(e/1e3)}k`:String(e)}function jlt(e){let t=(r,n)=>{let o=(Math.round(r*10)/10).toFixed(1);return`${o.endsWith(".0")?o.slice(0,-2):o}${n}`};return e>=1e9?t(e/1e9,"B"):e>=1e6?t(e/1e6,"M"):e>=1e3?t(e/1e3,"k"):String(e>0?e:0)}function qlt(e){let t=e.toLowerCase();for(let r of["opus","sonnet","haiku","fable"])if(t.includes(r))return r;return e}function $mr(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let r=Math.floor(t/60);if(r<60)return`${r}m${t%60}s`;let n=Math.floor(r/60);return n<24?`${n}h${r%60}m`:`${Math.floor(n/24)}d${n%24}h`}function z4(e){if(e<60)return`${e}s`;let t=Math.floor(e/60);if(t<60)return`${t}m`;let r=Math.floor(t/60),n=t%60;return n>0?`${r}h${n}m`:`${r}h`}function Hmr(e){let t=e.basename;if(e.branch){let r=e.branch;return r.length>28&&(r=`${r.slice(0,27)}\u2026`),`${t} (${r})`}return e.detachedSha?`${t} (detached ${e.detachedSha})`:t}function Wmr(e){return!e||!e.model?null:e.effort?`${e.model}\xB7${e.effort}`:e.model}function jmr(e){if(!e)return null;let t=e.contextTokens;if(t===void 0||t===0)return null;let r=G4(t);return e.contextPercent===void 0?r:`${r} ${Math.round(e.contextPercent)}%`}function qmr(e){if(!e||e.workers<=0)return[];let t=[],r=(i,s)=>{t.push({label:i,value:s,suffix:""})};if(e.workers>0&&r("wrk=",String(e.workers)),e.sourceCounts&&e.sourceCounts.length>0)for(let{origin:i,count:s}of e.sourceCounts)r(`${i}=`,String(s));let n=e.cacheAgeS!==void 0?` (${z4(e.cacheAgeS)})`:"";if(e.queue>0&&t.push({label:"rdy=",value:String(e.queue),suffix:n}),e.human>0){let i=n&&e.queue===0?n:"";t.push({label:"hmn=",value:String(e.human),suffix:i})}e.blocked>0&&r("blk=",String(e.blocked));let o=[];return e.added>0&&o.push(`+${e.added}`),e.removed>0&&o.push(`-${e.removed}`),o.length&&r("loc=",e.locIsPeak?`~${o.join(" ")}`:o.join(" ")),e.waiting!==void 0&&e.waiting>0&&r("wai=",String(e.waiting)),e.tokens!==void 0&&e.tokens>0&&r("tok=",G4(e.tokens)),e.costUsd!==void 0&&e.costUsd>0&&r("usd=",e.costUsd.toFixed(2)),e.issues.forEach((i,s)=>{let a=e.stages?.[s],c=e.aliveMs?.[s],u=a?`\xB7${a}`:"";c!==void 0&&c>0&&(u+=`\xB7${$mr(c)}`),t.push({label:"#",value:String(i),suffix:u})}),t}function Gmr(e){if(!e)return null;let t=[];return e.usage5h!==void 0&&t.push(`5h=${Math.round(e.usage5h)}%`),e.usage7d!==void 0&&t.push(`7d=${Math.round(e.usage7d)}%`),t.length?t.join(" "):null}function zmr(e){if(!e)return null;let t=[],r=e.cacheAgeS!==void 0?` (${z4(e.cacheAgeS)})`:"";if(e.openPrs&&e.openPrs>0&&t.push(`prs=${e.openPrs}${r}`),e.openIssues&&e.openIssues>0){let o=r&&(!e.openPrs||e.openPrs===0)?r:"";t.push(`iss=${e.openIssues}${o}`)}let n=[];return e.localAdded&&e.localAdded>0&&n.push(`+${e.localAdded}`),e.localRemoved&&e.localRemoved>0&&n.push(`-${e.localRemoved}`),n.length&&t.push(`loc=${n.join(" ")}`),t.length?t.join(" "):null}function Vmr(e){let t=qmr(e);return t.length===0?null:t.map(r=>`${r.label}${r.value}${r.suffix}`).join(" ")}function Glt(e){let t=[Hmr(e.project)],r=Wmr(e.claude);r!==null&&t.push(r);let n=jmr(e.claude);n!==null&&t.push(n);let o=Gmr(e.claude);o!==null&&t.push(o);let i=zmr(e.repo);i!==null&&t.push(i);let s=Vmr(e.afk);return s!==null&&t.push(s),t.join(" \xB7 ")}var Ymr="\x1B[48;2;114;47;55m",Jmr="\x1B[48;2;88;36;42m",zlt="\x1B[49m",yC="\x1B[38;2;255;255;255m",Vlt="\x1B[38;2;255;214;214m",Ylt="\x1B[39m",Y4="\x1B[38;2;224;138;148m",V4="\x1B[38;2;201;150;158m",Kmr="\x1B[38;2;240;200;120m",Jlt="\x1B[1m",Klt="\x1B[22m",Zlt="\x1B[0m",Zmr=28,Xmr=" ",bAe=["workerId","run","org","iss","stage","elapsed","loc","tks","tls","rsn","txt"],ehr=e=>e.replace(/\x1b\[[0-9;]*m/g,"");function Xlt(e){return ehr(e).length}function thr(e,t){return e+" ".repeat(Math.max(0,t-Xlt(e)))}var cR=(e,t)=>`${Vlt}${e}=${Ylt}${t}${Y4}`;function rhr(e,t){let r=[];return e&&e>0&&r.push(`+${e}`),t&&t>0&&r.push(`-${t}`),r.length?r.join(" "):null}function nhr(e){let t="";if(e.branch){let n=e.branch.length>Zmr?`${e.branch.slice(0,27)}\u2026`:e.branch;t=` ${V4}(${n})${yC}`}else e.detachedSha&&(t=` ${V4}(detached ${e.detachedSha})${yC}`);let r=e.version?` ${V4}v${e.version}${yC}`:"";return`${Kmr}\xBB${yC} ${Jlt}${e.basename}${Klt}${t}${r}`}function ohr(e){return!e||!e.model?null:e.effort?`${e.model}${V4}\xB7${yC}${e.effort}`:e.model}function ihr(e){if(!e||!e.contextTokens)return null;let t=G4(e.contextTokens),r=e.contextPercent===void 0?t:`${t} ${Math.round(e.contextPercent)}%`;return cR("ctx",r)}function shr(e){if(!e)return[];let t=[];return e.usage5h!==void 0&&t.push(cR("5h",`${Math.round(e.usage5h)}%`)),e.usage7d!==void 0&&t.push(cR("7d",`${Math.round(e.usage7d)}%`)),t}function ahr(e){if(!e)return[];let t=[],r=e.cacheAgeS!==void 0?` (${z4(e.cacheAgeS)})`:"";if(e.openPrs&&e.openPrs>0&&t.push(cR("prs",String(e.openPrs))+r),e.openIssues&&e.openIssues>0){let n=r&&(!e.openPrs||e.openPrs===0)?r:"";t.push(cR("iss",String(e.openIssues))+n)}return t}function chr(e){if(!e)return[];let t=rhr(e.localAdded,e.localRemoved);return t?[cR("loc",t)]:[]}function uhr(e,t,r){let n=`${Jmr}${yC} ${nhr(e)} `,o=ohr(t);o!==null&&(n+=`${Ymr}${yC} ${o} `),n+=`${zlt}${Y4}`;let i=[ihr(t),...shr(t),...ahr(r),...chr(r)].filter(s=>s!==null);return i.length&&(n+=` ${i.join(" ")}`),`${n}${Zlt}`}function lhr(e,t){let r=olt(e,t),n=[r.runner,r.model?qlt(r.model):void 0,r.effort].filter(o=>!!o).join(" ");return{workerId:r.workerId,run:`run=${n}`,org:`org=${r.origin||"afk"}`,iss:r.issue===null?"":`iss=${String(r.issue)}`,stage:r.issue===null?"":r.stage,elapsed:r.elapsed,loc:`loc=${N4(r.added,r.removed)}`,tks:`tks=${jlt(r.tokens)}`,tls:`tls=${String(r.tools)}`,rsn:`rsn=${String(r.reasoning)}`,txt:`txt=${String(r.text)}`}}function dhr(e){let t=Object.fromEntries(bAe.map(r=>[r,0]));for(let r of e)for(let n of bAe)t[n]=Math.max(t[n],Xlt(r[n]));return t}function fhr(e,t){if(e==="workerId")return`${Jlt}${t}${Klt}`;let r=t.indexOf("=");return r>0?`${Vlt}${t.slice(0,r+1)}${Ylt}${t.slice(r+1)}${Y4}`:t}function phr(e,t){let r=bAe.map(n=>fhr(n,thr(e[n],t[n])));return`${zlt}${Y4}${r.join(Xmr)}${Zlt}`}function mhr(e,t){let r=e.map(o=>lhr(o,t)),n=dhr(r);return r.map(o=>phr(o,n))}function hhr(e,t={}){let r=[uhr(e.project,e.claude,e.repo)],n=t.now??0;return r.push(...mhr(t.workers??[],n)),r.join(`
|
|
807
807
|
`)}function edt(e,t,r={}){return t?hhr(e,r):Glt(e)}Qo();function xhr(e){return new Promise(t=>{if(e.isTTY){t("");return}let r="",n=!1,o=()=>{n||(n=!0,t(r))};e.setEncoding("utf8"),e.on("data",i=>{r+=i}),e.on("end",o),e.on("error",o),e.on("close",o)})}function Ehr(e){if(!e.trim())return{};try{let t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}function bhr(e){try{return Ahr(e).isDirectory()}catch{return!1}}function Shr(e,t,r){if(e&&bhr(e))return e;let n=t.workspace?.project_dir||t.workspace?.current_dir||t.cwd;return n||r}function Chr(e){let t=tdt(e,".red","config.yaml");if(!ghr(t))return!0;let r=br(t,{warn:()=>{}});return!(tt(r,"statusline")==="false"||tt(r,"afk.statusline")==="false")}async function Ihr(e){let t={cwd:e},r=q4("dev").version,n={basename:yhr(e),version:r},o=await LN(t);if(o)return{...n,branch:o};let i=await Xh(t);return i?{...n,detachedSha:i}:n}function whr(e){let t=e.model?.display_name,r=e.effort?.level,n=e.context_window?.total_input_tokens,o=e.context_window?.used_percentage,i=e.rate_limits?.five_hour?.used_percentage,s=e.rate_limits?.seven_day?.used_percentage;if(!(t===void 0&&n===void 0&&i===void 0&&s===void 0))return{model:t||void 0,effort:r||void 0,contextTokens:n,contextPercent:o,usage5h:i,usage7d:s}}async function rdt(e,t=process.cwd(),r=process.stdout,n=process.stdin){if(e.includes("--legend"))return r.write(`${M4()}
|
|
808
808
|
`),0;let o=e[0],i=await xhr(n),s=Ehr(i),a=Shr(o,s,t);if(!Chr(a))return 0;let c=await Ihr(a),u=whr(s),l={root:a,repo:Wv(a),remote:"origin"},d=br(tdt(a,".red","config.yaml"),{warn:()=>{}}),f=jV(process.env,I=>tt(d,I)),[p,m,g]=await Promise.all([pst(l,f),dst(l,f).then(I=>I??void 0),fst(l)]),A=!process.env.NO_COLOR,E=Number.parseInt(process.env.COLUMNS??"",10),y=Math.floor(Date.now()/1e3),b=edt({project:c,claude:u,repo:p,afk:m},A,{columns:Number.isFinite(E)&&E>0?E:void 0,workers:g,now:y});return r.write(`${b}
|
|
809
809
|
`),0}async function ndt(e,t=process.cwd()){let r=e[0]??t,n="",o="";for(let i=1;i<e.length;i+=1){let s=e[i];s==="--repo"?n=e[++i]??"":s==="--lock"&&(o=e[++i]??"")}return await lst(r,n||Wv(r),o||void 0),0}vC();import{spawn as ydt}from"node:child_process";import{existsSync as CAe,openSync as Edt,closeSync as Ohr,writeFileSync as bdt,writeSync as Nhr,rmSync as IAe,renameSync as Mhr}from"node:fs";import{join as xC}from"node:path";import{existsSync as khr,readdirSync as EM,readFileSync as J4,statSync as adt}from"node:fs";import{join as os}from"node:path";Tp();function vhr(e,t){return os(e,`afk-supervisor-slot-${t}.log`)}function Rhr(e){let t;try{t=J4(e,"utf8")}catch{return[]}let r=[],n=new Set;for(let o of t.split(`
|
|
@@ -6515,7 +6515,7 @@ Usage:
|
|
|
6515
6515
|
${r} archive --candidate <json> [--root <dir>] [--archive-dir <rel>]
|
|
6516
6516
|
${r} restore <name> [--root <dir>] [--archive-dir <rel>]`}function nL(r){return ygr(typeof r.root=="string"?r.root:process.cwd())}function Dct(r){return typeof r["archive-dir"]=="string"?r["archive-dir"]:void 0}async function YW(r){let s=await Mu(r);return s?s.mode!=="graph"?{ok:!1,message:`curate: skill telemetry needs graph mode (this project is "${s.mode}") \u2014 run \`${_De}\``}:uh(s)?{ok:!0}:{ok:!1,message:`curate: skill telemetry is not enabled here \u2014 run \`${_De}\``}:{ok:!1,message:`curate: memory is not initialized here \u2014 run \`${_De}\``}}function bgr(){let r=hgr(vgr(import.meta.url));return r.includes("dist/curate-skill")||r.endsWith("dist/curate-skill")?Ect(r,"..","cli.js"):Ect(r,"..","cli.ts")}async function Sgr(r,s){let l=["curate","skills","--json"];s!==void 0&&l.push("--stale-days",String(s));let f=bgr(),v=f.endsWith(".ts")?Cct(process.execPath,["--import","tsx",f,...l,"--root",r],{encoding:"utf8"}):Cct(process.execPath,[f,...l,"--root",r],{encoding:"utf8"}),T=v.status??1;if(T!==0)throw new Error(`memory curate skills exited ${T}`);return kct(v.stdout??"")}function xgr(r){return typeof r.flags["stale-days"]=="string"?Number(r.flags["stale-days"]):void 0}async function Act(r,s){return(s.loadCuratorReport??Sgr)(nL(r.flags),xgr(r))}async function kgr(r){let s=nL(r.flags),l=await YW(s);return l.ok?(console.log("curate: skill telemetry is enabled \u2014 ready to curate"),0):(console.error(l.message),2)}async function wgr(r,s){let l=nL(r.flags),f=await YW(l);if(!f.ok)return console.error(f.message),2;let _;try{_=await Act(r,s)}catch(B){return console.error(`curate: ${B.message}`),1}let{candidates:v,byCategory:T,filtered:N}=fDe(_);return console.log(JSON.stringify({candidates:v,byCategory:T,filtered:N,totals:{totalSkills:_.totalSkills,curatableSkills:_.curatableSkills,readOnlySkills:_.readOnlySkills}},null,2)),0}async function Tgr(r,s){let l=nL(r.flags),f=await YW(l);if(!f.ok)return console.error(f.message),2;let _;try{_=await Act(r,s)}catch(B){return console.error(`curate: ${B.message}`),1}let{byCategory:v}=fDe(_);if(pDe(v)===0)return console.error("curate: no candidates \u2014 no issue filed"),0;let T=typeof r.flags.label=="string"?r.flags.label:void 0,N=await Tct({byCategory:v,totals:{totalSkills:_.totalSkills,curatableSkills:_.curatableSkills,readOnlySkills:_.readOnlySkills},generatedAt:_.generatedAt},{cwd:l,label:T});return console.log(`curate: filed background issue \u2014 ${N.output||N.title}`),0}async function Cgr(r){let s=nL(r.flags),l=await YW(s);if(!l.ok)return console.error(l.message),2;let f=r.flags.candidate;if(typeof f!="string")return console.error("curate archive: --candidate <json> is required"),2;let _;try{_=JSON.parse(f)}catch(T){return console.error(`curate archive: invalid --candidate JSON: ${T.message}`),2}let v=await Sct(_,{rootDir:s,archiveDir:Dct(r.flags)});return v.ok?(console.log(`curate: archived "${v.receipt.name}" \u2192 ${v.receipt.archiveRoot} (${v.receipt.files.length} file(s), manifest at ${v.receipt.manifestPath})`),0):(console.error(`curate archive: refused \u2014 ${v.rejection.reason}: ${v.rejection.detail}`),3)}async function Egr(r){let s=nL(r.flags),l=await YW(s);if(!l.ok)return console.error(l.message),2;let f=r.positional[0];if(!f)return console.error("curate restore: skill name is required"),2;let _=await xct(f,{rootDir:s,archiveDir:Dct(r.flags)});return console.log(`curate: restored "${_.name}" \u2192 ${_.restoredRoot} (${_.files.length} file(s) hash-verified)`),0}async function Nct(r,s={}){switch(r.command){case"check":return kgr(r);case"list":return wgr(r,s);case"background":return Tgr(r,s);case"archive":return Cgr(r);case"restore":return Egr(r);case void 0:case"--help":case"-h":return console.log(Pct(s.usageCommand)),0;default:return console.error(`unknown curate subcommand: ${r.command}
|
|
6517
6517
|
|
|
6518
|
-
${Pct(s.usageCommand)}`),2}}function Ict(r){let s={app:r,version:Pgr(iL("__RED_BUILD_VERSION__",()=>"2.
|
|
6518
|
+
${Pct(s.usageCommand)}`),2}}function Ict(r){let s={app:r,version:Pgr(iL("__RED_BUILD_VERSION__",()=>"2.8.0")??"0.0.0-dev"),gitSha:iL("__RED_BUILD_GIT_SHA__",()=>"a080233a4625516558a56adbaa2c78cf71809c32")??"unknown",buildTime:iL("__RED_BUILD_TIME__",()=>"2026-07-08T16:13:41-03:00")??"unknown",bundleAsset:iL("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},l=iL("__REDDB_SDK_VERSION__",()=>"1.7.0"),f=iL("__REDDB_BINARY_TAG__",()=>"v1.7.0");return l&&(s.reddbSdkVersion=l),f&&(s.reddbBinaryTag=f),s}function Pgr(r){return r.startsWith("v")?r.slice(1):r}function Rct(r){return`${r.app} ${r.version} ${r.gitSha}`}function iL(r,s){try{let l=s();return typeof l=="string"&&l.length>0?l:void 0}catch{return process.env[r.replace(/^__|__$/g,"")]}}var Oct=`memory \u2014 governed operational memory for code agents
|
|
6519
6519
|
|
|
6520
6520
|
Common workflows:
|
|
6521
6521
|
remember one fact memory store "Decision: ..."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reddb-io/red-skills",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "RedSkills plugin runtime bundles (dev, memory, brain) distributed over npm — the v2 client transport (ADR 0091). Carries the platform-independent JS bundles inside the tarball plus thin bin shims; no postinstall download.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|