Commit Graph

47 Commits

Author SHA1 Message Date
josedario87
2a999a1cb7 feat: support additional WhatsApp API functions 2025-06-07 10:52:21 -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
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
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
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
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
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
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
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
3904051af9 activando agent con mcp 2025-06-05 01:05:15 -06:00
fffbe6c313 convesation-layer-agent establecido 2025-06-05 00:34:57 -06:00
josedario87
cc6e378f8c Rename repo-agent to conversation-layer-agent 2025-06-05 00:10:10 -06:00
b154e74538 listo procesamiento y enrutamiento de mensajes de whatsapp 2025-06-04 23:45:48 -06:00
josedario87
37c4384dec fix webhook data parsing 2025-06-04 23:33:02 -06:00
41f6ace10a preparado entorno de desarrollo local
All checks were successful
Deploy conversation layer / deploy (push) Successful in 21s
2025-06-04 23:25:57 -06:00
986ded46f1 Merge branch 'main' of https://github.com/josedario87/conversation-layer
All checks were successful
Deploy conversation layer / deploy (push) Successful in 19s
2025-06-04 22:47:46 -06:00
715bcf03c2 mas logs
All checks were successful
Deploy conversation layer / deploy (push) Successful in 19s
2025-06-04 22:46:43 -06:00
3a2429486a trtando de lgoear el debug
All checks were successful
Deploy conversation layer / deploy (push) Successful in 19s
2025-06-04 22:36:06 -06:00
7abb14f311 log los eventos del webhook
All checks were successful
Deploy conversation layer / deploy (push) Successful in 19s
2025-06-04 22:16:17 -06:00
390c7da5fd aplicada la misma idea a todos los servicios
All checks were successful
Deploy conversation layer / deploy (push) Successful in 22s
2025-06-04 22:11:15 -06:00
josedario87
48fed42846 Merge branch 'main' into codex/change-repo-to-typescript-and-create-type-for-onmessage-even 2025-06-04 21:58:01 -06:00
josedario87
8d2e8f4854 Add HelloWorld debug agent and per-chat handler 2025-06-04 21:51:05 -06:00
josedario87
85d61c64b4 add handler mapping 2025-06-04 21:37:55 -06:00
josedario87
0836c086b2 docs: note TypeScript migration 2025-06-04 21:30:07 -06:00
dec4922d42 aumentada la cantidad de intentos antes de marcar la conexion como fallida
All checks were successful
Deploy conversation layer / deploy (push) Successful in 15s
2025-06-04 21:11:11 -06:00
josedario87
b51050a90a feat(router): manage webhook registration 2025-06-04 21:04:45 -06:00
josedario87
ca2384552c Add conversation layer services and compose setup 2025-06-04 18:45:25 -06:00