@toolr/seedr 0.1.12 → 0.1.14
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-NDYSR7CD.js → chunk-N3QN4Y4R.js} +25 -0
- package/dist/cli.js +11 -9
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -101,6 +101,11 @@ async function fetchItemToDestination(item, destPath) {
|
|
|
101
101
|
const { writeFile: writeFile2, mkdir: mkdir2 } = await import("fs/promises");
|
|
102
102
|
const { dirname: dirname4, join: join5 } = await import("path");
|
|
103
103
|
const { remote } = getItemBaseUrl(item);
|
|
104
|
+
if (item.type === "plugin" && item.contents?.files) {
|
|
105
|
+
await mkdir2(destPath, { recursive: true });
|
|
106
|
+
await fetchFileTree(item.contents.files, remote, destPath);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
104
109
|
const filesToFetch = item.type === "skill" ? ["SKILL.md"] : [`${item.type}.md`];
|
|
105
110
|
await mkdir2(destPath, { recursive: true });
|
|
106
111
|
for (const file of filesToFetch) {
|
|
@@ -110,6 +115,25 @@ async function fetchItemToDestination(item, destPath) {
|
|
|
110
115
|
await writeFile2(filePath, content, "utf-8");
|
|
111
116
|
}
|
|
112
117
|
}
|
|
118
|
+
async function fetchFileTree(nodes, baseUrl, destPath) {
|
|
119
|
+
const { writeFile: writeFile2, mkdir: mkdir2 } = await import("fs/promises");
|
|
120
|
+
const { join: join5 } = await import("path");
|
|
121
|
+
for (const node of nodes) {
|
|
122
|
+
const nodePath = join5(destPath, node.name);
|
|
123
|
+
if (node.type === "directory") {
|
|
124
|
+
await mkdir2(nodePath, { recursive: true });
|
|
125
|
+
if (node.children) {
|
|
126
|
+
await fetchFileTree(node.children, `${baseUrl}/${node.name}`, nodePath);
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
try {
|
|
130
|
+
const content = await fetchRemote(`${baseUrl}/${node.name}`);
|
|
131
|
+
await writeFile2(nodePath, content, "utf-8");
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
113
137
|
|
|
114
138
|
// src/config/tools.ts
|
|
115
139
|
import { homedir } from "os";
|
|
@@ -513,6 +537,7 @@ export {
|
|
|
513
537
|
searchItems,
|
|
514
538
|
getItemContent,
|
|
515
539
|
getItemSourcePath,
|
|
540
|
+
fetchItemToDestination,
|
|
516
541
|
exists,
|
|
517
542
|
ensureDir,
|
|
518
543
|
installFile,
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ALL_TOOLS,
|
|
5
5
|
ensureDir,
|
|
6
6
|
exists,
|
|
7
|
+
fetchItemToDestination,
|
|
7
8
|
getAgentsPath,
|
|
8
9
|
getContentPath,
|
|
9
10
|
getInstalledSkills,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
skillHandler,
|
|
23
24
|
uninstallSkill,
|
|
24
25
|
writeTextFile
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-N3QN4Y4R.js";
|
|
26
27
|
|
|
27
28
|
// src/cli.ts
|
|
28
29
|
import { Command as Command5 } from "commander";
|
|
@@ -512,15 +513,16 @@ async function installPluginForTool(item, tool, scope, method, cwd) {
|
|
|
512
513
|
if (tool !== "claude") {
|
|
513
514
|
throw new Error("Plugins are only supported for Claude Code");
|
|
514
515
|
}
|
|
515
|
-
const sourcePath = getItemSourcePath(item);
|
|
516
|
-
if (!sourcePath) {
|
|
517
|
-
throw new Error("Plugin source not found - external plugins not yet supported");
|
|
518
|
-
}
|
|
519
516
|
const marketplace = item.author?.name || "seedr";
|
|
520
517
|
const version = "1.0.0";
|
|
521
518
|
const pluginId = getPluginId(item.slug, marketplace);
|
|
522
519
|
const cachePath = getPluginCachePath(marketplace, item.slug, version);
|
|
523
|
-
|
|
520
|
+
const sourcePath = getItemSourcePath(item);
|
|
521
|
+
if (sourcePath) {
|
|
522
|
+
await installDirectory(sourcePath, cachePath, method);
|
|
523
|
+
} else {
|
|
524
|
+
await fetchItemToDestination(item, cachePath);
|
|
525
|
+
}
|
|
524
526
|
const registry = await readJson(INSTALLED_PLUGINS_PATH);
|
|
525
527
|
registry.plugins = registry.plugins || {};
|
|
526
528
|
const installInfo = {
|
|
@@ -714,14 +716,14 @@ function printInstallSummary(results) {
|
|
|
714
716
|
process.exit(1);
|
|
715
717
|
}
|
|
716
718
|
}
|
|
717
|
-
var addCommand = new Command("add").description("Install a skill, agent, hook, or other configuration").argument("[name]", "Name of the item to install").option("-
|
|
719
|
+
var addCommand = new Command("add").description("Install a skill, agent, hook, or other configuration").argument("[name]", "Name of the item to install").option("-t, --type <type>", "Content type: skill, agent, hook, mcp, plugin, settings").option(
|
|
718
720
|
"-a, --agents <tools>",
|
|
719
721
|
"Comma-separated AI tools or 'all' (claude,copilot,gemini,codex,opencode)"
|
|
720
|
-
).option("--scope <scope>", "Installation scope: project, user, or local").option("-m, --method <method>", "Installation method: symlink or copy").option("-y, --yes", "Skip confirmation prompts").option("-f, --force", "Overwrite existing files").option("-n, --dry-run", "Show what would be installed without making changes").action(async (name, options) => {
|
|
722
|
+
).option("-s, --scope <scope>", "Installation scope: project, user, or local").option("-m, --method <method>", "Installation method: symlink or copy").option("-y, --yes", "Skip confirmation prompts").option("-f, --force", "Overwrite existing files").option("-n, --dry-run", "Show what would be installed without making changes").action(async (name, options) => {
|
|
721
723
|
try {
|
|
722
724
|
printLogo();
|
|
723
725
|
intro2("Seedr");
|
|
724
|
-
const itemName = name
|
|
726
|
+
const itemName = name;
|
|
725
727
|
const contentType = options.type;
|
|
726
728
|
const item = await resolveItem(itemName, contentType);
|
|
727
729
|
if (!item) process.exit(1);
|
package/dist/index.js
CHANGED