Commit Graph

181 Commits

Author SHA1 Message Date
VPS 4 Deploy Agent a1a3b97eaa chore(infra): bump scoreodonto.com -> a383fc7 (login teal, home, endereço, biomédico)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 05:09:37 +02:00
VPS 4 Deploy Agent 518b5f8b92 chore(infra): bump scoreodonto.com -> 76f8fa6 (login remodelado)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 04:32:39 +02:00
VPS 4 Deploy Agent 10ba9260d4 chore(infra): bump scoreodonto.com -> d9eae3d (versão V1.0.12)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 03:28:15 +02:00
VPS 4 Deploy Agent 7cae226033 chore(infra): bump scoreodonto.com -> 17f83e5 (gate de endereço nos marketplaces)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 03:23:38 +02:00
VPS 4 Deploy Agent 1be581b227 chore(infra): bump scoreodonto.com -> bbbe370 (auto-reload anti-tela-branca)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 02:55:20 +02:00
VPS 4 Deploy Agent 0dd5374925 chore(infra): bump scoreodonto.com -> df7678f (plugins catálogo superadmin-only)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 01:28:48 +02:00
VPS 4 Deploy Agent 108363a571 chore(infra): bump scoreodonto.com -> fb7825f (origem automática por proximidade)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 01:27:53 +02:00
VPS 4 Deploy Agent cc4cdf96dd chore(infra): bump scoreodonto.com -> 503359e (geo/raio PostGIS)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 23:18:58 +02:00
VPS 4 Deploy Agent 0a190be2e3 chore(infra): bump scoreodonto.com -> cb00d9f (ViaCEP + menus por papel + fix preview)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 20:20:58 +02:00
VPS 4 Deploy Agent 90f4a1e5d0 chore(infra): bump instrucoes_gerais -> 5398006 (doc GITEA-COMMANDS)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 15:30:45 +02:00
VPS 4 Deploy Agent 267b7c49f1 chore(infra): bump scoreodonto.com -> ca7eba4 (Salas add-on por conta + preview biomédico)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 15:19:11 +02:00
VPS 4 Deploy Agent 3a836ebf85 chore(infra): bump scoreodonto.com -> reconciliação onboarding+plugins (98728b4)
Aponta para o merge de reconciliação no scoreodonto.com (branch
reconcile-onboarding-plugins): linha local (onboarding/plugins/RX) já
contendo o trabalho do origin/main (multi-tenancy/score/imports).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 13:49:24 +02:00
VPS 4 Deploy Agent 2d9d1670a4 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-18 03:54:35 +02:00
VPS 4 Deploy Agent 5876b783b0 feat(backend): add dynamic CORS origin validator supporting newwhats.clube67.com and subdomains
continuous-integration/webhook Deploy de clube67_newwhats.local concluido com sucesso (VPS 4)
2026-05-18 03:52:34 +02:00
VPS 4 Deploy Agent 48ec69d89a chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-18 03:50:18 +02:00
VPS 4 Deploy Agent 0364f251f1 chore(infra): update instrucoes_gerais submodule pointer
continuous-integration/webhook Deploy de clube67_newwhats.local concluido com sucesso (VPS 4)
2026-05-18 03:48:10 +02:00
VPS 4 Deploy Agent 8cbdcc9e57 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-18 03:41:40 +02:00
VPS 4 Deploy Agent 2f8c04a0a7 chore(ops): restore all source files in newwhats.clube67.com
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)
2026-05-18 03:28:29 +02:00
VPS 4 Deploy Agent 52f73753e7 chore(ops): cleanly purge old clube67 folder references
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)
2026-05-18 03:27:37 +02:00
VPS 4 Deploy Agent 0dc5eefa06 chore(ops): restore missing root files in newwhats.clube67.com
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)
2026-05-18 03:27:25 +02:00
VPS 4 Deploy Agent 5ec6bd6354 chore(ops): migrate clube67 to newwhats.clube67.com directory
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)
2026-05-18 03:26:41 +02:00
VPS 4 Deploy Agent 298b1c64b0 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-15 06:14:24 +02:00
VPS 4 Builder 6534781ad6 docs: adicionar obrigatoriedade de git pull no Passo 1 do protocolo de agentes
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
2026-05-15 06:12:00 +02:00
VPS 4 Deploy Agent 84f132d4ca chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-13 07:58:09 +02:00
ruicesar 9efc2e7394 feat(self-healing): support dynamic repository based on alert label
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
2026-05-13 07:56:07 +02:00
VPS 4 Deploy Agent 4a9ebb5992 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 06:30:41 +02:00
VPS 1 Deploy Agent e6ef64e7e9 feat(soc): add secure external domain routing and fully local grafana dashboards provisioning
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
2026-05-12 06:28:44 +02:00
VPS 4 Deploy Agent bc51697218 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 06:24:50 +02:00
Rui b7541eb248 docs(protocolo): adiciona governança de alteração estrutural e idioma português
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
2026-05-12 06:22:51 +02:00
VPS 4 Deploy Agent b9b094fb62 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 06:17:37 +02:00
Rui 599d8339ef docs: adiciona guia de auto-cura à wiki
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
2026-05-12 06:15:32 +02:00
VPS 4 Deploy Agent c0af1bc9b8 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 05:37:25 +02:00
VPS 4 Deploy Agent cabf9180f0 fix(secretaria): SEC-06/07/14 — provider OpenAI, telemetria e digitando...
SEC-06: ChatbotService reescrito com abstração aiCall() que despacha para
  GEMINI ou OPENAI baseado em bot.credential.provider. Fallback automático:
  se o provider primário falha (quota, rate limit), tenta a próxima credencial
  da instância com provider diferente.

