Commit Graph
255 Commits
Author SHA1 Message Date
LizandroandClaude Sonnet 4.6 75eddd16a6 feat: make Gemini model configurable + auto-list available models on error
- gemini_model is now a saved config field (default: gemini-2.0-flash)
- Config panel shows a text input to set the model name
- probarGemini() reads the configured model and on error calls ListModels
  to show exactly which model names are available for the account's API key
- GeminiIntentService and GeminiVisionService build the URL from config at runtime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 20:11:32 +00:00
LizandroandClaude Sonnet 4.6 13386f5b49 feat: add Gemini connection test button in config panel
probarGemini() sends a minimal prompt to gemini-1.5-flash and reports
latency + trimmed response text, or the error message from the API.
Mirrors the existing Whisper test button pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:35:16 +00:00
LizandroandClaude Sonnet 4.6 19667da4e9 Fix ia-logs view to use x-app-layout component instead of @extends
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:22:46 +00:00
LizandroandClaude Sonnet 4.6 44297aa0bb Add AI usage logs for Gemini and Whisper
- Migration + AiUsageLog model with tokens, duration, time, cost fields
- GeminiIntentService and GeminiVisionService log every API call
  with input/output token counts from usageMetadata and response time
- TelegramBotService logs Whisper calls with audio duration (from Telegram)
  and calculates cost at $1/second
- Whisper voice duration now passed from TelegramWebhookController
- Free text in Telegram now tries Gemini intent detection before showing menu
- /chat/ia-logs: Livewire component with summary cards + filterable table
- Whisper connection test button in config panel
- "Logs IA" link added to Chat/Bot nav section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:13:59 +00:00
LizandroandClaude Sonnet 4.6 ff109a5608 Move Correo/IMAP to Chat/Bot module, hide WhatsApp nav
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:06:38 +00:00
LizandroandClaude Sonnet 4.6 f39f3d4045 Add Whisper voice transcription to Telegram bot
- handleVoice() downloads Telegram audio and transcribes via Whisper API
- transcribeAudio() calls Whisper with Basic Auth, handles json response
- TelegramWebhookController now routes message.voice and message.audio
- Whisper URL, token and toggle configurable from admin config panel
- Transcribed text echoed back to user then processed as normal text intent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 19:00:57 +00:00
LizandroandClaude Sonnet 4.6 758b365b7f fix: file upload allows camera + gallery, images only (remove capture attr)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 15:01:22 +00:00
LizandroandClaude Sonnet 4.6 d4121ac435 feat: copy button for Bre-B llave with visual feedback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 14:51:11 +00:00
LizandroandClaude Sonnet 4.6 26953c9dd5 feat: smart scroll — keep position when reading, badge for new messages
- Add pollMensajes() so wire:poll no longer force-scrolls to bottom
- MutationObserver detects new DOM nodes: auto-scrolls only if user
  is already at the bottom (within 80px threshold)
- Floating '↓ N mensaje nuevo' badge appears when new bot messages
  arrive while user is scrolled up; tap badge to jump to bottom
- scroll-chat event (emitted on button clicks/sends) still forces
  scroll since the user just took an action

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 13:36:31 +00:00
LizandroandClaude Sonnet 4.6 2fc2aba8a3 feat: Telegram transactional flows + role pricing + services slider
- New TelegramBotService: full OTP auth, registration, main menu with
  inline keyboards, buy plans, buy promos, recharge (MP + Bre-B),
  credentials, history, profile, agent transfer, photo receipt analysis
- TelegramWebhookController: now handles text, callback_query and photo
- Role-based pricing: tarifas filtered by user rol_id in both web chat
  and Telegram; Preferencial price overrides base tarifa valor
- Services and promos now render as horizontal scroll slider
  (cards_slider tipo_ui) instead of stacked individual cards

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 04:36:03 +00:00
LizandroandClaude Sonnet 4.6 a3bd91c204 fix(chat): scroll móvil + input no desaparece al teclear
- Wrapper del chat: flex-1 + min-h-0 (en vez de h-full) para scroll correcto
- Área de mensajes: min-h-0 explícito — crítico para que flex-1 haga scroll en iOS/Android
- Input: flex-shrink:0 inline para reforzar que nunca se comprima
- visualViewport: usa requestAnimationFrame para scroll más suave, elimina listener scroll

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 02:34:48 +00:00
LizandroandClaude Sonnet 4.6 a9d8253800 fix(chat): menú no se repite + responsive corregido
- abrirChat(): mueve cargarMensajes() al final (después de crear mensajes en DB)
- abrirChat(): siempre agrega saludo+menú al autenticarse (no hay duplicación
  porque mount() no llama a abrirChat())
