@caliber-ai/cli 0.16.1 → 0.16.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 CHANGED
@@ -2392,11 +2392,15 @@ No ${options.status} recommendations.
2392
2392
  async function generateRecommendations(projectId) {
2393
2393
  const spinner = ora5("Detecting technologies and searching for skills...").start();
2394
2394
  try {
2395
- const recs = await apiRequest(
2395
+ const generated = await apiRequest(
2396
2396
  `/api/recommendations/project/${projectId}/generate`,
2397
2397
  { method: "POST" }
2398
2398
  );
2399
- spinner.succeed(`Found ${recs?.length || 0} recommendations`);
2399
+ spinner.succeed(`Found ${generated?.length || 0} recommendations`);
2400
+ if (!generated?.length) return generated;
2401
+ const recs = await apiRequest(
2402
+ `/api/recommendations/project/${projectId}?status=pending`
2403
+ );
2400
2404
  return recs;
2401
2405
  } catch (err) {
2402
2406
  spinner.fail("Failed to generate recommendations");
@@ -2498,6 +2502,10 @@ async function installSkills(recs, platforms) {
2498
2502
  const installed = [];
2499
2503
  const warnings = [];
2500
2504
  for (const rec of recs) {
2505
+ if (!rec.id) {
2506
+ warnings.push(`Missing ID for ${rec.skill_name}, skipping`);
2507
+ continue;
2508
+ }
2501
2509
  let accepted = false;
2502
2510
  for (const platform of platforms) {
2503
2511
  try {