@reddb-io/red-skills 2.74.3 → 2.74.4

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.
@@ -6578,7 +6578,7 @@ Usage:
6578
6578
  ${n} archive --candidate <json> [--root <dir>] [--archive-dir <rel>]
6579
6579
  ${n} restore <name> [--root <dir>] [--archive-dir <rel>]`}function Sx(n){return bVn(typeof n.root=="string"?n.root:process.cwd())}function lut(n){return typeof n["archive-dir"]=="string"?n["archive-dir"]:void 0}async function DD(n){let a=await xs(n);return a?a.mode!=="graph"?{ok:!1,message:`curate: skill telemetry needs graph mode (this project is "${a.mode}") \u2014 run \`${cEe}\``}:ju(a)?{ok:!0}:{ok:!1,message:`curate: skill telemetry is not enabled here \u2014 run \`${cEe}\``}:{ok:!1,message:`curate: memory is not initialized here \u2014 run \`${cEe}\``}}function ZVn(){let n=uVn(pVn(import.meta.url));return n.includes("dist/curate-skill")||n.endsWith("dist/curate-skill")?nut(n,"..","cli.js"):nut(n,"..","cli.ts")}async function hVn(n,a){let i=["curate","skills","--json"];a!==void 0&&i.push("--stale-days",String(a));let d=ZVn(),h=d.endsWith(".ts")?tut(process.execPath,["--import","tsx",d,...i,"--root",n],{encoding:"utf8"}):tut(process.execPath,[d,...i,"--root",n],{encoding:"utf8"}),g=h.status??1;if(g!==0)throw new Error(`memory curate skills exited ${g}`);return qmt(h.stdout??"")}function WVn(n){return typeof n.flags["stale-days"]=="string"?Number(n.flags["stale-days"]):void 0}async function aut(n,a){return(a.loadCuratorReport??hVn)(Sx(n.flags),WVn(n))}async function NVn(n){let a=Sx(n.flags),i=await DD(a);return i.ok?(console.log("curate: skill telemetry is enabled \u2014 ready to curate"),0):(console.error(i.message),2)}async function YVn(n,a){let i=Sx(n.flags),d=await DD(i);if(!d.ok)return console.error(d.message),2;let u;try{u=await aut(n,a)}catch(J){return console.error(`curate: ${J.message}`),1}let{candidates:h,byCategory:g,filtered:f}=aEe(u);return console.log(JSON.stringify({candidates:h,byCategory:g,filtered:f,totals:{totalSkills:u.totalSkills,curatableSkills:u.curatableSkills,readOnlySkills:u.readOnlySkills}},null,2)),0}async function VVn(n,a){let i=Sx(n.flags),d=await DD(i);if(!d.ok)return console.error(d.message),2;let u;try{u=await aut(n,a)}catch(J){return console.error(`curate: ${J.message}`),1}let{byCategory:h}=aEe(u);if(rEe(h)===0)return console.error("curate: no candidates \u2014 no issue filed"),0;let g=typeof n.flags.label=="string"?n.flags.label:void 0,f=await eut({byCategory:h,totals:{totalSkills:u.totalSkills,curatableSkills:u.curatableSkills,readOnlySkills:u.readOnlySkills},generatedAt:u.generatedAt},{cwd:i,label:g});return console.log(`curate: filed background issue \u2014 ${f.output||f.title}`),0}async function gVn(n){let a=Sx(n.flags),i=await DD(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 u;try{u=JSON.parse(d)}catch(g){return console.error(`curate archive: invalid --candidate JSON: ${g.message}`),2}let h=await Kmt(u,{rootDir:a,archiveDir:lut(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 yVn(n){let a=Sx(n.flags),i=await DD(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 u=await Pmt(d,{rootDir:a,archiveDir:lut(n.flags)});return console.log(`curate: restored "${u.name}" \u2192 ${u.restoredRoot} (${u.files.length} file(s) hash-verified)`),0}async function iEe(n,a={}){switch(n.command){case"check":return NVn(n);case"list":return YVn(n,a);case"background":return VVn(n,a);case"archive":return gVn(n);case"restore":return yVn(n);case void 0:case"--help":case"-h":return console.log(Iut(a.usageCommand)),0;default:return console.error(`unknown curate subcommand: ${n.command}
6580
6580
 
6581
- ${Iut(a.usageCommand)}`),2}}function sEe(n){let a={app:n,version:RVn(Ux("__RED_BUILD_VERSION__",()=>"2.74.3")??"0.0.0-dev"),gitSha:Ux("__RED_BUILD_GIT_SHA__",()=>"b9b49639d7935823de2d5943316e09ce6b9d5faa")??"unknown",buildTime:Ux("__RED_BUILD_TIME__",()=>"2026-07-18T19:22:05-03:00")??"unknown",bundleAsset:Ux("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},i=Ux("__REDDB_SDK_VERSION__",()=>"1.23.1"),d=Ux("__REDDB_BINARY_TAG__",()=>"v1.23.1");return i&&(a.reddbSdkVersion=i),d&&(a.reddbBinaryTag=d),a}function RVn(n){return n.startsWith("v")?n.slice(1):n}function oEe(n){return`${n.app} ${n.version} ${n.gitSha}`}function Ux(n,a){try{let i=a();return typeof i=="string"&&i.length>0?i:void 0}catch{return process.env[n.replace(/^__|__$/g,"")]}}async function dut(n){let a=n.positional[0];if(a==="context")return QVn(n);if(a!=="skills")throw new Error("status needs a kind \u2014 supported: memory status skills|context");let i=pa(n.flags),d=n.flags.json===!0,u=await xs(i);if(!u)return dEe(d,"uninitialized","memory is not initialized here",{hint:"run `memory init --mode graph --skill-telemetry`"});if(u.mode!=="graph")return dEe(d,"no-op",`skill telemetry needs graph mode, this project is "${u.mode}"`,{hint:"re-run `memory init --mode graph --skill-telemetry`"});if(!ju(u))return dEe(d,"unavailable","skill telemetry is not enabled here",{hint:"re-run `memory init --mode graph --skill-telemetry`"});let h=n.flags.all===!0,g=Pa(n.flags,"limit")??10,f=await Xi.open({uri:di(i,u)}),J,S;try{J=await DG(f),S=await wx(f,g)}finally{await f.close()}let ne=J.filter(Pe=>Ox(Pe.source_kind)).length,be=h?J:J.filter(Pe=>Ox(Pe.source_kind)),j=h?S:S.filter(Pe=>Ox(Pe.source_kind));if(d){console.log(JSON.stringify({state:"enabled",scope:h?"all":"curatable",totalSkills:J.length,curatableSkills:ne,readOnlySkills:J.length-ne,skills:be,recentEvents:j},null,2));return}if(console.log("memory: skill telemetry status \u2014 enabled (graph mode)"),console.log(` ${J.length} ${Dv(J.length,"skill")} observed (${ne} curatable, ${J.length-ne} read-only)`),J.length===0){console.log(" no skills observed yet \u2014 telemetry is enabled but nothing has been recorded"),console.log(`
6581
+ ${Iut(a.usageCommand)}`),2}}function sEe(n){let a={app:n,version:RVn(Ux("__RED_BUILD_VERSION__",()=>"2.74.4")??"0.0.0-dev"),gitSha:Ux("__RED_BUILD_GIT_SHA__",()=>"0d89149390402d75c73523f1168c7f829b273ab0")??"unknown",buildTime:Ux("__RED_BUILD_TIME__",()=>"2026-07-18T23:03:35-03:00")??"unknown",bundleAsset:Ux("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},i=Ux("__REDDB_SDK_VERSION__",()=>"1.23.1"),d=Ux("__REDDB_BINARY_TAG__",()=>"v1.23.1");return i&&(a.reddbSdkVersion=i),d&&(a.reddbBinaryTag=d),a}function RVn(n){return n.startsWith("v")?n.slice(1):n}function oEe(n){return`${n.app} ${n.version} ${n.gitSha}`}function Ux(n,a){try{let i=a();return typeof i=="string"&&i.length>0?i:void 0}catch{return process.env[n.replace(/^__|__$/g,"")]}}async function dut(n){let a=n.positional[0];if(a==="context")return QVn(n);if(a!=="skills")throw new Error("status needs a kind \u2014 supported: memory status skills|context");let i=pa(n.flags),d=n.flags.json===!0,u=await xs(i);if(!u)return dEe(d,"uninitialized","memory is not initialized here",{hint:"run `memory init --mode graph --skill-telemetry`"});if(u.mode!=="graph")return dEe(d,"no-op",`skill telemetry needs graph mode, this project is "${u.mode}"`,{hint:"re-run `memory init --mode graph --skill-telemetry`"});if(!ju(u))return dEe(d,"unavailable","skill telemetry is not enabled here",{hint:"re-run `memory init --mode graph --skill-telemetry`"});let h=n.flags.all===!0,g=Pa(n.flags,"limit")??10,f=await Xi.open({uri:di(i,u)}),J,S;try{J=await DG(f),S=await wx(f,g)}finally{await f.close()}let ne=J.filter(Pe=>Ox(Pe.source_kind)).length,be=h?J:J.filter(Pe=>Ox(Pe.source_kind)),j=h?S:S.filter(Pe=>Ox(Pe.source_kind));if(d){console.log(JSON.stringify({state:"enabled",scope:h?"all":"curatable",totalSkills:J.length,curatableSkills:ne,readOnlySkills:J.length-ne,skills:be,recentEvents:j},null,2));return}if(console.log("memory: skill telemetry status \u2014 enabled (graph mode)"),console.log(` ${J.length} ${Dv(J.length,"skill")} observed (${ne} curatable, ${J.length-ne} read-only)`),J.length===0){console.log(" no skills observed yet \u2014 telemetry is enabled but nothing has been recorded"),console.log(`
6582
6582
  Diagnostic command: normal-use ingestion stays silent; this surface only reads.`);return}if(console.log(h?" scope: all observed skills (including bundled plugin/hub skills)":" scope: curatable skills (use --all to include bundled plugin/hub skills)"),be.length===0)console.log(" no curatable skills observed \u2014 re-run with --all to see bundled skills");else{console.log(`
6583
6583
  skill / kind / events (v\xB7u\xB7p\xB7c\xB7r) / outcomes / last-activity:`);for(let Pe of be){let ye=zVn(Pe.outcome_counts);console.log(` ${Pe.name} (${Pe.source_kind}) \u2014 ${Pe.event_count} event(s) (v${Pe.view_count}\xB7u${Pe.use_count}\xB7p${Pe.patch_count}\xB7c${Pe.change_count}\xB7r${Pe.result_count})${ye?` ${ye}`:""} \u2014 ${Pe.last_activity}`)}}if(j.length>0){console.log(`
6584
6584
  recent events (newest first, up to ${g}):`);for(let Pe of j){let ye=Pe.status?` [${Pe.status}]`:"";console.log(` ${Pe.timestamp} ${Pe.event_type}${ye} ${Pe.name} (${Pe.source_kind}) <${Pe.runner}>`)}}console.log(`