zuppaclaude 1.3.12 → 1.3.14
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/claudehud.js +12 -1
- package/lib/components/claudez.js +20 -9
- package/lib/installer.js +1 -1
- package/package.json +1 -1
|
@@ -78,7 +78,18 @@ class ClaudeHUDInstaller {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
this.logger.success('Claude HUD setup script created');
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
// Show setup instructions directly
|
|
83
|
+
console.log('');
|
|
84
|
+
console.log(' \x1b[36m┌─────────────────────────────────────────────────────┐\x1b[0m');
|
|
85
|
+
console.log(' \x1b[36m│\x1b[0m Run these commands inside Claude Code: \x1b[36m│\x1b[0m');
|
|
86
|
+
console.log(' \x1b[36m│\x1b[0m \x1b[36m│\x1b[0m');
|
|
87
|
+
console.log(' \x1b[36m│\x1b[0m 1. /plugin marketplace add jarrodwatts/claude-hud \x1b[36m│\x1b[0m');
|
|
88
|
+
console.log(' \x1b[36m│\x1b[0m 2. /plugin install claude-hud \x1b[36m│\x1b[0m');
|
|
89
|
+
console.log(' \x1b[36m│\x1b[0m 3. /claude-hud:setup \x1b[36m│\x1b[0m');
|
|
90
|
+
console.log(' \x1b[36m└─────────────────────────────────────────────────────┘\x1b[0m');
|
|
91
|
+
console.log('');
|
|
92
|
+
|
|
82
93
|
return true;
|
|
83
94
|
} catch (error) {
|
|
84
95
|
this.logger.error(`Failed to install Claude HUD: ${error.message}`);
|
|
@@ -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');
|
package/lib/installer.js
CHANGED
|
@@ -98,7 +98,7 @@ class Installer {
|
|
|
98
98
|
zaiApiKey = this.settings.decodeApiKey(existingSettings.zaiApiKey);
|
|
99
99
|
this.logger.info('Using saved Z.AI API key');
|
|
100
100
|
} else {
|
|
101
|
-
installClaudeZ = await this.prompts.confirm('Install Claude-Z (z.ai backend)?',
|
|
101
|
+
installClaudeZ = await this.prompts.confirm('Install Claude-Z (z.ai backend)?', true);
|
|
102
102
|
if (installClaudeZ) {
|
|
103
103
|
zaiApiKey = await this.prompts.password('Enter your Z.AI API key:');
|
|
104
104
|
}
|