ccgather 2.0.4 → 2.0.6

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/index.js +16 -45
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -329,7 +329,7 @@ var init_ui = __esm({
329
329
  "use strict";
330
330
  import_chalk = __toESM(require("chalk"));
331
331
  import_string_width = __toESM(require("string-width"));
332
- VERSION = true ? "2.0.4" : "0.0.0";
332
+ VERSION = true ? "2.0.5" : "0.0.0";
333
333
  colors = {
334
334
  primary: import_chalk.default.hex("#DA7756"),
335
335
  // Claude coral
@@ -608,39 +608,27 @@ function mapSubscriptionToCCPlan(subscriptionType) {
608
608
  if (!subscriptionType) {
609
609
  return null;
610
610
  }
611
- const type = subscriptionType.toLowerCase();
612
- if (type === "max" || type.includes("max")) {
613
- return "max";
614
- }
615
- if (type === "pro") {
616
- return "pro";
617
- }
618
- if (type === "free") {
619
- return "free";
620
- }
621
- return type;
611
+ return subscriptionType.toLowerCase();
622
612
  }
623
613
  function inferPlanFromRateLimitTier(rateLimitTier) {
624
614
  if (!rateLimitTier) {
625
615
  return null;
626
616
  }
627
617
  const tier = rateLimitTier.toLowerCase();
628
- if (tier.includes("enterprise")) {
629
- return "enterprise";
630
- }
631
- if (tier.includes("team")) {
632
- return "team";
633
- }
634
- if (tier.includes("max")) {
635
- return "max";
636
- }
637
- if (tier.includes("pro")) {
638
- return "pro";
639
- }
640
- if (tier.includes("free")) {
641
- return "free";
618
+ const match = tier.match(/(?:default_claude_)?(\w+?)(?:_(\d+x))?$/);
619
+ if (match) {
620
+ const plan = match[1];
621
+ const multiplier = match[2];
622
+ if (["max", "pro", "free", "team", "enterprise"].includes(plan)) {
623
+ return multiplier ? `${plan}_${multiplier}` : plan;
624
+ }
642
625
  }
643
- return null;
626
+ if (tier.includes("enterprise")) return "enterprise";
627
+ if (tier.includes("team")) return "team";
628
+ if (tier.includes("max")) return tier.includes("20x") ? "max_20x" : "max";
629
+ if (tier.includes("pro")) return "pro";
630
+ if (tier.includes("free")) return "free";
631
+ return tier;
644
632
  }
645
633
  function detectApiKeyAuth() {
646
634
  const anthropicApiKey = process.env.ANTHROPIC_API_KEY;
@@ -738,44 +726,29 @@ function extractProjectName(filePath) {
738
726
  }
739
727
  return "unknown";
740
728
  }
741
- var DEBUG = process.env.CCGATHER_DEBUG === "1" || process.env.CCGATHER_DEBUG === "true";
742
- function debugLog(...args) {
743
- if (DEBUG) {
744
- console.log("[DEBUG]", ...args);
745
- }
746
- }
747
729
  function getClaudeProjectsDirs() {
748
730
  const dirs = [];
749
731
  const home = os2.homedir();
750
- debugLog("Home directory:", home);
751
- debugLog("Platform:", process.platform);
752
732
  const configDir = process.env.CLAUDE_CONFIG_DIR;
753
733
  if (configDir) {
754
734
  const envPath = path2.join(configDir, "projects");
755
735
  dirs.push(envPath);
756
- debugLog("CLAUDE_CONFIG_DIR path:", envPath);
757
736
  }
758
737
  if (process.platform === "win32") {
759
738
  const appData = process.env.APPDATA;
760
739
  if (appData) {
761
740
  const appDataPath = path2.join(appData, "claude", "projects");
762
741
  dirs.push(appDataPath);
763
- debugLog("APPDATA path:", appDataPath);
764
742
  }
765
743
  }
766
744
  const xdgPath = path2.join(home, ".config", "claude", "projects");
767
745
  dirs.push(xdgPath);
768
- debugLog("XDG path:", xdgPath);
769
746
  const legacyPath = path2.join(home, ".claude", "projects");
770
747
  dirs.push(legacyPath);
771
- debugLog("Legacy path:", legacyPath);
772
748
  const uniqueDirs = [...new Set(dirs)];
773
749
  const existingDirs = uniqueDirs.filter((dir) => {
774
- const exists = fs2.existsSync(dir);
775
- debugLog(`Path ${dir} exists:`, exists);
776
- return exists;
750
+ return fs2.existsSync(dir);
777
751
  });
778
- debugLog("Existing project dirs:", existingDirs);
779
752
  return existingDirs;
780
753
  }
781
754
  function encodePathLikeClaude(inputPath) {
@@ -897,7 +870,6 @@ function getSessionPathDebugInfo() {
897
870
  function scanAllProjects(options = {}) {
898
871
  const projectsDirs = getClaudeProjectsDirs();
899
872
  if (projectsDirs.length === 0) {
900
- debugLog("No project directories found");
901
873
  return null;
902
874
  }
903
875
  const days = options.days ?? 0;
@@ -936,7 +908,6 @@ function scanAllProjects(options = {}) {
936
908
  }
937
909
  }
938
910
  if (allJsonlFiles.length === 0) {
939
- debugLog("No JSONL files found in any project");
940
911
  return null;
941
912
  }
942
913
  sessionsCount = allJsonlFiles.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccgather",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "CLI tool for syncing Claude Code usage data to CCgather leaderboard",
5
5
  "bin": {
6
6
  "ccgather": "dist/index.js",