@toolr/seedr 0.1.63 → 0.1.64

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/config/registry.ts
4
- import { readFile, readdir } from "fs/promises";
4
+ import { readFile, readdir, writeFile, mkdir } from "fs/promises";
5
5
  import { join, dirname } from "path";
6
6
  import { fileURLToPath } from "url";
7
7
  var __dirname = dirname(fileURLToPath(import.meta.url));
@@ -104,36 +104,32 @@ function getItemSourcePath(item) {
104
104
  return join(REGISTRY_PATH, typeDir, item.slug);
105
105
  }
106
106
  async function fetchItemToDestination(item, destPath) {
107
- const { writeFile: writeFile2, mkdir: mkdir2 } = await import("fs/promises");
108
- const { dirname: dirname4, join: join5 } = await import("path");
109
107
  const { remote } = getItemBaseUrl(item);
110
108
  if (item.contents?.files) {
111
- await mkdir2(destPath, { recursive: true });
109
+ await mkdir(destPath, { recursive: true });
112
110
  await fetchFileTree(item.contents.files, remote, destPath);
113
111
  return;
114
112
  }
115
113
  const filesToFetch = item.type === "skill" ? ["SKILL.md"] : item.type === "plugin" ? [".claude-plugin/plugin.json"] : [`${item.type}.md`];
116
- await mkdir2(destPath, { recursive: true });
114
+ await mkdir(destPath, { recursive: true });
117
115
  for (const file of filesToFetch) {
118
116
  const content = await fetchRemote(`${remote}/${file}`);
119
- const filePath = join5(destPath, file);
120
- await mkdir2(dirname4(filePath), { recursive: true });
121
- await writeFile2(filePath, content, "utf-8");
117
+ const filePath = join(destPath, file);
118
+ await mkdir(dirname(filePath), { recursive: true });
119
+ await writeFile(filePath, content, "utf-8");
122
120
  }
123
121
  }
124
122
  async function fetchFileTree(nodes, baseUrl, destPath) {
125
- const { writeFile: writeFile2, mkdir: mkdir2 } = await import("fs/promises");
126
- const { join: join5 } = await import("path");
127
123
  for (const node of nodes) {
128
- const nodePath = join5(destPath, node.name);
124
+ const nodePath = join(destPath, node.name);
129
125
  if (node.type === "directory") {
130
- await mkdir2(nodePath, { recursive: true });
126
+ await mkdir(nodePath, { recursive: true });
131
127
  if (node.children) {
132
128
  await fetchFileTree(node.children, `${baseUrl}/${node.name}`, nodePath);
133
129
  }
134
130
  } else {
135
131
  const content = await fetchRemote(`${baseUrl}/${node.name}`);
136
- await writeFile2(nodePath, content, "utf-8");
132
+ await writeFile(nodePath, content, "utf-8");
137
133
  }
138
134
  }
139
135
  }
