

























@@ -19,7 +19,7 @@ import type { WhatsAppSocketTimingOptions } from "./socket-timing.js";
1919const LOGGED_OUT_STATUS = DisconnectReason?.loggedOut ?? 401;
2020const WHATSAPP_LOGIN_RESTART_MESSAGE =
2121"WhatsApp asked for a restart after pairing (code 515); waiting for creds to save…";
22-export const WHATSAPP_LOGGED_OUT_RELINK_MESSAGE =
22+const WHATSAPP_LOGGED_OUT_RELINK_MESSAGE =
2323"WhatsApp reported the session is logged out. Cleared cached web session; please rerun openclaw channels login and scan the QR again.";
2424export const WHATSAPP_LOGGED_OUT_QR_MESSAGE =
2525"WhatsApp reported the session is logged out. Cleared cached web session; please scan a new QR.";
@@ -33,7 +33,7 @@ export type ManagedWhatsAppListener = ActiveWebListener & {
3333signalClose?: (reason?: WebListenerCloseReason) => void;
3434};
353536-export type WhatsAppLiveConnection = {
36+type WhatsAppLiveConnection = {
3737connectionId: string;
3838startedAt: number;
3939sock: WASocket;
@@ -51,7 +51,7 @@ export type WhatsAppLiveConnection = {
5151resolveClose: (reason: WebListenerCloseReason) => void;
5252};
535354-export type WhatsAppConnectionSnapshot = {
54+type WhatsAppConnectionSnapshot = {
5555connectionId: string;
5656startedAt: number;
5757lastInboundAt: number | null;
@@ -61,23 +61,23 @@ export type WhatsAppConnectionSnapshot = {
6161uptimeMs: number;
6262};
636364-export type NormalizedConnectionCloseReason = {
64+type NormalizedConnectionCloseReason = {
6565statusCode?: number;
6666statusLabel: number | "unknown";
6767isLoggedOut: boolean;
6868error?: unknown;
6969errorText: string;
7070};
717172-export type WhatsAppConnectionCloseDecision = {
72+type WhatsAppConnectionCloseDecision = {
7373action: "stop" | "retry";
7474delayMs?: number;
7575reconnectAttempts: number;
7676healthState: "logged-out" | "conflict" | "stopped" | "reconnecting";
7777normalized: NormalizedConnectionCloseReason;
7878};
797980-export type WhatsAppReconnectAttemptDecision = {
80+type WhatsAppReconnectAttemptDecision = {
8181action: "stop" | "retry";
8282delayMs?: number;
8383reconnectAttempts: number;
@@ -148,7 +148,7 @@ export function closeWaSocketSoon(
148148}, delayMs);
149149}
150150151-export type WhatsAppLoginWaitResult =
151+type WhatsAppLoginWaitResult =
152152| {
153153outcome: "connected";
154154restarted: boolean;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。