@toolr/seedr 0.1.7 → 0.1.8

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.
@@ -97,6 +97,19 @@ function getItemSourcePath(item) {
97
97
  const typeDir = item.type + "s";
98
98
  return join(REGISTRY_PATH, typeDir, item.slug);
99
99
  }
100
+ async function fetchItemToDestination(item, destPath) {
101
+ const { writeFile: writeFile2, mkdir: mkdir2 } = await import("fs/promises");
102
+ const { dirname: dirname4, join: join5 } = await import("path");
103
+ const { remote } = getItemBaseUrl(item);
104
+ const filesToFetch = item.type === "skill" ? ["SKILL.md"] : [`${item.type}.md`];
105
+ await mkdir2(destPath, { recursive: true });
106
+ for (const file of filesToFetch) {
107
+ const content = await fetchRemote(`${remote}/${file}`);
108
+ const filePath = join5(destPath, file);
109
+ await mkdir2(dirname4(filePath), { recursive: true });
110
+ await writeFile2(filePath, content, "utf-8");
111
+ }
112
+ }
100
113
 
101
114
  // src/config/tools.ts
102
115
  import { homedir } from "os";
@@ -391,7 +404,11 @@ async function installToCentralLocation(item, sourcePath, cwd) {
391
404
  const { rm } = await import("fs/promises");
392
405
  await rm(centralPath, { recursive: true });
393
406
  }
394
- await copyDirectory(sourcePath, centralPath);
407
+ if (sourcePath && await exists(sourcePath)) {
408
+ await copyDirectory(sourcePath, centralPath);
409
+ } else {
410
+ await fetchItemToDestination(item, centralPath);
411
+ }
395
412
  return centralPath;
396
413
  }
397
414
  async function createToolSymlink(centralPath, destPath) {
@@ -416,10 +433,10 @@ async function installSkillForTool(item, tool, scope, method, cwd, centralPath)
416
433
  const sourcePath = getItemSourcePath(item);
417
434
  if (method === "symlink" && centralPath) {
418
435
  await createToolSymlink(centralPath, destPath);
419
- } else if (sourcePath) {
436
+ } else if (sourcePath && await exists(sourcePath)) {
420
437
  await installDirectory(sourcePath, destPath, "copy");
421
438
  } else {
422
- throw new Error("External skill installation not yet implemented");
439
+ await fetchItemToDestination(item, destPath);
423
440
  }
424
441
  spinner.succeed(
425
442
  chalk.green(`Installed ${item.name} for ${AI_TOOLS[tool].name}`)
@@ -437,7 +454,7 @@ async function installSkill(item, tools, scope, method, cwd = process.cwd()) {
437
454
  const results = [];
438
455
  const sourcePath = getItemSourcePath(item);
439
456
  let centralPath;
440
- if (method === "symlink" && sourcePath) {
457
+ if (method === "symlink") {
441
458
  centralPath = await installToCentralLocation(item, sourcePath, cwd);
442
459
  }
443
460
  for (const tool of tools) {
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  skillHandler,
23
23
  uninstallSkill,
24
24
  writeTextFile
25
- } from "./chunk-7GIETJRD.js";
25
+ } from "./chunk-NDYSR7CD.js";
26
26
 
27
27
  // src/cli.ts
28
28
  import { Command as Command5 } from "commander";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  loadManifest,
16
16
  searchItems,
17
17
  uninstallSkill
18
- } from "./chunk-7GIETJRD.js";
18
+ } from "./chunk-NDYSR7CD.js";
19
19
 
20
20
  // src/converters/index.ts
21
21
  import matter from "gray-matter";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolr/seedr",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Seed your projects with AI configurations",
5
5
  "type": "module",
6
6
  "bin": {