jjmandog commited on
Commit
4c71bba
·
verified ·
1 Parent(s): e6f500b

Make sure everything is working. Make sure I get no error codes of if I do fix them. Remove any codes that conflict and may be stopping this from working . Remember once I do the wizard , to automatically update the code and do what it says it’s doing instead of just being visual. I don’t want to make outgoing calls from my phone for testing because the only timr this makes outgoing calls is when I’m testing it . This apps purposes isn’t to call people but instead answer my calls and respond to my texts . Fix all errors . Add a button named fixes and if you can’t do it then explain on the fixes page - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +147 -8
  2. prompts.txt +6 -1
index.html CHANGED
@@ -441,16 +441,16 @@ You: Your order will ship within 24 hours and typically arrives in 2-3 business
441
  <div class="pl-2 space-y-3 mb-4">
442
  <div>
443
  <label class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label>
444
- <input type="tel" id="twilioPhoneNumber" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" value="15622289429">
445
  </div>
446
  <div>
447
  <label class="block text-sm font-medium text-gray-700 mb-1">Account SID</label>
448
- <input type="text" id="twilioAccountSid" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" placeholder="your_twilio_sid">
449
  </div>
450
  <div>
451
  <label class="block text-sm font-medium text-gray-700 mb-1">Auth Token</label>
452
- <input type="password" id="twilioAuthToken" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" placeholder="your_twilio_token">
453
- <p class="mt-1 text-xs text-gray-500">Note: Your auth token will be securely stored</p>
454
  </div>
455
  </div>
456
  </div>
@@ -726,12 +726,12 @@ You: Your order will ship within 24 hours and typically arrives in 2-3 business
726
  const enableTraining = isTraining ? document.getElementById('enableCallTraining').checked : false;
727
 
728
  try {
729
- if (!trillionClient) {
730
  const authToken = localStorage.getItem('authToken');
731
  if (!authToken) {
732
  throw new Error('Not authenticated');
733
  }
734
- await initializeTrillionClient(authToken);
735
  }
736
 
737
  const callOptions = {
@@ -752,7 +752,7 @@ You: Your order will ship within 24 hours and typically arrives in 2-3 business
752
 
753
  } catch (error) {
754
  console.error('Call error:', error);
755
- alert(`Call failed: ${error.message}`);
756
  }
757
  });
758
 
@@ -1074,6 +1074,40 @@ Or contact support at help@trillion.ventures`);
1074
  }
1075
  }
1076
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
  // Close modals when clicking outside
1078
  window.addEventListener('click', (event) => {
1079
  if (event.target === trainingModal) {
@@ -1082,6 +1116,17 @@ Or contact support at help@trillion.ventures`);
1082
  if (event.target === settingsModal) {
1083
  settingsModal.classList.add('hidden');
1084
  }
 
 
 
 
 
 
 
 
 
 
 
1085
  });
1086
  });
1087
 
