claude-code-arcane 2.6.0 → 2.6.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.6.1](https://github.com/SebastianLuser/claude-code-arcane/compare/v2.6.0...v2.6.1) (2026-08-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **update-check:** compare like with like, and check the CLI version too ([fe734ce](https://github.com/SebastianLuser/claude-code-arcane/commit/fe734ce9bff14ec37e22d75fc38e64ba7b17f098))
7
+
1
8
  # [2.6.0](https://github.com/SebastianLuser/claude-code-arcane/compare/v2.5.0...v2.6.0) (2026-08-18)
2
9
 
3
10
 
package/dist/cli.js CHANGED
@@ -2722,6 +2722,25 @@ var CHECK_INTERVAL_MS = 4 * 60 * 60 * 1e3;
2722
2722
  var GITHUB_OWNER2 = "SebastianLuser";
2723
2723
  var GITHUB_REPO2 = "Claude-Code-Arcane";
2724
2724
  var GITHUB_BRANCH2 = "main";
2725
+ var PACKAGE_NAME2 = "claude-code-arcane";
2726
+ var SHA_PATTERN = /^[0-9a-f]{7,40}$/i;
2727
+ function compareSemver(a, b) {
2728
+ const release = (v) => v.trim().replace(/^v/, "").split(/[-+]/)[0];
2729
+ const parts = (v) => release(v).split(".").map((n) => Number.parseInt(n, 10) || 0);
2730
+ const [aMajor = 0, aMinor = 0, aPatch = 0] = parts(a);
2731
+ const [bMajor = 0, bMinor = 0, bPatch = 0] = parts(b);
2732
+ if (aMajor !== bMajor) return aMajor - bMajor;
2733
+ if (aMinor !== bMinor) return aMinor - bMinor;
2734
+ if (aPatch !== bPatch) return aPatch - bPatch;
2735
+ const aPre = /-/.test(a.trim());
2736
+ const bPre = /-/.test(b.trim());
2737
+ if (aPre !== bPre) return aPre ? -1 : 1;
2738
+ return 0;
2739
+ }
2740
+ function isContentUpdateAvailable(localVersion, remoteSha) {
2741
+ if (!SHA_PATTERN.test(localVersion)) return false;
2742
+ return !remoteSha.startsWith(localVersion) && !localVersion.startsWith(remoteSha);
2743
+ }
2725
2744
  async function checkForUpdates(opts = {}) {
2726
2745
  try {
2727
2746
  const cached = readCachedCheck();
@@ -2729,40 +2748,62 @@ async function checkForUpdates(opts = {}) {
2729
2748
  const age = Date.now() - new Date(cached.checked_at).getTime();
2730
2749
  if (age < CHECK_INTERVAL_MS) {
2731
2750
  if (cached.update_available && !opts.quiet) {
2732
- printUpdateNotice(cached.local_version, cached.remote_sha);
2751
+ printUpdateNotice(cached);
2733
2752
  }
2734
2753
  return cached.update_available;
2735
2754
  }
2736
2755
  }
2737
2756
  const manifest = readManifest(process.cwd());
2738
2757
  const localVersion = manifest?.source_version ?? manifest?.arcane_version ?? "unknown";
2739
- const remoteSha = await getLatestCommitSha();
2740
- if (!remoteSha) return false;
2741
- const shortSha = remoteSha.substring(0, 12);
2742
- const updateAvailable = localVersion !== shortSha && !remoteSha.startsWith(localVersion);
2758
+ const cliVersion = getPackageVersion();
2759
+ const [remoteSha, latestCli] = await Promise.all([
2760
+ getLatestCommitSha(),
2761
+ getLatestNpmVersion()
2762
+ ]);
2763
+ const shortSha = remoteSha ? remoteSha.substring(0, 12) : cached?.remote_sha ?? "";
2764
+ const contentUpdate = shortSha !== "" && isContentUpdateAvailable(localVersion, shortSha);
2765
+ const cliUpdate = latestCli !== null && compareSemver(latestCli, cliVersion) > 0;
2766
+ if (!remoteSha && latestCli === null) return false;
2743
2767
  const result = {
2744
2768
  checked_at: (/* @__PURE__ */ new Date()).toISOString(),
2745
2769
  local_version: localVersion,
2746
2770
  remote_sha: shortSha,
2747
- update_available: updateAvailable
2771
+ update_available: contentUpdate || cliUpdate,
2772
+ content_update_available: contentUpdate,
2773
+ cli_version: cliVersion,
2774
+ latest_cli_version: latestCli ?? void 0,
2775
+ cli_update_available: cliUpdate
2748
2776
  };
2749
2777
  writeCachedCheck(result);
2750
- if (updateAvailable && !opts.quiet) {
2751
- printUpdateNotice(localVersion, shortSha);
2778
+ if (result.update_available && !opts.quiet) {
2779
+ printUpdateNotice(result);
2752
2780
  }
2753
- return updateAvailable;
2781
+ return result.update_available;
2754
2782
  } catch {
2755
2783
  return false;
2756
2784
  }
2757
2785
  }
2758
- function printUpdateNotice(localVersion, remoteSha) {
2759
- console.log(
2760
- chalk11.yellow(`
2761
- Arcane update available: ${localVersion} \u2192 ${remoteSha}`)
2762
- );
2763
- console.log(
2764
- chalk11.dim(" Run: arcane update (--dry-run to preview)\n")
2765
- );
2786
+ function printUpdateNotice(result) {
2787
+ if (result.cli_update_available) {
2788
+ console.log(
2789
+ chalk11.yellow(
2790
+ `
2791
+ Arcane CLI update: ${result.cli_version} \u2192 ${result.latest_cli_version}`
2792
+ )
2793
+ );
2794
+ const how = isGloballyInstalled() ? ` Run: npm install -g ${PACKAGE_NAME2}@latest` : ` You are on an older CLI. Latest: ${PACKAGE_NAME2}@${result.latest_cli_version}`;
2795
+ console.log(chalk11.dim(how));
2796
+ }
2797
+ if (result.content_update_available ?? true) {
2798
+ console.log(
2799
+ chalk11.yellow(
2800
+ `
2801
+ Arcane content update: ${result.local_version} \u2192 ${result.remote_sha}`
2802
+ )
2803
+ );
2804
+ console.log(chalk11.dim(" Run: arcane update (--dry-run to preview)"));
2805
+ }
2806
+ console.log("");
2766
2807
  }
2767
2808
  async function getLatestCommitSha() {
2768
2809
  try {
@@ -2783,6 +2824,22 @@ async function getLatestCommitSha() {
2783
2824
  return null;
2784
2825
  }
2785
2826
  }
2827
+ async function getLatestNpmVersion() {
2828
+ try {
2829
+ const response = await fetch(
2830
+ `https://registry.npmjs.org/${PACKAGE_NAME2}/latest`,
2831
+ {
2832
+ headers: { "User-Agent": "arcane-cli", Accept: "application/json" },
2833
+ signal: AbortSignal.timeout(5e3)
2834
+ }
2835
+ );
2836
+ if (!response.ok) return null;
2837
+ const data = await response.json();
2838
+ return typeof data.version === "string" ? data.version : null;
2839
+ } catch {
2840
+ return null;
2841
+ }
2842
+ }
2786
2843
  function readCachedCheck() {
2787
2844
  try {
2788
2845
  if (!fs15.existsSync(CHECK_FILE)) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-arcane",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Skills, agents, hooks and rules for Claude Code — installable via npx claude-code-arcane",
5
5
  "type": "module",
6
6
  "bin": {