SEC-07: Divergência entre LLMProvider Prisma (GEMINI/OPENAI) e Secretária
  (gemini/openai/anthropic/ollama) documentada com comentário explícito no
  topo do service. Chatbot Rápido é intencionalmente mais simples.

SEC-13 (bônus): logger.info no ChatbotService agora inclui inputTokens e
  outputTokens por chamada para observabilidade de consumo.

SEC-14: sendPresenceUpdate('composing', jid) antes de chamar a IA e
  sendPresenceUpdate('paused', jid) após enviar a resposta — tanto no
  ChatbotService quanto no listener ext:message.new da Secretária.
  O usuário no WhatsApp vê "digitando..." enquanto a IA processa.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 05:35:45 +02:00
VPS 4 Deploy Agent f8c0a0ea52 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 05:31:26 +02:00
VPS 4 Deploy Agent fc37a54376 fix(secretaria): corrige 7 inconsistências do issue #14
SEC-01+SEC-11: /secretaria/ask agora envia reply via WhatsApp (sock.sendMessage)
  e persiste a mensagem no banco Prisma após brain.chat(), com notify Socket.IO.

SEC-02+SEC-03: MessageHandler emite hookBus 'ext:message.new' para todo msg
  recebido. Listener no ext-api auto-dispara a Secretária apenas se NÃO
  houver AIBot ativo na instância (exclusão mútua — chatbot tem prioridade).

SEC-04: ChatListItem exibe ícone BotOff (âmbar) quando chat.bot_paused = true,
  com tooltip "Bot pausado — aguardando atendente".

SEC-05: chatToLegacy() mapeia c.botPaused → bot_paused na bridge legada.
  NewWhatsChat recebe campo bot_paused opcional.

SEC-08: POST /secretaria/ask valida que existe instância CONNECTED antes
  de criar conversa. Retorna 503 se nenhuma instância disponível.

SEC-10: POST /api/chatbot/bots/:instanceId valida que credentialId pertence
  ao mesmo tenantId antes de criar o bot. Retorna 403 se não pertencer.

SEC-12: chatBotState.resumeBot() limpa botSummary (= null) ao retomar,
  evitando contexto defasado após escalação humana.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 05:29:29 +02:00
VPS 4 Deploy Agent 5f23c51e17 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 05:19:08 +02:00
VPS 4 Deploy Agent e6a1ab9af5 fix(soc): trazer configs do Grafana/Promtail para o git e corrigir volumes
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
- Adiciona soc/promtail/config.yml (antes fora do git, em /opt/soc/)
- Adiciona soc/grafana/provisioning/alerting/alerts.yml (antes fora do git)
- Adiciona soc/grafana/provisioning/datasources/datasources.yml (antes fora do git)
- Corrige docker-compose.yml: volumes do Promtail e Grafana agora apontam
  para paths dentro do repo (/home/deploy/stack/soc/) ao invés de /opt/soc/
- Corrige mount dos containers Docker: host path mapeia para /var/lib/docker/containers
  (path padrão que o Promtail espera dentro do container)
- Corrige .gitignore: ignora apenas dados binários (grafana-data, loki-data, prom-data),
  não mais todos os subdiretórios do soc/
- Alertas Loki usam count_over_time() para retornar métrica numérica compatível
2026-05-12 05:16:21 +02:00
VPS 4 Deploy Agent 7e1591303a chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 05:04:18 +02:00
VPS 4 Deploy Agent bff325f193 feat(soc): add Docker container log collection to Promtail + app alert rules
- Mount rootless Docker socket and container log path into Promtail so it
  can discover and tail all application container logs via docker_sd_configs
