@cantemizyurek/skillz 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.
- package/dist/index.cjs +12 -40
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -11822,7 +11822,7 @@ program.command("list").description("List skills by download count (descending)"
|
|
|
11822
11822
|
}
|
|
11823
11823
|
return;
|
|
11824
11824
|
}
|
|
11825
|
-
|
|
11825
|
+
printSkillSummaryList(result.skills);
|
|
11826
11826
|
});
|
|
11827
11827
|
program.command("search").description("Search skills").argument("<query>", "search query").action(async (query, _options, command) => {
|
|
11828
11828
|
const { client } = await makeClient(command, true);
|
|
@@ -11831,7 +11831,7 @@ program.command("search").description("Search skills").argument("<query>", "sear
|
|
|
11831
11831
|
console.log("No skills found.");
|
|
11832
11832
|
return;
|
|
11833
11833
|
}
|
|
11834
|
-
|
|
11834
|
+
printSkillSummaryList(result.skills);
|
|
11835
11835
|
});
|
|
11836
11836
|
program.command("info").description("Show skill metadata and versions").argument("<namespace/skill>", "skill reference").action(async (skillRefInput, _options, command) => {
|
|
11837
11837
|
namespaceNameSchema.parse(skillRefInput);
|
|
@@ -12095,49 +12095,21 @@ function parseAgentTargetsOption(input) {
|
|
|
12095
12095
|
}
|
|
12096
12096
|
return Array.from(new Set(values));
|
|
12097
12097
|
}
|
|
12098
|
-
function
|
|
12098
|
+
function printSkillSummaryList(skills) {
|
|
12099
12099
|
const terminalWidth = import_node_process2.default.stdout.columns ?? 120;
|
|
12100
|
-
const
|
|
12101
|
-
|
|
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) {
|
|
12100
|
+
const descriptionWidth = clamp(terminalWidth - 4, 36, 96);
|
|
12101
|
+
skills.forEach((skill, index) => {
|
|
12133
12102
|
const skillRef = `${skill.namespace}/${skill.name}`;
|
|
12134
12103
|
const latest = skill.latestVersion ?? "none";
|
|
12135
12104
|
const downloads = skill.downloadCount.toLocaleString("en-US");
|
|
12136
12105
|
const description = truncateText(skill.description, descriptionWidth);
|
|
12137
|
-
console.log(
|
|
12138
|
-
|
|
12139
|
-
);
|
|
12140
|
-
|
|
12106
|
+
console.log(skillRef);
|
|
12107
|
+
console.log(` ${latest} | ${downloads} downloads`);
|
|
12108
|
+
console.log(` ${description}`);
|
|
12109
|
+
if (index < skills.length - 1) {
|
|
12110
|
+
console.log("");
|
|
12111
|
+
}
|
|
12112
|
+
});
|
|
12141
12113
|
}
|
|
12142
12114
|
function truncateText(value, maxLength) {
|
|
12143
12115
|
const normalized = value.replace(/\s+/g, " ").trim();
|