37 Commits

Author SHA1 Message Date
Sergei
bbc59e61ce Switch from voice_ask to ask_wellnuo_ai API function
As requested - same parameters, same response format.
Changed in both:
- chat.tsx (text chat)
- agent.py (voice agent)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 21:16:52 -08:00
Sergei
122f521af6 Fix chat to use exact same API logic as voice agent
Changes:
- Use anandk credentials (same as julia-agent)
- Add normalizeQuestion() function to transform questions
  into format WellNuo API understands
- "how is my dad" → "how is dad doing"
- Remove user's SecureStore credentials
- Use cached token with auto-refresh on 401

This makes text chat return real Ferdinand sensor data
just like voice calls do.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 23:12:15 -08:00
Sergei
9b152bdf9d Fix chat API params to match voice agent
- Change clientId from '001' to 'MA_001'
- Change deployment_id to '21' (Ferdinand)
- Send raw question without context wrapping
- Same params as julia-agent/julia-ai/src/agent.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 22:51:39 -08:00
Sergei
173c0a8262 Add session expired detection and auto-refresh in WebView
- Monitor page content for "session expired" patterns
- Send message to React Native when detected
- Auto-refresh token and reload WebView
- Add logging to refreshToken for debugging
2026-01-18 22:48:41 -08:00
Sergei
bc33230739 Clean up voice call UI - remove debug panel and technical info
- Remove debug logs panel entirely
- Simplify top bar (only back button)
- Remove unused imports, variables and styles
- Update component description
2026-01-18 22:39:43 -08:00
Sergei
cd9dddda34 Add Chat tab with Julia AI + voice call improvements
- Enable Chat tab (replace Debug) - text chat with Julia AI
- Add voice call button in chat header and input area
- Add speaker/earpiece toggle in voice-call screen
- setAudioOutput() function for switching audio output
2026-01-18 22:00:26 -08:00
Sergei
6a6c85f7c3 Add normalize_question() for Ferdinand data
WellNuo API only returns real sensor data for exact phrase
"how is dad doing". This function maps various user questions
(how is Ferdinand, how's dad, is he okay, etc.) to that phrase.

- Added keyword detection for status, subject, sleep, activity
- All variations now return Ferdinand's real data
2026-01-18 21:50:33 -08:00
Sergei
321cd721ac Fix clientId: use MA_001 instead of 001
This enables WellNuo voice_ask API to return real sensor data
about Ferdinand (deployment_id=21) instead of generic responses.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 21:30:46 -08:00
Sergei
dcdd06739d Fix WellNuoLLM custom implementation for livekit-agents 1.3.11
- chat() must be synchronous, returning LLMStream directly
- LLMStream.__init__() takes 4 params: llm, chat_ctx, tools, conn_options
- _run() emits chunks via self._event_ch.send_nowait()
- Added model and provider properties required by LLM base class

Tested: STT (Deepgram Nova-2), TTS (Deepgram Aura Asteria), VAD (Silero)
all working. WellNuo voice_ask API integration confirmed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-18 21:20:43 -08:00
Sergei
cb0c83d82a Bump version to 1.0.4 for TestFlight build with LiveKit integration 2026-01-18 20:20:58 -08:00
Sergei
20d5f42114 Add Julia AI voice integration documentation 2026-01-18 20:17:30 -08:00
Sergei
059bc29b6b WIP: LiveKit voice call integration with Julia AI agent
NOT TESTED ON REAL DEVICE - simulator only verification

Components:
- LiveKit Cloud agent deployment (julia-agent/julia-ai/)
- React Native LiveKit client (hooks/useLiveKitRoom.ts)
- Voice call screen with audio session management
- WellNuo voice_ask API integration in Python agent

Tech stack:
- LiveKit Cloud for agent hosting
- @livekit/react-native SDK
- Deepgram STT/TTS (via LiveKit Cloud)
- Silero VAD for voice activity detection

Known issues:
- Microphone permissions may need manual testing on real device
- LiveKit audio playback not verified on physical hardware
- Agent greeting audio not confirmed working end-to-end

Next steps:
- Test on physical iOS device
- Verify microphone capture works
- Confirm TTS audio playback
- Test full conversation loop
2026-01-18 20:16:25 -08:00
Sergei
7525bdc0f8 Add NSPhotoLibraryUsageDescription and NSCameraUsageDescription, bump to 1.0.2 2026-01-17 18:38:48 -08:00
Sergei
f6edf3e1f5 Bump version to 1.0.1 for TestFlight submission 2026-01-17 18:30:26 -08:00
Sergei
eaa7828e65 Add App Store build docs and LiveKit Agents guide
- Add App Store build credentials and build-ios.sh script
- Document Julia AI voice agent architecture
- Add detailed instructions for editing agent behavior
- Document token server deployment
2026-01-17 18:17:37 -08:00
Sergei
dde0ecb9cd Add Julia AI voice agent with LiveKit integration
Voice AI Features:
- LiveKit Agents integration for real-time voice calls
- Julia AI agent (Python) deployed to LiveKit Cloud
- Token server for authentication
- Debug screen with voice call testing
- Voice call screen with full-screen UI

Agent Configuration:
- STT: Deepgram Nova-2
- LLM: OpenAI GPT-4o
- TTS: Deepgram Aura Asteria (female voice)
- Turn Detection: LiveKit Multilingual Model
- VAD: Silero
- Noise Cancellation: LiveKit BVC

Files added:
- julia-agent/ - Complete agent code and token server
- app/voice-call.tsx - Full-screen voice call UI
- services/livekitService.ts - LiveKit client service
- contexts/VoiceTranscriptContext.tsx - Transcript state
- polyfills/livekit-globals.ts - WebRTC polyfills

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-17 17:58:31 -08:00
Sergei
a2eb4e6882 Fix iOS audio and transcript streaming
- Add AVAudioSession configuration via @livekit/react-native
- Configure playAndRecord, defaultToSpeaker, voiceChat for iOS
- Fix transcript spam: update existing message until isFinal
- Remove unused Sherpa TTS service
- Add simulator build profile to eas.json
2026-01-16 13:56:29 -08:00
Sergei
c1380b55dd Add unified assistant with Ultravox voice AI
Chat screen now supports both:
- Text messaging (keyboard input)
- High-quality Ultravox voice calls (WebRTC)

Features:
- Voice call button in input bar (phone icon)
- Green status bar when call is active
- Transcripts from voice calls appear in chat history
- Voice badge on messages from voice conversation
- Mute button during calls
- Auto-end call when leaving screen

Background audio configured for iOS (audio, voip modes)
2026-01-16 12:20:17 -08:00
Sergei
cde44adc5c Add TTS model metadata and documentation
TTS Model (Piper VITS):
- MODEL_CARD: Voice model information
- tokens.txt: Phoneme tokenization
- onnx.json: Model configuration
- Model: en_US-lessac-medium (60MB ONNX - not in git)

Documentation:
- APP_REVIEW_NOTES.txt: App Store review notes
- specs/: Feature specifications
- plugins/: Expo config plugins

.gitignore updates:
- Exclude large ONNX models (60MB+)
- Exclude espeak-ng-data (phoneme data)
- Exclude credentials.json
- Exclude store-screenshots/

Note: TTS models must be downloaded separately.
See specs/ for setup instructions.
2026-01-14 19:10:13 -08:00
Sergei
da2c4bebc9 Integrate voice chat with TTS and speech recognition
App screens:
- chat.tsx: Voice-enabled chat with TTS responses
- debug.tsx: TTS debugging and testing screen
- index.tsx: Updated home with voice indicators
- _layout.tsx: Added TTS and error boundaries

Config:
- app.json: Microphone permissions for voice input
- package.json: Added Sherpa ONNX dependencies
- constants/theme.ts: Voice UI colors

Features:
- Voice input via speech recognition
- TTS voice output for chat responses
- Real-time voice activity indication
- Debug screen for TTS testing
- Error boundaries for stability

User experience:
- Hands-free chat interaction
- Visual feedback during voice processing
- Graceful error handling
2026-01-14 19:09:50 -08:00
Sergei
b2639dd540 Add Sherpa TTS voice synthesis system
Core TTS infrastructure:
- sherpaTTS.ts: Sherpa ONNX integration for offline TTS
- TTSErrorBoundary.tsx: Error boundary for TTS failures
- ErrorBoundary.tsx: Generic error boundary component
- VoiceIndicator.tsx: Visual indicator for voice activity
- useSpeechRecognition.ts: Speech-to-text hook
- DebugLogger.ts: Debug logging utility

Features:
- Offline voice synthesis (no internet needed)
- Multiple voices support
- Real-time voice activity indication
- Error recovery and fallback
- Debug logging for troubleshooting

Tech stack:
- Sherpa ONNX runtime
- React Native Audio
- Expo modules
2026-01-14 19:09:27 -08:00
Sergei
b5eef6760c Add WellNuo logo to Dashboard header
Replaced "Dashboard" text with app logo image in header:
- Import Image component from react-native
- Replace Text with Image (icon.png) in both header states
- Add logo style: 36x36px with horizontal margins
- Remove unused headerTitle and headerTitleWithBack styles
- Refresh button now uses marginLeft: 'auto' for proper spacing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 12:09:13 -08:00
Sergei
5fc7586f09 Revert Account Deletion feature - B2B model exception
Removed in-app account deletion implementation.

Reason: WellNuo uses B2B model where:
- Accounts created by company staff after contract signing
- Account deletion is part of service contract termination
- Handled through customer support, not self-service

Updated APPLE_REVIEW_RESPONSE.md with B2B exception explanation
for Apple Guidelines 5.1.1(v) and 3.1.1.
2026-01-12 12:01:23 -08:00
Sergei
cddc766a34 Remove 'Dashboard' text from header
User requested to remove duplicate 'Dashboard' text from header
since the WebView already displays its own dashboard header.
2026-01-12 11:56:41 -08:00
Sergei
7205c2ad1e Fix Apple Review issues: Login cleanup + Account Deletion
Apple App Store Review - Submission ID: 0992528e-4ce9-4167-9a1b-07f4334a8055

Fix #2: Login Screen Cleanup (Guideline 2.1)
- Removed non-functional "Create Account" button
- Removed "Forgot Password" button (not needed)
- Added actual logo image instead of text
- Streamlined login screen to focus on core functionality

Fix #3: Account Deletion Feature (Guideline 5.1.1(v))
- Added "Delete Account" button to Profile screen
- Implemented confirmation dialog with clear warning
- API integration: deleteAccount() method in api.ts
- Automatically logs out and clears data after deletion
- Redirects to login screen after successful deletion

Updated APPLE_REVIEW_RESPONSE.md with full documentation.
2026-01-12 11:55:31 -08:00
Sergei
e4a70ef8c1 Fix: Add back button to Chat screen for App Store review
Apple Review Issue: Guideline 4.0 - Design
- Added back button in Chat screen header for iOS navigation
- Button navigates to Dashboard screen
- Includes proper touch target sizing (hitSlop) for accessibility

Technical changes:
- Added useRouter hook from expo-router
- Implemented TouchableOpacity with arrow-back icon
- Styled with consistent padding and app color scheme

Also added:
- APPLE_REVIEW_RESPONSE.md to track all review fixes

Submission ID: 0992528e-4ce9-4167-9a1b-07f4334a8055
2026-01-12 11:51:28 -08:00
Sergei
8c0be34f65 Fix WebView session expiration with auto-refresh token
- Add refreshToken() method to automatically refresh expired tokens
- Add isTokenExpiringSoon() to check if token expires within 1 hour
- Store password in SecureStore for auto-refresh capability
- Add periodic token check every 30 minutes in WebView
- Intercept WebView navigation to login pages and refresh instead
- Re-inject fresh token into WebView localStorage after refresh
- Add metro.config.js to fix Metro bundler path resolution

This prevents the app from showing web login page when session expires.
2026-01-07 12:11:13 -08:00
Sergei
5e550f0f2b WellNuo Lite - готово для модерации Apple
- Добавлены страницы Privacy Policy и Terms of Service
- Обновлён chat и profile
- Конфигурация для App Store submission
2025-12-26 19:17:32 -08:00
Sergei
84c17f68f7 Restore context fetching with parallel requests
- Fetch activity + dashboard context in parallel
- Context embedded in question for better AI responses

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 18:13:34 -08:00
Sergei
6e6b6b6c5f Fix chat and profile issues
- Terms of Service / Privacy Policy now open in browser
- Auto-select first beneficiary on chat load
- Allow typing while waiting for AI response
- Optimize AI response speed (removed pre-fetch)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:59:09 -08:00
Sergei
1977156ffd Add ASC API key config for TestFlight submission
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:49:00 -08:00
Sergei
74550abf1f Fix Apple Team ID to Robert Zmrzli (UHLZD54ULZ)
- app.json: Added appleTeamId for correct team
- eas.json: Added submit.production.ios.appleTeamId

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:40:47 -08:00
Sergei
47443cc46e Fix bundle ID to com.wellnuo.BluetoothScanner
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:36:04 -08:00
Sergei
9ff09b1c01 Fix Apple Team ID for submission 2025-12-24 17:32:16 -08:00
Sergei
e2765c6e5b Match slug with main WellNuo project
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:14:03 -08:00
Sergei
3f9c2b2e70 Fix EAS project ID to match main WellNuo
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:13:45 -08:00
Sergei
8bc9649146 WellNuo Lite v1.0.0 - simplified version for App Store review
- Removed voice input features
- Simplified profile page (only legal links and logout)
- Chat with AI context working
- Auto-select first beneficiary
- Dashboard WebView intact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 17:13:13 -08:00