skillmds 1.3.2 → 1.3.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.
Files changed (2) hide show
  1. package/dist/cli.js +31 -9
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -655,6 +655,7 @@ function resolveClaudeBin(env = process.env) {
655
655
  var needsShell = (bin) => /\.(cmd|bat)$/i.test(bin);
656
656
  var MARKETPLACE_URL = "https://skillmd.com/.claude-plugin/marketplace.json";
657
657
  var MARKETPLACE_NAME = "skillmd";
658
+ var MARKETPLACE_SCHEMA = "https://anthropic.com/claude-code/marketplace.schema.json";
658
659
  var TIMEOUT_MS = 12e4;
659
660
  function exec(deps) {
660
661
  return deps.exec ?? ((file, args) => {
@@ -776,17 +777,36 @@ async function installPluginNatively(owner, slug, deps = {}) {
776
777
  writeFileSync3(dest, data);
777
778
  }
778
779
  writeFileSync3(join2(installPath, ".in_use"), "");
779
- mkdirSync2(join2(pluginsDir, "marketplaces", MARKETPLACE_NAME), { recursive: true });
780
780
  const now = (/* @__PURE__ */ new Date()).toISOString();
781
781
  const source = { source: "url", url: MARKETPLACE_URL };
782
+ const marketplaceDir = join2(pluginsDir, "marketplaces", MARKETPLACE_NAME);
783
+ const cachedPath = join2(marketplaceDir, ".claude-plugin", "marketplace.json");
784
+ const cached = readJson(cachedPath);
785
+ if (cached === "unparsable") return { ok: false, reason: "the cached marketplace manifest is not readable JSON \u2014 left untouched" };
786
+ const cachedDoc = cached === "absent" ? {
787
+ $schema: MARKETPLACE_SCHEMA,
788
+ name: MARKETPLACE_NAME,
789
+ owner: { name: "SkillMD", email: "hi@skillmd.com" },
790
+ description: "Agent Skill plugins from the SkillMD registry.",
791
+ plugins: []
792
+ } : cached;
793
+ const list = Array.isArray(cachedDoc.plugins) ? cachedDoc.plugins : [];
794
+ cachedDoc.plugins = [
795
+ ...list.filter((e) => e?.name !== name),
796
+ {
797
+ name,
798
+ version: version2,
799
+ homepage: `${SITE_URL}/plugins/${owner}/${slug}`,
800
+ author: { name: owner === "skillmd" ? "SkillMD" : `@${owner}` },
801
+ source: { source: "archive", url: `${SITE_URL}/plugins/${owner}/${slug}/plugin.zip` }
802
+ }
803
+ ];
804
+ writeJson(cachedPath, cachedDoc);
782
805
  const knownDoc = known === "absent" ? {} : known;
783
- knownDoc[MARKETPLACE_NAME] = {
784
- ...obj(knownDoc[MARKETPLACE_NAME]),
785
- source,
786
- installLocation: join2(pluginsDir, "marketplaces", MARKETPLACE_NAME),
787
- lastUpdated: now
788
- };
789
- writeJson(knownPath, knownDoc);
806
+ if (!knownDoc[MARKETPLACE_NAME]) {
807
+ knownDoc[MARKETPLACE_NAME] = { source, installLocation: marketplaceDir, lastUpdated: now };
808
+ writeJson(knownPath, knownDoc);
809
+ }
790
810
  const installedDoc = installed === "absent" ? { version: 2, plugins: {} } : installed;
791
811
  const plugins = obj(installedDoc.plugins);
792
812
  const prior = Array.isArray(plugins[qualified]) ? plugins[qualified] : [];
@@ -798,7 +818,9 @@ async function installPluginNatively(owner, slug, deps = {}) {
798
818
  if (typeof installedDoc.version !== "number") installedDoc.version = 2;
799
819
  writeJson(installedPath, installedDoc);
800
820
  const settingsDoc = settings === "absent" ? {} : settings;
801
- settingsDoc.extraKnownMarketplaces = { ...obj(settingsDoc.extraKnownMarketplaces), [MARKETPLACE_NAME]: { source } };
821
+ const declared = obj(settingsDoc.extraKnownMarketplaces);
822
+ if (!declared[MARKETPLACE_NAME]) declared[MARKETPLACE_NAME] = { source };
823
+ settingsDoc.extraKnownMarketplaces = declared;
802
824
  settingsDoc.enabledPlugins = { ...obj(settingsDoc.enabledPlugins), [qualified]: true };
803
825
  writeJson(settingsPath, settingsDoc);
804
826
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillmds",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "SkillMD for agents: the `skillmds` MCP server + the `skillmd` CLI (lint, scan, search, install, publish Agent Skills) from skillmd.com.",
5
5
  "license": "MIT",
6
6
  "author": "SkillMD",