@builderbot/provider-sherpa 1.3.15-alpha.153 → 1.3.15-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +152 -17
- package/dist/index.mjs +152 -17
- package/dist/sherpa.d.ts +18 -0
- package/dist/sherpa.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -4268,6 +4268,9 @@ const emptyDirSessions = async (pathBase) => new Promise((resolve, reject) => {
|
|
|
4268
4268
|
* @returns The cleaned number.
|
|
4269
4269
|
*/
|
|
4270
4270
|
const baileyCleanNumber = (number, full = false) => {
|
|
4271
|
+
if (!number || typeof number !== 'string') {
|
|
4272
|
+
return '';
|
|
4273
|
+
}
|
|
4271
4274
|
const regexGroup = /\@g.us\b/gm;
|
|
4272
4275
|
const exist = number.match(regexGroup);
|
|
4273
4276
|
if (exist)
|
|
@@ -308802,8 +308805,9 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308802
308805
|
fallBackAction: undefined,
|
|
308803
308806
|
};
|
|
308804
308807
|
this.reconnectAttempts = 0;
|
|
308805
|
-
this.maxReconnectAttempts =
|
|
308808
|
+
this.maxReconnectAttempts = 50;
|
|
308806
308809
|
this.reconnectDelay = 1000; // 1 segundo inicial
|
|
308810
|
+
this.badSessionCount = 0;
|
|
308807
308811
|
this.idsDuplicates = [];
|
|
308808
308812
|
this.mapSet = new Set();
|
|
308809
308813
|
this.indexHome = (req, res) => {
|
|
@@ -308855,9 +308859,37 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308855
308859
|
this.initVendor().then((v) => this.listenOnEvents(v));
|
|
308856
308860
|
}
|
|
308857
308861
|
try {
|
|
308862
|
+
// Close previous socket to prevent leaked connections and event listeners
|
|
308863
|
+
if (this.vendor) {
|
|
308864
|
+
try {
|
|
308865
|
+
// Remove all event listeners by event type (whaileys requires event argument)
|
|
308866
|
+
const events = [
|
|
308867
|
+
'connection.update',
|
|
308868
|
+
'creds.update',
|
|
308869
|
+
'messages.upsert',
|
|
308870
|
+
'messages.update',
|
|
308871
|
+
'call',
|
|
308872
|
+
];
|
|
308873
|
+
events.forEach((event) => {
|
|
308874
|
+
try {
|
|
308875
|
+
this.vendor?.ev?.removeAllListeners(event);
|
|
308876
|
+
}
|
|
308877
|
+
catch {
|
|
308878
|
+
// Ignore if event doesn't exist
|
|
308879
|
+
}
|
|
308880
|
+
});
|
|
308881
|
+
this.vendor.ws?.close();
|
|
308882
|
+
this.vendor.end(undefined);
|
|
308883
|
+
}
|
|
308884
|
+
catch (e) {
|
|
308885
|
+
this.logger.log(`[${new Date().toISOString()}] Error closing previous socket:`, e);
|
|
308886
|
+
}
|
|
308887
|
+
this.vendor = undefined;
|
|
308888
|
+
}
|
|
308889
|
+
const waVersion = this.globalVendorArgs.version ?? [2, 3000, 1023223821];
|
|
308858
308890
|
const sock = makeWASocketOther({
|
|
308859
308891
|
logger: loggerSherpa,
|
|
308860
|
-
version:
|
|
308892
|
+
version: waVersion,
|
|
308861
308893
|
printQRInTerminal: false,
|
|
308862
308894
|
auth: {
|
|
308863
308895
|
creds: state.creds,
|
|
@@ -308870,9 +308902,9 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308870
308902
|
getMessage: this.getMessage,
|
|
308871
308903
|
msgRetryCounterMap: {},
|
|
308872
308904
|
userDevicesCache: this.userDevicesCache,
|
|
308873
|
-
retryRequestDelayMs:
|
|
308905
|
+
retryRequestDelayMs: 2000, // Delay entre reintentos (2s para evitar rate-limit)
|
|
308874
308906
|
connectTimeoutMs: 60_000, // 1 minuto timeout conexión
|
|
308875
|
-
keepAliveIntervalMs:
|
|
308907
|
+
keepAliveIntervalMs: 15_000, // Keep alive cada 15 segundos (recomendado por comunidad)
|
|
308876
308908
|
qrTimeout: 40_000, // 40 segundos para QR
|
|
308877
308909
|
defaultQueryTimeoutMs: 60_000, // 1 minuto para queries
|
|
308878
308910
|
emitOwnEvents: false, // No emitir eventos propios
|
|
@@ -308889,13 +308921,15 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308889
308921
|
if (this.globalVendorArgs.phoneNumber) {
|
|
308890
308922
|
const phoneNumberClean = bot.utils.removePlus(this.globalVendorArgs.phoneNumber);
|
|
308891
308923
|
await bot.utils.delay(2000);
|
|
308924
|
+
const code = await this.vendor.requestPairingCode(phoneNumberClean);
|
|
308892
308925
|
this.emit('require_action', {
|
|
308893
308926
|
title: '⚡⚡ ACTION REQUIRED ⚡⚡',
|
|
308894
308927
|
instructions: [
|
|
308895
308928
|
`Accept the WhatsApp notification from ${this.globalVendorArgs.phoneNumber} on your phone 👌`,
|
|
308929
|
+
`The pairing code is: ${code}`,
|
|
308896
308930
|
`Need help: https://link.codigoencasa.com/DISCORD`,
|
|
308897
308931
|
],
|
|
308898
|
-
payload: { qr: null },
|
|
308932
|
+
payload: { qr: null, code: code },
|
|
308899
308933
|
});
|
|
308900
308934
|
}
|
|
308901
308935
|
else {
|
|
@@ -308914,6 +308948,7 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308914
308948
|
const reason = lastDisconnect?.error?.message;
|
|
308915
308949
|
/** Connection closed for various reasons */
|
|
308916
308950
|
if (connection === 'close') {
|
|
308951
|
+
this.stopHealthCheck();
|
|
308917
308952
|
this.logger.log(`[${new Date().toISOString()}] Connection closed. Status: ${statusCode}, Reason: ${reason}`);
|
|
308918
308953
|
// Check if device was removed
|
|
308919
308954
|
const errorData = lastDisconnect?.error?.data;
|
|
@@ -308930,6 +308965,7 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308930
308965
|
`You can also check a log that has been created sherpa.log`,
|
|
308931
308966
|
`Need help: https://link.codigoencasa.com/DISCORD`,
|
|
308932
308967
|
]);
|
|
308968
|
+
return;
|
|
308933
308969
|
}
|
|
308934
308970
|
// Casos donde NO debemos reconectar
|
|
308935
308971
|
if (statusCode === libExports.DisconnectReason.loggedOut) {
|
|
@@ -308940,11 +308976,30 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308940
308976
|
await this.delayedReconnect();
|
|
308941
308977
|
return;
|
|
308942
308978
|
}
|
|
308979
|
+
// badSession: try reconnecting first, but if it repeats too many times, clear session
|
|
308980
|
+
if (statusCode === libExports.DisconnectReason.badSession) {
|
|
308981
|
+
this.badSessionCount++;
|
|
308982
|
+
if (this.badSessionCount >= 3) {
|
|
308983
|
+
this.logger.log(`[${new Date().toISOString()}] Bad session repeated ${this.badSessionCount} times, clearing session...`);
|
|
308984
|
+
const PATH_BASE = require$$1.join(process.cwd(), `${this.globalVendorArgs.name}_sessions`);
|
|
308985
|
+
await emptyDirSessions(PATH_BASE);
|
|
308986
|
+
this.badSessionCount = 0;
|
|
308987
|
+
this.reconnectAttempts = 0;
|
|
308988
|
+
}
|
|
308989
|
+
await this.delayedReconnect();
|
|
308990
|
+
return;
|
|
308991
|
+
}
|
|
308943
308992
|
// Casos donde debemos reconectar con backoff
|
|
308944
308993
|
if (this.shouldReconnect(statusCode)) {
|
|
308945
308994
|
await this.delayedReconnect();
|
|
308946
308995
|
return;
|
|
308947
308996
|
}
|
|
308997
|
+
// If statusCode is undefined/unknown, attempt reconnect rather than dying
|
|
308998
|
+
if (statusCode === undefined || statusCode === null) {
|
|
308999
|
+
this.logger.log(`[${new Date().toISOString()}] Unknown disconnect (no status code), attempting reconnect...`);
|
|
309000
|
+
await this.delayedReconnect();
|
|
309001
|
+
return;
|
|
309002
|
+
}
|
|
308948
309003
|
// Casos críticos - emitir error
|
|
308949
309004
|
this.logger.log(`[${new Date().toISOString()}] Critical error, stopping reconnection attempts`);
|
|
308950
309005
|
this.emit('auth_failure', [
|
|
@@ -308959,6 +309014,8 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
308959
309014
|
this.logger.log(`[${new Date().toISOString()}] Connection opened successfully`);
|
|
308960
309015
|
this.reconnectAttempts = 0; // Reset counter on successful connection
|
|
308961
309016
|
this.reconnectDelay = 1000; // Reset delay
|
|
309017
|
+
this.badSessionCount = 0; // Reset bad session counter
|
|
309018
|
+
this.startHealthCheck();
|
|
308962
309019
|
const parseNumber = `${sock?.user?.id}`.split(':').shift();
|
|
308963
309020
|
const host = { ...sock?.user, phone: parseNumber };
|
|
308964
309021
|
this.globalVendorArgs.host = host;
|
|
@@ -309087,15 +309144,13 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
309087
309144
|
this.logger.log(`[${new Date().toISOString()}] Message received from phone, id=${messageCtx.requestId}`, messageCtx);
|
|
309088
309145
|
}
|
|
309089
309146
|
}
|
|
309090
|
-
//
|
|
309091
|
-
const
|
|
309092
|
-
const remoteJidAlt = messageCtx?.key?.remoteJidAlt;
|
|
309093
|
-
const fromParse = remoteJid?.includes('@lid') ? remoteJidAlt : remoteJid;
|
|
309147
|
+
// Extraer el número de teléfono del mensaje
|
|
309148
|
+
const from = this.extractFromFromMessage(messageCtx);
|
|
309094
309149
|
let payload = {
|
|
309095
309150
|
...messageCtx,
|
|
309096
309151
|
body: textToBody,
|
|
309097
309152
|
name: messageCtx?.pushName,
|
|
309098
|
-
from: baileyCleanNumber(
|
|
309153
|
+
from: baileyCleanNumber(from),
|
|
309099
309154
|
};
|
|
309100
309155
|
if (messageCtx.message?.locationMessage) {
|
|
309101
309156
|
const { degreesLatitude, degreesLongitude } = messageCtx.message.locationMessage;
|
|
@@ -309594,7 +309649,7 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
309594
309649
|
}
|
|
309595
309650
|
setupPeriodicCleanup() {
|
|
309596
309651
|
// Limpiar duplicados cada 10 minutos para evitar memory leaks
|
|
309597
|
-
setInterval(() => {
|
|
309652
|
+
this.periodicCleanupInterval = setInterval(() => {
|
|
309598
309653
|
const maxSize = 1000;
|
|
309599
309654
|
if (this.idsDuplicates.length > maxSize) {
|
|
309600
309655
|
this.logger.log(`[${new Date().toISOString()}] Cleaning duplicates array: ${this.idsDuplicates.length} -> ${maxSize}`);
|
|
@@ -309609,6 +309664,11 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
309609
309664
|
}
|
|
309610
309665
|
cleanup() {
|
|
309611
309666
|
try {
|
|
309667
|
+
this.stopHealthCheck();
|
|
309668
|
+
if (this.periodicCleanupInterval) {
|
|
309669
|
+
clearInterval(this.periodicCleanupInterval);
|
|
309670
|
+
this.periodicCleanupInterval = undefined;
|
|
309671
|
+
}
|
|
309612
309672
|
if (this.msgRetryCounterCache) {
|
|
309613
309673
|
this.msgRetryCounterCache.close();
|
|
309614
309674
|
this.msgRetryCounterCache = undefined;
|
|
@@ -309642,6 +309702,79 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
309642
309702
|
.get('/', this.indexHome);
|
|
309643
309703
|
}
|
|
309644
309704
|
afterHttpServerInit() { }
|
|
309705
|
+
/**
|
|
309706
|
+
* Extrae el número de teléfono (from) de un mensaje
|
|
309707
|
+
* @param messageCtx - Contexto del mensaje
|
|
309708
|
+
* @returns El número de teléfono extraído
|
|
309709
|
+
*/
|
|
309710
|
+
extractFromFromMessage(messageCtx) {
|
|
309711
|
+
const remoteJid = messageCtx?.key?.remoteJid;
|
|
309712
|
+
const remoteJidAlt = messageCtx?.key?.remoteJidAlt;
|
|
309713
|
+
// Si remoteJid contiene @lid, usar remoteJidAlt si existe, sino extraer el número de remoteJid
|
|
309714
|
+
const fromParse = remoteJid?.includes('@lid') ? remoteJidAlt || remoteJid?.split('@')[0] : remoteJid;
|
|
309715
|
+
return fromParse;
|
|
309716
|
+
}
|
|
309717
|
+
/**
|
|
309718
|
+
* Starts a periodic health check that verifies the WebSocket connection is alive.
|
|
309719
|
+
* If the connection is detected as dead (zombie), it triggers a reconnect.
|
|
309720
|
+
* Also sends periodic presence updates as an application-level heartbeat
|
|
309721
|
+
* to prevent WhatsApp from considering the connection inactive.
|
|
309722
|
+
*/
|
|
309723
|
+
startHealthCheck() {
|
|
309724
|
+
this.stopHealthCheck();
|
|
309725
|
+
// WebSocket state check every 30 seconds
|
|
309726
|
+
this.healthCheckInterval = setInterval(() => {
|
|
309727
|
+
try {
|
|
309728
|
+
const sock = this.vendor;
|
|
309729
|
+
if (!sock)
|
|
309730
|
+
return;
|
|
309731
|
+
const wsState = sock?.ws?.readyState;
|
|
309732
|
+
// WebSocket.OPEN = 1, if it's not open and not connecting, connection is dead
|
|
309733
|
+
if (wsState !== undefined && wsState !== 1 && wsState !== 0) {
|
|
309734
|
+
this.logger.log(`[${new Date().toISOString()}] Health check: WebSocket dead (state=${wsState}), triggering reconnect...`);
|
|
309735
|
+
this.stopHealthCheck();
|
|
309736
|
+
this.delayedReconnect();
|
|
309737
|
+
}
|
|
309738
|
+
}
|
|
309739
|
+
catch (error) {
|
|
309740
|
+
this.logger.log(`[${new Date().toISOString()}] Health check error:`, error);
|
|
309741
|
+
}
|
|
309742
|
+
}, 30_000); // Check every 30 seconds
|
|
309743
|
+
// Presence update with random interval (3-8 min) to mimic human behavior
|
|
309744
|
+
const schedulePresenceHeartbeat = () => {
|
|
309745
|
+
// Guard: don't schedule if health check was stopped (prevents orphaned timers)
|
|
309746
|
+
if (!this.healthCheckInterval)
|
|
309747
|
+
return;
|
|
309748
|
+
const minDelay = 180_000; // 3 minutes
|
|
309749
|
+
const maxDelay = 480_000; // 8 minutes
|
|
309750
|
+
const randomDelay = minDelay + Math.floor(Math.random() * (maxDelay - minDelay));
|
|
309751
|
+
this.presenceInterval = setTimeout(async () => {
|
|
309752
|
+
try {
|
|
309753
|
+
const sock = this.vendor;
|
|
309754
|
+
if (!sock)
|
|
309755
|
+
return;
|
|
309756
|
+
await sock.sendPresenceUpdate('available');
|
|
309757
|
+
this.logger.log(`[${new Date().toISOString()}] Presence heartbeat sent (next in ~${Math.round(randomDelay / 60_000)}min)`);
|
|
309758
|
+
}
|
|
309759
|
+
catch (error) {
|
|
309760
|
+
this.logger.log(`[${new Date().toISOString()}] Presence heartbeat error:`, error);
|
|
309761
|
+
}
|
|
309762
|
+
// Schedule the next one with a new random delay
|
|
309763
|
+
schedulePresenceHeartbeat();
|
|
309764
|
+
}, randomDelay);
|
|
309765
|
+
};
|
|
309766
|
+
schedulePresenceHeartbeat();
|
|
309767
|
+
}
|
|
309768
|
+
stopHealthCheck() {
|
|
309769
|
+
if (this.healthCheckInterval) {
|
|
309770
|
+
clearInterval(this.healthCheckInterval);
|
|
309771
|
+
this.healthCheckInterval = undefined;
|
|
309772
|
+
}
|
|
309773
|
+
if (this.presenceInterval) {
|
|
309774
|
+
clearTimeout(this.presenceInterval);
|
|
309775
|
+
this.presenceInterval = undefined;
|
|
309776
|
+
}
|
|
309777
|
+
}
|
|
309645
309778
|
shouldReconnect(statusCode) {
|
|
309646
309779
|
// Lista de códigos donde SÍ debemos reconectar
|
|
309647
309780
|
const reconnectableCodes = [
|
|
@@ -309673,13 +309806,15 @@ class SherpaProvider extends bot.ProviderClass {
|
|
|
309673
309806
|
this.reconnectAttempts++;
|
|
309674
309807
|
const delay = Math.min(this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1), 30000); // Max 30 segundos
|
|
309675
309808
|
this.logger.log(`[${new Date().toISOString()}] Reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`);
|
|
309676
|
-
setTimeout(
|
|
309677
|
-
|
|
309678
|
-
|
|
309679
|
-
|
|
309680
|
-
catch (error) {
|
|
309809
|
+
setTimeout(() => {
|
|
309810
|
+
this.initVendor()
|
|
309811
|
+
.then((v) => this.listenOnEvents(v))
|
|
309812
|
+
.catch((error) => {
|
|
309681
309813
|
this.logger.log(`[${new Date().toISOString()}] Reconnection failed:`, error);
|
|
309682
|
-
|
|
309814
|
+
if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
309815
|
+
this.delayedReconnect();
|
|
309816
|
+
}
|
|
309817
|
+
});
|
|
309683
309818
|
}, delay);
|
|
309684
309819
|
}
|
|
309685
309820
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4266,6 +4266,9 @@ const emptyDirSessions = async (pathBase) => new Promise((resolve, reject) => {
|
|
|
4266
4266
|
* @returns The cleaned number.
|
|
4267
4267
|
*/
|
|
4268
4268
|
const baileyCleanNumber = (number, full = false) => {
|
|
4269
|
+
if (!number || typeof number !== 'string') {
|
|
4270
|
+
return '';
|
|
4271
|
+
}
|
|
4269
4272
|
const regexGroup = /\@g.us\b/gm;
|
|
4270
4273
|
const exist = number.match(regexGroup);
|
|
4271
4274
|
if (exist)
|
|
@@ -308800,8 +308803,9 @@ class SherpaProvider extends ProviderClass {
|
|
|
308800
308803
|
fallBackAction: undefined,
|
|
308801
308804
|
};
|
|
308802
308805
|
this.reconnectAttempts = 0;
|
|
308803
|
-
this.maxReconnectAttempts =
|
|
308806
|
+
this.maxReconnectAttempts = 50;
|
|
308804
308807
|
this.reconnectDelay = 1000; // 1 segundo inicial
|
|
308808
|
+
this.badSessionCount = 0;
|
|
308805
308809
|
this.idsDuplicates = [];
|
|
308806
308810
|
this.mapSet = new Set();
|
|
308807
308811
|
this.indexHome = (req, res) => {
|
|
@@ -308853,9 +308857,37 @@ class SherpaProvider extends ProviderClass {
|
|
|
308853
308857
|
this.initVendor().then((v) => this.listenOnEvents(v));
|
|
308854
308858
|
}
|
|
308855
308859
|
try {
|
|
308860
|
+
// Close previous socket to prevent leaked connections and event listeners
|
|
308861
|
+
if (this.vendor) {
|
|
308862
|
+
try {
|
|
308863
|
+
// Remove all event listeners by event type (whaileys requires event argument)
|
|
308864
|
+
const events = [
|
|
308865
|
+
'connection.update',
|
|
308866
|
+
'creds.update',
|
|
308867
|
+
'messages.upsert',
|
|
308868
|
+
'messages.update',
|
|
308869
|
+
'call',
|
|
308870
|
+
];
|
|
308871
|
+
events.forEach((event) => {
|
|
308872
|
+
try {
|
|
308873
|
+
this.vendor?.ev?.removeAllListeners(event);
|
|
308874
|
+
}
|
|
308875
|
+
catch {
|
|
308876
|
+
// Ignore if event doesn't exist
|
|
308877
|
+
}
|
|
308878
|
+
});
|
|
308879
|
+
this.vendor.ws?.close();
|
|
308880
|
+
this.vendor.end(undefined);
|
|
308881
|
+
}
|
|
308882
|
+
catch (e) {
|
|
308883
|
+
this.logger.log(`[${new Date().toISOString()}] Error closing previous socket:`, e);
|
|
308884
|
+
}
|
|
308885
|
+
this.vendor = undefined;
|
|
308886
|
+
}
|
|
308887
|
+
const waVersion = this.globalVendorArgs.version ?? [2, 3000, 1023223821];
|
|
308856
308888
|
const sock = makeWASocketOther({
|
|
308857
308889
|
logger: loggerSherpa,
|
|
308858
|
-
version:
|
|
308890
|
+
version: waVersion,
|
|
308859
308891
|
printQRInTerminal: false,
|
|
308860
308892
|
auth: {
|
|
308861
308893
|
creds: state.creds,
|
|
@@ -308868,9 +308900,9 @@ class SherpaProvider extends ProviderClass {
|
|
|
308868
308900
|
getMessage: this.getMessage,
|
|
308869
308901
|
msgRetryCounterMap: {},
|
|
308870
308902
|
userDevicesCache: this.userDevicesCache,
|
|
308871
|
-
retryRequestDelayMs:
|
|
308903
|
+
retryRequestDelayMs: 2000, // Delay entre reintentos (2s para evitar rate-limit)
|
|
308872
308904
|
connectTimeoutMs: 60_000, // 1 minuto timeout conexión
|
|
308873
|
-
keepAliveIntervalMs:
|
|
308905
|
+
keepAliveIntervalMs: 15_000, // Keep alive cada 15 segundos (recomendado por comunidad)
|
|
308874
308906
|
qrTimeout: 40_000, // 40 segundos para QR
|
|
308875
308907
|
defaultQueryTimeoutMs: 60_000, // 1 minuto para queries
|
|
308876
308908
|
emitOwnEvents: false, // No emitir eventos propios
|
|
@@ -308887,13 +308919,15 @@ class SherpaProvider extends ProviderClass {
|
|
|
308887
308919
|
if (this.globalVendorArgs.phoneNumber) {
|
|
308888
308920
|
const phoneNumberClean = utils$6.removePlus(this.globalVendorArgs.phoneNumber);
|
|
308889
308921
|
await utils$6.delay(2000);
|
|
308922
|
+
const code = await this.vendor.requestPairingCode(phoneNumberClean);
|
|
308890
308923
|
this.emit('require_action', {
|
|
308891
308924
|
title: '⚡⚡ ACTION REQUIRED ⚡⚡',
|
|
308892
308925
|
instructions: [
|
|
308893
308926
|
`Accept the WhatsApp notification from ${this.globalVendorArgs.phoneNumber} on your phone 👌`,
|
|
308927
|
+
`The pairing code is: ${code}`,
|
|
308894
308928
|
`Need help: https://link.codigoencasa.com/DISCORD`,
|
|
308895
308929
|
],
|
|
308896
|
-
payload: { qr: null },
|
|
308930
|
+
payload: { qr: null, code: code },
|
|
308897
308931
|
});
|
|
308898
308932
|
}
|
|
308899
308933
|
else {
|
|
@@ -308912,6 +308946,7 @@ class SherpaProvider extends ProviderClass {
|
|
|
308912
308946
|
const reason = lastDisconnect?.error?.message;
|
|
308913
308947
|
/** Connection closed for various reasons */
|
|
308914
308948
|
if (connection === 'close') {
|
|
308949
|
+
this.stopHealthCheck();
|
|
308915
308950
|
this.logger.log(`[${new Date().toISOString()}] Connection closed. Status: ${statusCode}, Reason: ${reason}`);
|
|
308916
308951
|
// Check if device was removed
|
|
308917
308952
|
const errorData = lastDisconnect?.error?.data;
|
|
@@ -308928,6 +308963,7 @@ class SherpaProvider extends ProviderClass {
|
|
|
308928
308963
|
`You can also check a log that has been created sherpa.log`,
|
|
308929
308964
|
`Need help: https://link.codigoencasa.com/DISCORD`,
|
|
308930
308965
|
]);
|
|
308966
|
+
return;
|
|
308931
308967
|
}
|
|
308932
308968
|
// Casos donde NO debemos reconectar
|
|
308933
308969
|
if (statusCode === libExports.DisconnectReason.loggedOut) {
|
|
@@ -308938,11 +308974,30 @@ class SherpaProvider extends ProviderClass {
|
|
|
308938
308974
|
await this.delayedReconnect();
|
|
308939
308975
|
return;
|
|
308940
308976
|
}
|
|
308977
|
+
// badSession: try reconnecting first, but if it repeats too many times, clear session
|
|
308978
|
+
if (statusCode === libExports.DisconnectReason.badSession) {
|
|
308979
|
+
this.badSessionCount++;
|
|
308980
|
+
if (this.badSessionCount >= 3) {
|
|
308981
|
+
this.logger.log(`[${new Date().toISOString()}] Bad session repeated ${this.badSessionCount} times, clearing session...`);
|
|
308982
|
+
const PATH_BASE = join(process.cwd(), `${this.globalVendorArgs.name}_sessions`);
|
|
308983
|
+
await emptyDirSessions(PATH_BASE);
|
|
308984
|
+
this.badSessionCount = 0;
|
|
308985
|
+
this.reconnectAttempts = 0;
|
|
308986
|
+
}
|
|
308987
|
+
await this.delayedReconnect();
|
|
308988
|
+
return;
|
|
308989
|
+
}
|
|
308941
308990
|
// Casos donde debemos reconectar con backoff
|
|
308942
308991
|
if (this.shouldReconnect(statusCode)) {
|
|
308943
308992
|
await this.delayedReconnect();
|
|
308944
308993
|
return;
|
|
308945
308994
|
}
|
|
308995
|
+
// If statusCode is undefined/unknown, attempt reconnect rather than dying
|
|
308996
|
+
if (statusCode === undefined || statusCode === null) {
|
|
308997
|
+
this.logger.log(`[${new Date().toISOString()}] Unknown disconnect (no status code), attempting reconnect...`);
|
|
308998
|
+
await this.delayedReconnect();
|
|
308999
|
+
return;
|
|
309000
|
+
}
|
|
308946
309001
|
// Casos críticos - emitir error
|
|
308947
309002
|
this.logger.log(`[${new Date().toISOString()}] Critical error, stopping reconnection attempts`);
|
|
308948
309003
|
this.emit('auth_failure', [
|
|
@@ -308957,6 +309012,8 @@ class SherpaProvider extends ProviderClass {
|
|
|
308957
309012
|
this.logger.log(`[${new Date().toISOString()}] Connection opened successfully`);
|
|
308958
309013
|
this.reconnectAttempts = 0; // Reset counter on successful connection
|
|
308959
309014
|
this.reconnectDelay = 1000; // Reset delay
|
|
309015
|
+
this.badSessionCount = 0; // Reset bad session counter
|
|
309016
|
+
this.startHealthCheck();
|
|
308960
309017
|
const parseNumber = `${sock?.user?.id}`.split(':').shift();
|
|
308961
309018
|
const host = { ...sock?.user, phone: parseNumber };
|
|
308962
309019
|
this.globalVendorArgs.host = host;
|
|
@@ -309085,15 +309142,13 @@ class SherpaProvider extends ProviderClass {
|
|
|
309085
309142
|
this.logger.log(`[${new Date().toISOString()}] Message received from phone, id=${messageCtx.requestId}`, messageCtx);
|
|
309086
309143
|
}
|
|
309087
309144
|
}
|
|
309088
|
-
//
|
|
309089
|
-
const
|
|
309090
|
-
const remoteJidAlt = messageCtx?.key?.remoteJidAlt;
|
|
309091
|
-
const fromParse = remoteJid?.includes('@lid') ? remoteJidAlt : remoteJid;
|
|
309145
|
+
// Extraer el número de teléfono del mensaje
|
|
309146
|
+
const from = this.extractFromFromMessage(messageCtx);
|
|
309092
309147
|
let payload = {
|
|
309093
309148
|
...messageCtx,
|
|
309094
309149
|
body: textToBody,
|
|
309095
309150
|
name: messageCtx?.pushName,
|
|
309096
|
-
from: baileyCleanNumber(
|
|
309151
|
+
from: baileyCleanNumber(from),
|
|
309097
309152
|
};
|
|
309098
309153
|
if (messageCtx.message?.locationMessage) {
|
|
309099
309154
|
const { degreesLatitude, degreesLongitude } = messageCtx.message.locationMessage;
|
|
@@ -309592,7 +309647,7 @@ class SherpaProvider extends ProviderClass {
|
|
|
309592
309647
|
}
|
|
309593
309648
|
setupPeriodicCleanup() {
|
|
309594
309649
|
// Limpiar duplicados cada 10 minutos para evitar memory leaks
|
|
309595
|
-
setInterval(() => {
|
|
309650
|
+
this.periodicCleanupInterval = setInterval(() => {
|
|
309596
309651
|
const maxSize = 1000;
|
|
309597
309652
|
if (this.idsDuplicates.length > maxSize) {
|
|
309598
309653
|
this.logger.log(`[${new Date().toISOString()}] Cleaning duplicates array: ${this.idsDuplicates.length} -> ${maxSize}`);
|
|
@@ -309607,6 +309662,11 @@ class SherpaProvider extends ProviderClass {
|
|
|
309607
309662
|
}
|
|
309608
309663
|
cleanup() {
|
|
309609
309664
|
try {
|
|
309665
|
+
this.stopHealthCheck();
|
|
309666
|
+
if (this.periodicCleanupInterval) {
|
|
309667
|
+
clearInterval(this.periodicCleanupInterval);
|
|
309668
|
+
this.periodicCleanupInterval = undefined;
|
|
309669
|
+
}
|
|
309610
309670
|
if (this.msgRetryCounterCache) {
|
|
309611
309671
|
this.msgRetryCounterCache.close();
|
|
309612
309672
|
this.msgRetryCounterCache = undefined;
|
|
@@ -309640,6 +309700,79 @@ class SherpaProvider extends ProviderClass {
|
|
|
309640
309700
|
.get('/', this.indexHome);
|
|
309641
309701
|
}
|
|
309642
309702
|
afterHttpServerInit() { }
|
|
309703
|
+
/**
|
|
309704
|
+
* Extrae el número de teléfono (from) de un mensaje
|
|
309705
|
+
* @param messageCtx - Contexto del mensaje
|
|
309706
|
+
* @returns El número de teléfono extraído
|
|
309707
|
+
*/
|
|
309708
|
+
extractFromFromMessage(messageCtx) {
|
|
309709
|
+
const remoteJid = messageCtx?.key?.remoteJid;
|
|
309710
|
+
const remoteJidAlt = messageCtx?.key?.remoteJidAlt;
|
|
309711
|
+
// Si remoteJid contiene @lid, usar remoteJidAlt si existe, sino extraer el número de remoteJid
|
|
309712
|
+
const fromParse = remoteJid?.includes('@lid') ? remoteJidAlt || remoteJid?.split('@')[0] : remoteJid;
|
|
309713
|
+
return fromParse;
|
|
309714
|
+
}
|
|
309715
|
+
/**
|
|
309716
|
+
* Starts a periodic health check that verifies the WebSocket connection is alive.
|
|
309717
|
+
* If the connection is detected as dead (zombie), it triggers a reconnect.
|
|
309718
|
+
* Also sends periodic presence updates as an application-level heartbeat
|
|
309719
|
+
* to prevent WhatsApp from considering the connection inactive.
|
|
309720
|
+
*/
|
|
309721
|
+
startHealthCheck() {
|
|
309722
|
+
this.stopHealthCheck();
|
|
309723
|
+
// WebSocket state check every 30 seconds
|
|
309724
|
+
this.healthCheckInterval = setInterval(() => {
|
|
309725
|
+
try {
|
|
309726
|
+
const sock = this.vendor;
|
|
309727
|
+
if (!sock)
|
|
309728
|
+
return;
|
|
309729
|
+
const wsState = sock?.ws?.readyState;
|
|
309730
|
+
// WebSocket.OPEN = 1, if it's not open and not connecting, connection is dead
|
|
309731
|
+
if (wsState !== undefined && wsState !== 1 && wsState !== 0) {
|
|
309732
|
+
this.logger.log(`[${new Date().toISOString()}] Health check: WebSocket dead (state=${wsState}), triggering reconnect...`);
|
|
309733
|
+
this.stopHealthCheck();
|
|
309734
|
+
this.delayedReconnect();
|
|
309735
|
+
}
|
|
309736
|
+
}
|
|
309737
|
+
catch (error) {
|
|
309738
|
+
this.logger.log(`[${new Date().toISOString()}] Health check error:`, error);
|
|
309739
|
+
}
|
|
309740
|
+
}, 30_000); // Check every 30 seconds
|
|
309741
|
+
// Presence update with random interval (3-8 min) to mimic human behavior
|
|
309742
|
+
const schedulePresenceHeartbeat = () => {
|
|
309743
|
+
// Guard: don't schedule if health check was stopped (prevents orphaned timers)
|
|
309744
|
+
if (!this.healthCheckInterval)
|
|
309745
|
+
return;
|
|
309746
|
+
const minDelay = 180_000; // 3 minutes
|
|
309747
|
+
const maxDelay = 480_000; // 8 minutes
|
|
309748
|
+
const randomDelay = minDelay + Math.floor(Math.random() * (maxDelay - minDelay));
|
|
309749
|
+
this.presenceInterval = setTimeout(async () => {
|
|
309750
|
+
try {
|
|
309751
|
+
const sock = this.vendor;
|
|
309752
|
+
if (!sock)
|
|
309753
|
+
return;
|
|
309754
|
+
await sock.sendPresenceUpdate('available');
|
|
309755
|
+
this.logger.log(`[${new Date().toISOString()}] Presence heartbeat sent (next in ~${Math.round(randomDelay / 60_000)}min)`);
|
|
309756
|
+
}
|
|
309757
|
+
catch (error) {
|
|
309758
|
+
this.logger.log(`[${new Date().toISOString()}] Presence heartbeat error:`, error);
|
|
309759
|
+
}
|
|
309760
|
+
// Schedule the next one with a new random delay
|
|
309761
|
+
schedulePresenceHeartbeat();
|
|
309762
|
+
}, randomDelay);
|
|
309763
|
+
};
|
|
309764
|
+
schedulePresenceHeartbeat();
|
|
309765
|
+
}
|
|
309766
|
+
stopHealthCheck() {
|
|
309767
|
+
if (this.healthCheckInterval) {
|
|
309768
|
+
clearInterval(this.healthCheckInterval);
|
|
309769
|
+
this.healthCheckInterval = undefined;
|
|
309770
|
+
}
|
|
309771
|
+
if (this.presenceInterval) {
|
|
309772
|
+
clearTimeout(this.presenceInterval);
|
|
309773
|
+
this.presenceInterval = undefined;
|
|
309774
|
+
}
|
|
309775
|
+
}
|
|
309643
309776
|
shouldReconnect(statusCode) {
|
|
309644
309777
|
// Lista de códigos donde SÍ debemos reconectar
|
|
309645
309778
|
const reconnectableCodes = [
|
|
@@ -309671,13 +309804,15 @@ class SherpaProvider extends ProviderClass {
|
|
|
309671
309804
|
this.reconnectAttempts++;
|
|
309672
309805
|
const delay = Math.min(this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1), 30000); // Max 30 segundos
|
|
309673
309806
|
this.logger.log(`[${new Date().toISOString()}] Reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`);
|
|
309674
|
-
setTimeout(
|
|
309675
|
-
|
|
309676
|
-
|
|
309677
|
-
|
|
309678
|
-
catch (error) {
|
|
309807
|
+
setTimeout(() => {
|
|
309808
|
+
this.initVendor()
|
|
309809
|
+
.then((v) => this.listenOnEvents(v))
|
|
309810
|
+
.catch((error) => {
|
|
309679
309811
|
this.logger.log(`[${new Date().toISOString()}] Reconnection failed:`, error);
|
|
309680
|
-
|
|
309812
|
+
if (this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
309813
|
+
this.delayedReconnect();
|
|
309814
|
+
}
|
|
309815
|
+
});
|
|
309681
309816
|
}, delay);
|
|
309682
309817
|
}
|
|
309683
309818
|
}
|
package/dist/sherpa.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ declare class SherpaProvider extends ProviderClass<WASocket> {
|
|
|
11
11
|
private reconnectAttempts;
|
|
12
12
|
private maxReconnectAttempts;
|
|
13
13
|
private reconnectDelay;
|
|
14
|
+
private healthCheckInterval?;
|
|
15
|
+
private presenceInterval?;
|
|
16
|
+
private periodicCleanupInterval?;
|
|
17
|
+
private badSessionCount;
|
|
14
18
|
msgRetryCounterCache?: NodeCache;
|
|
15
19
|
userDevicesCache?: NodeCache;
|
|
16
20
|
private logger;
|
|
@@ -50,6 +54,12 @@ declare class SherpaProvider extends ProviderClass<WASocket> {
|
|
|
50
54
|
flush(): Promise<void>;
|
|
51
55
|
processInBuffer(task: Promise<any>): any;
|
|
52
56
|
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Extrae el número de teléfono (from) de un mensaje
|
|
59
|
+
* @param messageCtx - Contexto del mensaje
|
|
60
|
+
* @returns El número de teléfono extraído
|
|
61
|
+
*/
|
|
62
|
+
private extractFromFromMessage;
|
|
53
63
|
/**
|
|
54
64
|
* Map native events that the Provider class expects
|
|
55
65
|
* to have a standard set of events
|
|
@@ -201,6 +211,14 @@ declare class SherpaProvider extends ProviderClass<WASocket> {
|
|
|
201
211
|
saveFile: (ctx: Partial<WAMessage & BotContext>, options?: {
|
|
202
212
|
path: string;
|
|
203
213
|
}) => Promise<string>;
|
|
214
|
+
/**
|
|
215
|
+
* Starts a periodic health check that verifies the WebSocket connection is alive.
|
|
216
|
+
* If the connection is detected as dead (zombie), it triggers a reconnect.
|
|
217
|
+
* Also sends periodic presence updates as an application-level heartbeat
|
|
218
|
+
* to prevent WhatsApp from considering the connection inactive.
|
|
219
|
+
*/
|
|
220
|
+
private startHealthCheck;
|
|
221
|
+
private stopHealthCheck;
|
|
204
222
|
private shouldReconnect;
|
|
205
223
|
private delayedReconnect;
|
|
206
224
|
}
|
package/dist/sherpa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sherpa.d.ts","sourceRoot":"","sources":["../src/sherpa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAA;AAI9C,OAAO,SAAS,MAAM,YAAY,CAAA;AAIlC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAK3D,OAAO,EAGH,eAAe,EACf,SAAS,EACT,QAAQ,EASR,KAAK,EAER,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,Q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EACxC,WAAU,GAAU,mBAWvB;IAED,OAAO,CAAC,WAAW,CAYlB;IAED,OAAO,CAAC,gBAAgB,CAAmE;IAE3F;;;;;OAKG;IACH,QAAQ,GAAU,KAAK,OAAO,CAAC,SAAS,GAAG,UAAU,CAAC,EAAE,UAAU;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,MAAM,CAAC,CAUnG;IAED;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAkDxB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,eAAe;YAmBT,gBAAgB;CAkCjC;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,gBAAgB,GAAU,UAAU,MAAM,qBAM1C,CAAA;AACN;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,OAAM,OAAe,KAAG,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,gBAAgB,GAAU,UAAU,MAAM,qBAM1C,CAAA;AACN;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,OAAM,OAAe,KAAG,MAUlE,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GAAU,QAAQ,MAAM,EAAE,OAAM,MAAiB,KAAG,OAAO,CAAC,IAAI,CAaxF,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GAAI,WAAW,MAAM,KAAG,OAKhD,CAAA;AAGD,QAAA,MAAM,iBAAiB,WA7CY,MAAM,SAAQ,OAAO,KAAW,MA6CxB,CAAA;AAC3C,QAAA,MAAM,mBAAmB,WA7BkB,MAAM,SAAQ,MAAM,KAAc,OAAO,CAAC,IAAI,CA6B1C,CAAA;AAC/C,QAAA,MAAM,mBAAmB,cAVe,MAAM,KAAG,OAUF,CAAA;AAE/C,OAAO,EACH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,GACtB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builderbot/provider-sherpa",
|
|
3
|
-
"version": "1.3.15-alpha.
|
|
3
|
+
"version": "1.3.15-alpha.17",
|
|
4
4
|
"description": "Provider Sherpa for BuilderBot - WhatsApp integration using Whaileys",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@builderbot/bot": "1.3.15-alpha.
|
|
41
|
+
"@builderbot/bot": "^1.3.15-alpha.17",
|
|
42
42
|
"@hapi/boom": "^10.0.1",
|
|
43
43
|
"@jest/globals": "^30.2.0",
|
|
44
44
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"typescript": "^5.9.3",
|
|
81
81
|
"whaileys": "6.3.8"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "3a191e56045d5785299bfe984da445424e18d29d"
|
|
84
84
|
}
|