zuppaclaude 1.3.12 → 1.3.13
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/lib/components/claudez.js +20 -9
- package/package.json +1 -1
|
@@ -87,23 +87,34 @@ fi
|
|
|
87
87
|
|
|
88
88
|
ZAI_API_KEY=$(cat "$API_KEY_FILE")
|
|
89
89
|
|
|
90
|
-
#
|
|
91
|
-
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
|
|
92
|
-
export ANTHROPIC_API_KEY="$ZAI_API_KEY"
|
|
93
|
-
|
|
94
|
-
# Check for auth conflict (claude.ai token file)
|
|
90
|
+
# Handle auth conflict - backup and remove claude.ai credentials
|
|
95
91
|
CLAUDE_AUTH_FILE="$HOME/.claude/.credentials.json"
|
|
92
|
+
CLAUDE_AUTH_BACKUP="$HOME/.claude/.credentials.json.bak"
|
|
93
|
+
|
|
96
94
|
if [ -f "$CLAUDE_AUTH_FILE" ]; then
|
|
97
|
-
echo -e "\\033[0;33m[!]\\033[0m
|
|
98
|
-
|
|
99
|
-
echo ""
|
|
95
|
+
echo -e "\\033[0;33m[!]\\033[0m Temporarily disabling claude.ai session for z.ai..."
|
|
96
|
+
mv "$CLAUDE_AUTH_FILE" "$CLAUDE_AUTH_BACKUP"
|
|
100
97
|
fi
|
|
101
98
|
|
|
99
|
+
# Export environment for z.ai
|
|
100
|
+
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
|
|
101
|
+
export ANTHROPIC_API_KEY="$ZAI_API_KEY"
|
|
102
|
+
|
|
102
103
|
echo -e "\\033[0;32m[✓]\\033[0m Using z.ai backend"
|
|
103
104
|
echo -e "\\033[0;34m[i]\\033[0m Starting Claude Code..."
|
|
104
105
|
echo ""
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
# Run claude and restore credentials on exit
|
|
108
|
+
claude "$@"
|
|
109
|
+
EXIT_CODE=$?
|
|
110
|
+
|
|
111
|
+
# Restore claude.ai credentials
|
|
112
|
+
if [ -f "$CLAUDE_AUTH_BACKUP" ]; then
|
|
113
|
+
mv "$CLAUDE_AUTH_BACKUP" "$CLAUDE_AUTH_FILE"
|
|
114
|
+
echo -e "\\033[0;32m[✓]\\033[0m claude.ai session restored"
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
exit $EXIT_CODE
|
|
107
118
|
`;
|
|
108
119
|
|
|
109
120
|
fs.writeFileSync(this.binPath, script, 'utf8');
|