Integrate WhatsApp connectivity through the wacli CLI, paired as a Wh… - #73
Open
arefbehboudi wants to merge 5 commits into
Open
Integrate WhatsApp connectivity through the wacli CLI, paired as a Wh…#73arefbehboudi wants to merge 5 commits into
arefbehboudi wants to merge 5 commits into
Conversation
…atsApp Web linked device. JavaClaw supervises wacli sync as a subprocess and receives inbound messages over a local webhook, replying with wacli send. WacliSyncSupervisor: launches and restarts the sync subprocess with exponential backoff and health-based retry reset. WhatsAppWebhookController: handles inbound webhooks, gates on the allowed chat JID, and processes messages off the request thread. WacliWhatsAppChannel: sends replies and suppresses echoes of the agent's own outbound messages by message ID. WhatsAppOnboardingProvider: onboarding step for install/pair/config. Wire the plugin into the build and document setup in the README.
Fold the wacli command line into WhatsApp so it is the only class that knows wacli exists. Everything else talks to it: WhatsApp the chat we talk in: send, receive, list WacliSync keeps the 'wacli sync' subprocess alive WhatsAppChannel puts the agent behind it WhatsAppWebhookController answers wacli, hands over the message WacliSync no longer knows what wacli is: it takes a ProcessStarter, a Clock and a restart delay, which also lets its tests drive the restarts without really waiting. Refuse group chats. The assistant authorises by chat, so pointing it at a group let every member instruct an agent that can run shell commands. Onboarding now accepts one-to-one JIDs only, and the SenderJID field that nothing ever read is gone rather than left looking like a check. Pick the chat by name during onboarding, from 'wacli chats list'. WhatsApp issues opaque @lid identifiers that cannot be derived from a phone number, so asking people to type a JID did not work for many chats. Drop the wacli-path property and take wacli from the PATH; the onboarding page claimed to store it and never did. Move the Brave step to @order(56) so WhatsApp keeps 55.
Spring Modulith only treats types in a module's root package as its API, so ai.javaclaw.utils.threads.NamedThreadFactory was internal to the utils module and the WhatsApp webhook controller could not use it. Move it up to ai.javaclaw.utils, alongside how ai.javaclaw.cli.CliRunner is already reachable from plugins. Fixes ModularityTests, which arrived on main after this branch started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…atsApp Web linked device. JavaClaw supervises wacli sync as a subprocess and receives inbound messages over a local webhook, replying with wacli send.
WacliSyncSupervisor: launches and restarts the sync subprocess with exponential backoff and health-based retry reset. WhatsAppWebhookController: handles inbound webhooks, gates on the allowed chat JID, and processes messages off the request thread. WacliWhatsAppChannel: sends replies and suppresses echoes of the agent's own outbound messages by message ID. WhatsAppOnboardingProvider: onboarding step for install/pair/config. Wire the plugin into the build and document setup in the README.
Closes #52