Commit Graph

15 Commits

Author SHA1 Message Date
48c2b21dad procesar bien el primer mensaje de voz ya no enreda al proceso de manejo de la conversacion. probablemente necesitemos refactorizar todo este codigo eventualmente 2025-06-06 21:41:56 -06:00
d2fec7fb4e la transcripcion de audios funciona incluso cuando se reinicia el objeto conversation 2025-06-06 21:28:15 -06:00
google-labs-jules[bot]
2ea837c2ae Refactor: Modularize whatsapp-router interactions
This commit introduces a significant refactoring to the whatsapp-router service to improve modularity and extend its capabilities for interacting with OpenWA (nucleo-whatsapp).

Key changes include:

1.  **Message Processing Logic**:
    *   Created a new `messageProcessor.ts` module.
    *   Moved message mapping (`mapWhatsAppMessageToMsg`), message addition to conversations (`processIncomingMessageForConversation`), and audio transcription handling (`handleAudioMessageTranscription`) into this new module.
    *   Updated `store/conversation.ts` and `webhook.ts` to utilize `messageProcessor.ts`, streamlining their responsibilities.

2.  **OpenWA Client (`nucleoClient.ts`)**:
    *   Introduced `nucleoClient.ts`, a dedicated module for encapsulating API calls to OpenWA.
    *   Implemented functions for various OpenWA commands:
        *   Sending text, image, and file messages.
        *   Fetching chat and contact information.
        *   Creating groups.
        *   Managing the blocklist (get, block, unblock).
        *   Listing all chats and fetching messages for a specific chat.
    *   Includes error handling and basic typing for API responses.

3.  **New API Endpoints (`routes/nucleoActions.ts`)**:
    *   Created `nucleoActions.ts` to expose the functionalities of `nucleoClient.ts` via a new set of HTTP API endpoints.
    *   Endpoints cover all implemented client functions, with request validation and robust error handling.
    *   These routes are grouped under the `/nucleo` base path.

4.  **Route Registration**:
    *   Registered the new `/nucleo` routes in the main `index.ts` file.

5.  **Conversation Store and Routes Review**:
    *   Reviewed and confirmed that `store/conversation.ts` and `routes/conversations.ts` are correctly integrated with the new `messageProcessor.ts` and remain focused on their core responsibilities.

This refactoring enhances the structure of `whatsapp-router`, making it easier to maintain and extend. It also provides a comprehensive set of API endpoints for more granular control over OpenWA functionalities.
2025-06-07 02:49:50 +00:00
603322258a corregidas imcompativilidades despues del merge
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m4s
2025-06-06 14:57:53 -06:00
3bd2922e9d arregladas incompatibilidades despues del merge, y ahora ya funciona bien esta vaina 2025-06-06 14:55:08 -06:00
54ef965009 Revert "Merge branch 'main' of https://github.com/josedario87/conversation-layer"
This reverts commit b508bea3dd, reversing
changes made to 4c4052bb64.
2025-06-06 14:49:34 -06:00
b508bea3dd Merge branch 'main' of https://github.com/josedario87/conversation-layer
Some checks failed
Deploy conversation layer / deploy (push) Failing after 1m13s
2025-06-06 14:48:01 -06:00
5e5c7cd556 ya se puede transcribir mensajes y recibirlos en el agent 2025-06-06 14:43:42 -06:00
4c4052bb64 regresado a la vida el router
All checks were successful
Deploy conversation layer / deploy (push) Successful in 20s
2025-06-05 23:05:59 -06:00
9a6dfa9471 Merge branch 'main' of https://github.com/josedario87/conversation-layer
Some checks failed
Deploy conversation layer / deploy (push) Failing after 6s
2025-06-05 18:34:56 -06:00
josedario87
cced5b37d9 Include bot messages from webhook 2025-06-05 18:29:57 -06:00
fff921df0a se incluye al propio agente usuario de la cuenta de whatsapp dentro del convo, se actualiza system prompt para el agent
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-05 15:24:18 -06:00
josedario87
624d06530e Implement conversation snapshot structure 2025-06-05 14:25:20 -06:00
josedario87
84798a014f Add debug logging for conversation routes and store 2025-06-05 13:58:54 -06:00
josedario87
e135868cb7 Update handlers to receive conversation objects 2025-06-05 10:01:28 -06:00