openskillmd 0.4.0 → 0.6.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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as u,b as d,c as f,k as m}from"./chunk-C5KG3WI6.js";import{e as c,f as p}from"./chunk-AZ56ID7P.js";import{g as n,h as a,l,m as e}from"./chunk-GTRQVB2J.js";async function h(){let o={mcpServers:{openskill:{url:`${await u()}/mcp/sse`}}};console.error(c("MCP Server Configuration")),console.error(e(` Add this to your Claude Desktop or Cursor MCP config:
3
+ import{a as u,b as d,c as f,k as m}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import{g as n,h as a,k as l,l as e,t as c,u as p}from"./chunk-4WV7FA5L.js";async function h(){let o={mcpServers:{openskill:{url:`${await u()}/mcp/sse`}}};console.error(c("MCP Server Configuration")),console.error(e(` Add this to your Claude Desktop or Cursor MCP config:
4
4
  `)),console.log(JSON.stringify(o,null,2)),console.error(""),console.error(n.bold(" For Claude Desktop:")),console.error(e(" Add to ~/Library/Application Support/Claude/claude_desktop_config.json")),console.error(""),console.error(n.bold(" For Cursor:")),console.error(e(" Add to .cursor/mcp.json in your project root")),console.error(""),console.error(e(" The OpenSkill MCP server gives your AI agent access to the full")),console.error(e(" skill and blueprint registry via tool calls.")),console.error("")}async function b(t){console.error(c(`MCP Server: ${t}`));let o;try{o=await m(t)}catch(r){if(r instanceof f&&r.statusCode===404){let i=await d();process.stderr.write(p(`MCP server "${t}" not found.`,`Browse available servers at ${i}/mcp-servers`)+`
5
5
  `);return}process.stderr.write(p(r instanceof Error?r.message:"Unknown error")+`
6
6
  `);return}console.error(""),console.error(n.bold(` ${o.displayName||o.name}`)),o.description&&console.error(e(` ${o.description}`)),console.error(""),o.mcpEndpointUrl&&(console.error(a.bold(" Endpoint URL:")),console.error(a(` ${o.mcpEndpointUrl}`)),console.error(""));let s=[];if(o.transportType){let r=o.transportType==="sse"||o.transportType==="streamable-http";s.push(["Transport",r?"Remote (SSE)":"Local install (stdio)"])}o.authType&&s.push(["Auth",o.authType==="none"?"None required":o.authType]),o.verified&&s.push(["Verified","Yes"]),o.status&&s.push(["Status",o.status]),o.stargazerCount!=null&&s.push(["Stars",String(o.stargazerCount)]),o.toolCount&&s.push(["Tools",String(o.toolCount)]),o.primaryLanguage&&s.push(["Language",o.primaryLanguage]),o.category&&s.push(["Category",o.category]);for(let[r,i]of s)console.error(` ${e(`${r}:`)} ${l(i)}`);if(console.error(""),o.installCommand&&(console.error(n.bold(" Install:")),console.error(l(` ${o.installCommand}`)),console.error("")),o.toolNames&&o.toolNames.length>0){console.error(n.bold(" Tools:"));for(let r of o.toolNames.slice(0,20))console.error(e(` - ${r}`));o.toolNames.length>20&&console.error(e(` ... and ${o.toolNames.length-20} more`)),console.error("")}if(o.mcpEndpointUrl){console.error(n.bold(" Config JSON (Claude Desktop / Cursor):"));let r={mcpServers:{[o.slug]:{url:o.mcpEndpointUrl}}};console.log(JSON.stringify(r,null,2)),console.error("")}else o.githubUrl&&(console.error(n.bold(" GitHub:")),console.error(l(` ${o.githubUrl}`)),console.error(""))}export{b as mcpInfoCommand,h as mcpSetupCommand};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
+ import{b as x,c as k,l as j}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import{g as f,h as S,k as R,l as u,t as $,u as m,w as P}from"./chunk-4WV7FA5L.js";import{spawn as H}from"child_process";import{existsSync as v}from"fs";import{delimiter as D,join as O}from"path";var p={"claude-code":{cli:"claude",label:"Claude Code",autoInstall:!0},codex:{cli:"codex",label:"Codex",autoInstall:!0}},_=new Set(Object.keys(p));function T(n){return _.has(n)}function E(n,e=process.env,r=process.platform){let o=(e.PATH||"").split(D).filter(Boolean),i=r==="win32"?["",".exe",".cmd",".bat"]:[""];for(let s of o)for(let l of i)if(v(O(s,n+l)))return!0;return!1}function A(n){let e=n.trim().toLowerCase();return e==="claude-code"||e==="claude"||e==="claudecode"?"claude-code":e==="codex"?"codex":null}function L(n,e){let r=n.runtimes.filter(T),o=new Set(r);if(e&&e.length>0){let i=[],s=[];for(let l of e){let a=A(l);a&&o.has(a)?i.includes(a)||i.push(a):s.push(l)}return{targets:i,unsupported:s}}return{targets:r,unsupported:[]}}function N(n){return n?"user":"project"}function C(n,e){return n.marketplaces.find(r=>r.runtime===e)??n.marketplaces[0]??null}function F(n,e,r){return[["plugin","marketplace","add",e.source],["plugin","install",`${n}@${e.name}`,"--scope",r]]}function z(n){return/^(https?:\/\/|git@|\.\/|\/)/.test(n)||n.endsWith(".git")?n:`https://github.com/${n}.git`}function B(n,e){return[["plugin","marketplace","add",z(e.source)],["plugin","add",`${n}@${e.name}`]]}function y(n,e,r,o){return n==="codex"?B(e,r):F(e,r,o)}function K(n,e,r){return new Promise(o=>{let i=H(n,e,{stdio:r?"ignore":"inherit"});i.once("exit",s=>o(s??1)),i.once("error",()=>o(127))})}async function ne(n,e={},r){let o;try{o=r??await j(n)}catch(t){if(t instanceof k&&t.statusCode===404){let g=await x();e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_NOT_FOUND",message:`Plugin "${n}" not found.`}}):process.stderr.write(m(`Plugin "${n}" not found in the registry.`,`Browse plugins at ${g}/plugins`)+`
4
+ `),process.exit(2)}e.json?P({ok:!1,slug:n,error:{code:"PLUGIN_LOOKUP_FAILED",message:t instanceof Error?t.message:"Unknown error"}}):process.stderr.write(m(`Couldn't reach the registry to resolve "${n}".`,"Check your connection (and OPENSKILL_API_URL, if set).")+`
5
+ `),process.exit(1)}let i=o.displayName||o.name,{targets:s,unsupported:l}=L(o,e.agent),a=N(!!e.global);e.json||(console.error($(`Install plugin: ${i}`)),o.description&&console.error(u(` ${o.description}`)),console.error(""),l.length>0&&console.error(u(` Note: ${l.join(", ")} \u2014 not supported by this plugin (supports: ${o.runtimes.join(", ")||"none"}).`)));let M=s.length>0?s:o.runtimes.filter(t=>t in p),h=[],c=[],d=[];for(let t of s){let g=p[t],I=C(o,t);if(!I){c.push(t);continue}if(E(g.cli)){if(!e.json){let b=t==="codex"?"global":`${a} scope`;console.error(f.bold(` \u2192 Installing for ${g.label} (${b})\u2026`)),console.error("")}let U=y(t,o.name,I,a),w=!0;for(let b of U)if(await K(g.cli,b,!!e.json)!==0){w=!1;break}w?h.push(t):c.push(t)}else d.push({runtime:t,reason:"cli-not-found"})}if(s.length===0)for(let t of M)d.push({runtime:t,reason:"cli-not-found"});!e.json&&d.length>0&&W(o,d,a),e.json||(console.error(""),h.length>0&&(console.error(S.bold(` \u2713 Installed for ${h.map(t=>p[t].label).join(", ")}.`)),console.error(u(" Run /reload-plugins in Claude Code to activate it."))),c.length>0&&console.error(m(`Install failed for ${c.map(t=>p[t].label).join(", ")}.`))),e.json&&P({ok:c.length===0,slug:o.slug,installed:h,manual:d.map(t=>t.runtime),failed:c}),process.exit(c.length>0?1:0)}function W(n,e,r){for(let{runtime:o}of e){let i=p[o],s=C(n,o);if(s){console.error(""),console.error(f.bold(` ${i.label} CLI ("${i.cli}") not found on PATH. Install it, then run:`));for(let l of y(o,n.name,s,r))console.error(R(` ${i.cli} ${l.join(" ")}`))}}}async function oe(n){console.error($(`Plugin: ${n}`));let e;try{e=await j(n)}catch(o){if(o instanceof k&&o.statusCode===404){let i=await x();process.stderr.write(m(`Plugin "${n}" not found.`,`Browse plugins at ${i}/plugins`)+`
6
+ `);return}process.stderr.write(m(o instanceof Error?o.message:"Unknown error")+`
7
+ `);return}console.error(""),console.error(f.bold(` ${e.displayName||e.name}`)),e.description&&console.error(u(` ${e.description}`)),console.error("");let r=[];e.runtimes.length&&r.push(["Runtimes",e.runtimes.join(", ")]),e.category&&r.push(["Category",e.category]),e.stargazerCount!=null&&r.push(["Stars",String(e.stargazerCount)]),e.primaryLanguage&&r.push(["Language",e.primaryLanguage]),e.license&&r.push(["License",e.license]),e.source&&r.push(["Source",e.source]);for(let[o,i]of r)console.error(` ${u(`${o}:`)} ${R(i)}`);if(console.error(""),console.error(f.bold(" Install:")),console.error(R(` osm add ${e.slug}`)),e.marketplaces.length){console.error(""),console.error(f.bold(" Listed in marketplaces:"));for(let o of e.marketplaces)console.error(u(` - ${o.name} (${o.source}) \xB7 ${o.runtime}`))}console.error("")}export{oe as pluginInfoCommand,ne as pluginInstallCommand};
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as p,b as m}from"./chunk-AXKAVWKJ.js";import{f as n,g as o}from"./chunk-AZ56ID7P.js";import{k as d}from"./chunk-GTRQVB2J.js";import s from"fs";import t from"path";async function h(e){try{e=p(e)}catch(a){process.stderr.write(n(a instanceof Error?a.message:"Invalid slug")+`
3
+ import{a as p,b as m}from"./chunk-AXKAVWKJ.js";import{j as d,u as n,v as o}from"./chunk-4WV7FA5L.js";import s from"fs";import t from"path";async function h(e){try{e=p(e)}catch(a){process.stderr.write(n(a instanceof Error?a.message:"Invalid slug")+`
4
4
  `);return}let r=process.cwd(),l=t.join(r,".skills",`${e}.md`),c=t.join(r,".blueprints",`${e}.md`),i=!1;s.existsSync(l)&&(m(t.join(r,".skills"),`${e}.md`),s.unlinkSync(l),process.stderr.write(o(`Removed skill "${e}" from .skills/`)+`
5
5
  `),i=!0),s.existsSync(c)&&(m(t.join(r,".blueprints"),`${e}.md`),s.unlinkSync(c),process.stderr.write(o(`Removed blueprint "${e}" from .blueprints/`)+`
6
6
  `),i=!0),i||process.stderr.write(n(`"${e}" is not installed.`,`Run ${d("osm list")} to see installed skills and blueprints.`)+`
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
+ import{a as d}from"./chunk-N5U3SVLG.js";import{b as m}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{g as t,k as l,l as o,n as i,u as a,v as c}from"./chunk-4WV7FA5L.js";import u from"fs";import p from"path";async function I(){let s=d({text:"Downloading OpenSkill router...",spinner:i,color:!1}).start();try{let r=await m(),e=await fetch(`${r}/skills/router/SKILL.md`);if(!e.ok)throw new Error(`Failed to download router SKILL.md (HTTP ${e.status})`);let f=await e.text(),n=p.join(process.cwd(),".skills");u.mkdirSync(n,{recursive:!0});let h=p.join(n,"openskill-router.md");u.writeFileSync(h,f,"utf-8"),s.stop(),console.error(c("Installed OpenSkill router to .skills/openskill-router.md")),console.error(""),console.error(t.bold(" What is the router?")),console.error(o(" The router skill teaches your AI agent how to discover and install")),console.error(o(" skills on-demand from the OpenSkill registry.")),console.error(""),console.error(t.bold(" How to use:")),console.error(l(' Point your agent at the file: "Read .skills/openskill-router.md"')),console.error(o(" The agent will then automatically search for relevant skills as needed.")),console.error("")}catch(r){s.fail("Failed to install router"),console.error(a(r instanceof Error?r.message:"Unknown error"))}}export{I as routerInstallCommand};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{b as l,c as m,e as d,f as u}from"./chunk-AZ56ID7P.js";import{h as p,i as f}from"./chunk-GTRQVB2J.js";import g from"fs";function h(s){let t=[],e=A(s,t),o=w(s,t),r=$(s,t),a=k(s,t);return{overall:e+o+r+a,format:e,structure:o,security:r,specificity:a,suggestions:t}}function A(s,t){let e=0,o=s.split(`
3
+ import{h as p,i as f,q as l,r as m,t as d,u}from"./chunk-4WV7FA5L.js";import g from"fs";function h(s){let t=[],e=A(s,t),o=w(s,t),r=$(s,t),a=k(s,t);return{overall:e+o+r+a,format:e,structure:o,security:r,specificity:a,suggestions:t}}function A(s,t){let e=0,o=s.split(`
4
4
  `);if(s.startsWith("---")){let n=s.indexOf("---",3);if(n>3){let c=s.slice(3,n).trim(),v=/^name:/m.test(c),S=/^description:/m.test(c),b=/^version:/m.test(c);v?e+=3:t.push("Add a 'name' field to your YAML frontmatter"),S?e+=3:t.push("Add a 'description' field to your YAML frontmatter"),b?e+=2:t.push("Add a 'version' field to your YAML frontmatter"),e+=4}else t.push("Your YAML frontmatter is not properly closed with '---'")}else t.push("Add YAML frontmatter at the top of your SKILL.md (between --- delimiters)");let a=o.some(n=>/^# /.test(n)),i=o.some(n=>/^## /.test(n));return a?e+=4:t.push("Add a top-level heading (# Title)"),i?e+=3:t.push("Add section headings (## Section)"),/```[\s\S]*?```/.test(s)&&(e+=3),o.some(n=>/^\s*[-*]\s/.test(n)||/^\s*\d+\.\s/.test(n))&&(e+=3),Math.min(e,25)}function w(s,t){let e=0,o=[{pattern:/when to use/i,name:"When to Use",points:5},{pattern:/workflow|process|steps/i,name:"Workflow",points:5},{pattern:/rules|guidelines|constraints/i,name:"Rules/Guidelines",points:5}];for(let i of o)i.pattern.test(s)?e+=i.points:t.push(`Add a '${i.name}' section to improve structure`);let r=s.match(/^##?\s+.+$/gm)||[];r.length>=3?e+=4:r.length>=2?e+=2:t.push("Add more sections to organize your content (aim for 3+ headings)");let a=s.split(/\s+/).length;return a>=500?e+=3:a>=200?e+=2:t.push("Expand your content \u2014 aim for at least 500 words for a comprehensive skill"),/examples?/i.test(s)?e+=3:t.push("Add an 'Examples' section with concrete usage scenarios"),Math.min(e,25)}function $(s,t){let e=25,o=[{pattern:/(?:api[_-]?key|secret|password|token)\s*[:=]\s*['"][^'"]+['"]/gi,name:"hardcoded secrets",penalty:8},{pattern:/rm\s+-rf\s+\//g,name:"dangerous rm -rf / commands",penalty:8},{pattern:/eval\s*\(/g,name:"eval() usage",penalty:5},{pattern:/sudo\s+/g,name:"sudo commands",penalty:3},{pattern:/chmod\s+777/g,name:"chmod 777 permissions",penalty:5},{pattern:/curl.*\|\s*(ba)?sh/g,name:"piping curl to shell",penalty:5}];for(let r of o)r.pattern.test(s)&&(e-=r.penalty,t.push(`Security concern: contains ${r.name}`));return/environment\s*variable|env\s+var|\$\{?\w+\}?/i.test(s)&&!/hardcod/i.test(s)&&(e=Math.min(e+2,25)),/sanitiz|validat|escape|safe/i.test(s)&&(e=Math.min(e+2,25)),Math.max(e,0)}function k(s,t){let e=0,o=s.match(/```[\s\S]*?```/g)||[];return o.length>=3?e+=6:o.length>=1?e+=3:t.push("Add code examples to make your skill more actionable"),/for example|e\.g\.|such as|here's|consider this/i.test(s)?e+=4:t.push("Add concrete examples with phrases like 'For example...' or 'Here's how...'"),/\.\w{2,4}\b/.test(s)&&/file|path|directory|folder/i.test(s)&&(e+=3),/do not|don't|avoid|never|always|must|should not/i.test(s)?e+=4:t.push("Add clear do's and don'ts (use 'Always...', 'Never...', 'Avoid...')"),/output|result|returns|produces|generates/i.test(s)&&(e+=3),/edge case|corner case|error|exception|fallback|handle/i.test(s)?e+=3:t.push("Document edge cases and error handling scenarios"),s.split(/\s+/).length>=1e3&&(e+=2),Math.min(e,25)}async function D(s){if(!g.existsSync(s)){console.error(u(`File not found: ${s}`,"Provide a path to a SKILL.md file."));return}let t=g.readFileSync(s,"utf-8");if(t.trim().length===0){console.error(u("File is empty."));return}let e=h(t);console.error(d(`Score: ${s}`));let o=[{label:"Format",score:e.format,max:25},{label:"Structure",score:e.structure,max:25},{label:"Security",score:e.security,max:25},{label:"Specificity",score:e.specificity,max:25}];for(let r of o)console.error(` ${r.label.padEnd(14)} ${m(r.score,r.max)} ${l(r.score,r.max)}/${r.max}`);if(console.error(""),console.error(` ${"Overall".padEnd(14)} ${m(e.overall,100)} ${l(e.overall,100)}/100`),e.suggestions.length>0){console.error(d("Suggestions"));for(let r of e.suggestions)console.error(` ${f("\u2192")} ${r}`)}else console.error(""),console.error(p(" \u2728 Great job! No suggestions for improvement."));console.error(""),console.log(JSON.stringify(e))}export{D as scoreCommand};
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as k}from"./chunk-K3MPWRF4.js";import{d as C,e as P,f as x}from"./chunk-C5KG3WI6.js";import"./chunk-YAZPI4SK.js";import{a as w,b as v,d as $,e as d,f as h}from"./chunk-AZ56ID7P.js";import{g as n,m as t,o as S}from"./chunk-GTRQVB2J.js";async function A(p){let b=k({text:`Searching for "${p}"...`,spinner:S,color:!1}).start();try{let s=await C(p);b.stop();let a=s.mcpServers??[];if(s.skills.length+s.blueprints.length+a.length===0){process.stderr.write(h(`No results found for "${p}".`)+`
3
+ import{a as v}from"./chunk-N5U3SVLG.js";import{d as C,e as P,f as x}from"./chunk-QRUOUQVA.js";import"./chunk-C7AXVR6L.js";import"./chunk-YAZPI4SK.js";import{g as n,l as t,n as S,p as w,q as k,s as $,t as d,u as h}from"./chunk-4WV7FA5L.js";async function A(p){let b=v({text:`Searching for "${p}"...`,spinner:S,color:!1}).start();try{let s=await C(p);b.stop();let a=s.mcpServers??[];if(s.skills.length+s.blueprints.length+a.length===0){process.stderr.write(h(`No results found for "${p}".`)+`
4
4
  `),process.stderr.write(t(` \u2192 Try broader search terms or run ${n("osm browse")} to explore categories.
5
5
  `)+`
6
6
  `);return}if(s.skills.length>0){process.stderr.write(d(`Skills (${s.skills.length})`)+`
7
- `);let o=await Promise.allSettled(s.skills.map(r=>P(r.slug)));for(let r=0;r<s.skills.length;r++){let l=s.skills[r],i=o[r],e=i.status==="fulfilled"?i.value:null,u=e?.name||l.name,f=e?.scoreOverall!=null?v(e.scoreOverall,100):t("--"),g=e?.downloads!=null?$(e.downloads):"--",c=e?w(e.publisher):"",m=e?.description||l.description||"";process.stdout.write(` ${n(u)}${c} ${t("\xB7")} score: ${f} ${t("\xB7")} ${g} downloads
7
+ `);let o=await Promise.allSettled(s.skills.map(r=>P(r.slug)));for(let r=0;r<s.skills.length;r++){let l=s.skills[r],i=o[r],e=i.status==="fulfilled"?i.value:null,u=e?.name||l.name,f=e?.scoreOverall!=null?k(e.scoreOverall,100):t("--"),g=e?.downloads!=null?$(e.downloads):"--",c=e?w(e.publisher):"",m=e?.description||l.description||"";process.stdout.write(` ${n(u)}${c} ${t("\xB7")} score: ${f} ${t("\xB7")} ${g} downloads
8
8
  `),m&&process.stdout.write(` ${t(typeof m=="string"?m.slice(0,120):"")}
9
9
  `),process.stdout.write(` ${t(`slug: ${l.slug}`)}
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openskillmd",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "The OpenSkill CLI (osm) — search, add, score, and explore AI agent skills from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a as h}from"./chunk-K3MPWRF4.js";import{c as y,e as S}from"./chunk-C5KG3WI6.js";import"./chunk-YAZPI4SK.js";import{f as u,h as c}from"./chunk-AZ56ID7P.js";import{m as g,o as k}from"./chunk-GTRQVB2J.js";import{spawn as $}from"child_process";import{createRequire as x}from"module";var w=x(import.meta.url);function b(e){return e.replace(/^.*[█╔╗╚╝═║].*\r?\n?/gm,"").replace(/^.*open agent skills ecosystem.*\r?\n?/gm,"")}function v(e){return!e||typeof e!="string"||e.length===0||e.length>500?{ok:!1,code:2,message:"Source is required, e.g. owner/repo or owner/repo@skill"}:/[/@:.]/.test(e)?{ok:!0}:{ok:!1,code:"needs-resolution",slug:e}}async function A(e){let r;try{r=await S(e)}catch(t){return t instanceof y&&t.statusCode===404?{ok:!1,message:`No skill named "${e}" in the registry.`,suggestion:"Run `osm search <query>` to find it, or pass owner/repo directly."}:{ok:!1,message:`Couldn't reach the registry to resolve "${e}".`,suggestion:"Check your connection (and OPENSKILL_API_URL, if set), or pass owner/repo directly."}}let s=r.name||null;if(r.githubOwner&&r.githubRepo){let t=`${r.githubOwner}/${r.githubRepo}`;return{ok:!0,source:t,skillName:s,note:s?`resolved ${e} \u2192 ${t} (skill: ${s})`:`resolved ${e} \u2192 ${t}`}}return r.sourceUrl&&/^https?:\/\//.test(r.sourceUrl)?{ok:!0,source:r.sourceUrl,skillName:s,note:s?`resolved ${e} \u2192 ${r.sourceUrl} (skill: ${s})`:`resolved ${e} \u2192 ${r.sourceUrl}`}:{ok:!1,message:`"${e}" lives only in the OpenSkill registry \u2014 it has no GitHub source to install from yet.`,suggestion:`Run \`osm info ${e}\` to inspect it.`}}function L(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function O(e,r={},s=null){let t=["add",e,"-y"];if(s){t.push("--skill",s);let n=L(s);n&&n!==s.toLowerCase()&&t.push("--skill",n)}for(let n of r.agent??[])t.push("-a",n);return r.global&&t.push("-g"),r.copy&&t.push("--copy"),t}function j(e,r,s,t,n=null){return s===0?{ok:!0,source:e,resolvedFrom:n,agent:r.agent??null,scope:r.global?"user":"project"}:{ok:!1,source:e,resolvedFrom:n,error:{code:`INSTALL_EXIT_${s}`,message:t.trim()||"install failed"}}}async function T(e,r={}){let s=e,t=null,n=null,i=v(e);if(!i.ok){i.code!=="needs-resolution"&&(console.error(u(i.message,i.suggestion)),process.exit(i.code));let l=r.json?null:h({text:`Resolving "${i.slug}" in the registry...`,spinner:k,color:!1}).start(),o=await A(i.slug);l?.stop(),o.ok||(r.json?c({ok:!1,source:e,resolvedFrom:null,error:{code:"SLUG_RESOLUTION_FAILED",message:o.message}}):console.error(u(o.message,o.suggestion)),process.exit(2)),r.json||console.error(g(` \u2192 ${o.note}`)),s=o.source,t=i.slug,n=o.skillName}let d;try{d=w.resolve("skills/bin/cli.mjs")}catch{console.error(u("The installer backend is missing.","Reinstall @openskillmd/osm to restore its dependencies.")),process.exit(3)}let R=O(s,r,n);r.json||(console.error(g(" \u2192 fetching skill files\u2026")),console.error(""));let a=$(process.execPath,[d,...R],{stdio:["inherit","pipe","pipe"],env:{...process.env,DISABLE_TELEMETRY:"1"}}),p="";a.stdout&&a.stdout.on("data",l=>{let o=b(l.toString("utf-8"));o&&!r.json&&process.stdout.write(o)}),a.stderr&&a.stderr.on("data",l=>{let o=l.toString("utf-8");if(r.json)p+=o;else{let m=b(o);m&&process.stderr.write(m)}});let f=await new Promise(l=>{a.once("exit",o=>l(o??1)),a.once("error",()=>l(3))});r.json&&c(j(s,r,f,p,t)),process.exit(f)}export{T as addCommand,j as buildJsonResult,O as buildSkillsArgs,A as resolveSlug,b as stripSkillsBanner,L as toSkillSlug,v as validateSource};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{g as c,h as e,i as o,j as i,m as u}from"./chunk-GTRQVB2J.js";function a(r){return r?.verificationStatus==="verified"?e(" \u2713 verified"):""}function d(r,n){let t=r/n;return t>=.8?e(String(r)):t>=.6?o(String(r)):i(String(r))}function l(r,n){let t=Math.round(r/n*20),f=20-t,s=r/n;return(s>=.8?e:s>=.6?o:i)("\u2588".repeat(t))+u("\u2591".repeat(f))}function m(r){return r?r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r):"0"}function x(r){return c.bold(`
4
- ${r}
5
- ${"\u2500".repeat(r.length)}
6
- `)}function b(r,n){let t=i(` \u2716 ${r}`);return n&&(t+=u(`
7
- \u2192 ${n}`)),t}function S(r){return e(` \u2714 ${r}`)}function v(r){process.stdout.write(JSON.stringify(r)+`
8
- `)}export{a,d as b,l as c,m as d,x as e,b as f,S as g,v as h};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- var G=Object.create;var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var ce=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var ue=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)R(r,t,{get:e[t],enumerable:!0})},V=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of D(e))!U.call(r,n)&&n!==t&&R(r,n,{get:()=>e[n],enumerable:!(o=Y(e,n))||o.enumerable});return r};var he=(r,e,t)=>(t=r!=null?G($(r)):{},V(e||!r||!r.__esModule?R(t,"default",{value:r,enumerable:!0}):t,r));var M=(r=0)=>e=>`\x1B[${e+r}m`,N=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,B=(r=0)=>(e,t,o)=>`\x1B[${38+r};2;${e};${t};${o}m`,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},me=Object.keys(i.modifier),K=Object.keys(i.color),W=Object.keys(i.bgColor),pe=[...K,...W];function z(){let r=new Map;for(let[e,t]of Object.entries(i)){for(let[o,n]of Object.entries(t))i[o]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[o]=i[o],r.set(n[0],n[1]);Object.defineProperty(i,e,{value:t,enumerable:!1})}return Object.defineProperty(i,"codes",{value:r,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi=M(),i.color.ansi256=N(),i.color.ansi16m=B(),i.bgColor.ansi=M(10),i.bgColor.ansi256=N(10),i.bgColor.ansi16m=B(10),Object.defineProperties(i,{rgbToAnsi256:{value(e,t,o){return e===t&&t===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[o]=t;o.length===3&&(o=[...o].map(l=>l+l).join(""));let n=Number.parseInt(o,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>i.rgbToAnsi256(...i.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,o,n;if(e>=232)t=((e-232)*10+8)/255,o=t,n=t;else{e-=16;let C=e%36;t=Math.floor(e/36)/5,o=Math.floor(C/6)/5,n=C%6/5}let l=Math.max(t,o,n)*2;if(l===0)return 30;let c=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(t));return l===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:(e,t,o)=>i.ansi256ToAnsi(i.rgbToAnsi256(e,t,o)),enumerable:!1},hexToAnsi:{value:e=>i.ansi256ToAnsi(i.hexToAnsi256(e)),enumerable:!1}}),i}var H=z(),f=H;import y from"process";import q from"os";import S from"tty";function u(r,e=globalThis.Deno?globalThis.Deno.args:y.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),n=e.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:a}=y,g;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?g=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(g=1);function J(){if("FORCE_COLOR"in a)return a.FORCE_COLOR==="true"?1:a.FORCE_COLOR==="false"?0:a.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(a.FORCE_COLOR,10),3)}function Q(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function X(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let o=J();o!==void 0&&(g=o);let n=t?g:o;if(n===0)return 0;if(t){if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2}if("TF_BUILD"in a&&"AGENT_NAME"in a)return 1;if(r&&!e&&n===void 0)return 0;let l=n||0;if(a.TERM==="dumb")return l;if(y.platform==="win32"){let c=q.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in a)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(c=>c in a)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(c=>c in a)||a.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM==="truecolor"||a.TERM==="xterm-kitty"||a.TERM==="xterm-ghostty"||a.TERM==="wezterm")return 3;if("TERM_PROGRAM"in a){let c=Number.parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:l}function I(r,e={}){let t=X(r,{streamIsTTY:r&&r.isTTY,...e});return Q(t)}var Z={stdout:I({isTTY:S.isatty(1)}),stderr:I({isTTY:S.isatty(2)})},F=Z;function _(r,e,t){let o=r.indexOf(e);if(o===-1)return r;let n=e.length,l=0,c="";do c+=r.slice(l,o)+e+t,l=o+n,o=r.indexOf(e,l);while(o!==-1);return c+=r.slice(l),c}function w(r,e,t,o){let n=0,l="";do{let c=r[o-1]==="\r";l+=r.slice(n,c?o-1:o)+e+(c?`\r
4
- `:`
5
- `)+t,n=o+1,o=r.indexOf(`
6
- `,n)}while(o!==-1);return l+=r.slice(n),l}var{stdout:j,stderr:k}=F,A=Symbol("GENERATOR"),b=Symbol("STYLER"),p=Symbol("IS_EMPTY"),L=["ansi","ansi","ansi256","ansi16m"],m=Object.create(null),ee=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=j?j.level:0;r.level=e.level===void 0?t:e.level};var re=r=>{let e=(...t)=>t.join(" ");return ee(e,r),Object.setPrototypeOf(e,d.prototype),e};function d(r){return re(r)}Object.setPrototypeOf(d.prototype,Function.prototype);for(let[r,e]of Object.entries(f))m[r]={get(){let t=O(this,E(e.open,e.close,this[b]),this[p]);return Object.defineProperty(this,r,{value:t}),t}};m.visible={get(){let r=O(this,this[b],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var v=(r,e,t,...o)=>r==="rgb"?e==="ansi16m"?f[t].ansi16m(...o):e==="ansi256"?f[t].ansi256(f.rgbToAnsi256(...o)):f[t].ansi(f.rgbToAnsi(...o)):r==="hex"?v("rgb",e,t,...f.hexToRgb(...o)):f[t][r](...o),te=["rgb","hex","ansi256"];for(let r of te){m[r]={get(){let{level:t}=this;return function(...o){let n=E(v(r,L[t],"color",...o),f.color.close,this[b]);return O(this,n,this[p])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);m[e]={get(){let{level:t}=this;return function(...o){let n=E(v(r,L[t],"bgColor",...o),f.bgColor.close,this[b]);return O(this,n,this[p])}}}}var oe=Object.defineProperties(()=>{},{...m,level:{enumerable:!0,get(){return this[A].level},set(r){this[A].level=r}}}),E=(r,e,t)=>{let o,n;return t===void 0?(o=r,n=e):(o=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:o,closeAll:n,parent:t}},O=(r,e,t)=>{let o=(...n)=>ne(o,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(o,oe),o[A]=r,o[b]=e,o[p]=t,o},ne=(r,e)=>{if(r.level<=0||!e)return r[p]?"":e;let t=r[b];if(t===void 0)return e;let{openAll:o,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=_(e,t.close,t.open),t=t.parent;let l=e.indexOf(`
7
- `);return l!==-1&&(e=w(e,n,o,l)),o+e+n};Object.defineProperties(d.prototype,m);var se=d(),ve=d({level:k?k.level:0});var s=se;var h={rosewater:s.hex("#f5e0dc"),flamingo:s.hex("#f2cdcd"),pink:s.hex("#f5c2e7"),mauve:s.hex("#cba6f7"),red:s.hex("#f38ba8"),maroon:s.hex("#eba0ac"),peach:s.hex("#fab387"),yellow:s.hex("#f9e2af"),green:s.hex("#a6e3a1"),teal:s.hex("#94e2d5"),sky:s.hex("#89dceb"),sapphire:s.hex("#74c7ec"),blue:s.hex("#89b4fa"),lavender:s.hex("#b4befe"),text:s.hex("#cdd6f4"),subtext1:s.hex("#bac2de"),subtext0:s.hex("#a6adc8"),overlay2:s.hex("#9399b2"),overlay1:s.hex("#7f849c"),overlay0:s.hex("#6c7086"),surface2:s.hex("#585b70"),surface1:s.hex("#45475a"),surface0:s.hex("#313244"),base:s.hex("#1e1e2e"),mantle:s.hex("#181825"),crust:s.hex("#11111b")},le=h.mauve,Ne=h.green,Be=h.yellow,Se=h.red,Ie=h.teal,Fe=h.text,_e=h.overlay1,we=h.overlay0,je=h.surface2,ie=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],ke={interval:80,frames:ie.map(r=>le(r))},T=[[203,166,247],[245,194,231],[250,179,135]];function ae(r){let t=Math.max(0,Math.min(1,r))*(T.length-1),o=Math.min(Math.floor(t),T.length-2),n=t-o,[l,c]=[T[o],T[o+1]];return`#${l.map((x,P)=>Math.round(x+(c[P]-x)*n)).map(x=>x.toString(16).padStart(2,"0")).join("")}`}function Le(r,e=0,t=1){let o=Array.from(r),n=o.length+t*2;return o.map((l,c)=>l===" "?l:s.hex(ae((c+e*2)/n))(l)).join("")}export{ce as a,ue as b,fe as c,he as d,s as e,h as f,le as g,Ne as h,Be as i,Se as j,Ie as k,Fe as l,_e as m,je as n,ke as o,Le as p};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
- import{a}from"./chunk-K3MPWRF4.js";import{b as m}from"./chunk-C5KG3WI6.js";import"./chunk-YAZPI4SK.js";import{f as c,g as d}from"./chunk-AZ56ID7P.js";import{g as t,l,m as o,o as i}from"./chunk-GTRQVB2J.js";import u from"fs";import p from"path";async function I(){let s=a({text:"Downloading OpenSkill router...",spinner:i,color:!1}).start();try{let r=await m(),e=await fetch(`${r}/skills/router/SKILL.md`);if(!e.ok)throw new Error(`Failed to download router SKILL.md (HTTP ${e.status})`);let f=await e.text(),n=p.join(process.cwd(),".skills");u.mkdirSync(n,{recursive:!0});let h=p.join(n,"openskill-router.md");u.writeFileSync(h,f,"utf-8"),s.stop(),console.error(d("Installed OpenSkill router to .skills/openskill-router.md")),console.error(""),console.error(t.bold(" What is the router?")),console.error(o(" The router skill teaches your AI agent how to discover and install")),console.error(o(" skills on-demand from the OpenSkill registry.")),console.error(""),console.error(t.bold(" How to use:")),console.error(l(' Point your agent at the file: "Read .skills/openskill-router.md"')),console.error(o(" The agent will then automatically search for relevant skills as needed.")),console.error("")}catch(r){s.fail("Failed to install router"),console.error(c(r instanceof Error?r.message:"Unknown error"))}}export{I as routerInstallCommand};