@rely-ai/caliber 1.5.0 → 1.5.1

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.
Files changed (2) hide show
  1. package/dist/bin.js +14 -27
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -1469,13 +1469,13 @@ async function detectProjectStack(fileTree, fileContents) {
1469
1469
  }
1470
1470
 
1471
1471
  // src/fingerprint/index.ts
1472
- function collectFingerprint(dir) {
1472
+ async function collectFingerprint(dir) {
1473
1473
  const gitRemoteUrl = getGitRemoteUrl();
1474
1474
  const fileTree = getFileTree(dir);
1475
1475
  const existingConfigs = readExistingConfigs(dir);
1476
1476
  const codeAnalysis = analyzeCode(dir);
1477
1477
  const packageName = readPackageName(dir);
1478
- return {
1478
+ const fingerprint = {
1479
1479
  gitRemoteUrl,
1480
1480
  packageName,
1481
1481
  languages: [],
@@ -1485,6 +1485,8 @@ function collectFingerprint(dir) {
1485
1485
  existingConfigs,
1486
1486
  codeAnalysis
1487
1487
  };
1488
+ await enrichWithLLM(fingerprint, dir);
1489
+ return fingerprint;
1488
1490
  }
1489
1491
  function readPackageName(dir) {
1490
1492
  try {
@@ -1510,7 +1512,7 @@ var DEP_FILE_PATTERNS = [
1510
1512
  "composer.json"
1511
1513
  ];
1512
1514
  var MAX_CONTENT_SIZE = 50 * 1024;
1513
- async function enrichFingerprintWithLLM(fingerprint, dir) {
1515
+ async function enrichWithLLM(fingerprint, dir) {
1514
1516
  try {
1515
1517
  const config = loadConfig();
1516
1518
  if (!config) return;
@@ -1532,21 +1534,9 @@ async function enrichFingerprintWithLLM(fingerprint, dir) {
1532
1534
  }
1533
1535
  if (Object.keys(fileContents).length === 0 && fingerprint.fileTree.length === 0) return;
1534
1536
  const result = await detectProjectStack(fingerprint.fileTree, fileContents);
1535
- if (result.languages?.length) {
1536
- const langSet = new Set(fingerprint.languages);
1537
- for (const lang of result.languages) langSet.add(lang);
1538
- fingerprint.languages = [...langSet];
1539
- }
1540
- if (result.frameworks?.length) {
1541
- const fwSet = new Set(fingerprint.frameworks);
1542
- for (const fw of result.frameworks) fwSet.add(fw);
1543
- fingerprint.frameworks = [...fwSet];
1544
- }
1545
- if (result.tools?.length) {
1546
- const toolSet = new Set(fingerprint.tools);
1547
- for (const tool of result.tools) toolSet.add(tool);
1548
- fingerprint.tools = [...toolSet];
1549
- }
1537
+ if (result.languages?.length) fingerprint.languages = result.languages;
1538
+ if (result.frameworks?.length) fingerprint.frameworks = result.frameworks;
1539
+ if (result.tools?.length) fingerprint.tools = result.tools;
1550
1540
  } catch {
1551
1541
  }
1552
1542
  }
@@ -4988,9 +4978,8 @@ ${candidateList}`,
4988
4978
  reason: s.reason || candidates[s.index].reason
4989
4979
  }));
4990
4980
  }
4991
- function buildProjectContext(dir) {
4981
+ function buildProjectContext(fingerprint) {
4992
4982
  const parts = [];
4993
- const fingerprint = collectFingerprint(dir);
4994
4983
  if (fingerprint.packageName) parts.push(`Package: ${fingerprint.packageName}`);
4995
4984
  if (fingerprint.languages.length > 0) parts.push(`Languages: ${fingerprint.languages.join(", ")}`);
4996
4985
  if (fingerprint.frameworks.length > 0) parts.push(`Frameworks: ${fingerprint.frameworks.join(", ")}`);
@@ -5108,7 +5097,7 @@ async function recommendCommand() {
5108
5097
  await searchAndInstallSkills();
5109
5098
  }
5110
5099
  async function searchAndInstallSkills() {
5111
- const fingerprint = collectFingerprint(process.cwd());
5100
+ const fingerprint = await collectFingerprint(process.cwd());
5112
5101
  const platforms = detectLocalPlatforms();
5113
5102
  const installedSkills = getInstalledSkills();
5114
5103
  const technologies = [...new Set([
@@ -5141,7 +5130,7 @@ async function searchAndInstallSkills() {
5141
5130
  if (config) {
5142
5131
  const scoreSpinner = ora2("Scoring relevance for your project...").start();
5143
5132
  try {
5144
- const projectContext = buildProjectContext(process.cwd());
5133
+ const projectContext = buildProjectContext(fingerprint);
5145
5134
  results = await scoreWithLLM2(newCandidates, projectContext, technologies);
5146
5135
  if (results.length === 0) {
5147
5136
  scoreSpinner.succeed("No highly relevant skills found for your specific project.");
@@ -5404,8 +5393,7 @@ async function initCommand(options) {
5404
5393
  console.log(title.bold(" Step 2/6 \u2014 Discover your project\n"));
5405
5394
  console.log(chalk7.dim(" Learning about your languages, dependencies, structure, and existing configs.\n"));
5406
5395
  const spinner = ora3("Analyzing project...").start();
5407
- const fingerprint = collectFingerprint(process.cwd());
5408
- await enrichFingerprintWithLLM(fingerprint, process.cwd());
5396
+ const fingerprint = await collectFingerprint(process.cwd());
5409
5397
  spinner.succeed("Project analyzed");
5410
5398
  console.log(chalk7.dim(` Languages: ${fingerprint.languages.join(", ") || "none detected"}`));
5411
5399
  console.log(chalk7.dim(` Files: ${fingerprint.fileTree.length} found
@@ -6055,8 +6043,7 @@ async function regenerateCommand(options) {
6055
6043
  }
6056
6044
  const targetAgent = readState()?.targetAgent ?? ["claude", "cursor"];
6057
6045
  const spinner = ora5("Analyzing project...").start();
6058
- const fingerprint = collectFingerprint(process.cwd());
6059
- await enrichFingerprintWithLLM(fingerprint, process.cwd());
6046
+ const fingerprint = await collectFingerprint(process.cwd());
6060
6047
  spinner.succeed("Project analyzed");
6061
6048
  const baselineScore = computeLocalScore(process.cwd(), targetAgent);
6062
6049
  displayScoreSummary(baselineScore);
@@ -6422,7 +6409,7 @@ async function refreshSingleRepo(repoDir, options) {
6422
6409
  }
6423
6410
  const spinner = quiet ? null : ora6(`${prefix}Analyzing changes...`).start();
6424
6411
  const existingDocs = readExistingConfigs(repoDir);
6425
- const fingerprint = collectFingerprint(repoDir);
6412
+ const fingerprint = await collectFingerprint(repoDir);
6426
6413
  const projectContext = {
6427
6414
  languages: fingerprint.languages,
6428
6415
  frameworks: fingerprint.frameworks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) — no API key needed",
5
5
  "type": "module",
6
6
  "bin": {