diff --git a/extensions/whatsapp/src/auto-reply/monitor/inbound-context.ts b/extensions/whatsapp/src/auto-reply/monitor/inbound-context.ts index f49698eac4b..6f9b8367135 100644 --- a/extensions/whatsapp/src/auto-reply/monitor/inbound-context.ts +++ b/extensions/whatsapp/src/auto-reply/monitor/inbound-context.ts @@ -21,7 +21,7 @@ export type GroupHistoryEntry = { type ContextVisibilityMode = "all" | "allowlist" | "allowlist_quote"; -export function isWhatsAppSupplementalSenderAllowed(params: { +function isWhatsAppSupplementalSenderAllowed(params: { allowFrom: string[]; sender?: WhatsAppIdentity | null; }): boolean { diff --git a/extensions/whatsapp/src/connection-controller-registry.ts b/extensions/whatsapp/src/connection-controller-registry.ts index f1e3bab0bef..20ad82dec61 100644 --- a/extensions/whatsapp/src/connection-controller-registry.ts +++ b/extensions/whatsapp/src/connection-controller-registry.ts @@ -1,6 +1,6 @@ import type { ActiveWebListener } from "./inbound/types.js"; -export type WhatsAppConnectionControllerHandle = { +type WhatsAppConnectionControllerHandle = { getActiveListener(): ActiveWebListener | null; }; diff --git a/extensions/whatsapp/src/connection-controller.ts b/extensions/whatsapp/src/connection-controller.ts index 10762947403..27b5b284853 100644 --- a/extensions/whatsapp/src/connection-controller.ts +++ b/extensions/whatsapp/src/connection-controller.ts @@ -19,7 +19,7 @@ import type { WhatsAppSocketTimingOptions } from "./socket-timing.js"; const LOGGED_OUT_STATUS = DisconnectReason?.loggedOut ?? 401; const WHATSAPP_LOGIN_RESTART_MESSAGE = "WhatsApp asked for a restart after pairing (code 515); waiting for creds to save…"; -export const WHATSAPP_LOGGED_OUT_RELINK_MESSAGE = +const WHATSAPP_LOGGED_OUT_RELINK_MESSAGE = "WhatsApp reported the session is logged out. Cleared cached web session; please rerun openclaw channels login and scan the QR again."; export const WHATSAPP_LOGGED_OUT_QR_MESSAGE = "WhatsApp reported the session is logged out. Cleared cached web session; please scan a new QR."; @@ -33,7 +33,7 @@ export type ManagedWhatsAppListener = ActiveWebListener & { signalClose?: (reason?: WebListenerCloseReason) => void; }; -export type WhatsAppLiveConnection = { +type WhatsAppLiveConnection = { connectionId: string; startedAt: number; sock: WASocket; @@ -51,7 +51,7 @@ export type WhatsAppLiveConnection = { resolveClose: (reason: WebListenerCloseReason) => void; }; -export type WhatsAppConnectionSnapshot = { +type WhatsAppConnectionSnapshot = { connectionId: string; startedAt: number; lastInboundAt: number | null; @@ -61,7 +61,7 @@ export type WhatsAppConnectionSnapshot = { uptimeMs: number; }; -export type NormalizedConnectionCloseReason = { +type NormalizedConnectionCloseReason = { statusCode?: number; statusLabel: number | "unknown"; isLoggedOut: boolean; @@ -69,7 +69,7 @@ export type NormalizedConnectionCloseReason = { errorText: string; }; -export type WhatsAppConnectionCloseDecision = { +type WhatsAppConnectionCloseDecision = { action: "stop" | "retry"; delayMs?: number; reconnectAttempts: number; @@ -77,7 +77,7 @@ export type WhatsAppConnectionCloseDecision = { normalized: NormalizedConnectionCloseReason; }; -export type WhatsAppReconnectAttemptDecision = { +type WhatsAppReconnectAttemptDecision = { action: "stop" | "retry"; delayMs?: number; reconnectAttempts: number; @@ -148,7 +148,7 @@ export function closeWaSocketSoon( }, delayMs); } -export type WhatsAppLoginWaitResult = +type WhatsAppLoginWaitResult = | { outcome: "connected"; restarted: boolean; diff --git a/extensions/whatsapp/src/group-intro.ts b/extensions/whatsapp/src/group-intro.ts index ad382320180..a4db1e87557 100644 --- a/extensions/whatsapp/src/group-intro.ts +++ b/extensions/whatsapp/src/group-intro.ts @@ -1,4 +1,4 @@ -export const WHATSAPP_GROUP_INTRO_HINT = +const WHATSAPP_GROUP_INTRO_HINT = "WhatsApp IDs: SenderId is the participant JID (group participant id)."; export function resolveWhatsAppGroupIntroHint(): string { diff --git a/extensions/whatsapp/src/identity.ts b/extensions/whatsapp/src/identity.ts index 3df32046f5f..6a7af35ff96 100644 --- a/extensions/whatsapp/src/identity.ts +++ b/extensions/whatsapp/src/identity.ts @@ -50,7 +50,7 @@ type LegacyMentionsLike = { mentionedJids?: string[]; }; -export function normalizeDeviceScopedJid(jid: string | null | undefined): string | null { +function normalizeDeviceScopedJid(jid: string | null | undefined): string | null { return jid ? jid.replace(/:\d+/, "") : null; } @@ -148,7 +148,7 @@ export function getReplyContext( }; } -export function getMentionJids(msg: LegacyMentionsLike): string[] { +function getMentionJids(msg: LegacyMentionsLike): string[] { return msg.mentions ?? msg.mentionedJids ?? []; } diff --git a/extensions/whatsapp/src/inbound/monitor.ts b/extensions/whatsapp/src/inbound/monitor.ts index c7920e94a35..42cc04db93a 100644 --- a/extensions/whatsapp/src/inbound/monitor.ts +++ b/extensions/whatsapp/src/inbound/monitor.ts @@ -50,7 +50,7 @@ const RECONNECT_IN_PROGRESS_ERROR = "no active socket - reconnection in progress const GROUP_META_TTL_MS = 5 * 60 * 1000; // 5 minutes export const WHATSAPP_GROUP_METADATA_CACHE_MAX_ENTRIES = 500; -export type WhatsAppGroupMetadataCacheEntry = { +type WhatsAppGroupMetadataCacheEntry = { subject?: string; expires: number; }; @@ -118,7 +118,7 @@ function isNonEmptyString(value: string | undefined): value is string { return Boolean(value); } -export type MonitorWebInboxOptions = { +type MonitorWebInboxOptions = { cfg: OpenClawConfig; verbose: boolean; accountId: string; diff --git a/extensions/whatsapp/src/inbound/send-result.ts b/extensions/whatsapp/src/inbound/send-result.ts index a24f31f8271..1ed41927539 100644 --- a/extensions/whatsapp/src/inbound/send-result.ts +++ b/extensions/whatsapp/src/inbound/send-result.ts @@ -2,7 +2,7 @@ import type { WAMessage, WAMessageKey } from "@whiskeysockets/baileys"; export type WhatsAppSendKind = "media" | "poll" | "reaction" | "text"; -export type WhatsAppSendKey = Omit< +type WhatsAppSendKey = Omit< Pick, "id" > & { diff --git a/extensions/whatsapp/src/outbound-media-contract.ts b/extensions/whatsapp/src/outbound-media-contract.ts index 8f7cb9de064..8db8e3883ac 100644 --- a/extensions/whatsapp/src/outbound-media-contract.ts +++ b/extensions/whatsapp/src/outbound-media-contract.ts @@ -24,7 +24,7 @@ type WhatsAppLoadedMediaLike = { fileName?: string; }; -export type NormalizedWhatsAppOutboundPayload = Omit< +type NormalizedWhatsAppOutboundPayload = Omit< T, "text" | "mediaUrl" | "mediaUrls" > & { @@ -40,7 +40,7 @@ export type DeliverableWhatsAppOutboundPayload Promise, ): ChannelSetupWizard { return createDelegatedSetupWizardProxy({