@cantemizyurek/skillz 0.1.5 → 0.1.7

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/index.cjs CHANGED
@@ -11822,13 +11822,7 @@ program.command("list").description("List skills by download count (descending)"
11822
11822
  }
11823
11823
  return;
11824
11824
  }
11825
- for (const skill of result.skills) {
11826
- const latest = skill.latestVersion ?? "none";
11827
- console.log(
11828
- `${skill.namespace}/${skill.name} downloads=${skill.downloadCount} latest=${latest}`
11829
- );
11830
- console.log(` ${skill.description}`);
11831
- }
11825
+ printSkillSummaryTable(result.skills);
11832
11826
  });
11833
11827
  program.command("search").description("Search skills").argument("<query>", "search query").action(async (query, _options, command) => {
11834
11828
  const { client } = await makeClient(command, true);
@@ -11837,13 +11831,7 @@ program.command("search").description("Search skills").argument("<query>", "sear
11837
11831
  console.log("No skills found.");
11838
11832
  return;
11839
11833
  }
11840
- for (const skill of result.skills) {
11841
- const latest = skill.latestVersion ?? "none";
11842
- console.log(
11843
- `${skill.namespace}/${skill.name} latest=${latest} downloads=${skill.downloadCount}`
11844
- );
11845
- console.log(` ${skill.description}`);
11846
- }
11834
+ printSkillSummaryTable(result.skills);
11847
11835
  });
11848
11836
  program.command("info").description("Show skill metadata and versions").argument("<namespace/skill>", "skill reference").action(async (skillRefInput, _options, command) => {
11849
11837
  namespaceNameSchema.parse(skillRefInput);
@@ -12107,6 +12095,63 @@ function parseAgentTargetsOption(input) {
12107
12095
  }
12108
12096
  return Array.from(new Set(values));
12109
12097
  }
12098
+ function printSkillSummaryTable(skills) {
12099
+ const terminalWidth = import_node_process2.default.stdout.columns ?? 120;
12100
+ const skillRefs = skills.map((skill) => `${skill.namespace}/${skill.name}`);
12101
+ const latestValues = skills.map((skill) => skill.latestVersion ?? "none");
12102
+ const downloadValues = skills.map(
12103
+ (skill) => skill.downloadCount.toLocaleString("en-US")
12104
+ );
12105
+ const skillWidth = clamp(
12106
+ Math.max("skill".length, ...skillRefs.map((value) => value.length)),
12107
+ 20,
12108
+ 40
12109
+ );
12110
+ const latestWidth = clamp(
12111
+ Math.max("latest".length, ...latestValues.map((value) => value.length)),
12112
+ 6,
12113
+ 14
12114
+ );
12115
+ const downloadsWidth = clamp(
12116
+ Math.max("downloads".length, ...downloadValues.map((value) => value.length)),
12117
+ "downloads".length,
12118
+ 12
12119
+ );
12120
+ const separatorWidth = 6;
12121
+ const descriptionWidth = clamp(
12122
+ terminalWidth - (skillWidth + latestWidth + downloadsWidth + separatorWidth),
12123
+ 24,
12124
+ 72
12125
+ );
12126
+ console.log(
12127
+ `${"skill".padEnd(skillWidth)} ${"latest".padEnd(latestWidth)} ${"downloads".padStart(downloadsWidth)} description`
12128
+ );
12129
+ console.log(
12130
+ `${"-".repeat(skillWidth)} ${"-".repeat(latestWidth)} ${"-".repeat(downloadsWidth)} ${"-".repeat(descriptionWidth)}`
12131
+ );
12132
+ for (const skill of skills) {
12133
+ const skillRef = `${skill.namespace}/${skill.name}`;
12134
+ const latest = skill.latestVersion ?? "none";
12135
+ const downloads = skill.downloadCount.toLocaleString("en-US");
12136
+ const description = truncateText(skill.description, descriptionWidth);
12137
+ console.log(
12138
+ `${truncateText(skillRef, skillWidth).padEnd(skillWidth)} ${truncateText(latest, latestWidth).padEnd(latestWidth)} ${truncateText(downloads, downloadsWidth).padStart(downloadsWidth)} ${description}`
12139
+ );
12140
+ }
12141
+ }
12142
+ function truncateText(value, maxLength) {
12143
+ const normalized = value.replace(/\s+/g, " ").trim();
12144
+ if (normalized.length <= maxLength) {
12145
+ return normalized;
12146
+ }
12147
+ if (maxLength <= 3) {
12148
+ return normalized.slice(0, maxLength);
12149
+ }
12150
+ return `${normalized.slice(0, maxLength - 3)}...`;
12151
+ }
12152
+ function clamp(value, min, max) {
12153
+ return Math.min(Math.max(value, min), max);
12154
+ }
12110
12155
  function groupManifestEntriesBySource(entries) {
12111
12156
  const grouped = /* @__PURE__ */ new Map();
12112
12157
  for (const entry of entries) {