@rely-ai/caliber 1.1.2 → 1.1.4
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 +35 -11
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -3534,7 +3534,7 @@ function checkBonus(dir) {
|
|
|
3534
3534
|
earnedPoints: hasHooks ? POINTS_HOOKS : 0,
|
|
3535
3535
|
passed: hasHooks,
|
|
3536
3536
|
detail: hookDetail,
|
|
3537
|
-
suggestion: hasHooks ? void 0 : "Run `caliber hooks install`
|
|
3537
|
+
suggestion: hasHooks ? void 0 : "Run `caliber hooks --install` for auto-refresh"
|
|
3538
3538
|
});
|
|
3539
3539
|
const agentsMdExists = existsSync7(join6(dir, "AGENTS.md"));
|
|
3540
3540
|
checks.push({
|
|
@@ -4356,11 +4356,27 @@ async function initCommand(options) {
|
|
|
4356
4356
|
const baselineScore = computeLocalScore(process.cwd(), targetAgent);
|
|
4357
4357
|
displayScoreSummary(baselineScore);
|
|
4358
4358
|
const hasExistingConfig = !!(fingerprint.existingConfigs.claudeMd || fingerprint.existingConfigs.claudeSettings || fingerprint.existingConfigs.claudeSkills?.length || fingerprint.existingConfigs.cursorrules || fingerprint.existingConfigs.cursorRules?.length);
|
|
4359
|
+
const NON_LLM_CHECKS = /* @__PURE__ */ new Set(["hooks_configured", "agents_md_exists", "permissions_configured", "mcp_servers"]);
|
|
4359
4360
|
if (hasExistingConfig && baselineScore.score === 100) {
|
|
4360
4361
|
console.log(chalk5.bold.green(" Your setup is already optimal \u2014 nothing to change.\n"));
|
|
4361
4362
|
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber onboard --force") + chalk5.dim(" to regenerate anyway.\n"));
|
|
4362
4363
|
if (!options.force) return;
|
|
4363
4364
|
}
|
|
4365
|
+
const allFailingChecks = baselineScore.checks.filter((c) => !c.passed && c.maxPoints > 0);
|
|
4366
|
+
const llmFixableChecks = allFailingChecks.filter((c) => !NON_LLM_CHECKS.has(c.id));
|
|
4367
|
+
if (hasExistingConfig && llmFixableChecks.length === 0 && allFailingChecks.length > 0 && !options.force) {
|
|
4368
|
+
console.log(chalk5.bold.green("\n Your config is fully optimized for LLM generation.\n"));
|
|
4369
|
+
console.log(chalk5.dim(" Remaining items need CLI actions:\n"));
|
|
4370
|
+
for (const check of allFailingChecks) {
|
|
4371
|
+
console.log(chalk5.dim(` \u2022 ${check.name}`));
|
|
4372
|
+
if (check.suggestion) {
|
|
4373
|
+
console.log(` ${chalk5.hex("#83D1EB")(check.suggestion)}`);
|
|
4374
|
+
}
|
|
4375
|
+
}
|
|
4376
|
+
console.log("");
|
|
4377
|
+
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber onboard --force") + chalk5.dim(" to regenerate anyway.\n"));
|
|
4378
|
+
return;
|
|
4379
|
+
}
|
|
4364
4380
|
const isEmpty = fingerprint.fileTree.length < 3;
|
|
4365
4381
|
if (isEmpty) {
|
|
4366
4382
|
fingerprint.description = await promptInput3("What will you build in this project?");
|
|
@@ -4369,7 +4385,7 @@ async function initCommand(options) {
|
|
|
4369
4385
|
let passingChecks;
|
|
4370
4386
|
let currentScore;
|
|
4371
4387
|
if (hasExistingConfig && baselineScore.score >= 95 && !options.force) {
|
|
4372
|
-
failingChecks =
|
|
4388
|
+
failingChecks = llmFixableChecks.map((c) => ({ name: c.name, suggestion: c.suggestion }));
|
|
4373
4389
|
passingChecks = baselineScore.checks.filter((c) => c.passed).map((c) => ({ name: c.name }));
|
|
4374
4390
|
currentScore = baselineScore.score;
|
|
4375
4391
|
if (failingChecks.length > 0) {
|
|
@@ -4450,14 +4466,22 @@ async function initCommand(options) {
|
|
|
4450
4466
|
console.log(title.bold(" Step 4/5 \u2014 Review and apply\n"));
|
|
4451
4467
|
const setupFiles = collectSetupFiles(generatedSetup);
|
|
4452
4468
|
const staged = stageFiles(setupFiles, process.cwd());
|
|
4453
|
-
|
|
4469
|
+
const totalChanges = staged.newFiles + staged.modifiedFiles;
|
|
4470
|
+
console.log(chalk5.dim(` ${chalk5.green(`${staged.newFiles} new`)} / ${chalk5.yellow(`${staged.modifiedFiles} modified`)} file${totalChanges !== 1 ? "s" : ""}
|
|
4454
4471
|
`));
|
|
4455
|
-
|
|
4456
|
-
if (
|
|
4457
|
-
|
|
4458
|
-
|
|
4472
|
+
let action;
|
|
4473
|
+
if (totalChanges === 0) {
|
|
4474
|
+
console.log(chalk5.dim(" No changes needed \u2014 your configs are already up to date.\n"));
|
|
4475
|
+
cleanupStaging();
|
|
4476
|
+
action = "accept";
|
|
4477
|
+
} else {
|
|
4478
|
+
const wantsReview = await promptWantsReview();
|
|
4479
|
+
if (wantsReview) {
|
|
4480
|
+
const reviewMethod = await promptReviewMethod();
|
|
4481
|
+
await openReview(reviewMethod, staged.stagedFiles);
|
|
4482
|
+
}
|
|
4483
|
+
action = await promptReviewAction();
|
|
4459
4484
|
}
|
|
4460
|
-
let action = await promptReviewAction();
|
|
4461
4485
|
while (action === "refine") {
|
|
4462
4486
|
generatedSetup = await refineLoop(generatedSetup, targetAgent, sessionHistory);
|
|
4463
4487
|
if (!generatedSetup) {
|
|
@@ -4540,7 +4564,7 @@ async function initCommand(options) {
|
|
|
4540
4564
|
const hookResult = installHook();
|
|
4541
4565
|
if (hookResult.installed) {
|
|
4542
4566
|
console.log(` ${chalk5.green("\u2713")} Claude Code hook installed \u2014 docs update on session end`);
|
|
4543
|
-
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber hooks remove") + chalk5.dim(" to disable"));
|
|
4567
|
+
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber hooks --remove") + chalk5.dim(" to disable"));
|
|
4544
4568
|
} else if (hookResult.alreadyInstalled) {
|
|
4545
4569
|
console.log(chalk5.dim(" Claude Code hook already installed"));
|
|
4546
4570
|
}
|
|
@@ -4556,7 +4580,7 @@ async function initCommand(options) {
|
|
|
4556
4580
|
const precommitResult = installPreCommitHook();
|
|
4557
4581
|
if (precommitResult.installed) {
|
|
4558
4582
|
console.log(` ${chalk5.green("\u2713")} Pre-commit hook installed \u2014 docs refresh before each commit`);
|
|
4559
|
-
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber hooks remove
|
|
4583
|
+
console.log(chalk5.dim(" Run ") + chalk5.hex("#83D1EB")("caliber hooks --remove") + chalk5.dim(" to disable"));
|
|
4560
4584
|
} else if (precommitResult.alreadyInstalled) {
|
|
4561
4585
|
console.log(chalk5.dim(" Pre-commit hook already installed"));
|
|
4562
4586
|
} else {
|
|
@@ -4564,7 +4588,7 @@ async function initCommand(options) {
|
|
|
4564
4588
|
}
|
|
4565
4589
|
}
|
|
4566
4590
|
if (hookChoice === "skip") {
|
|
4567
|
-
console.log(chalk5.dim(" Skipped auto-refresh hooks. Run ") + chalk5.hex("#83D1EB")("caliber hooks install") + chalk5.dim(" later to enable."));
|
|
4591
|
+
console.log(chalk5.dim(" Skipped auto-refresh hooks. Run ") + chalk5.hex("#83D1EB")("caliber hooks --install") + chalk5.dim(" later to enable."));
|
|
4568
4592
|
}
|
|
4569
4593
|
const afterScore = computeLocalScore(process.cwd(), targetAgent);
|
|
4570
4594
|
if (afterScore.score < baselineScore.score) {
|
package/package.json
CHANGED