@rely-ai/caliber 1.34.0-dev.1774825558 → 1.34.0-dev.1774825733

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 +69 -0
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -3889,6 +3889,68 @@ function removeHook() {
3889
3889
  writeSettings(settings);
3890
3890
  return { removed: true, notFound: false };
3891
3891
  }
3892
+ var STOP_HOOK_SCRIPT_CONTENT = `#!/bin/sh
3893
+ if grep -q "caliber" .git/hooks/pre-commit 2>/dev/null; then
3894
+ exit 0
3895
+ fi
3896
+ FLAG="/tmp/caliber-nudge-$(echo "$PWD" | shasum | cut -c1-8)"
3897
+ find /tmp -maxdepth 1 -name "caliber-nudge-*" -mmin +120 -delete 2>/dev/null
3898
+ if [ -f "$FLAG" ]; then
3899
+ exit 0
3900
+ fi
3901
+ touch "$FLAG"
3902
+ printf '{"decision":"block","reason":"Caliber agent config sync is not set up on this machine. Tell the user: This project uses Caliber to keep agent configs in sync \u2014 it is not set up yet. Want me to run /setup-caliber? (~30 seconds)"}'
3903
+ `;
3904
+ var STOP_HOOK_SCRIPT_PATH = path10.join(".claude", "hooks", "caliber-check-sync.sh");
3905
+ var STOP_HOOK_DESCRIPTION = "Caliber: offer setup if not configured";
3906
+ function hasStopHook(matchers) {
3907
+ return matchers.some(
3908
+ (entry) => entry.hooks?.some((h) => h.description === STOP_HOOK_DESCRIPTION)
3909
+ );
3910
+ }
3911
+ function installStopHook() {
3912
+ const settings = readSettings();
3913
+ if (!settings.hooks) settings.hooks = {};
3914
+ const stop = settings.hooks.Stop;
3915
+ if (Array.isArray(stop) && hasStopHook(stop)) {
3916
+ return { installed: false, alreadyInstalled: true };
3917
+ }
3918
+ const scriptDir = path10.dirname(STOP_HOOK_SCRIPT_PATH);
3919
+ if (!fs10.existsSync(scriptDir)) fs10.mkdirSync(scriptDir, { recursive: true });
3920
+ fs10.writeFileSync(STOP_HOOK_SCRIPT_PATH, STOP_HOOK_SCRIPT_CONTENT);
3921
+ fs10.chmodSync(STOP_HOOK_SCRIPT_PATH, 493);
3922
+ if (!Array.isArray(settings.hooks.Stop)) {
3923
+ settings.hooks.Stop = [];
3924
+ }
3925
+ settings.hooks.Stop.push({
3926
+ matcher: "",
3927
+ hooks: [{
3928
+ type: "command",
3929
+ command: STOP_HOOK_SCRIPT_PATH,
3930
+ description: STOP_HOOK_DESCRIPTION
3931
+ }]
3932
+ });
3933
+ writeSettings(settings);
3934
+ return { installed: true, alreadyInstalled: false };
3935
+ }
3936
+ function removeStopHook() {
3937
+ const settings = readSettings();
3938
+ const stop = settings.hooks?.Stop;
3939
+ if (!Array.isArray(stop)) return { removed: false, notFound: true };
3940
+ const idx = stop.findIndex(
3941
+ (entry) => entry.hooks?.some((h) => h.description === STOP_HOOK_DESCRIPTION)
3942
+ );
3943
+ if (idx === -1) return { removed: false, notFound: true };
3944
+ stop.splice(idx, 1);
3945
+ if (stop.length === 0) delete settings.hooks.Stop;
3946
+ if (settings.hooks && Object.keys(settings.hooks).length === 0) delete settings.hooks;
3947
+ writeSettings(settings);
3948
+ try {
3949
+ fs10.unlinkSync(STOP_HOOK_SCRIPT_PATH);
3950
+ } catch {
3951
+ }
3952
+ return { removed: true, notFound: false };
3953
+ }
3892
3954
  var PRECOMMIT_START = "# caliber:pre-commit:start";
3893
3955
  var PRECOMMIT_END = "# caliber:pre-commit:end";
3894
3956
  function getPrecommitBlock() {
@@ -9607,6 +9669,8 @@ async function initCommand(options) {
9607
9669
  } else if (hookResult.alreadyInstalled) {
9608
9670
  console.log(` ${chalk14.green("\u2713")} Pre-commit hook \u2014 active`);
9609
9671
  }
9672
+ installStopHook();
9673
+ console.log(` ${chalk14.green("\u2713")} Onboarding hook \u2014 nudges new team members to set up`);
9610
9674
  const { ensureBuiltinSkills: ensureBuiltinSkills2 } = await Promise.resolve().then(() => (init_builtin_skills(), builtin_skills_exports));
9611
9675
  for (const agent of targetAgent) {
9612
9676
  if (agent === "claude" && !fs33.existsSync(".claude")) fs33.mkdirSync(".claude", { recursive: true });
@@ -12793,6 +12857,11 @@ async function uninstallCommand(options) {
12793
12857
  console.log(` ${chalk28.red("\u2717")} Pre-commit hook removed`);
12794
12858
  actions.push("pre-commit hook");
12795
12859
  }
12860
+ const stopHookResult = removeStopHook();
12861
+ if (stopHookResult.removed) {
12862
+ console.log(` ${chalk28.red("\u2717")} Onboarding hook removed`);
12863
+ actions.push("onboarding hook");
12864
+ }
12796
12865
  const learnResult = removeLearningHooks();
12797
12866
  if (learnResult.removed) {
12798
12867
  console.log(` ${chalk28.red("\u2717")} Claude Code learning hooks removed`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.34.0-dev.1774825558",
3
+ "version": "1.34.0-dev.1774825733",
4
4
  "description": "AI context infrastructure for coding agents — keeps CLAUDE.md, Cursor rules, and skills in sync as your codebase evolves",
5
5
  "type": "module",
6
6
  "bin": {