openskillmd 0.3.2 → 0.4.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/README.md CHANGED
@@ -8,18 +8,17 @@ Search, add, score, and explore AI agent skills, blueprints, and MCP servers fro
8
8
  [OpenSkill.md](https://openskill.md) — right from your terminal.
9
9
 
10
10
  ```bash
11
- npm i -g @openskillmd/osm@beta
11
+ npm i -g @openskillmd/osm
12
12
  # or the unscoped alias:
13
- npm i -g openskillmd@beta
13
+ npm i -g openskillmd
14
14
  ```
15
15
 
16
16
  Both packages install the same CLI and expose the `osm` command (plus `openskill`
17
17
  and `openskillmd` aliases).
18
18
 
19
- > **Beta:** the current release is published under the `beta` dist-tag and points at
20
- > the staging API install it with the `@beta` tag shown above. A plain
21
- > `npm i -g @openskillmd/osm` will not resolve until the stable `latest` release
22
- > lands when the production API goes live.
19
+ > **Note:** releases are published to both the `latest` and `beta` dist-tags.
20
+ > The CLI points at the production API (`https://openskill.md/api`) by default;
21
+ > override anytime with `OPENSKILL_API_URL` (e.g. to target staging or local).
23
22
 
24
23
  ## Usage
25
24
 
@@ -54,7 +53,8 @@ hint shows the exact `osm add owner/repo` command for that skill.
54
53
 
55
54
  ## Configuration
56
55
 
57
- Settings live in `~/.openskill/config.json`:
56
+ Settings live in `~/.openskill/config.json`. The CLI defaults to **production**;
57
+ set `baseUrl` only to pin a non-default API (e.g. staging):
58
58
 
59
59
  ```json
60
60
  { "baseUrl": "https://staging.openskill.md/api" }
@@ -64,7 +64,7 @@ The API base URL is resolved in this order:
64
64
 
65
65
  1. `OPENSKILL_API_URL` environment variable
66
66
  2. `baseUrl` in `~/.openskill/config.json`
67
- 3. the built-in default (staging during beta)
67
+ 3. the built-in default (production: `https://openskill.md/api`)
68
68
 
69
69
  ```bash
70
70
  OPENSKILL_API_URL=http://localhost:8080/api osm search testing
@@ -1,3 +1,3 @@
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 h}from"./chunk-IZJHFL7T.js";import{c as y,e as S}from"./chunk-5CDG6OB7.js";import"./chunk-YAZPI4SK.js";import{f as u,h as c}from"./chunk-ONVELHE6.js";import{l as g,n as k}from"./chunk-OVTYCRA4.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};
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,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 d}from"./chunk-IZJHFL7T.js";import{g as C,h as v,i as y,j as S}from"./chunk-5CDG6OB7.js";import{a as g}from"./chunk-MWJMJUS4.js";import"./chunk-YAZPI4SK.js";import{a as f,b as h,d as $,e as l,f as m}from"./chunk-ONVELHE6.js";import{f as n,k as w,l as s,n as u}from"./chunk-OVTYCRA4.js";var p="__exit__";async function _(){try{let{mode:t}=await g.prompt([{type:"list",name:"mode",message:n("What would you like to explore?"),choices:[{name:"\u{1F4DA} Collections (curated sets of skills & blueprints)",value:"collections"},{name:"\u{1F50C} MCP servers",value:"mcp"},{name:s("\u2190 Exit"),value:p}]}]);if(t===p)return;if(t==="mcp"){await k();return}await x()}catch(t){process.stderr.write(m(t instanceof Error?t.message:"Unknown error")+`
3
+ import{a as d}from"./chunk-K3MPWRF4.js";import{g as C,h as v,i as y,j as S}from"./chunk-C5KG3WI6.js";import{a as g}from"./chunk-KS57GYQM.js";import"./chunk-YAZPI4SK.js";import{a as f,b as h,d as $,e as l,f as m}from"./chunk-AZ56ID7P.js";import{g as n,l as w,m as s,o as u}from"./chunk-GTRQVB2J.js";var p="__exit__";async function _(){try{let{mode:t}=await g.prompt([{type:"list",name:"mode",message:n("What would you like to explore?"),choices:[{name:"\u{1F4DA} Collections (curated sets of skills & blueprints)",value:"collections"},{name:"\u{1F50C} MCP servers",value:"mcp"},{name:s("\u2190 Exit"),value:p}]}]);if(t===p)return;if(t==="mcp"){await k();return}await x()}catch(t){process.stderr.write(m(t instanceof Error?t.message:"Unknown error")+`
4
4
  `)}}async function x(){let t=d({text:"Loading collections...",spinner:u,color:!1}).start(),i=await C({limit:50});if(t.stop(),i.length===0){process.stderr.write(m("No collections found.")+`
5
5
  `);return}let c=i.map(r=>({name:`${r.icon||"\u{1F4E6}"} ${r.name} ${s(`(${r.itemCount} items)`)}`,value:r.slug}));c.push({name:s("\u2190 Exit"),value:p});let{slug:o}=await g.prompt([{type:"list",name:"slug",message:n("Choose a collection to explore:"),choices:c,pageSize:15}]);if(o===p)return;let e=d({text:"Loading collection...",spinner:u,color:!1}).start(),a=await v(o);e.stop(),M(a)}function M(t){process.stderr.write(l(`${t.icon||"\u{1F4E6}"} ${t.name}`)+`
6
6
  `),t.description&&process.stderr.write(` ${w(t.description)}
@@ -0,0 +1,8 @@
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};