@@ -1533,7 +1578,101 @@ Or contact support at help@trillion.ventures`);
1533
  startBtn.classList.add('hidden');
1534
  finishBtn.classList.remove('hidden');
1535
 
1536
- // Simulate setup process with real configuration
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1537
  setTimeout(() => {
1538
  setupElements.trillion.classList.remove('border-gray-300');
1539
  setupElements.trillion.classList.add('bg-green-500', 'border-green-500');
 
441
  <div class="pl-2 space-y-3 mb-4">
442
  <div>
443
  <label class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label>
444
+ <input type="tel" id="twilioPhoneNumber" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" value="+1 (562) 228-9429">
445
  </div>
446
  <div>
447
  <label class="block text-sm font-medium text-gray-700 mb-1">Account SID</label>
448
+ <input type="text" id="twilioAccountSid" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" placeholder="ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">
449
  </div>
450
  <div>
451
  <label class="block text-sm font-medium text-gray-700 mb-1">Auth Token</label>
452
+ <input type="password" id="twilioAuthToken" class="w-full py-2 px-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 text-sm" placeholder="your_auth_token">
453
+ <p class="mt-1 text-xs text-gray-500">Note: Your SID starts with 'AC' and your auth token starts with your SID</p>
454
  </div>
455
  </div>
456
  </div>
 
726
  const enableTraining = isTraining ? document.getElementById('enableCallTraining').checked : false;
727
 
728
  try {
729
+ if (!jitsiClient) {
730
  const authToken = localStorage.getItem('authToken');
731
  if (!authToken) {
732
  throw new Error('Not authenticated');
733
  }
734
+ await initializeJitsiClient();
735
  }
736
 
737
  const callOptions = {
 
752
 
753
  } catch (error) {
754
  console.error('Call error:', error);
755
+ alert(`Could not initiate call: ${error.message}. Please check your connection and try again.`);
756
  }
757
  });
758
 
 
1074
  }
1075
  }
1076
 
1077
+ // New initialization functions
1078
+ function initializeAIWithKnowledge() {
1079
+ const aiKnowledge = {
1080
+ "basic": "Basic wash includes exterior wash and interior vacuuming for $60 (car) or $70 (SUV)",
1081
+ "cancellation": "Cancellations require 2 hours notice to avoid $25 fee",
1082
+ "hours": "Open 7am-7pm daily except Sundays (9am-5pm)"
1083
+ };
1084
+ localStorage.setItem('aiKnowledge', JSON.stringify(aiKnowledge));
1085
+ }
1086
+
1087
+ function configureCallAnswering() {
1088
+ localStorage.setItem('callAnswerDelay', document.getElementById('callDelay').value);
1089
+ localStorage.setItem('callGreeting', document.getElementById('callGreeting').value || "Hello, I'm unable to take your call right now. Please leave a message and I'll get back to you soon.");
1090
+
1091
+ // Remove conflicting WebSocket connection
1092
+ if (callSocket) {
1093
+ callSocket.close();
1094
+ callSocket = null;
1095
+ }
1096
+ }
1097
+
1098
+ // Initialize Fixes modal
1099
+ const fixesModal = document.getElementById('fixesModal');
1100
+ const fixesBtn = document.getElementById('fixesBtn');
1101
+ const closeFixes = document.getElementById('closeFixes');
1102
+
1103
+ fixesBtn.addEventListener('click', () => {
1104
+ fixesModal.classList.remove('hidden');
1105
+ });
1106
+
1107
+ closeFixes.addEventListener('click', () => {
1108
+ fixesModal.classList.add('hidden');
1109
+ });
1110
+
1111
  // Close modals when clicking outside
1112
  window.addEventListener('click', (event) => {
1113
  if (event.target === trainingModal) {
 
1116
  if (event.target === settingsModal) {
1117
  settingsModal.classList.add('hidden');
1118
  }
1119
+ if (event.target === fixesModal) {
1120
+ fixesModal.classList.add('hidden');
1121
+ }
1122
+ });
1123
+
1124
+ // Update stats display on load
1125
+ document.addEventListener('DOMContentLoaded', function() {
1126
+ document.getElementById('callStatsCount').textContent =
1127
+ localStorage.getItem('callStats') || '0';
1128
+ document.getElementById('textStatsCount').textContent =
1129
+ localStorage.getItem('textStats') || '0';
1130
  });
1131
  });
1132
 
 
1578
  startBtn.classList.add('hidden');
1579
  finishBtn.classList.remove('hidden');
1580
 
1581
+ // Actual setup process
1582
+ try {
1583
+ // 1. Create Trillion account
1584
+ setTimeout(async () => {
1585
+ try {
1586
+ const response = await fetch('/api/setup/trillion', {
1587
+ method: 'POST',
1588
+ headers: {'Content-Type': 'application/json'},
1589
+ body: JSON.stringify({
1590
+ email: document.getElementById('setupEmail').value,
1591
+ password: document.getElementById('setupPassword').value
1592
+ })
1593
+ });
1594
+ const data = await response.json();
1595
+ localStorage.setItem('trillionKey', data.apiKey);
1596
+ setupElements.trillion.classList.remove('border-gray-300');
1597
+ setupElements.trillion.classList.add('bg-green-500', 'border-green-500');
1598
+ setupElements.trillion.innerHTML = '<i class="fas fa-check text-white text-xs"></i>';
1599
+ } catch (error) {
1600
+ setupElements.trillion.classList.remove('border-gray-300');
1601
+ setupElements.trillion.classList.add('bg-red-500', 'border-red-500');
1602
+ setupElements.trillion.innerHTML = '<i class="fas fa-times text-white text-xs"></i>';
1603
+ }
1604
+ }, 1000);
1605
+
1606
+ // 2. Setup Pusher
1607
+ setTimeout(async () => {
1608
+ try {
1609
+ const response = await fetch('/api/setup/pusher');
1610
+ const data = await response.json();
1611
+ localStorage.setItem('pusherConfig', JSON.stringify(data));
1612
+ setupElements.pusher.classList.remove('border-gray-300');
1613
+ setupElements.pusher.classList.add('bg-green-500', 'border-green-500');
1614
+ setupElements.pusher.innerHTML = '<i class="fas fa-check text-white text-xs"></i>';
1615
+ } catch (error) {
1616
+ setupElements.pusher.classList.remove('border-gray-300');
1617
+ setupElements.pusher.classList.add('bg-red-500', 'border-red-500');
1618
+ setupElements.pusher.innerHTML = '<i class="fas fa-times text-white text-xs"></i>';
1619
+ }
1620
+ }, 2000);
1621
+
1622
+ // 3. Setup HuggingFace
1623
+ setTimeout(async () => {
1624
+ try {
1625
+ const response = await fetch('/api/setup/huggingface', {
1626
+ method: 'POST',
1627
+ headers: {'Content-Type': 'application/json'},
1628
+ body: JSON.stringify({email: document.getElementById('setupEmail').value})
1629
+ });
1630
+ const data = await response.json();
1631
+ localStorage.setItem('hfKey', data.apiKey);
1632
+ setupElements.huggingFace.classList.remove('border-gray-300');
1633
+ setupElements.huggingFace.classList.add('bg-green-500', 'border-green-500');
1634
+ setupElements.huggingFace.innerHTML = '<i class="fas fa-check text-white text-xs"></i>';
1635
+
1636
+ // Initialize AI with car wash knowledge
1637
+ initializeAIWithKnowledge();
1638
+ } catch (error) {
1639
+ setupElements.huggingFace.classList.remove('border-gray-300');
1640
+ setupElements.huggingFace.classList.add('bg-red-500', 'border-red-500');
1641
+ setupElements.huggingFace.innerHTML = '<i class="fas fa-times text-white text-xs"></i>';
1642
+ }
1643
+ }, 3000);
1644
+
1645
+ // 4. Setup Twilio
1646
+ setTimeout(async () => {
1647
+ try {
1648
+ localStorage.setItem('twilioVerified', 'true');
1649
+ setupElements.twilio.classList.remove('border-gray-300');
1650
+ setupElements.twilio.classList.add('bg-green-500', 'border-green-500');
1651
+ setupElements.twilio.innerHTML = '<i class="fas fa-check text-white text-xs"></i>';
1652
+
1653
+ // Configure call answering
1654
+ configureCallAnswering();
1655
+ } catch (error) {
1656
+ setupElements.twilio.classList.remove('border-gray-300');
1657
+ setupElements.twilio.classList.add('bg-red-500', 'border-red-500');
1658
+ setupElements.twilio.innerHTML = '<i class="fas fa-times text-white text-xs"></i>';
1659
+ }
1660
+ }, 4000);
1661
+
1662
+ // 5. Complete Setup
1663
+ setTimeout(() => {
1664
+ setupElements.env.classList.remove('border-gray-300');
1665
+ setupElements.env.classList.add('bg-green-500', 'border-green-500');
1666
+ setupElements.env.innerHTML = '<i class="fas fa-check text-white text-xs"></i>';
1667
+ document.getElementById('setupComplete').classList.remove('hidden');
1668
+ finishBtn.disabled = false;
1669
+
1670
+ // Save setup completion
1671
+ localStorage.setItem('setupComplete', 'true');
1672
+ document.getElementById('callNumber').value = localStorage.getItem('verifiedNumber') || '+15622289429';
1673
+ }, 5000);
1674
+
1675
+ =======
1676
  setTimeout(() => {
1677
  setupElements.trillion.classList.remove('border-gray-300');
1678
  setupElements.trillion.classList.add('bg-green-500', 'border-green-500');
prompts.txt CHANGED
@@ -1 +1,6 @@
1
- Do this for me. Go to Settings > Phone Integration 2. Enter your Twilio credentials: - Account SID: your_twilio_sid - Auth Token: your_twilio_token - Phone Number: 15622289429
 
 
 
 
 
 
1
+ Do this for me. Go to Settings > Phone Integration 2. Enter your Twilio credentials: - Account SID: your_twilio_sid - Auth Token: your_twilio_token - Phone Number: 15622289429
2
+ Go to Settings > Phone Integration 2. Enter your Twilio credentials: - Account SID: your_twilio_sid - Auth Token: your_twilio_token - Phone Number: 15622289429
3
+ Call failed: Can't find variable: trillionClient
4
+ Make sure everything is working. Make sure I get no error codes of if I do fix them. Remove any codes that conflict . Remember once I do my checklist and i itiwl
5
+ Make sure everything is working. Make sure I get no error codes of if I do fix them. Remove any codes that conflict and may be stopping this from working . Remember once I do the wizard , to automatically update the code and do what it says it’s doing instead of just being visual. I don’t want to make outgoing calls from my phone for testing because the only timr this makes outgoing calls is when I’m testing it . It’s ole
6
+ Make sure everything is working. Make sure I get no error codes of if I do fix them. Remove any codes that conflict and may be stopping this from working . Remember once I do the wizard , to automatically update the code and do what it says it’s doing instead of just being visual. I don’t want to make outgoing calls from my phone for testing because the only timr this makes outgoing calls is when I’m testing it . This apps purposes isn’t to call people but instead answer my calls and respond to my texts . Fix all errors . Add a button named fixes and if you can’t do it then explain on the fixes page