@rely-ai/caliber 0.5.1 → 0.5.2
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/bin.js +20 -12
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -4935,9 +4935,24 @@ async function recommendCommand(options) {
|
|
|
4935
4935
|
} else {
|
|
4936
4936
|
results = newCandidates.slice(0, 20);
|
|
4937
4937
|
}
|
|
4938
|
-
const
|
|
4938
|
+
const fetchSpinner = ora4("Verifying skill availability...").start();
|
|
4939
|
+
const contentMap = /* @__PURE__ */ new Map();
|
|
4940
|
+
await Promise.all(results.map(async (rec) => {
|
|
4941
|
+
const content = await fetchSkillContent(rec);
|
|
4942
|
+
if (content) contentMap.set(rec.slug, content);
|
|
4943
|
+
}));
|
|
4944
|
+
const available = results.filter((r) => contentMap.has(r.slug));
|
|
4945
|
+
if (!available.length) {
|
|
4946
|
+
fetchSpinner.fail("No installable skills found \u2014 content could not be fetched.");
|
|
4947
|
+
return;
|
|
4948
|
+
}
|
|
4949
|
+
const unavailableCount = results.length - available.length;
|
|
4950
|
+
fetchSpinner.succeed(
|
|
4951
|
+
`${available.length} installable skill${available.length > 1 ? "s" : ""}` + (unavailableCount > 0 ? chalk8.dim(` (${unavailableCount} unavailable)`) : "")
|
|
4952
|
+
);
|
|
4953
|
+
const selected = await interactiveSelect(available);
|
|
4939
4954
|
if (selected?.length) {
|
|
4940
|
-
await installSkills(selected, platforms);
|
|
4955
|
+
await installSkills(selected, platforms, contentMap);
|
|
4941
4956
|
}
|
|
4942
4957
|
}
|
|
4943
4958
|
async function interactiveSelect(recs) {
|
|
@@ -5076,16 +5091,12 @@ async function fetchSkillContent(rec) {
|
|
|
5076
5091
|
}
|
|
5077
5092
|
return null;
|
|
5078
5093
|
}
|
|
5079
|
-
async function installSkills(recs, platforms) {
|
|
5094
|
+
async function installSkills(recs, platforms, contentMap) {
|
|
5080
5095
|
const spinner = ora4(`Installing ${recs.length} skill${recs.length > 1 ? "s" : ""}...`).start();
|
|
5081
5096
|
const installed = [];
|
|
5082
|
-
const warnings = [];
|
|
5083
5097
|
for (const rec of recs) {
|
|
5084
|
-
const content =
|
|
5085
|
-
if (!content)
|
|
5086
|
-
warnings.push(`No content available for ${rec.name}`);
|
|
5087
|
-
continue;
|
|
5088
|
-
}
|
|
5098
|
+
const content = contentMap.get(rec.slug);
|
|
5099
|
+
if (!content) continue;
|
|
5089
5100
|
for (const platform of platforms) {
|
|
5090
5101
|
const skillPath = getSkillPath(platform, rec.slug);
|
|
5091
5102
|
const fullPath = join8(process.cwd(), skillPath);
|
|
@@ -5102,9 +5113,6 @@ async function installSkills(recs, platforms) {
|
|
|
5102
5113
|
} else {
|
|
5103
5114
|
spinner.fail("No skills were installed");
|
|
5104
5115
|
}
|
|
5105
|
-
for (const w of warnings) {
|
|
5106
|
-
console.log(chalk8.yellow(` \u26A0 ${w}`));
|
|
5107
|
-
}
|
|
5108
5116
|
console.log("");
|
|
5109
5117
|
}
|
|
5110
5118
|
function printRecommendations(recs) {
|
package/package.json
CHANGED