Skip to content

Commit c8e6b60

Browse files
committed
fix: move shared methods to BaseFlow to fix UpdateFlow error
- Moved _setup_kokoro and _configure_claude_hooks from FirstTimeFlow to BaseFlow - Both FirstTimeFlow and UpdateFlow now inherit these methods from BaseFlow - Fixes 'UpdateFlow object has no attribute _setup_kokoro' error during updates - Version bump to 0.1.6
1 parent e4879f3 commit c8e6b60

11 files changed

Lines changed: 2819 additions & 157 deletions

File tree

.github/workflows/publish.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Voice Notification System for Claude Code
44

5-
🗣️ Have your favourite Voide tell you what's up in Claude Code
6-
⁉ Get notified when your Input is needed
7-
⚠ Be aware of critical commands being executed
8-
🏃‍♂️ Stay in control of multiple agents
9-
🕵🏻‍♂️ Select between local TTS (Kokoro) and Elevenlabs (more to come)
10-
💡 Sound caching system to save on API Credity/Processing time
5+
- 🗣️ Have your favourite Voide tell you what's up in Claude Code
6+
- ⁉ Get notified when your Input is needed
7+
- ⚠ Be aware of critical commands being executed
8+
- 🏃‍♂️ Stay in control of multiple agents
9+
- 🕵🏻‍♂️ Select between local TTS (Kokoro) and Elevenlabs (more to come)
10+
- 💡 Sound caching system to save on API Credity/Processing time
1111

1212
**NOTE:** This is an early stage project I primarily designed around my own use cases.
1313

@@ -60,8 +60,9 @@ uvx ccnotify install --quiet # Minimal output mode
6060
```
6161

6262
The new installer automatically detects:
63+
6364
- Whether CCNotify is already installed (runs update flow)
64-
- What TTS provider you prefer
65+
- What TTS provider you prefer
6566
- Whether models need downloading
6667
- Configuration migration needs
6768

models/model_info.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "ccnotify"
3-
version = "0.1.5"
3+
version = "0.1.6"
44
description = "Intelligent notification system for Claude Code with audio feedback"
55
authors = [
66
{name = "Frank Helmschrott", email = "frank@helmschrott.de"}

scripts/test_installer_complete.sh

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#!/bin/bash
2+
# Complete installer test in isolated environment
3+
4+
set -e
5+
6+
echo "🧪 CCNotify Complete Installer Test"
7+
echo "==================================="
8+
9+
# Create temporary directory
10+
TEMP_DIR=$(mktemp -d)
11+
echo "📁 Test directory: $TEMP_DIR"
12+
13+
# Create virtual environment
14+
echo "🐍 Creating virtual environment..."
15+
python3 -m venv "$TEMP_DIR/venv"
16+
source "$TEMP_DIR/venv/bin/activate"
17+
18+
# Install dependencies
19+
echo "📦 Installing dependencies..."
20+
pip install --quiet --upgrade pip
21+
pip install --quiet requests tqdm rich pytest
22+
23+
# Set up test home
24+
export TEST_HOME="$TEMP_DIR/home"
25+
mkdir -p "$TEST_HOME/.claude"
26+
27+
# Create fake settings.json
28+
cat > "$TEST_HOME/.claude/settings.json" << 'EOF'
29+
{
30+
"version": "1.0",
31+
"hooks": {
32+
"preToolUse": [],
33+
"postToolUse": []
34+
}
35+
}
36+
EOF
37+
38+
# Set HOME to test directory
39+
export HOME="$TEST_HOME"
40+
export PYTHONPATH="$(pwd)/src:$PYTHONPATH"
41+
42+
echo "📍 Test HOME: $HOME"
43+
echo "📍 Python: $(which python)"
44+
echo "📍 PYTHONPATH: $PYTHONPATH"
45+
46+
# Test 1: KokoroProvider fix
47+
echo -e "\n🧪 Test 1: KokoroProvider initialization"
48+
echo "----------------------------------------"
49+
50+
python3 << 'EOF'
51+
import sys
52+
import tempfile
53+
from pathlib import Path
54+
55+
# Test the fix
56+
try:
57+
from ccnotify.tts.kokoro import KokoroProvider
58+
59+
with tempfile.TemporaryDirectory() as tmpdir:
60+
models_dir = Path(tmpdir) / "models"
61+
models_dir.mkdir()
62+
63+
# Create dummy files
64+
(models_dir / "kokoro-v1.0.onnx").write_text("dummy")
65+
(models_dir / "voices-v1.0.bin").write_text("dummy")
66+
67+
# Test with config dict (should work)
68+
config = {
69+
"models_dir": str(models_dir),
70+
"voice": "af_sarah",
71+
"speed": 1.0
72+
}
73+
74+
provider = KokoroProvider(config)
75+
print("✅ KokoroProvider created successfully with config dict")
76+
77+
except Exception as e:
78+
print(f"❌ Error: {e}")
79+
import traceback
80+
traceback.print_exc()
81+
EOF
82+
83+
# Test 2: Setup script
84+
echo -e "\n🧪 Test 2: setup.py --kokoro"
85+
echo "----------------------------"
86+
87+
cd "$HOME/.claude"
88+
mkdir -p ccnotify
89+
cd ccnotify
90+
91+
# Run setup with force to test the fix
92+
python "$(pwd)/src/ccnotify/setup.py" --kokoro --force 2>&1 | grep -E "(Testing installation|Installation test|Error|Failed|Success)" || true
93+
94+
# Test 3: Full installer flow
95+
echo -e "\n🧪 Test 3: Full installer flow"
96+
echo "-------------------------------"
97+
98+
python3 << 'EOF'
99+
import os
100+
os.environ['HOME'] = os.environ['TEST_HOME']
101+
102+
from ccnotify.cli import execute_install_command
103+
104+
# Test quiet installation
105+
success = execute_install_command(quiet=True, force=True)
106+
print(f"Installation success: {success}")
107+
108+
# Check what was created
109+
ccnotify_dir = os.path.join(os.environ['HOME'], '.claude', 'ccnotify')
110+
if os.path.exists(ccnotify_dir):
111+
print(f"✅ Created: {ccnotify_dir}")
112+
for item in os.listdir(ccnotify_dir):
113+
print(f" - {item}")
114+
else:
115+
print("❌ CCNotify directory not created")
116+
EOF
117+
118+
# Cleanup
119+
deactivate
120+
rm -rf "$TEMP_DIR"
121+
122+
echo -e "\n✅ All tests completed"

0 commit comments

Comments
 (0)