@reddb-io/red-skills 2.57.2 → 2.57.3

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.
@@ -6577,7 +6577,7 @@ Usage:
6577
6577
  ${n} archive --candidate <json> [--root <dir>] [--archive-dir <rel>]
6578
6578
  ${n} restore <name> [--root <dir>] [--archive-dir <rel>]`}function gx(n){return NNn(typeof n.root=="string"?n.root:process.cwd())}function Yot(n){return typeof n["archive-dir"]=="string"?n["archive-dir"]:void 0}async function hj(n){let a=await Co(n);return a?a.mode!=="graph"?{ok:!1,message:`curate: skill telemetry needs graph mode (this project is "${a.mode}") \u2014 run \`${Vwe}\``}:sZ(a)?{ok:!0}:{ok:!1,message:`curate: skill telemetry is not enabled here \u2014 run \`${Vwe}\``}:{ok:!1,message:`curate: memory is not initialized here \u2014 run \`${Vwe}\``}}function VNn(){let n=WNn(YNn(import.meta.url));return n.includes("dist/curate-skill")||n.endsWith("dist/curate-skill")?Wot(n,"..","cli.js"):Wot(n,"..","cli.ts")}async function gNn(n,a){let i=["curate","skills","--json"];a!==void 0&&i.push("--stale-days",String(a));let d=VNn(),h=d.endsWith(".ts")?hot(process.execPath,["--import","tsx",d,...i,"--root",n],{encoding:"utf8"}):hot(process.execPath,[d,...i,"--root",n],{encoding:"utf8"}),y=h.status??1;if(y!==0)throw new Error(`memory curate skills exited ${y}`);return uot(h.stdout??"")}function yNn(n){return typeof n.flags["stale-days"]=="string"?Number(n.flags["stale-days"]):void 0}async function Vot(n,a){return(a.loadCuratorReport??gNn)(gx(n.flags),yNn(n))}async function RNn(n){let a=gx(n.flags),i=await hj(a);return i.ok?(console.log("curate: skill telemetry is enabled \u2014 ready to curate"),0):(console.error(i.message),2)}async function vNn(n,a){let i=gx(n.flags),d=await hj(i);if(!d.ok)return console.error(d.message),2;let b;try{b=await Vot(n,a)}catch(J){return console.error(`curate: ${J.message}`),1}let{candidates:h,byCategory:y,filtered:w}=Nwe(b);return console.log(JSON.stringify({candidates:h,byCategory:y,filtered:w,totals:{totalSkills:b.totalSkills,curatableSkills:b.curatableSkills,readOnlySkills:b.readOnlySkills}},null,2)),0}async function FNn(n,a){let i=gx(n.flags),d=await hj(i);if(!d.ok)return console.error(d.message),2;let b;try{b=await Vot(n,a)}catch(J){return console.error(`curate: ${J.message}`),1}let{byCategory:h}=Nwe(b);if(Ywe(h)===0)return console.error("curate: no candidates \u2014 no issue filed"),0;let y=typeof n.flags.label=="string"?n.flags.label:void 0,w=await Zot({byCategory:h,totals:{totalSkills:b.totalSkills,curatableSkills:b.curatableSkills,readOnlySkills:b.readOnlySkills},generatedAt:b.generatedAt},{cwd:i,label:y});return console.log(`curate: filed background issue \u2014 ${w.output||w.title}`),0}async function XNn(n){let a=gx(n.flags),i=await hj(a);if(!i.ok)return console.error(i.message),2;let d=n.flags.candidate;if(typeof d!="string")return console.error("curate archive: --candidate <json> is required"),2;let b;try{b=JSON.parse(d)}catch(y){return console.error(`curate archive: invalid --candidate JSON: ${y.message}`),2}let h=await mot(b,{rootDir:a,archiveDir:Yot(n.flags)});return h.ok?(console.log(`curate: archived "${h.receipt.name}" \u2192 ${h.receipt.archiveRoot} (${h.receipt.files.length} file(s), manifest at ${h.receipt.manifestPath})`),0):(console.error(`curate archive: refused \u2014 ${h.rejection.reason}: ${h.rejection.detail}`),3)}async function fNn(n){let a=gx(n.flags),i=await hj(a);if(!i.ok)return console.error(i.message),2;let d=n.positional[0];if(!d)return console.error("curate restore: skill name is required"),2;let b=await bot(d,{rootDir:a,archiveDir:Yot(n.flags)});return console.log(`curate: restored "${b.name}" \u2192 ${b.restoredRoot} (${b.files.length} file(s) hash-verified)`),0}async function got(n,a={}){switch(n.command){case"check":return RNn(n);case"list":return vNn(n,a);case"background":return FNn(n,a);case"archive":return XNn(n);case"restore":return fNn(n);case void 0:case"--help":case"-h":return console.log(Not(a.usageCommand)),0;default:return console.error(`unknown curate subcommand: ${n.command}
6579
6579
 
6580
- ${Not(a.usageCommand)}`),2}}function yot(n){let a={app:n,version:wNn(yx("__RED_BUILD_VERSION__",()=>"2.57.2")??"0.0.0-dev"),gitSha:yx("__RED_BUILD_GIT_SHA__",()=>"50513f32fbfe148d55f35746bfbf9bbe990e5809")??"unknown",buildTime:yx("__RED_BUILD_TIME__",()=>"2026-07-15T02:20:33-03:00")??"unknown",bundleAsset:yx("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},i=yx("__REDDB_SDK_VERSION__",()=>"1.23.1"),d=yx("__REDDB_BINARY_TAG__",()=>"v1.23.1");return i&&(a.reddbSdkVersion=i),d&&(a.reddbBinaryTag=d),a}function wNn(n){return n.startsWith("v")?n.slice(1):n}function Rot(n){return`${n.app} ${n.version} ${n.gitSha}`}function yx(n,a){try{let i=a();return typeof i=="string"&&i.length>0?i:void 0}catch{return process.env[n.replace(/^__|__$/g,"")]}}var vot=`memory \u2014 governed operational memory for code agents
6580
+ ${Not(a.usageCommand)}`),2}}function yot(n){let a={app:n,version:wNn(yx("__RED_BUILD_VERSION__",()=>"2.57.3")??"0.0.0-dev"),gitSha:yx("__RED_BUILD_GIT_SHA__",()=>"3a4886f9d7da9cafb4dd5f70014c3bb5d2f9a28f")??"unknown",buildTime:yx("__RED_BUILD_TIME__",()=>"2026-07-15T02:36:26-03:00")??"unknown",bundleAsset:yx("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},i=yx("__REDDB_SDK_VERSION__",()=>"1.23.1"),d=yx("__REDDB_BINARY_TAG__",()=>"v1.23.1");return i&&(a.reddbSdkVersion=i),d&&(a.reddbBinaryTag=d),a}function wNn(n){return n.startsWith("v")?n.slice(1):n}function Rot(n){return`${n.app} ${n.version} ${n.gitSha}`}function yx(n,a){try{let i=a();return typeof i=="string"&&i.length>0?i:void 0}catch{return process.env[n.replace(/^__|__$/g,"")]}}var vot=`memory \u2014 governed operational memory for code agents
6581
6581
 
6582
6582
  Common workflows:
6583
6583
  remember one fact memory store "Decision: ..."
@@ -144,7 +144,7 @@ ${n[n.length-1]}`,s=Buffer.from(r);return s.length<=t?r:s.subarray(0,t).toString
144
144
  `:""}`,truncated:o.length<s.length}}function Zg(e){let t=[];for(let n=0;n<e.length;n++){let s=e[n].trim(),i=/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(class|interface|type)\s+([A-Za-z_$][\w$]*)/.exec(s);if(i){t.push({kind:i[1],name:i[2],line:n+1,signature:s});continue}let o=/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s+([A-Za-z_$][\w$]*)\s*\([^)]*\)\s*(?::[^{]+)?/.exec(s);if(o){t.push({kind:"function",name:o[1],line:n+1,signature:s});continue}let a=/^(?:public\s+|private\s+|protected\s+|static\s+|async\s+)*([A-Za-z_$][\w$]*)\s*\([^)]*\)\s*(?::[^{]+)?\s*\{/.exec(s);a&&!eh(a[1])&&t.push({kind:"method",name:a[1],line:n+1,signature:s})}return t}function rr(e){let t=e.split(`
145
145
  `);return t.at(-1)===""?t.slice(0,-1):t}function zc(e){return e.includes(0)||!Fg(e)}function Wc(e){return Vg.has(Jg(e).toLowerCase())}function eh(e){return["for","if","switch","while"].includes(e)}function Hc(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function Vc(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}var Jc,Ws,Wg,Hg,Vg,Ks=R(()=>{"use strict";Re();Ke();Jc=8*1024,Ws=10,Wg=8,Hg=2,Vg=new Set([".c",".cc",".cpp",".cs",".go",".java",".js",".jsx",".mjs",".py",".rs",".ts",".tsx"])});var sr={};N(sr,{parseExecCommandLine:()=>Xc,renderExecContract:()=>Qc,runExecWrapper:()=>oh});import{isUtf8 as th}from"node:buffer";import{spawn as nh}from"node:child_process";async function oh(e,t){let n=Xc(e),r=await ah(n);return await Qc(n,r,t)}async function Qc(e,t,n){let r=Buffer.from(t.stdout,"binary"),s=Buffer.from(t.stderr,"binary");if(r.length===0)return{stdout:r,stderr:s,status:t.status,signal:t.signal,rawOutput:r};let i=ch(r);if(i.kind==="text"){let d=await Yt(i.text,{level:n.level,command:e,store:n.store?{mint:async(...f)=>await n.store.mint(...f)}:void 0});if(d.detected)return{stdout:Buffer.from(d.output),stderr:s,status:t.status,signal:t.signal,mintedHandle:d.handle,bytesElided:d.lossy?r.length:void 0,rawOutput:r}}let o=i.kind==="text"?Buffer.from(i.text):r,a=dh(n.heavyByteThreshold,rh);if(o.length<=a&&n.level!=="terse")return{stdout:o,stderr:s,status:t.status,signal:t.signal,rawOutput:r};let c=r.length,u=n.level==="lossless"?"terse":n.level,l=await n.store?.mint(r,{command:e,loss:{level:u,bytes_elided:c}});if(!l)throw new Error("rsp exec output elision requires an elision store");return{stdout:Buffer.from(uh(o,r.length,l,n.level)),stderr:s,status:t.status,signal:t.signal,mintedHandle:l,bytesElided:c,rawOutput:r}}function Xc(e){if(e[0]!=="exec")throw new Error("expected rsp exec -- <command line>");let t=e.indexOf("--"),n=t>=0?e.slice(t+1):e.slice(1),r=n.length===1?n[0]:n.join(" ");if(!r.trim())throw new Error("usage: rsp exec -- <command line>");return r}async function ah(e){let t=nh(e,{shell:!0,stdio:["inherit","pipe","pipe"]}),n=[],r=[];return t.stdout.on("data",s=>n.push(s)),t.stderr.on("data",s=>r.push(s)),await new Promise((s,i)=>{t.on("error",i),t.on("close",(o,a)=>{s({stdout:Buffer.concat(n).toString("binary"),stderr:Buffer.concat(r).toString("binary"),status:o,signal:a})})})}function ch(e){return th(e)?{kind:"text",text:gt(e.toString("utf8"))}:{kind:"bytes"}}function uh(e,t,n,r){let i=Math.max(1,Math.floor((r==="terse"?ih:sh)/2)),o=Yc(e.subarray(0,i)),a=Yc(e.subarray(Math.max(0,e.length-i))),c=lh(e),u=["stdout summary",`bytes: ${t}`,`lines: ${c}`,"head:",o];return a&&a!==o&&u.push("tail:",a),u.push(`\u2026 elided stdout (+${t}) \u2014 ${Q(n)}`),`${u.join(`
146
146
  `)}
147
- `}function Yc(e){return e.toString("utf8").replace(/�$/g,"")}function lh(e){if(e.length===0)return 0;let t=0;for(let n of e)n===10&&t++;return e[e.length-1]===10?t:t+1}function dh(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}var rh,sh,ih,ir=R(()=>{"use strict";Ke();Qt();rh=8*1024,sh=2*1024,ih=1024});xr();Re();import{spawn as fh}from"node:child_process";import{createHash as mh}from"node:crypto";import{appendFileSync as Zc,existsSync as nn,mkdirSync as ph,readFileSync as gh,readdirSync as hh,statSync as yh}from"node:fs";import{tmpdir as wh}from"node:os";import{dirname as nu,join as ce}from"node:path";import{fileURLToPath as ru}from"node:url";function Ci(e){let t={app:e,version:El(it("__RED_BUILD_VERSION__",()=>"2.57.2")??"0.0.0-dev"),gitSha:it("__RED_BUILD_GIT_SHA__",()=>"50513f32fbfe148d55f35746bfbf9bbe990e5809")??"unknown",buildTime:it("__RED_BUILD_TIME__",()=>"2026-07-15T02:20:33-03:00")??"unknown",bundleAsset:it("__RED_BUNDLE_ASSET__",()=>"rsp.bundle.min.mjs")??"unknown"},n=it("__REDDB_SDK_VERSION__",()=>"1.23.1"),r=it("__REDDB_BINARY_TAG__",()=>"v1.23.1");return n&&(t.reddbSdkVersion=n),r&&(t.reddbBinaryTag=r),t}function El(e){return e.startsWith("v")?e.slice(1):e}function it(e,t){try{let n=t();return typeof n=="string"&&n.length>0?n:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}jr();async function bh(e=process.argv.slice(2)){let t=Ci("rsp"),n=Ch(e);if(n.command==="hook"&&n.positional[1]==="claude-pre-exec"){let{runClaudePreExecHook:m}=await Promise.resolve().then(()=>(qn(),us));return await m()}if(n.command==="hook"&&n.positional[1]==="codex-pre-exec"){let{runCodexPreExecHook:m}=await Promise.resolve().then(()=>(qn(),us));return await m()}if(n.command==="hook"&&n.positional[1]==="claude-post-exec"){let{runClaudePostExecHook:m}=await Promise.resolve().then(()=>(Qt(),ds));return await m()}if(n.command==="hook"&&n.positional[1]==="codex-post-exec"){let{runCodexPostExecHook:m}=await Promise.resolve().then(()=>(Qt(),ds));return await m()}if(n.command==="setup"){let{provisionRspRepoStore:m}=await Promise.resolve().then(()=>(Sa(),Ra)),p=await m(process.cwd());return process.stdout.write(Jh(p)),0}if(n.command==="mcp"){let{runRspMcpServer:m}=await Promise.resolve().then(()=>(Oa(),Pa));return await m(),0}if(n.command==="wait"){let{runWait:m}=await Promise.resolve().then(()=>(Ma(),La));return await m(n.positional)}if(n.command==="shell-init"){let m=n.positional[1];if(m!=="fish"&&m!=="bash"&&m!=="zsh")return process.stdout.write(`error: usage rsp shell-init fish|bash|zsh
147
+ `}function Yc(e){return e.toString("utf8").replace(/�$/g,"")}function lh(e){if(e.length===0)return 0;let t=0;for(let n of e)n===10&&t++;return e[e.length-1]===10?t:t+1}function dh(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}var rh,sh,ih,ir=R(()=>{"use strict";Ke();Qt();rh=8*1024,sh=2*1024,ih=1024});xr();Re();import{spawn as fh}from"node:child_process";import{createHash as mh}from"node:crypto";import{appendFileSync as Zc,existsSync as nn,mkdirSync as ph,readFileSync as gh,readdirSync as hh,statSync as yh}from"node:fs";import{tmpdir as wh}from"node:os";import{dirname as nu,join as ce}from"node:path";import{fileURLToPath as ru}from"node:url";function Ci(e){let t={app:e,version:El(it("__RED_BUILD_VERSION__",()=>"2.57.3")??"0.0.0-dev"),gitSha:it("__RED_BUILD_GIT_SHA__",()=>"3a4886f9d7da9cafb4dd5f70014c3bb5d2f9a28f")??"unknown",buildTime:it("__RED_BUILD_TIME__",()=>"2026-07-15T02:36:26-03:00")??"unknown",bundleAsset:it("__RED_BUNDLE_ASSET__",()=>"rsp.bundle.min.mjs")??"unknown"},n=it("__REDDB_SDK_VERSION__",()=>"1.23.1"),r=it("__REDDB_BINARY_TAG__",()=>"v1.23.1");return n&&(t.reddbSdkVersion=n),r&&(t.reddbBinaryTag=r),t}function El(e){return e.startsWith("v")?e.slice(1):e}function it(e,t){try{let n=t();return typeof n=="string"&&n.length>0?n:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}jr();async function bh(e=process.argv.slice(2)){let t=Ci("rsp"),n=Ch(e);if(n.command==="hook"&&n.positional[1]==="claude-pre-exec"){let{runClaudePreExecHook:m}=await Promise.resolve().then(()=>(qn(),us));return await m()}if(n.command==="hook"&&n.positional[1]==="codex-pre-exec"){let{runCodexPreExecHook:m}=await Promise.resolve().then(()=>(qn(),us));return await m()}if(n.command==="hook"&&n.positional[1]==="claude-post-exec"){let{runClaudePostExecHook:m}=await Promise.resolve().then(()=>(Qt(),ds));return await m()}if(n.command==="hook"&&n.positional[1]==="codex-post-exec"){let{runCodexPostExecHook:m}=await Promise.resolve().then(()=>(Qt(),ds));return await m()}if(n.command==="setup"){let{provisionRspRepoStore:m}=await Promise.resolve().then(()=>(Sa(),Ra)),p=await m(process.cwd());return process.stdout.write(Jh(p)),0}if(n.command==="mcp"){let{runRspMcpServer:m}=await Promise.resolve().then(()=>(Oa(),Pa));return await m(),0}if(n.command==="wait"){let{runWait:m}=await Promise.resolve().then(()=>(Ma(),La));return await m(n.positional)}if(n.command==="shell-init"){let m=n.positional[1];if(m!=="fish"&&m!=="bash"&&m!=="zsh")return process.stdout.write(`error: usage rsp shell-init fish|bash|zsh
148
148
  `),2;let{renderShellInit:p}=await Promise.resolve().then(()=>(Ga(),Ua));return process.stdout.write(p(m)),0}let{resolveRspConfig:r}=await Promise.resolve().then(()=>(ne(),ao)),s=r(process.cwd(),process.env,n.storeUri),i=$h(n.command);if(!s.enabled)return i?await Ih(n.positional):(process.stdout.write(`${ni()}
149
149
  `),0);if(n.command==="git"&&Xs(n.positional)){let m=process.hrtime.bigint();return await G(n,await Zs(),m,void 0,await _h(process.cwd()))}let{resolveResidentPaths:o,ResidentRspElisionStore:a,ensureResidentServer:c}=await Promise.resolve().then(()=>(je(),Lt));if(n.command==="server"){let{runResidentServer:m}=await Promise.resolve().then(()=>(bc(),wc)),p=o(process.cwd()),k=ae(n.positional,"--socket")??p.socketPath,w=r(process.cwd(),process.env,n.storeUri??ae(n.positional,"--store-uri"));return w.enabled?(await m({socketPath:k,pidPath:ae(n.positional,"--pid-file")??o(process.cwd()).pidPath,rootDir:p.rootDir,storeUri:w.storeUri,ttlDays:B(n.positional,"--ttl-days")??w.ttlDays,ephemeralTtlHours:B(n.positional,"--ephemeral-ttl-hours")??w.ephemeralTtlHours,byteBudget:B(n.positional,"--byte-budget")??w.byteBudget,telemetryTtlDays:B(n.positional,"--telemetry-ttl-days")??w.telemetryTtlDays,telemetryByteBudget:B(n.positional,"--telemetry-byte-budget")??w.telemetryByteBudget,telemetryDrainIntervalMs:B(n.positional,"--telemetry-drain-interval-ms")??w.telemetryDrainIntervalMs,telemetryDrainTimeoutMs:B(n.positional,"--telemetry-drain-timeout-ms")??w.telemetryDrainTimeoutMs,idleMs:B(n.positional,"--idle-ms")??w.idleMs,residentVersion:ae(n.positional,"--resident-version")??t.version,registryPath:ae(n.positional,"--registry")??p.registryPath}),0):(process.stdout.write(`${ni()}
150
150
  `),0)}if(n.command==="warm-resident"){let m=o(process.cwd()),p=ae(n.positional,"--socket")??m.socketPath,k=ae(n.positional,"--wake-lock")??m.wakeLockPath,w=r(process.cwd(),process.env,n.storeUri??ae(n.positional,"--store-uri"));if(!w.enabled)return 0;let{warmResidentServer:T}=await Promise.resolve().then(()=>(je(),Lt));return await T({...m,socketPath:p,wakeLockPath:k},{storeUri:w.storeUri,ttlDays:B(n.positional,"--ttl-days")??w.ttlDays,ephemeralTtlHours:B(n.positional,"--ephemeral-ttl-hours")??w.ephemeralTtlHours,byteBudget:B(n.positional,"--byte-budget")??w.byteBudget,telemetryTtlDays:B(n.positional,"--telemetry-ttl-days")??w.telemetryTtlDays,telemetryByteBudget:B(n.positional,"--telemetry-byte-budget")??w.telemetryByteBudget,telemetryDrainIntervalMs:B(n.positional,"--telemetry-drain-interval-ms")??w.telemetryDrainIntervalMs,telemetryDrainTimeoutMs:B(n.positional,"--telemetry-drain-timeout-ms")??w.telemetryDrainTimeoutMs,idleMs:B(n.positional,"--idle-ms")??w.idleMs,clientVersion:t.version}),0}let u=o(process.cwd());if(n.command==="proxy"){let{runProxy:m}=await Promise.resolve().then(()=>(Cs(),Ns));return await m(n.positional,{telemetryRoot:u.rootDir,level:n.level})}if(n.command==="status"||n.command==="sweep"){let{residentRegistryStatus:m,sweepResidentRegistry:p}=await Promise.resolve().then(()=>(je(),Lt)),k=n.command==="sweep"?await p(u):await m(u);return process.stdout.write(`${v(k)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reddb-io/red-skills",
3
- "version": "2.57.2",
3
+ "version": "2.57.3",
4
4
  "description": "RedSkills plugin runtime bundles (dev, code-nav, 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",