- mount(): solo restaura estado desde sesión, sin agregar mensajes nuevos
- public-chat.blade.php: root div recupera flex flex-col (flex-1 en hijos funciona)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:32:29 +00:00
LizandroandClaude Sonnet 4.6 d27bd1c0d7 fix(chat): sesión persistente entre recargas + responsive móvil/desktop
- mount(): restaura userId y convId desde sesión Laravel al recargar página
- abrirChat(): guarda chat_user_id y chat_conv_id en sesión
- cerrarSesion(): limpia la sesión correctamente
- Desktop: chat centrado como frame (420px, bordes redondeados, sombra)
- Móvil: pantalla completa sin restricción de ancho
- teclado virtual: ajuste de altura solo en móvil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:22:23 +00:00
LizandroandClaude Sonnet 4.6 4ddfdaeecc fix(chat): renombrar transferencia bancaria a Bre-B y clave a llave
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:18:09 +00:00
LizandroandClaude Sonnet 4.6 9b76f63aa0 feat(chat): recarga con transferencia bancaria, fix OTP y mejoras UI
- Fix: autocomplete="off" en campo OTP (evita que el correo aparezca ahí)
- Recarga: nuevo paso elegir método (MercadoPago o Transferencia bancaria)
- Transferencia: muestra card con banco/clave/titular/monto y aviso de comprobante
- Validación automática al enviar foto del comprobante (flujo existente)
- Config admin: nuevos campos banco/clave/titular para transferencia
- UI: card de banco con estilo diferenciado (azul), aviso destacado en ámbar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:16:51 +00:00
LizandroandClaude Sonnet 4.6 9d0940873d feat(chat): botón cerrar sesión en el header del chat
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:08:46 +00:00
LizandroandClaude Sonnet 4.6 5f06c27869 feat(chat): pedir cédula y celular al crear cuenta desde el chat
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:06:05 +00:00
LizandroandClaude Sonnet 4.6 a693ce2527 feat(chat): identificación por correo con registro automático
- Reemplaza campo teléfono por correo electrónico en el inicio del chat
- Si el correo existe: envía OTP y abre el chat
- Si no existe: ofrece crear cuenta automáticamente (pide nombre)
- Si rechaza registro: vuelve al formulario inicial
- Cuenta nueva se crea con contraseña aleatoria

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 01:03:24 +00:00
LizandroandClaude Sonnet 4.6 536377363c feat: web chat con IA, validación de pagos y OTP por correo
- Chat público en /chat con flujos de compra, recarga y credenciales
- Verificación de identidad por código OTP enviado al correo registrado
- Botones enriquecidos: cards, links, credenciales, validación de comprobante
- Gemini IA para detección de intención en texto libre
- Gemini Vision para extraer datos de foto de comprobante
- Validador de pagos cruzando IA con correos IMAP (Bancolombia)
- MercadoPago como pasarela de pago (reemplaza Wompi en el chat)
- Migraciones: payload en chat_messages, user_id en chat_contacts
- Config admin: API key Gemini, toggles IA y validación de foto

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 00:09:31 +00:00
Lizandro Guarnizo a56a69dccb up 2026-06-18 13:04:07 -05:00
Lizandro Guarnizo 9066229e3a up 2026-06-18 12:56:20 -05:00
Lizandro Guarnizo a7f8d7bfba Update show-promociones.blade.php 2026-06-18 12:46:11 -05:00
Lizandro Guarnizo 0282645c08 nuevo formulario 2026-06-18 11:06:49 -05:00
Lizandro Guarnizo abd3a90962 up 2026-05-12 20:35:10 -05:00
Lizandro Guarnizo e9948d93f7 up 2026-05-12 20:25:57 -05:00
Lizandro Guarnizo e8f003cfb7 up 2026-05-12 20:22:43 -05:00
Lizandro Guarnizo 011bf0fbca up 2026-04-30 21:40:55 -05:00
Lizandro Guarnizo f61e8005fc chatbot nuevo 2026-04-30 21:32:32 -05:00
Lizandro Guarnizo 0e5ff957eb up 2026-04-25 15:04:50 -05:00
Lizandro Guarnizo fa1f4bc581 up 2026-04-25 14:55:11 -05:00
Lizandro Guarnizo 2228818c85 up 2026-04-25 14:54:19 -05:00
Lizandro Guarnizo bbf34d08d0 correo 2026-04-25 14:47:20 -05:00
Lizandro Guarnizo c56cd218fa Update navigation.blade.php 2026-04-24 21:44:26 -05:00
Lizandro Guarnizo 148fa6b9f9 up 2026-04-24 21:40:10 -05:00
Lizandro Guarnizo 877a0d393a up 2026-04-21 18:32:01 -05:00
Lizandro Guarnizo e6f749e059 ip 2026-04-21 18:27:16 -05:00
Lizandro Guarnizo 91684cd3fa Update show-recarga.blade.php 2026-04-21 18:19:48 -05:00
Lizandro Guarnizo 9108a584cf up 2026-04-18 20:07:42 -05:00
Lizandro Guarnizo 535e10f714 Revert "up"
This reverts commit 5b0e4eff91.
2026-04-18 19:05:23 -05:00
Lizandro Guarnizo 5b0e4eff91 up 2026-04-18 19:04:34 -05:00
Lizandro Guarnizo c3f1eda346 up 2026-04-18 18:58:27 -05:00
Lizandro Guarnizo 0025d46a34 up 2026-04-18 18:53:37 -05:00
Lizandro Guarnizo 63c68bc93d Update show-usuarios.blade.php 2026-04-18 18:49:31 -05:00
Lizandro Guarnizo 50a579ca81 Update show-usuarios.blade.php 2026-04-18 18:45:42 -05:00
Lizandro Guarnizo d3676d54de Update show-usuarios.blade.php 2026-04-18 18:42:45 -05:00
Lizandro Guarnizo d7595c133c Reapply "Update navigationup.blade.php"
This reverts commit eed5c1c8e0.
2026-04-18 14:24:53 -05:00
Lizandro Guarnizo eed5c1c8e0 Revert "Update navigationup.blade.php"
This reverts commit 3b919ac8a9.
2026-04-18 14:24:06 -05:00
Lizandro Guarnizo 3b919ac8a9 Update navigationup.blade.php 2026-04-18 14:18:52 -05:00
Lizandro Guarnizo 03207775af up 2026-04-18 14:08:14 -05:00
Lizandro Guarnizo 9a418caf39 Update show-usuarios.blade.php 2026-04-18 13:58:16 -05:00