Commit Graph

101 Commits

Author SHA1 Message Date
c3662798e9 agregado cors para todo *.interno.com
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m56s
2025-06-11 23:22:11 -06:00
josedario87
3593c34fe6 Merge pull request #21 from josedario87/codex/add-sse-connection-to-whatsapp-router
Refactor SSE log streaming
2025-06-11 23:10:45 -06:00
7f0861ae77 ahora tambien enruta mensajes enviados por chatUI 2025-06-11 23:09:38 -06:00
2287333965 agregado cors para recibir peticiones de otros endpoints distintos 2025-06-11 20:18:41 -06:00
josedario87
ad5bfc788f Refactor SSE logging 2025-06-11 19:23:34 -06:00
josedario87
e7dea54592 Merge pull request #20 from josedario87/codex/implement-nucleo-whatsapp-api-functions
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m4s
Add new WhatsApp API routes and MCP tools
2025-06-07 11:15:16 -06:00
josedario87
2a999a1cb7 feat: support additional WhatsApp API functions 2025-06-07 10:52:21 -06:00
josedario87
fd74992f72 Merge pull request #19 from josedario87/codex/fix-broken-whatsapp-router-actions
All checks were successful
Deploy conversation layer / deploy (push) Successful in 1m59s
Fix WhatsApp router actions
2025-06-07 02:01:08 -06:00
40dcfe00e4 ya funciona al 80% el agent, es una pasada 2025-06-07 02:00:43 -06:00
josedario87
9c16fb55fa fix: align whatsapp routes with OpenWA docs 2025-06-07 00:49:41 -06:00
josedario87
c2ca4eb324 Merge pull request #18 from josedario87/feature/refactor-resources-add-delete-chat
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m14s
Feature/refactor resources add delete chat
2025-06-07 00:22:21 -06:00
acc7581169 cambios pequeños para refinar el codigo 2025-06-07 00:21:55 -06:00
google-labs-jules[bot]
546c654111 Refactor MCP resources to tools, add chat deletion
This commit implements two main changes based on your feedback:

1.  Refactors all Model Context Protocol (MCP) resources into tools:
    - In `whatsappIntegration.js`:
        - `whatsapp.chat` (resource) -> `whatsapp.list-chats` (tool) & `whatsapp.get-chat-details` (tool)
        - `whatsapp.contact` (resource) -> `whatsapp.get-contact-details` (tool)
        - `whatsapp.blocklist` (resource) -> `whatsapp.get-blocklist` (tool)
    - In `conversationIntegration.js`:
        - `conversation` (resource) -> `conversation.list-conversations` (tool) & `conversation.get-conversation-details` (tool)
    This change aligns with current Gemini SDK capabilities for MCP.

2.  Implements chat deletion functionality:
    - In `whatsapp-router`:
        - Added `deleteChat` function to `whatsappClient.ts`. This function calls an assumed OpenWA endpoint (`POST /deleteChat`) and will require verification against the actual OpenWA API.
        - Added a `DELETE /chats/:chatId` route to `whatsappActions.ts` that utilizes the new `deleteChat` client function.
    - In `conversation-layer-mcp`:
        - Added a new `whatsapp.delete-chat` tool to `whatsappIntegration.js`. This tool calls the new `DELETE /chats/:chatId` endpoint in `whatsapp-router`.

