@toolr/seedr 0.1.16 → 0.1.17
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/{chunk-N3QN4Y4R.js → chunk-GBM42TSU.js} +1 -1
- package/dist/cli.js +38 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -106,7 +106,7 @@ async function fetchItemToDestination(item, destPath) {
|
|
|
106
106
|
await fetchFileTree(item.contents.files, remote, destPath);
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
const filesToFetch = item.type === "skill" ? ["SKILL.md"] : [`${item.type}.md`];
|
|
109
|
+
const filesToFetch = item.type === "skill" ? ["SKILL.md"] : item.type === "plugin" ? [".claude-plugin/plugin.json", ".claude-plugin/marketplace.json"] : [`${item.type}.md`];
|
|
110
110
|
await mkdir2(destPath, { recursive: true });
|
|
111
111
|
for (const file of filesToFetch) {
|
|
112
112
|
const content = await fetchRemote(`${remote}/${file}`);
|
package/dist/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
skillHandler,
|
|
24
24
|
uninstallSkill,
|
|
25
25
|
writeTextFile
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GBM42TSU.js";
|
|
27
27
|
|
|
28
28
|
// src/cli.ts
|
|
29
29
|
import { Command as Command5 } from "commander";
|
|
@@ -568,12 +568,45 @@ import ora5 from "ora";
|
|
|
568
568
|
var home = homedir();
|
|
569
569
|
var PLUGINS_CACHE_DIR = join3(home, ".claude/plugins/cache");
|
|
570
570
|
var INSTALLED_PLUGINS_PATH = join3(home, ".claude/plugins/installed_plugins.json");
|
|
571
|
+
var KNOWN_MARKETPLACES_PATH = join3(home, ".claude/plugins/known_marketplaces.json");
|
|
572
|
+
var MARKETPLACES_DIR = join3(home, ".claude/plugins/marketplaces");
|
|
571
573
|
function getPluginCachePath(marketplace, name, version) {
|
|
572
574
|
return join3(PLUGINS_CACHE_DIR, marketplace, name, version);
|
|
573
575
|
}
|
|
574
576
|
function getPluginId(name, marketplace) {
|
|
575
577
|
return `${name}@${marketplace}`;
|
|
576
578
|
}
|
|
579
|
+
function extractGitHubRepo(url) {
|
|
580
|
+
const match = url.match(/github\.com\/([^/]+\/[^/]+)/);
|
|
581
|
+
return match?.[1]?.replace(/\.git$/, "") ?? null;
|
|
582
|
+
}
|
|
583
|
+
async function ensureMarketplaceRegistered(marketplace, item) {
|
|
584
|
+
const known = await readJson(
|
|
585
|
+
KNOWN_MARKETPLACES_PATH
|
|
586
|
+
);
|
|
587
|
+
if (known[marketplace]) return;
|
|
588
|
+
const repo = item.externalUrl ? extractGitHubRepo(item.externalUrl) : null;
|
|
589
|
+
if (!repo) return;
|
|
590
|
+
const installLocation = join3(MARKETPLACES_DIR, marketplace);
|
|
591
|
+
const { execFile } = await import("child_process");
|
|
592
|
+
const { mkdir: mkdir2 } = await import("fs/promises");
|
|
593
|
+
const { promisify } = await import("util");
|
|
594
|
+
const execFileAsync = promisify(execFile);
|
|
595
|
+
await mkdir2(MARKETPLACES_DIR, { recursive: true });
|
|
596
|
+
await execFileAsync("git", [
|
|
597
|
+
"clone",
|
|
598
|
+
"--depth",
|
|
599
|
+
"1",
|
|
600
|
+
`https://github.com/${repo}.git`,
|
|
601
|
+
installLocation
|
|
602
|
+
]);
|
|
603
|
+
known[marketplace] = {
|
|
604
|
+
source: { source: "github", repo },
|
|
605
|
+
installLocation,
|
|
606
|
+
lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
|
|
607
|
+
};
|
|
608
|
+
await writeJson(KNOWN_MARKETPLACES_PATH, known);
|
|
609
|
+
}
|
|
577
610
|
async function installPluginForTool(item, tool, scope, method, cwd) {
|
|
578
611
|
const spinner = ora5(
|
|
579
612
|
`Installing ${item.name} for ${AI_TOOLS[tool].name}...`
|
|
@@ -599,6 +632,10 @@ async function installPluginForTool(item, tool, scope, method, cwd) {
|
|
|
599
632
|
const pluginName = pluginJson.name || item.slug;
|
|
600
633
|
const version = pluginJson.version || "1.0.0";
|
|
601
634
|
const pluginId = getPluginId(pluginName, marketplace);
|
|
635
|
+
try {
|
|
636
|
+
await ensureMarketplaceRegistered(marketplace, item);
|
|
637
|
+
} catch {
|
|
638
|
+
}
|
|
602
639
|
const cachePath = getPluginCachePath(marketplace, pluginName, version);
|
|
603
640
|
const { rm } = await import("fs/promises");
|
|
604
641
|
await installDirectory(tmpPath, cachePath, "copy");
|
package/dist/index.js
CHANGED