@@ -299,14 +295,16 @@ function getToolPath(tool, scope, cwd = process.cwd()) {
299
295
  // src/utils/fs.ts
300
296
  import {
301
297
  access,
302
- mkdir,
298
+ mkdir as mkdir2,
303
299
  symlink,
304
300
  copyFile,
305
301
  readFile as readFile2,
306
- writeFile,
302
+ writeFile as writeFile2,
307
303
  unlink,
308
304
  readlink,
309
- lstat
305
+ lstat,
306
+ cp,
307
+ rm
310
308
  } from "fs/promises";
311
309
  import { dirname as dirname2, join as join3, relative, isAbsolute } from "path";
312
310
  async function exists(path) {
@@ -318,7 +316,7 @@ async function exists(path) {
318
316
  }
319
317
  }
320
318
  async function ensureDir(path) {
321
- await mkdir(path, { recursive: true });
319
+ await mkdir2(path, { recursive: true });
322
320
  }
323
321
  async function installFile(source, destination, method) {
324
322
  await ensureDir(dirname2(destination));
@@ -342,19 +340,17 @@ async function removeFile(path) {
342
340
  }
343
341
  async function writeTextFile(path, content) {
344
342
  await ensureDir(dirname2(path));
345
- await writeFile(path, content, "utf-8");
343
+ await writeFile2(path, content, "utf-8");
346
344
  }
347
345
  function getAgentsPath(contentType, slug, cwd) {
348
346
  return join3(cwd, ".agents", contentType + "s", slug);
349
347
  }
350
348
  async function copyDirectory(source, destination) {
351
- const { cp } = await import("fs/promises");
352
349
  await cp(source, destination, { recursive: true });
353
350
  }
354
351
  async function installDirectory(source, destination, method) {
355
352
  await ensureDir(dirname2(destination));
356
353
  if (await exists(destination)) {
357
- const { rm } = await import("fs/promises");
358
354
  await rm(destination, { recursive: true });
359
355
  }
360
356
  if (method === "symlink") {
@@ -422,14 +418,13 @@ function parseToolsArg(agents, allTools) {
422
418
 
423
419
  // src/handlers/skill.ts
424
420
  import { join as join4, relative as relative2, dirname as dirname3 } from "path";
425
- import { readdir as readdir2, symlink as symlink2 } from "fs/promises";
421
+ import { readdir as readdir2, symlink as symlink2, rm as rm2 } from "fs/promises";
426
422
  import chalk from "chalk";
427
423
  import ora from "ora";
428
424
  async function installToCentralLocation(item, sourcePath, cwd) {
429
425
  const centralPath = getAgentsPath("skill", item.slug, cwd);
430
426
  if (await exists(centralPath)) {
431
- const { rm } = await import("fs/promises");
432
- await rm(centralPath, { recursive: true });
427
+ await rm2(centralPath, { recursive: true });
433
428
  }
434
429
  if (sourcePath && await exists(sourcePath)) {
435
430
  await copyDirectory(sourcePath, centralPath);
@@ -441,8 +436,7 @@ async function installToCentralLocation(item, sourcePath, cwd) {
441
436
  async function createToolSymlink(centralPath, destPath) {
442
437
  await ensureDir(dirname3(destPath));
443
438
  if (await exists(destPath)) {
444
- const { rm } = await import("fs/promises");
445
- await rm(destPath, { recursive: true });
439
+ await rm2(destPath, { recursive: true });
446
440
  }
447
441
  const relPath = relative2(dirname3(destPath), centralPath);
448
442
  await symlink2(relPath, destPath);
@@ -509,8 +503,8 @@ async function uninstallSkill(slug, tool, scope, cwd = process.cwd()) {
509
503
  if (!await exists(destPath)) {
510
504
  return false;
511
505
  }
512
- const { rm } = await import("fs/promises");
513
- await rm(destPath, { recursive: true });
506
+ const { rm: rm3 } = await import("fs/promises");
507
+ await rm3(destPath, { recursive: true });
514
508
  return true;
515
509
  }
516
510
  async function getInstalledSkills(tool, scope, cwd = process.cwd()) {
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  searchItems,
23
23
  skillHandler,
24
24
  writeTextFile
25
- } from "./chunk-U2KZAN6F.js";
25
+ } from "./chunk-JFTWHQQ7.js";
26
26
 
27
27
  // src/cli.ts
28
28
  import { Command as Command5 } from "commander";
@@ -164,7 +164,7 @@ function trackInstalls(slug, type, results, scope) {
164
164
  type,
165
165
  tool: result.tool,
166
166
  scope,
167
- version: "0.1.63"
167
+ version: "0.1.64"
168
168
  }),
169
169
  signal: AbortSignal.timeout(4e3)
170
170
  }).catch(() => {
@@ -269,6 +269,7 @@ var agentHandler = {
269
269
 
270
270
  // src/handlers/hook.ts
271
271
  import { join as join2, basename } from "path";
272
+ import { homedir } from "os";
272
273
  import { mkdir, copyFile, chmod, rm } from "fs/promises";
273
274
  import chalk4 from "chalk";
274
275
  import ora2 from "ora";
@@ -308,7 +309,7 @@ function deepMerge(target, source) {
308
309
  function getHooksDir(scope, cwd) {
309
310
  switch (scope) {
310
311
  case "user":
311
- return join2(process.env.HOME || "~", ".claude", "hooks");
312
+ return join2(homedir(), ".claude", "hooks");
312
313
  case "project":
313
314
  case "local":
314
315
  return join2(cwd, ".claude", "hooks");
@@ -360,8 +361,7 @@ async function installHookForTool(item, tool, scope, _method, cwd) {
360
361
  const tempDir = join2(cwd, ".claude", ".tmp", item.slug);
361
362
  await fetchItemToDestination(item, tempDir);
362
363
  await copyFile(join2(tempDir, scriptFile), destScriptPath);
363
- const { rm: rm2 } = await import("fs/promises");
364
- await rm2(tempDir, { recursive: true, force: true });
364
+ await rm(tempDir, { recursive: true, force: true });
365
365
  }
366
366
  await chmod(destScriptPath, 493);
367
367
  const settingsPath = getSettingsPath(scope, cwd);
@@ -676,11 +676,11 @@ var settingsHandler = {
676
676
  };
677
677
 
678
678
  // src/handlers/plugin.ts
679
- import { homedir } from "os";
679
+ import { homedir as homedir2 } from "os";
680
680
  import { join as join3 } from "path";
681
681
  import chalk7 from "chalk";
682
682
  import ora5 from "ora";
683
- var home = homedir();
683
+ var home = homedir2();
684
684
  var PLUGINS_CACHE_DIR = join3(home, ".claude/plugins/cache");
685
685
  var INSTALLED_PLUGINS_PATH = join3(home, ".claude/plugins/installed_plugins.json");
686
686
  var KNOWN_MARKETPLACES_PATH = join3(home, ".claude/plugins/known_marketplaces.json");
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  loadManifest,
16
16
  searchItems,
17
17
  uninstallSkill
18
- } from "./chunk-U2KZAN6F.js";
18
+ } from "./chunk-JFTWHQQ7.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.63",
3
+ "version": "0.1.64",
4
4
  "description": "Seed your projects with AI configurations",
5
5
  "type": "module",
6
6
  "bin": {