@toolr/seedr 0.1.71 → 0.1.73

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.
@@ -145,11 +145,11 @@ async function fetchFileTree(nodes, baseUrl, destPath) {
145
145
  }));
146
146
  }
147
147
 
148
- // src/config/tools.ts
148
+ // src/config/agents.ts
149
149
  import { homedir } from "os";
150
150
  import { join as join2 } from "path";
151
151
  var home = homedir();
152
- var AI_TOOLS = {
152
+ var CODING_AGENTS = {
153
153
  claude: {
154
154
  name: "Claude Code",
155
155
  shortName: "claude",
@@ -257,15 +257,15 @@ var AI_TOOLS = {
257
257
  }
258
258
  }
259
259
  };
260
- var ALL_TOOLS = Object.keys(AI_TOOLS);
261
- function getToolConfig(tool) {
262
- return AI_TOOLS[tool];
260
+ var ALL_AGENTS = Object.keys(CODING_AGENTS);
261
+ function getAgentConfig(agent) {
262
+ return CODING_AGENTS[agent];
263
263
  }
264
- function getContentTypeConfig(tool, type) {
265
- return AI_TOOLS[tool].contentTypes[type];
264
+ function getContentTypeConfig(agent, type) {
265
+ return CODING_AGENTS[agent].contentTypes[type];
266
266
  }
267
- function getToolRoot(tool, scope, cwd = process.cwd()) {
268
- const config = AI_TOOLS[tool];
267
+ function getAgentRoot(agent, scope, cwd = process.cwd()) {
268
+ const config = CODING_AGENTS[agent];
269
269
  switch (scope) {
270
270
  case "project":
271
271
  case "local":
@@ -274,10 +274,10 @@ function getToolRoot(tool, scope, cwd = process.cwd()) {
274
274
  return config.userRoot;
275
275
  }
276
276
  }
277
- function getContentPath(tool, type, scope, cwd = process.cwd()) {
278
- const typeConfig = getContentTypeConfig(tool, type);
277
+ function getContentPath(agent, type, scope, cwd = process.cwd()) {
278
+ const typeConfig = getContentTypeConfig(agent, type);
279
279
  if (!typeConfig) return void 0;
280
- const root = getToolRoot(tool, scope, cwd);
280
+ const root = getAgentRoot(agent, scope, cwd);
281
281
  return typeConfig.path ? join2(root, typeConfig.path) : root;
282
282
  }
283
283
  function getSettingsPath(scope, cwd = process.cwd()) {
@@ -299,8 +299,8 @@ function getMcpPath(scope, cwd = process.cwd()) {
299
299
  return join2(home, ".claude.json");
300
300
  }
301
301
  }
302
- function getToolPath(tool, scope, cwd = process.cwd()) {
303
- return getContentPath(tool, "skill", scope, cwd) || "";
302
+ function getAgentPath(agent, scope, cwd = process.cwd()) {
303
+ return getContentPath(agent, "skill", scope, cwd) || "";
304
304
  }
305
305
 
306
306
  // src/utils/fs.ts
@@ -373,34 +373,34 @@ async function installDirectory(source, destination, method) {
373
373
  }
374
374
 
375
375
  // src/utils/detection.ts
376
- async function detectInstalledTools(cwd = process.cwd()) {
377
- const checks = ALL_TOOLS.flatMap((tool) => {
378
- const projectPath = getToolPath(tool, "project", cwd);
379
- const userPath = getToolPath(tool, "user", cwd);
376
+ async function detectInstalledAgents(cwd = process.cwd()) {
377
+ const checks = ALL_AGENTS.flatMap((agent) => {
378
+ const projectPath = getAgentPath(agent, "project", cwd);
379
+ const userPath = getAgentPath(agent, "user", cwd);
380
380
  return [
381
- exists(projectPath).then((found) => found ? { tool, scope: "project", path: projectPath } : null),
382
- exists(userPath).then((found) => found ? { tool, scope: "user", path: userPath } : null)
381
+ exists(projectPath).then((found) => found ? { agent, scope: "project", path: projectPath } : null),
382
+ exists(userPath).then((found) => found ? { agent, scope: "user", path: userPath } : null)
383
383
  ];
384
384
  });
385
385
  const results = await Promise.all(checks);
386
386
  return results.filter((r) => r !== null);
387
387
  }
388
- async function detectProjectTools(cwd = process.cwd()) {
389
- const checks = ALL_TOOLS.map(async (tool) => {
390
- const projectPath = getToolPath(tool, "project", cwd);
391
- return await exists(projectPath) ? tool : null;
388
+ async function detectProjectAgents(cwd = process.cwd()) {
389
+ const checks = ALL_AGENTS.map(async (agent) => {
390
+ const projectPath = getAgentPath(agent, "project", cwd);
391
+ return await exists(projectPath) ? agent : null;
392
392
  });
393
393
  const results = await Promise.all(checks);
394
- return results.filter((t) => t !== null);
394
+ return results.filter((a) => a !== null);
395
395
  }
396
- async function isToolInstalled(tool, scope, cwd = process.cwd()) {
396
+ async function isAgentInstalled(agent, scope, cwd = process.cwd()) {
397
397
  const effectiveScope = scope === "local" ? "project" : scope;
398
- const path = getToolPath(tool, effectiveScope, cwd);
398
+ const path = getAgentPath(agent, effectiveScope, cwd);
399
399
  return exists(path);
400
400
  }
401
- function parseToolArg(arg) {
401
+ function parseAgentArg(arg) {
402
402
  const normalized = arg.toLowerCase().trim();
403
- if (ALL_TOOLS.includes(normalized)) {
403
+ if (ALL_AGENTS.includes(normalized)) {
404
404
  return normalized;
405
405
  }
406
406
  const aliases = {
@@ -416,17 +416,120 @@ function parseToolArg(arg) {
416
416
  };
417
417
  return aliases[normalized] ?? null;
418
418
  }
419
- function parseToolsArg(agents, allTools) {
419
+ function parseAgentsArg(agents, allAgents) {
420
420
  if (agents === "all") {
421
- return allTools;
421
+ return allAgents;
422
422
  }
423
- return agents.split(",").map((t) => parseToolArg(t.trim())).filter((t) => t !== null);
423
+ return agents.split(",").map((a) => parseAgentArg(a.trim())).filter((a) => a !== null);
424
+ }
425
+
426
+ // src/utils/ui.ts
427
+ import * as p from "@clack/prompts";
428
+ import chalk from "chalk";
429
+ var brand = chalk.hex("#22c55e");
430
+ var bgBrand = chalk.bgHex("#22c55e").black;
431
+ var LOGO = `
432
+ \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557
433
+ \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
434
+ \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D
435
+ \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
436
+ \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551
437
+ \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D`;
438
+ var URLS = {
439
+ toolr: "https://toolr.dev",
440
+ seedr: "https://seedr.toolr.dev"
441
+ };
442
+ function printLogo() {
443
+ console.log(brand(LOGO));
444
+ console.log(brand(" Seed your projects with capabilities"));
445
+ console.log(chalk.gray(` ${URLS.seedr}`));
446
+ console.log();
447
+ }
448
+ async function selectSkill(items) {
449
+ const result = await p.select({
450
+ message: "Select a skill to install",
451
+ options: items.map((item) => ({
452
+ label: item.name,
453
+ value: item,
454
+ hint: item.description
455
+ }))
456
+ });
457
+ return result;
458
+ }
459
+ async function selectAgents(compatible) {
460
+ const allOption = await p.select({
461
+ message: "Which coding agents do you want to install for?",
462
+ options: [
463
+ { label: `All (${compatible.length} agents)`, value: "all" },
464
+ { label: "Select specific agents...", value: "select" }
465
+ ]
466
+ });
467
+ if (p.isCancel(allOption)) return allOption;
468
+ if (allOption === "all") return compatible;
469
+ const result = await p.multiselect({
470
+ message: "Select agents",
471
+ options: compatible.map((agent) => ({
472
+ label: CODING_AGENTS[agent].name,
473
+ value: agent,
474
+ hint: CODING_AGENTS[agent].projectRoot
475
+ })),
476
+ initialValues: ["claude"],
477
+ required: true
478
+ });
479
+ return result;
480
+ }
481
+ async function selectScope(includeLocal = false) {
482
+ const options = [
483
+ { label: "Project", value: "project", hint: includeLocal ? "current directory, settings.json" : "current directory" },
484
+ { label: "User", value: "user", hint: "home directory" },
485
+ ...includeLocal ? [{ label: "Local", value: "local", hint: "current directory, settings.local.json" }] : []
486
+ ];
487
+ const result = await p.select({ message: "Installation scope", options });
488
+ return result;
489
+ }
490
+ async function selectMethod(symlinkPath) {
491
+ const result = await p.select({
492
+ message: "Installation method",
493
+ options: [
494
+ { label: "Symlink", value: "symlink", hint: `shared at ${symlinkPath}` },
495
+ { label: "Copy", value: "copy", hint: "standalone copy per agent" }
496
+ ]
497
+ });
498
+ return result;
499
+ }
500
+ async function confirm2(message) {
501
+ return p.confirm({ message });
502
+ }
503
+ function cancelled() {
504
+ p.cancel("Operation cancelled");
505
+ process.exit(0);
506
+ }
507
+ function intro2(message) {
508
+ p.intro(bgBrand(` ${message} `));
509
+ }
510
+ function outro2(message) {
511
+ p.outro(brand(message));
512
+ }
513
+ function step(message) {
514
+ p.log.step(message);
515
+ }
516
+ function info(message) {
517
+ p.log.info(message);
518
+ }
519
+ function success(message) {
520
+ p.log.success(message);
521
+ }
522
+ function warn(message) {
523
+ p.log.warn(message);
524
+ }
525
+ function error(message) {
526
+ p.log.error(message);
424
527
  }
425
528
 
426
529
  // src/handlers/skill.ts
427
530
  import { join as join4, relative as relative2, dirname as dirname3 } from "path";
428
531
  import { readdir as readdir2, symlink as symlink2, rm as rm2 } from "fs/promises";
429
- import chalk from "chalk";
532
+ import chalk2 from "chalk";
430
533
  import ora from "ora";
431
534
  async function installToCentralLocation(item, sourcePath, cwd) {
432
535
  const centralPath = getAgentsPath("skill", item.slug, cwd);
@@ -438,58 +541,58 @@ async function installToCentralLocation(item, sourcePath, cwd) {
438
541
  }
439
542
  return centralPath;
440
543
  }
441
- async function createToolSymlink(centralPath, destPath) {
544
+ async function createAgentSymlink(centralPath, destPath) {
442
545
  await ensureDir(dirname3(destPath));
443
546
  await rm2(destPath, { recursive: true, force: true });
444
547
  const relPath = relative2(dirname3(destPath), centralPath);
445
548
  await symlink2(relPath, destPath);
446
549
  }
447
- async function installSkillForTool(item, tool, scope, method, cwd, centralPath) {
550
+ async function installSkillForAgent(item, agent, scope, method, cwd, centralPath) {
448
551
  const spinner = ora(
449
- `Installing ${item.name} for ${AI_TOOLS[tool].name}...`
552
+ `Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
450
553
  ).start();
451
554
  try {
452
- const destDir = getContentPath(tool, "skill", scope, cwd);
555
+ const destDir = getContentPath(agent, "skill", scope, cwd);
453
556
  if (!destDir) {
454
- throw new Error(`${AI_TOOLS[tool].name} does not support skills`);
557
+ throw new Error(`${CODING_AGENTS[agent].name} does not support skills`);
455
558
  }
456
559
  const destPath = join4(destDir, item.slug);
457
560
  const sourcePath = getItemSourcePath(item);
458
561
  if (method === "symlink" && centralPath) {
459
- await createToolSymlink(centralPath, destPath);
562
+ await createAgentSymlink(centralPath, destPath);
460
563
  } else if (sourcePath && await exists(sourcePath)) {
461
564
  await installDirectory(sourcePath, destPath, "copy");
462
565
  } else {
463
566
  await fetchItemToDestination(item, destPath);
464
567
  }
465
568
  spinner.succeed(
466
- chalk.green(`Installed ${item.name} for ${AI_TOOLS[tool].name}`)
569
+ brand(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
467
570
  );
468
- return { tool, success: true, path: destPath };
469
- } catch (error) {
470
- const errorMsg = error instanceof Error ? error.message : "Unknown error";
571
+ return { agent, success: true, path: destPath };
572
+ } catch (error2) {
573
+ const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
471
574
  spinner.fail(
472
- chalk.red(`Failed to install for ${AI_TOOLS[tool].name}: ${errorMsg}`)
575
+ chalk2.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
473
576
  );
474
- return { tool, success: false, path: "", error: errorMsg };
577
+ return { agent, success: false, path: "", error: errorMsg };
475
578
  }
476
579
  }
477
- async function installSkill(item, tools, scope, method, cwd = process.cwd()) {
580
+ async function installSkill(item, agents, scope, method, cwd = process.cwd()) {
478
581
  const results = [];
479
582
  const sourcePath = getItemSourcePath(item);
480
583
  let centralPath;
481
584
  if (method === "symlink") {
482
585
  centralPath = await installToCentralLocation(item, sourcePath, cwd);
483
586
  }
484
- for (const tool of tools) {
485
- const readsAgentsDir = tool === "gemini" || tool === "codex" || tool === "opencode";
587
+ for (const agent of agents) {
588
+ const readsAgentsDir = agent === "gemini" || agent === "codex" || agent === "opencode";
486
589
  if (readsAgentsDir && method === "symlink" && centralPath) {
487
- results.push({ tool, success: true, path: centralPath });
590
+ results.push({ agent, success: true, path: centralPath });
488
591
  continue;
489
592
  }
490
- const result = await installSkillForTool(
593
+ const result = await installSkillForAgent(
491
594
  item,
492
- tool,
595
+ agent,
493
596
  scope,
494
597
  method,
495
598
  cwd,
@@ -499,8 +602,8 @@ async function installSkill(item, tools, scope, method, cwd = process.cwd()) {
499
602
  }
500
603
  return results;
501
604
  }
502
- async function uninstallSkill(slug, tool, scope, cwd = process.cwd()) {
503
- const destDir = getContentPath(tool, "skill", scope, cwd);
605
+ async function uninstallSkill(slug, agent, scope, cwd = process.cwd()) {
606
+ const destDir = getContentPath(agent, "skill", scope, cwd);
504
607
  if (!destDir) return false;
505
608
  const destPath = join4(destDir, slug);
506
609
  if (!await exists(destPath)) {
@@ -509,8 +612,8 @@ async function uninstallSkill(slug, tool, scope, cwd = process.cwd()) {
509
612
  await rm2(destPath, { recursive: true });
510
613
  return true;
511
614
  }
512
- async function getInstalledSkills(tool, scope, cwd = process.cwd()) {
513
- const destDir = getContentPath(tool, "skill", scope, cwd);
615
+ async function getInstalledSkills(agent, scope, cwd = process.cwd()) {
616
+ const destDir = getContentPath(agent, "skill", scope, cwd);
514
617
  if (!destDir || !await exists(destDir)) {
515
618
  return [];
516
619
  }
@@ -519,14 +622,14 @@ async function getInstalledSkills(tool, scope, cwd = process.cwd()) {
519
622
  }
520
623
  var skillHandler = {
521
624
  type: "skill",
522
- async install(item, tools, scope, method, cwd) {
523
- return installSkill(item, tools, scope, method, cwd);
625
+ async install(item, agents, scope, method, cwd) {
626
+ return installSkill(item, agents, scope, method, cwd);
524
627
  },
525
- async uninstall(slug, tool, scope, cwd) {
526
- return uninstallSkill(slug, tool, scope, cwd);
628
+ async uninstall(slug, agent, scope, cwd) {
629
+ return uninstallSkill(slug, agent, scope, cwd);
527
630
  },
528
- async listInstalled(tool, scope, cwd) {
529
- return getInstalledSkills(tool, scope, cwd);
631
+ async listInstalled(agent, scope, cwd) {
632
+ return getInstalledSkills(agent, scope, cwd);
530
633
  }
531
634
  };
532
635
 
@@ -545,17 +648,33 @@ export {
545
648
  writeTextFile,
546
649
  getAgentsPath,
547
650
  installDirectory,
548
- AI_TOOLS,
549
- ALL_TOOLS,
550
- getToolConfig,
651
+ CODING_AGENTS,
652
+ ALL_AGENTS,
653
+ getAgentConfig,
551
654
  getContentPath,
552
655
  getSettingsPath,
553
656
  getMcpPath,
554
- getToolPath,
555
- detectInstalledTools,
556
- detectProjectTools,
557
- isToolInstalled,
558
- parseToolsArg,
657
+ getAgentPath,
658
+ detectInstalledAgents,
659
+ detectProjectAgents,
660
+ isAgentInstalled,
661
+ parseAgentsArg,
662
+ p,
663
+ brand,
664
+ printLogo,
665
+ selectSkill,
666
+ selectAgents,
667
+ selectScope,
668
+ selectMethod,
669
+ confirm2 as confirm,
670
+ cancelled,
671
+ intro2 as intro,
672
+ outro2 as outro,
673
+ step,
674
+ info,
675
+ success,
676
+ warn,
677
+ error,
559
678
  installSkill,
560
679
  uninstallSkill,
561
680
  getInstalledSkills,