cc-context-stats 1.15.0 → 1.15.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-context-stats",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Monitor your Claude Code session context in real-time - track token usage and never run out of context",
5
5
  "main": "scripts/statusline.js",
6
6
  "bin": {
@@ -43,8 +43,5 @@
43
43
  ],
44
44
  "engines": {
45
45
  "node": ">=18"
46
- },
47
- "dependencies": {
48
- "cc-context-stats": "^1.15.0"
49
46
  }
50
47
  }
@@ -26,7 +26,7 @@
26
26
 
27
27
  # === CONFIGURATION ===
28
28
  # shellcheck disable=SC2034
29
- VERSION="1.11.1"
29
+ VERSION="1.15.1"
30
30
  COMMIT_HASH="dev" # Will be replaced during installation
31
31
  STATE_DIR=~/.claude/statusline
32
32
  CONFIG_FILE=~/.claude/statusline.conf
@@ -988,17 +988,35 @@ dispatch_python_subcommand() {
988
988
  local subcommand=$1
989
989
  shift
990
990
 
991
+ local py_cmd=""
991
992
  if command -v python3 >/dev/null 2>&1; then
992
- python3 -m claude_statusline.cli.context_stats "$subcommand" "$@"
993
- return $?
993
+ py_cmd="python3"
994
+ elif command -v python >/dev/null 2>&1; then
995
+ py_cmd="python"
996
+ else
997
+ error_exit "Python 3 is required for '$subcommand'."
994
998
  fi
995
999
 
996
- if command -v python >/dev/null 2>&1; then
997
- python -m claude_statusline.cli.context_stats "$subcommand" "$@"
998
- return $?
1000
+ # Check installed package is available and version matches this script
1001
+ local installed_version
1002
+ installed_version=$($py_cmd -c "import claude_statusline; print(claude_statusline.__version__)" 2>/dev/null || echo "")
1003
+
1004
+ if [ -z "$installed_version" ]; then
1005
+ echo -e "${RED}✗${RESET} Python package 'cc-context-stats' is not installed." >&2
1006
+ echo " Install it with: pip3 install cc-context-stats==$VERSION" >&2
1007
+ return 1
1008
+ fi
1009
+
1010
+ if [ "$installed_version" != "$VERSION" ]; then
1011
+ echo -e "${RED}✗${RESET} Python package version mismatch:" >&2
1012
+ echo " Script version: $VERSION" >&2
1013
+ echo " Package version: $installed_version" >&2
1014
+ echo " Run: pip3 install --upgrade cc-context-stats" >&2
1015
+ return 1
999
1016
  fi
1000
1017
 
1001
- error_exit "Python 3 is required for '$subcommand'."
1018
+ $py_cmd -m claude_statusline.cli.context_stats "$subcommand" "$@"
1019
+ return $?
1002
1020
  }
1003
1021
 
1004
1022
  # Render graphs once