@reddb-io/red-skills 3.16.0 → 3.17.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/brain.bundle.min.mjs +1 -1
- package/dist/code-nav.bundle.min.mjs +1 -1
- package/dist/dev.bundle.min.mjs +622 -619
- package/dist/memory.bundle.min.mjs +1 -1
- package/dist/redskilled-mcp.bundle.min.mjs +413 -412
- package/dist/redskilled.bundle.min.mjs +132 -131
- package/dist/rsp.bundle.min.mjs +150 -150
- package/package.json +1 -1
|
@@ -6609,7 +6609,7 @@ Usage:
|
|
|
6609
6609
|
${n} archive --candidate <json> [--root <dir>] [--archive-dir <rel>]
|
|
6610
6610
|
${n} restore <name> [--root <dir>] [--archive-dir <rel>]`}function R9(n){return nFn(typeof n.root=="string"?n.root:process.cwd())}function vZt(n){return typeof n["archive-dir"]=="string"?n["archive-dir"]:void 0}async function xK(n){let r=await xs(n);return r?r.mode!=="graph"?{ok:!1,message:`curate: skill telemetry needs graph mode (this project is "${r.mode}") \u2014 run \`${sCe}\``}:qu(r)?{ok:!0}:{ok:!1,message:`curate: skill telemetry is not enabled here \u2014 run \`${sCe}\``}:{ok:!1,message:`curate: memory is not initialized here \u2014 run \`${sCe}\``}}function lFn(){let n=tFn(IFn(import.meta.url));return n.includes("dist/curate-skill")||n.endsWith("dist/curate-skill")?yZt(n,"..","cli.js"):yZt(n,"..","cli.ts")}async function rFn(n,r){let c=["curate","skills","--json"];r!==void 0&&c.push("--stale-days",String(r));let d=lFn(),h=d.endsWith(".ts")?gZt(process.execPath,["--import","tsx",d,...c,"--root",n],{encoding:"utf8"}):gZt(process.execPath,[d,...c,"--root",n],{encoding:"utf8"}),N=h.status??1;if(N!==0)throw new Error(`memory curate skills exited ${N}`);return NZt(h.stdout??"")}function aFn(n){return typeof n.flags["stale-days"]=="string"?Number(n.flags["stale-days"]):void 0}async function FZt(n,r){return(r.loadCuratorReport??rFn)(R9(n.flags),aFn(n))}async function cFn(n){let r=R9(n.flags),c=await xK(r);return c.ok?(console.log("curate: skill telemetry is enabled \u2014 ready to curate"),0):(console.error(c.message),2)}async function iFn(n,r){let c=R9(n.flags),d=await xK(c);if(!d.ok)return console.error(d.message),2;let G;try{G=await FZt(n,r)}catch(E){return console.error(`curate: ${E.message}`),1}let{candidates:h,byCategory:N,filtered:v}=cCe(G);return console.log(JSON.stringify({candidates:h,byCategory:N,filtered:v,totals:{totalSkills:G.totalSkills,curatableSkills:G.curatableSkills,readOnlySkills:G.readOnlySkills}},null,2)),0}async function sFn(n,r){let c=R9(n.flags),d=await xK(c);if(!d.ok)return console.error(d.message),2;let G;try{G=await FZt(n,r)}catch(E){return console.error(`curate: ${E.message}`),1}let{byCategory:h}=cCe(G);if(iCe(h)===0)return console.error("curate: no candidates \u2014 no issue filed"),0;let N=typeof n.flags.label=="string"?n.flags.label:void 0,v=await VZt({byCategory:h,totals:{totalSkills:G.totalSkills,curatableSkills:G.curatableSkills,readOnlySkills:G.readOnlySkills},generatedAt:G.generatedAt},{cwd:c,label:N});return console.log(`curate: filed background issue \u2014 ${v.output||v.title}`),0}async function oFn(n){let r=R9(n.flags),c=await xK(r);if(!c.ok)return console.error(c.message),2;let d=n.flags.candidate;if(typeof d!="string")return console.error("curate archive: --candidate <json> is required"),2;let G;try{G=JSON.parse(d)}catch(N){return console.error(`curate archive: invalid --candidate JSON: ${N.message}`),2}let h=await hZt(G,{rootDir:r,archiveDir:vZt(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 dFn(n){let r=R9(n.flags),c=await xK(r);if(!c.ok)return console.error(c.message),2;let d=n.positional[0];if(!d)return console.error("curate restore: skill name is required"),2;let G=await WZt(d,{rootDir:r,archiveDir:vZt(n.flags)});return console.log(`curate: restored "${G.name}" \u2192 ${G.restoredRoot} (${G.files.length} file(s) hash-verified)`),0}async function oCe(n,r={}){switch(n.command){case"check":return cFn(n);case"list":return iFn(n,r);case"background":return sFn(n,r);case"archive":return oFn(n);case"restore":return dFn(n);case void 0:case"--help":case"-h":return console.log(RZt(r.usageCommand)),0;default:return console.error(`unknown curate subcommand: ${n.command}
|
|
6611
6611
|
|
|
6612
|
-
${RZt(r.usageCommand)}`),2}}function dCe(n){let r={app:n,version:GFn(v9("__RED_BUILD_VERSION__",()=>"3.
|
|
6612
|
+
${RZt(r.usageCommand)}`),2}}function dCe(n){let r={app:n,version:GFn(v9("__RED_BUILD_VERSION__",()=>"3.17.0")??"0.0.0-dev"),gitSha:v9("__RED_BUILD_GIT_SHA__",()=>"edf32ce97c253b427bb8401f7566bc84af6170b3")??"unknown",buildTime:v9("__RED_BUILD_TIME__",()=>"2026-08-12T01:46:36-03:00")??"unknown",bundleAsset:v9("__RED_BUNDLE_ASSET__",()=>"memory.bundle.min.mjs")??"unknown"},c=v9("__REDDB_SDK_VERSION__",()=>"1.23.1"),d=v9("__REDDB_BINARY_TAG__",()=>"v1.23.1");return c&&(r.reddbSdkVersion=c),d&&(r.reddbBinaryTag=d),r}function GFn(n){return n.startsWith("v")?n.slice(1):n}function GCe(n){return`${n.app} ${n.version} ${n.gitSha}`}function v9(n,r){try{let c=r();return typeof c=="string"&&c.length>0?c:void 0}catch{return process.env[n.replace(/^__|__$/g,"")]}}async function EZt(n){let{store:r}=await yr(n);try{let c=await r.stats();console.log(`memory: ${c.nodes} node(s), ${c.edges} edge(s)`)}finally{await r.close()}}async function _Zt(n){let r=n.positional[0];if(r!=="status"&&r!=="status-viewer"&&r!=="maintain"&&r!=="search")throw new Error("vector needs an action \u2014 supported: memory vector status|status-viewer|maintain|search");let c=process.env.RED_MEMORY_VECTOR_PROVIDER;n.flags.local===!0&&(process.env.RED_MEMORY_VECTOR_PROVIDER="local");let{store:d}=await yr(n);try{if(r==="search"){let h=n.positional.slice(1).join(" ").trim();if(!h)throw new Error("nothing to search \u2014 pass a query: memory vector search <query>");let N=await J5(d,h,{limit:la(n.flags,"limit")});if(n.flags.json===!0){console.log(JSON.stringify(N,null,2));return}if(N.status==="unavailable"){let v=N.error?` \u2014 ${N.error}`:"";console.log(`memory: vector search unavailable${v}`);return}console.log(`memory: vector search ${N.hits.length}/${N.limit} hit(s) for "${h}"`);for(let v of N.hits){let E=v.source?` source=${v.source}`:"";console.log(` ${v.score.toFixed(3)} memory_nodes:${v.rid} (${v.node_type}) ${v.title}${E}`),v.excerpt&&console.log(` ${v.excerpt}`)}return}if(r==="status-viewer"){let h=Nr(n.flags),N=Vl(n.flags,"out")??qa(h,".red/memory/vector-status-viewer.html"),v=HK(await d.vectorStatus());await hs(Ps(N),{recursive:!0}),await Xi(N,v.html,"utf8"),console.log(`memory: vector status viewer written ${N}`),console.log(` status: ${v.report.overall}`),console.log(` contract: ${v.contract.consumes}`);return}let G=r==="maintain"?await d.maintainVectorProjection({strict:n.flags.strict===!0}):await d.vectorStatus();if(n.flags.json===!0){console.log(JSON.stringify(G,null,2));return}console.log(`memory: vector projection ${G.overall} \u2014 ${G.ready}/${G.total} ready`),G.stale>0&&console.log(` stale: ${G.stale}`),G.unavailable>0&&console.log(` unavailable: ${G.unavailable}`),G.failed>0&&console.log(` failed: ${G.failed}`);for(let h of G.nodes.filter(N=>N.status!=="ready")){let N=h.error?` \u2014 ${h.error}`:"";console.log(` ${h.rid} (${h.node_type}) ${h.label}: ${h.status}${N}`)}for(let h of G.docs.filter(N=>N.status!=="ready")){let N=h.error?` \u2014 ${h.error}`:"";console.log(` doc:${h.rid} ${h.path}: ${h.status}${N}`)}}finally{await d.close(),n.flags.local===!0&&(c==null?delete process.env.RED_MEMORY_VECTOR_PROVIDER:process.env.RED_MEMORY_VECTOR_PROVIDER=c)}}async function CZt(n){let{store:r}=await yr(n);try{let c=la(n.flags,"stale-days")??90,d=await Ry(r,{staleDays:c});if(d.stale.length===0){console.log(`memory: healthy \u2014 0 of ${d.totalNodes} node(s) stale (unaccessed ${c}+ days, never recalled)`);return}console.log(`memory: ${d.stale.length} of ${d.totalNodes} node(s) stale (unaccessed ${c}+ days, never recalled):`);for(let N of d.stale)console.log(` ${N.rid} (${N.node_type}) ${N.title} \u2014 ${N.ageDays}d idle`);if(n.flags.prune!==!0){console.log(`
|
|
6613
6613
|
Re-run with --prune to delete these (asks for confirmation first).`);return}let G=n.flags.yes===!0;if(!G){if(!process.stdin.isTTY){console.log(`
|
|
6614
6614
|
refusing to prune without confirmation \u2014 re-run with --yes in a non-interactive shell`);return}let N=Jse({input:process.stdin,output:process.stdout}),v=(await N.question(`
|
|
6615
6615
|
Delete ${d.stale.length} stale node(s)? Type "yes" to confirm: `)).trim();N.close(),G=v==="yes"}if(!G){console.log("memory: aborted \u2014 nothing deleted");return}let{pruned:h}=await VXe(r,d.stale);console.log(`memory: pruned ${h} stale node(s)`)}finally{await r.close()}}async function JZt(n){let r=Nr(n.flags),c=n.positional[0]??".red/memory/export",d=xm(c)?c:za(r,c),G=n.flags.communities===!0,h=n.flags.interop===!0,{store:N}=await yr(n);try{let v=await NQ(N,d,{communities:G,interop:h});console.log(`memory: exported ${v.nodes} node(s), ${v.edges} edge(s)`),G&&console.log(" communities: coloured via native Louvain"),console.log(` graph: ${v.htmlPath}`),console.log(` json: ${v.jsonPath}`),console.log(` audit: ${v.auditPath}`),v.interop&&(console.log(` nodes: ${v.interop.nodesJsonlPath}`),console.log(` edges: ${v.interop.edgesJsonlPath}`),console.log(` graphml:${v.interop.graphmlPath}`),console.log(` cypher: ${v.interop.cypherPath}`))}finally{await N.close()}}async function kZt(n){let r=n.positional.join(" ").trim();if(!r)throw new Error("nothing to search \u2014 pass a query: memory global-search <query>");let c=typeof n.flags.limit=="string"?Number(n.flags.limit):void 0,{store:d,config:G}=await yr(n);try{let h=await oF("memory.global-search",{store:d,providerConfig:G.provider},{query:r,limit:c,cache:n.flags["no-cache"]===!0?"off":"read-only"});if(n.flags.json===!0){console.log(JSON.stringify(h,null,2));return}console.log(`memory: ${h.total_hits} global-search hit(s) for "${h.query}"`),console.log(` source: ${h.generated_from.operation_id}`),console.log(` graph hash: ${h.generated_from.graph_hash}`),console.log(` provider: ${h.generated_from.provider.status}${h.generated_from.provider.error?` (${h.generated_from.provider.error})`:""}`);for(let N of h.evidence)console.log(` ${N.community_id}: score ${N.score}, ${N.size} node(s)`),console.log(` matched: ${N.matched_terms.join(", ")}`),console.log(` top label: ${N.top_label}`),console.log(` top type: ${N.top_node_type}`),N.narrative_summary&&console.log(` summary: ${N.narrative_summary}`)}finally{await d.close()}}async function bFn(n,r){let c=Vl(n.flags,"from");if(c){let G=xm(c)?c:za(r,c),h=JSON.parse(await jb(G,"utf8")),N=h.contract??h,v=oXe(N);if(!v.valid)throw new Error(`architecture-overview: ${G} is not a valid graph contract \u2014 ${v.errors.join("; ")}`);return N}let{store:d}=await yr(n);try{let[G,h,N]=await Promise.all([d.listNodes(),d.listEdges(),d.communities()]);return BX({nodes:G,edges:h.map(a1),communities:N})}finally{await d.close()}}async function AZt(n){let r=Nr(n.flags),c=await bFn(n,r),d=U1e(c);if(n.flags.json===!0){console.log(JSON.stringify(d,null,2));return}if(n.flags.stdout===!0){process.stdout.write(d.markdown);return}let G=Vl(n.flags,"out")??".red/memory/architecture-overview.md",h=xm(G)?G:za(r,G);await hs(Ps(h),{recursive:!0}),await Xi(h,d.markdown,"utf8"),console.log(`memory: architecture overview written ${h}`),console.log(` contract: ${d.generated_from.contract_version}`),console.log(` ${d.totals.nodes} node(s), ${d.layers.length} layer(s), ${d.communities.length} community(ies)`)}async function U5(){if(process.stdin.isTTY)return"";let n=[];for await(let r of process.stdin)n.push(r);return Buffer.concat(n).toString("utf8")}var pFn=["SessionStart","PostToolUse","Stop","PreCompact"];async function LZt(n){let r=n.positional[0],c=n.flags.runner==="codex"?"codex":"claude";if(!r||!pFn.includes(r)){process.stdout.write("{}");return}try{let d=await U5(),G=d.trim()?JSON.parse(d):{},h=Nr(n.flags)!==process.cwd()?Nr(n.flags):typeof G.cwd=="string"?G.cwd:process.cwd(),N=await K1e(c,r,G);try{r==="SessionStart"?await Ey(h,N.sessionId?{id:N.sessionId}:{}):await cN(h)||(N.sessionId?await Ey(h,{id:N.sessionId}):await bQe(h))}catch{}let v=await WQe(N,h);process.stdout.write(P1e(c,r,v))}catch{process.stdout.write("{}")}}var ZFn=["post-commit","post-checkout"];async function xZt(n){switch(n.positional[0]){case"refresh":return hFn(n);case"install-hooks":return NFn(n);case"uninstall-hooks":return YFn(n);default:throw new Error("vcs needs a subcommand \u2014 memory vcs refresh|install-hooks|uninstall-hooks")}}async function hFn(n){let r=Nr(n.flags),c=Vl(n.flags,"event"),d=n.flags.json===!0;if(!c||!ZFn.includes(c)){d&&console.log(JSON.stringify({noop:!0,reason:"unknown vcs event"}));return}try{let G=await NQe(r,{event:c,prevHead:Vl(n.flags,"prev"),newHead:Vl(n.flags,"new"),flag:Vl(n.flags,"flag"),export:n.flags["no-export"]!==!0});if(d){console.log(JSON.stringify(G,null,2));return}if(G.noop){console.log(`memory: ${c} \u2014 no-op (${G.reason})`);return}let h=G.refresh;console.log(`memory: ${c} refreshed ${h?.files??0} changed file(s) \u2014 ${h?.added??0} added, ${h?.updated??0} updated, ${h?.stale??0} stale`),G.exported&&console.log(` exported ${G.exported.nodes} node(s) \u2192 ${G.exported.jsonPath}`)}catch(G){let h=`error: ${G instanceof Error?G.message:String(G)}`;console.log(d?JSON.stringify({noop:!0,reason:h}):`memory: ${c} \u2014 no-op (${h})`)}}async function zZt(n){try{let{stdout:r}=await ky("git",["-C",n,"rev-parse","--git-path","hooks"],{encoding:"utf8"}),c=r.trim();return c?xm(c)?c:za(n,c):za(n,".git/hooks")}catch{return za(n,".git/hooks")}}function WFn(){let n=process.env.CLAUDE_PLUGIN_ROOT??process.env.CODEX_PLUGIN_ROOT,r=HZt(new URL("../cli.ts",import.meta.url)),c=[n?qa(n,"scripts","bootstrap.mjs"):void 0,qa(Ps(Ps(r)),"scripts","bootstrap.mjs")];for(let d of c)if(d&&zK(d))return d}async function NFn(n){let r=Nr(n.flags),c=await xs(r);if(!c){console.log("memory: not initialized here \u2014 run `memory init --mode graph` before installing git hooks");return}if(c.mode!=="graph"){console.log(`memory: git hooks need graph mode \u2014 this project is "${c.mode}". Re-run \`memory init --mode graph\` first`);return}let d=await zZt(r),G=await VQe({hooksDir:d,bootstrapPath:WFn(),force:n.flags.force===!0});if(n.flags.json===!0){console.log(JSON.stringify({hooksDir:d,...G},null,2));return}G.installed.length>0&&console.log(`memory: installed ${G.installed.join(", ")} into ${d}`);for(let h of G.backedUp)console.log(` backed up existing hook \u2192 ${h}`);for(let h of G.skipped)console.log(` skipped ${h.hook}: ${h.reason}`)}async function YFn(n){let r=Nr(n.flags),c=await zZt(r),d=await gQe(c);if(n.flags.json===!0){console.log(JSON.stringify({hooksDir:c,...d},null,2));return}d.removed.length>0?console.log(`memory: removed ${d.removed.join(", ")} from ${c}`):console.log(`memory: no managed hooks found in ${c}`);for(let G of d.restored)console.log(` restored backed-up hook \u2192 ${G}`);for(let G of d.skipped)console.log(` ${G.reason}`)}async function OZt(n){let r=n.positional[0];if(r==="learn")return VFn(n);if(r!=="record")throw new Error("unknown worker command \u2014 expected: memory worker record|learn");let c=await U5();if(!c.trim())throw new Error("worker record needs a JSON payload on stdin");let d=JSON.parse(c),{store:G}=await yr(n);try{let h=await K_e(G,d);console.log(`memory: recorded worker ${d.repository}#${d.issueNumber}/${d.attemptNumber} (rid ${h.workerRid})`)}finally{await G.close()}}async function VFn(n){let r=n.positional[1];if(r==="apply")return gFn(n);if(r!=null)throw new Error("memory worker learn supports: apply");let c=Nr(n.flags),d=n.flags.json===!0,G=n.flags["write-proposal"]===!0,{store:h}=await yr(n);try{let N=await P_e(h),v=G?await q_e(c,N):null,E=N.proposals.length===0?"no-candidates":G?"proposal-written":"proposal-ready";if(d){console.log(JSON.stringify({state:E,proposalFile:v,...N},null,2));return}console.log(`memory: worker learning - ${E}`);for(let z of N.proposals)console.log(` [${z.kind}] ${z.title}`),console.log(` evidence: ${z.evidenceSummary}`);for(let z of N.rejected)console.log(` ${z.action}: ${z.kind} - ${z.reason}`);v&&console.log(` proposal: ${v}`),console.log(`
|