@rely-ai/caliber 1.20.0-dev.1773695082 → 1.20.0-dev.1773695140

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 +47 -7
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -5816,6 +5816,9 @@ function trackSkillsInstalled(count) {
5816
5816
  function trackUndoExecuted() {
5817
5817
  trackEvent("undo_executed");
5818
5818
  }
5819
+ function trackInitLearnEnabled(enabled) {
5820
+ trackEvent("init_learn_enabled", { enabled });
5821
+ }
5819
5822
  function trackLearnSessionAnalyzed(props) {
5820
5823
  trackEvent("learn_session_analyzed", {
5821
5824
  event_count: props.eventCount,
@@ -7441,13 +7444,6 @@ ${agentRefs.join(" ")}
7441
7444
  } else if (hookResult.alreadyInstalled) {
7442
7445
  console.log(chalk11.dim(" Claude Code hook already installed"));
7443
7446
  }
7444
- const learnResult = installLearningHooks();
7445
- if (learnResult.installed) {
7446
- console.log(` ${chalk11.green("\u2713")} Learning hooks installed \u2014 session insights captured automatically`);
7447
- console.log(chalk11.dim(" Run ") + chalk11.hex("#83D1EB")("caliber learn remove") + chalk11.dim(" to disable"));
7448
- } else if (learnResult.alreadyInstalled) {
7449
- console.log(chalk11.dim(" Learning hooks already installed"));
7450
- }
7451
7447
  }
7452
7448
  if (hookChoice === "precommit" || hookChoice === "both") {
7453
7449
  const precommitResult = installPreCommitHook();
@@ -7463,6 +7459,31 @@ ${agentRefs.join(" ")}
7463
7459
  if (hookChoice === "skip") {
7464
7460
  console.log(chalk11.dim(" Skipped auto-sync hooks. Run ") + chalk11.hex("#83D1EB")("caliber hooks --install") + chalk11.dim(" later to enable."));
7465
7461
  }
7462
+ const hasLearnableAgent = targetAgent.includes("claude") || targetAgent.includes("cursor");
7463
+ if (hasLearnableAgent) {
7464
+ if (!options.autoApprove) {
7465
+ const enableLearn = await promptLearnInstall(targetAgent);
7466
+ trackInitLearnEnabled(enableLearn);
7467
+ if (enableLearn) {
7468
+ if (targetAgent.includes("claude")) {
7469
+ const r = installLearningHooks();
7470
+ if (r.installed) console.log(` ${chalk11.green("\u2713")} Learning hooks installed for Claude Code`);
7471
+ else if (r.alreadyInstalled) console.log(chalk11.dim(" Claude Code learning hooks already installed"));
7472
+ }
7473
+ if (targetAgent.includes("cursor")) {
7474
+ const r = installCursorLearningHooks();
7475
+ if (r.installed) console.log(` ${chalk11.green("\u2713")} Learning hooks installed for Cursor`);
7476
+ else if (r.alreadyInstalled) console.log(chalk11.dim(" Cursor learning hooks already installed"));
7477
+ }
7478
+ console.log(chalk11.dim(" Run ") + chalk11.hex("#83D1EB")("caliber learn status") + chalk11.dim(" to see insights"));
7479
+ } else {
7480
+ console.log(chalk11.dim(" Skipped. Run ") + chalk11.hex("#83D1EB")("caliber learn install") + chalk11.dim(" later to enable."));
7481
+ }
7482
+ } else {
7483
+ if (targetAgent.includes("claude")) installLearningHooks();
7484
+ if (targetAgent.includes("cursor")) installCursorLearningHooks();
7485
+ }
7486
+ }
7466
7487
  console.log(chalk11.bold.green("\n Setup complete!"));
7467
7488
  console.log(chalk11.dim(" Your AI agents now understand your project's architecture, build commands,"));
7468
7489
  console.log(chalk11.dim(" testing patterns, and conventions. All changes are backed up automatically.\n"));
@@ -7619,6 +7640,25 @@ async function promptHookType(targetAgent) {
7619
7640
  choices
7620
7641
  });
7621
7642
  }
7643
+ async function promptLearnInstall(targetAgent) {
7644
+ const hasClaude = targetAgent.includes("claude");
7645
+ const hasCursor = targetAgent.includes("cursor");
7646
+ const agentName = hasClaude && hasCursor ? "Claude and Cursor" : hasClaude ? "Claude" : "Cursor";
7647
+ console.log(chalk11.bold(`
7648
+ Session Learning
7649
+ `));
7650
+ console.log(chalk11.dim(` Caliber can learn from your ${agentName} sessions \u2014 when a tool fails`));
7651
+ console.log(chalk11.dim(` or you correct a mistake, it captures the lesson so it won't`));
7652
+ console.log(chalk11.dim(` happen again. Runs once at session end using the fast model.
7653
+ `));
7654
+ return select5({
7655
+ message: "Enable session learning?",
7656
+ choices: [
7657
+ { name: "Enable session learning (recommended)", value: true },
7658
+ { name: "Skip for now", value: false }
7659
+ ]
7660
+ });
7661
+ }
7622
7662
  async function promptReviewAction(hasSkillResults = false) {
7623
7663
  const acceptLabel = hasSkillResults ? "Accept and continue to community skills" : "Accept and apply";
7624
7664
  return select5({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.20.0-dev.1773695082",
3
+ "version": "1.20.0-dev.1773695140",
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": {