Additionally, the existing `conversation.delete` MCP tool was verified to be correctly implemented.
2025-06-07 05:49:44 +00:00
0671cc9445 renombrado nucleoClient y nucleoActions por whatsappCliente y whatsappActions
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m4s
2025-06-06 23:06:59 -06:00
781b4e809f Merge branch 'main' of https://github.com/josedario87/conversation-layer
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m13s
2025-06-06 21:43:31 -06:00
josedario87
a8fe62f5ed Merge pull request #17 from josedario87/refactor/whatsapp-router-interactions
Refactor/whatsapp router interactions
2025-06-06 21:43:11 -06:00
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
7eba5b2755 iniciada creacion del mcp
All checks were successful
Deploy conversation layer / deploy (push) Successful in 6s
2025-06-06 20:51:06 -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
b39db9ad06 tratando de guiar al agente de transcripcion de audio
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m11s
2025-06-06 15:40:21 -06:00
06fc6b2608 no se estan usando las gitea varibles secrets
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m7s
2025-06-06 15:33:05 -06:00
767585b421 cambiado nombre del secreto, gemini api key
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m3s
2025-06-06 15:28:10 -06:00
ea276d5d09 agregada variable para PLANILLA_AGENT
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m0s
2025-06-06 15:20:38 -06:00
2c85e1206b logs para saber las variables de entorno
All checks were successful
Deploy conversation layer / deploy (push) Successful in 2m2s
2025-06-06 15:07:51 -06:00
5055741ef4 desactivado mcp por el momenot para el agent
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-06 15:03:49 -06: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
josedario87
8316533167 Merge pull request #16 from josedario87/feat/whatsapp-audio-transcription
Feat/whatsapp audio transcription
2025-06-06 14:44:12 -06:00
5e5c7cd556 ya se puede transcribir mensajes y recibirlos en el agent 2025-06-06 14:43:42 -06:00
google-labs-jules[bot]
5f8ba127ae fix: Update audio download method for WhatsApp messages
This commit modifies the audio download process in `whatsapp-router/src/webhook.ts` to align with the updated nucleo-whatsapp API.

Previously, audio files were downloaded using a direct GET request to the file URL. This has been changed to a POST request to the `/downloadFileWithCredentials` endpoint provided by nucleo-whatsapp.

Key changes:
- Audio files are now downloaded by POSTing to `[OPEN_WA_URL]/downloadFileWithCredentials` with the audio file's URL in the request body.
- The `/downloadFileWithCredentials` endpoint returns a base64 encoded string directly, so the explicit base64 conversion step after downloading has been removed.

This change ensures compatibility with the correct API for fetching message media.
2025-06-06 17:40:56 +00:00
2880b7dbe9 cambiando dev variables 2025-06-06 11:28:21 -06:00
google-labs-jules[bot]
cfbe535747 Revert: Remove tests for WhatsApp audio transcription
This commit removes the Jest unit tests, configuration, and related dependencies that were added for the WhatsApp audio transcription feature.

This is done as per your request due to potential issues with the test execution environment.

The core functionality for audio transcription remains.
2025-06-06 17:19:47 +00: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
08f352a40d Merge pull request #14 from josedario87/codex/fix-whatsapp-router-message-handling
Fix own messages in whatsapp router
2025-06-05 18:31:41 -06:00
josedario87
cced5b37d9 Include bot messages from webhook 2025-06-05 18:29:57 -06:00
13d1dfe26b actualizado el agent a utilizar en el grupo planilla
All checks were successful
Deploy conversation layer / deploy (push) Successful in 19s
2025-06-05 15:40:30 -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
b66b037f1f Merge branch 'main' of https://github.com/josedario87/conversation-layer
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-05 14:36:22 -06:00
josedario87
c7dbaf9add Merge pull request #13 from josedario87/codex/create-conversation-object
Add conversation snapshot structure
2025-06-05 14:35:09 -06:00
021afb0cf9 conversation object es el nuevo que inicia al agent 2025-06-05 14:33:41 -06:00
josedario87
624d06530e Implement conversation snapshot structure 2025-06-05 14:25:20 -06:00
7c5d292d61 Merge branch 'main' of https://github.com/josedario87/conversation-layer
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-05 14:05:59 -06:00
josedario87
9acb48bb29 Merge pull request #12 from josedario87/codex/add-user-management-endpoints-to-whatsapp-router
Implement conversation-oriented handlers
2025-06-05 14:05:28 -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
00b1171595 usando el mcp siempre ya no se necesita lllamar /planilla
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-05 02:21:36 -06:00