claude-glm 1.2.2 → 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 +31 -31
  2. package/install.sh +31 -31
  3. package/package.json +1 -1
package/bin/ccx CHANGED
@@ -68,39 +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 proxy on the same port
72
- if lsof -ti:${PORT} >/dev/null 2>&1; then
73
- echo "[ccx] Killing stale proxy on port ${PORT}..."
74
- lsof -ti:${PORT} | xargs kill -9 2>/dev/null || true
75
- sleep 0.5
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
100
+ sleep 0.5
101
+ done
76
102
  fi
77
103
 
78
- # Start proxy in background
79
- npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
80
- PROXY_PID=$!
81
-
82
- cleanup() {
83
- echo ""
84
- echo "[ccx] Shutting down proxy..."
85
- kill ${PROXY_PID} 2>/dev/null || true
86
- }
87
- trap cleanup EXIT INT TERM
88
-
89
- # Wait for proxy to be ready (health check)
90
- echo "[ccx] Waiting for proxy to start..."
91
- for i in {1..30}; do
92
- if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
93
- echo "[ccx] Proxy ready!"
94
- break
95
- fi
96
- if [ $i -eq 30 ]; then
97
- echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
98
- cat /tmp/claude-proxy.log
99
- exit 1
100
- fi
101
- sleep 0.5
102
- done
103
-
104
104
  echo ""
105
105
  echo "🎯 Available model prefixes:"
106
106
  echo " openai:<model> - OpenAI models (gpt-4o, gpt-4o-mini, etc.)"
package/install.sh CHANGED
@@ -615,39 +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 proxy on the same port
619
- if lsof -ti:${PORT} >/dev/null 2>&1; then
620
- echo "[ccx] Killing stale proxy on port ${PORT}..."
621
- lsof -ti:${PORT} | xargs kill -9 2>/dev/null || true
622
- sleep 0.5
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
647
+ sleep 0.5
648
+ done
623
649
  fi
624
650
 
625
- # Start proxy in background
626
- npx -y tsx "${ROOT_DIR}/adapters/anthropic-gateway.ts" > /tmp/claude-proxy.log 2>&1 &
627
- PROXY_PID=$!
628
-
629
- cleanup() {
630
- echo ""
631
- echo "[ccx] Shutting down proxy..."
632
- kill ${PROXY_PID} 2>/dev/null || true
633
- }
634
- trap cleanup EXIT INT TERM
635
-
636
- # Wait for proxy to be ready (health check)
637
- echo "[ccx] Waiting for proxy to start..."
638
- for i in {1..30}; do
639
- if curl -sf "http://127.0.0.1:${PORT}/healthz" >/dev/null 2>&1; then
640
- echo "[ccx] Proxy ready!"
641
- break
642
- fi
643
- if [ $i -eq 30 ]; then
644
- echo "❌ Proxy failed to start. Check /tmp/claude-proxy.log"
645
- cat /tmp/claude-proxy.log
646
- exit 1
647
- fi
648
- sleep 0.5
649
- done
650
-
651
651
  echo ""
652
652
  echo "🎯 Available model prefixes:"
653
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.2",
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",