mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 06:50:42 +00:00
refactor(whatsapp): remove legacy heartbeat runners
This commit is contained in:
@@ -224,7 +224,7 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
|
||||
'export { handleWhatsAppAction, whatsAppActionRuntime } from "./src/action-runtime.js";',
|
||||
'export { createWhatsAppLoginTool } from "./src/agent-tools-login.js";',
|
||||
'export { formatWhatsAppWebAuthStatusState, getWebAuthAgeMs, hasWebCredsSync, logWebSelfId, logoutWeb, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resolveDefaultWebAuthDir, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, WA_WEB_AUTH_DIR, webAuthExists, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, type WhatsAppWebAuthState } from "./src/auth-store.js";',
|
||||
'export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, monitorWebChannel, resolveHeartbeatRecipients, runWebHeartbeatOnce, SILENT_REPLY_TOKEN, stripHeartbeatToken, type WebChannelStatus, type WebMonitorTuning } from "./src/auto-reply.js";',
|
||||
'export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, monitorWebChannel, SILENT_REPLY_TOKEN, stripHeartbeatToken, type WebChannelStatus, type WebMonitorTuning } from "./src/auto-reply.js";',
|
||||
'export { extractContactContext, extractLocationData, extractMediaPlaceholder, extractText, monitorWebInbox, resetWebInboundDedupe, type WebInboundMessage, type WebListenerCloseReason } from "./src/inbound.js";',
|
||||
'export { loginWeb } from "./src/login.js";',
|
||||
'export { getDefaultLocalRoots, loadWebMedia, loadWebMediaRaw, LocalMediaAccessError, optimizeImageToJpeg, optimizeImageToPng, type LocalMediaAccessErrorCode, type WebMediaResult } from "./src/media.js";',
|
||||
|
||||
@@ -98,13 +98,11 @@ type WebChannelHeavyRuntimeModule = {
|
||||
) => Promise<AgentToolResult<unknown>>;
|
||||
monitorWebChannel: (...args: unknown[]) => Promise<unknown>;
|
||||
monitorWebInbox: (...args: unknown[]) => Promise<unknown>;
|
||||
runWebHeartbeatOnce: (...args: unknown[]) => Promise<unknown>;
|
||||
startWebLoginWithQr: (...args: unknown[]) => Promise<unknown>;
|
||||
waitForWaConnection: (sock: unknown) => Promise<void>;
|
||||
waitForWebLogin: (...args: unknown[]) => Promise<unknown>;
|
||||
extractMediaPlaceholder: (...args: unknown[]) => unknown;
|
||||
extractText: (...args: unknown[]) => unknown;
|
||||
resolveHeartbeatRecipients: (...args: unknown[]) => unknown;
|
||||
};
|
||||
|
||||
type WebChannelRuntimeModuleKind = "heavy" | "light";
|
||||
@@ -335,12 +333,6 @@ export async function optimizeImageToJpeg(
|
||||
return await optimizeImageToJpegImpl(...args);
|
||||
}
|
||||
|
||||
export async function runWebHeartbeatOnce(
|
||||
...args: Parameters<WebChannelHeavyRuntimeModule["runWebHeartbeatOnce"]>
|
||||
): ReturnType<WebChannelHeavyRuntimeModule["runWebHeartbeatOnce"]> {
|
||||
return (await getHeavyExport("runWebHeartbeatOnce"))(...args);
|
||||
}
|
||||
|
||||
export async function startWebLoginWithQr(
|
||||
...args: Parameters<WebChannelHeavyRuntimeModule["startWebLoginWithQr"]>
|
||||
): ReturnType<WebChannelHeavyRuntimeModule["startWebLoginWithQr"]> {
|
||||
@@ -371,9 +363,3 @@ export function getDefaultLocalRoots(
|
||||
): ReturnType<typeof getDefaultLocalRootsImpl> {
|
||||
return getDefaultLocalRootsImpl(...args);
|
||||
}
|
||||
|
||||
export function resolveHeartbeatRecipients(
|
||||
...args: Parameters<WebChannelHeavyRuntimeModule["resolveHeartbeatRecipients"]>
|
||||
): ReturnType<WebChannelHeavyRuntimeModule["resolveHeartbeatRecipients"]> {
|
||||
return loadCurrentHeavyModuleSync().resolveHeartbeatRecipients(...args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user