- Add 3 application-level Grafana alert rules targeting newwhats-backend-prod:
  - BACKEND - Exceção Não Tratada (unhandledRejection, TypeError, etc.)
  - BACKEND - Colisão Prisma P2002 (unique constraint violations)
  - BACKEND - Erros HTTP 5xx (5xx response codes)
- Wire default notification policy to gitea-bridge (was routing to "empty")
- Full self-healing pipeline now covers: infra alerts + application runtime errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 05:02:04 +02:00
VPS 4 Deploy Agent 2f906b1d40 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 03:59:59 +02:00
VPS 4 Deploy Agent 12268c24ab fix(history): salva mediaPayload em processHistoryBatch + recupera msgs antigas
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
processHistoryBatch não incluía mediaPayload no createMany, tornando
impossível o re-download de mídias recebidas via history sync (que é a
maioria das mensagens ao reconectar a sessão).

1. Inclui mediaPayload no objeto de cada row para mensagens de mídia.
2. Após o createMany, dispara updateMany para preencher mediaPayload em
   registros que já existiam no DB com o campo null (mensagens antigas
   recebidas antes desta correção), sem bloquear o event loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 03:58:13 +02:00
VPS 4 Deploy Agent 1efc0ab1d1 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 03:33:56 +02:00
VPS 4 Deploy Agent 4efa6fb2f2 fix(media): aplica estado 'não disponível' a imagem, vídeo, documento e sticker
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
Estende o tratamento de erro 400/404 do redownload para todos os tipos
de mídia. Quando mediaUnavailable=true (payload ausente no backend),
cada tipo exibe sua mensagem específica e desabilita o clique:
- Imagem: 'Imagem não disponível'
- Vídeo: 'Vídeo não disponível'
- Documento: 'Arquivo não disponível' + cursor-default
- Sticker: 'Figurinha não disponível'
DocumentBubble recebe nova prop mediaUnavailable para controle interno.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 03:32:02 +02:00
VPS 4 Deploy Agent a3c78aed8c chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 03:28:29 +02:00
VPS 4 Deploy Agent 5fb9a8f34a fix(audio): trata erro 400/404 no redownload com estado 'Áudio não disponível'
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
Mensagens antigas sem mediaPayload retornam 400 do backend (sem como
re-solicitar ao WhatsApp). O erro agora é capturado em handleRedownload,
que seta mediaUnavailable=true — o botão fica desabilitado e exibe
'Áudio não disponível' em vez de explodir com Uncaught (in promise).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 03:26:29 +02:00
VPS 4 Deploy Agent 0af0eba663 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 03:22:07 +02:00
VPS 4 Deploy Agent 634426ed15 fix(audio): corrige redownload de áudio + move botão de velocidade antes do waveform
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
1. MessageArea: handleRedownloadMedia usava selectedChat?.instanceId (undefined
   no formato legado) — substituído por instance_name ?? instanceId. O clique
   em 'Toque para baixar áudio' agora chama o backend corretamente.

2. MessageBubble/AudioBubble: botão de velocidade (1×/1.5×/2×) movido para
   entre o botão play e as barras do waveform, conforme layout do WhatsApp.
   A linha inferior agora exibe apenas o tempo decorrido.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 03:19:48 +02:00
VPS 4 Deploy Agent 5b3259d705 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-12 03:13:00 +02:00
VPS 4 Deploy Agent 9d082a17e4 fix(whatsapp): mensagens do celular perdidas para contatos @lid + crash P2002
continuous-integration/webhook Deploy concluido com sucesso (VPS 4)
Três correções independentes para mensagens enviadas/recebidas via celular:

1. WhatsAppConnectionManager: o listener CB:message agora captura também
   recipient_pn (InfiniteAPI v7+) além de peer_recipient_pn (Baileys oficial),
   garantindo que o PN correto do destinatário seja gravado no peerRecipientHints
   antes do messages.upsert ser emitido.

2. MessageHandler.processMessage: adicionado fast path fromMe=false via
   remoteJidAlt para contatos @lid (InfiniteAPI já resolve o PN do remetente).
   Para fromMe=true onde InfiniteAPI resolveu @lid→nosso próprio JID incorretamente,
   recupera o JID correto via peerRecipientHints antes de descartar como self-chat.

3. MessageHandler.processHistoryBatch: corrigido guard senderPn que não testava
   !msg.key.fromMe; para mensagens enviadas, senderPn é o nosso próprio JID,
   não o destinatário — o que criava self-chats corrompidos no DB.

4. whatsapp.send.routes: adicionado .catch P2002 no upsert da rota POST /send;
   race condition com eco Baileys causava unhandled rejection → exit(1) no Node 20.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 03:10:56 +02:00
VPS 4 Deploy Agent ab688b7ef8 chore(deploy): bump version
continuous-integration/webhook Ignorado: bump version
2026-05-11 23:31:54 +02:00