claude-glm 1.2.3 → 1.2.4

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 (3) hide show
  1. package/bin/ccx +30 -35
  2. package/install.sh +30 -35
  3. package/package.json +1 -1
package/bin/ccx CHANGED
@@ -68,44 +68,39 @@ export ANTHROPIC_AUTH_TOKEN="${ANTHROPIC_AUTH_TOKEN:-local-proxy-token}"
68
68
  echo "[ccx] Starting Claude Code with multi-provider proxy..."
69
69
  echo "[ccx] Proxy will listen on: ${ANTHROPIC_BASE_URL}"
70
70
 
71
- # Kill any stale ccx proxy (tsx anthropic-gateway) on the same port
72
- if lsof -ti:${PORT} >/dev/null 2>&1; then
73
- STALE_PIDS=$(lsof -ti:${PORT} 2>/dev/null | while read pid; do
74
- ps -p "$pid" -o args= 2>/dev/null | grep -q "anthropic-gateway" && echo "$pid"
75
- done)
76
- if [ -n "$STALE_PIDS" ]; then
77
- echo "[ccx] Killing stale proxy on port ${PORT}..."
78
- echo "$STALE_PIDS" | xargs kill -9 2>/dev/null || true
71
+ # Check if a proxy is already running on this port
72
+ SHARED_PROXY=false
73
+ if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
74
+ echo "[ccx] Reusing existing proxy on port ${PORT}"
75
+ SHARED_PROXY=true
76
+ else
77
+ # Start proxy in background
78
+ npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
79
+ PROXY_PID=$!
80
+
81
+ cleanup() {
82
+ echo ""
83
+ echo "[ccx] Shutting down proxy..."
84
+ kill ${PROXY_PID} 2>/dev/null || true
85
+ }
86
+ trap cleanup EXIT INT TERM
87
+
88
+ # Wait for proxy to be ready (health check)
89
+ echo "[ccx] Waiting for proxy to start..."
90
+ for i in {1..30}; do
91
+ if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
92
+ echo "[ccx] Proxy ready!"
93
+ break
94
+ fi
95
+ if [ $i -eq 30 ]; then
96
+ echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
97
+ cat /tmp/claude-proxy.log
98
+ exit 1
99
+ fi
79
100
  sleep 0.5
80
- fi
101
+ done
81
102
  fi
82
103
 
83
- # Start proxy in background
84
- npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
85
- PROXY_PID=$!
86
-
87
- cleanup() {
88
- echo ""
89
- echo "[ccx] Shutting down proxy..."
90
- kill ${PROXY_PID} 2>/dev/null || true
91
- }
92
- trap cleanup EXIT INT TERM
93
-
94
- # Wait for proxy to be ready (health check)
95
- echo "[ccx] Waiting for proxy to start..."
96
- for i in {1..30}; do
97
- if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
98
- echo "[ccx] Proxy ready!"
99
- break
100
- fi
101
- if [ $i -eq 30 ]; then
102
- echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
103
- cat /tmp/claude-proxy.log
104
- exit 1
105
- fi
106
- sleep 0.5
107
- done
108
-
109
104
  echo ""
110
105
  echo "🎯 Available model prefixes:"
111
106
  echo " openai:<model> - OpenAI models (gpt-4o, gpt-4o-mini, etc.)"
package/install.sh CHANGED
@@ -615,44 +615,39 @@ export ANTHROPIC_AUTH_TOKEN="${ANTHROPIC_AUTH_TOKEN:-local-proxy-token}"
615
615
  echo "[ccx] Starting Claude Code with multi-provider proxy..."
616
616
  echo "[ccx] Proxy will listen on: ${ANTHROPIC_BASE_URL}"
617
617
 
618
- # Kill any stale ccx proxy (tsx anthropic-gateway) on the same port
619
- if lsof -ti:${PORT} >/dev/null 2>&1; then
620
- STALE_PIDS=$(lsof -ti:${PORT} 2>/dev/null | while read pid; do
621
- ps -p "$pid" -o args= 2>/dev/null | grep -q "anthropic-gateway" && echo "$pid"
622
- done)
623
- if [ -n "$STALE_PIDS" ]; then
624
- echo "[ccx] Killing stale proxy on port ${PORT}..."
625
- echo "$STALE_PIDS" | xargs kill -9 2>/dev/null || true
618
+ # Check if a proxy is already running on this port
619
+ SHARED_PROXY=false
620
+ if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
621
+ echo "[ccx] Reusing existing proxy on port ${PORT}"
622
+ SHARED_PROXY=true
623
+ else
624
+ # Start proxy in background
625
+ npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
626
+ PROXY_PID=$!
627
+
628
+ cleanup() {
629
+ echo ""
630
+ echo "[ccx] Shutting down proxy..."
631
+ kill ${PROXY_PID} 2>/dev/null || true
632
+ }
633
+ trap cleanup EXIT INT TERM
634
+
635
+ # Wait for proxy to be ready (health check)
636
+ echo "[ccx] Waiting for proxy to start..."
637
+ for i in {1..30}; do
638
+ if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
639
+ echo "[ccx] Proxy ready!"
640
+ break
641
+ fi
642
+ if [ $i -eq 30 ]; then
643
+ echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
644
+ cat /tmp/claude-proxy.log
645
+ exit 1
646
+ fi
626
647
  sleep 0.5
627
- fi
648
+ done
628
649
  fi
629
650
 
630
- # Start proxy in background
631
- npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
632
- PROXY_PID=$!
633
-
634
- cleanup() {
635
- echo ""
636
- echo "[ccx] Shutting down proxy..."
637
- kill ${PROXY_PID} 2>/dev/null || true
638
- }
639
- trap cleanup EXIT INT TERM
640
-
641
- # Wait for proxy to be ready (health check)
642
- echo "[ccx] Waiting for proxy to start..."
643
- for i in {1..30}; do
644
- if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
645
- echo "[ccx] Proxy ready!"
646
- break
647
- fi
648
- if [ $i -eq 30 ]; then
649
- echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
650
- cat /tmp/claude-proxy.log
651
- exit 1
652
- fi
653
- sleep 0.5
654
- done
655
-
656
651
  echo ""
657
652
  echo "🎯 Available model prefixes:"
658
653
  echo " openai:<model> - OpenAI models (gpt-4o, gpt-4o-mini, etc.)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-glm",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Cross-platform installer for Claude Code with Z.AI GLM models, multi-provider proxy, and dangerously-skip-permissions shortcuts. Run with: npx claude-glm",
5
5
  "keywords": [
6
6
  "claude",