@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
22 lines • 1.14 kB
JavaScript
import { evolutionFormatAdapter } from './evolution_api.js';
/** `http://host:8080` → `http://host:8080/v1`; a url ending in `/v1`, `/v2`… as is. */
function whatsmiauBase(url) {
const trimmed = url.replace(/\/+$/, '');
return /\/v\d+$/.test(trimmed) ? trimmed : `${trimmed}/v1`;
}
/**
* WhatsApp through [Whatsmiau](https://github.com/verbeux-ai/whatsmiau) — an Evolution-compatible
* server built on whatsmeow (verbeux-ai's fork). The same webhook, routes and options as
* `evolutionApi()`, with two differences: the route prefix (`/v1`) is added to `url`, and reply
* buttons are on by default — Whatsmiau's render on the phone, where Evolution's (Baileys) did not in
* our test (so the buttons card carries no text instruction; the text fallback does). Point the
* instance's webhook (`POST /v1/webhook/set/{instance}`, event
* `MESSAGES_UPSERT`) at the route, with the token.
*/
export function whatsmiau(options) {
return evolutionFormatAdapter({ ...options, url: whatsmiauBase(options.url) }, {
buttons: true,
instructionWithButtons: false,
});
}
//# sourceMappingURL=whatsmiau.js.map