From 8bd9e227a09bb03ad1702800f70457a4b506f94b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 16:04:05 +0100 Subject: [PATCH] refactor: trim bluebubbles helper exports --- extensions/bluebubbles/src/account-resolve.ts | 2 +- extensions/bluebubbles/src/attachments.ts | 4 ++-- extensions/bluebubbles/src/client.ts | 4 ++-- extensions/bluebubbles/src/history.ts | 8 ++++---- extensions/bluebubbles/src/inbound-dedupe.ts | 2 +- extensions/bluebubbles/src/monitor-debounce.ts | 4 ++-- extensions/bluebubbles/src/monitor-processing.ts | 2 +- extensions/bluebubbles/src/monitor-reply-fetch.ts | 4 ++-- extensions/bluebubbles/src/multipart.ts | 2 +- extensions/bluebubbles/src/probe.ts | 6 +++--- extensions/bluebubbles/src/targets.ts | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/extensions/bluebubbles/src/account-resolve.ts b/extensions/bluebubbles/src/account-resolve.ts index f71d09a2210..ed0e8c6326f 100644 --- a/extensions/bluebubbles/src/account-resolve.ts +++ b/extensions/bluebubbles/src/account-resolve.ts @@ -6,7 +6,7 @@ import { import type { OpenClawConfig } from "./runtime-api.js"; import { normalizeResolvedSecretInputString } from "./secret-input.js"; -export type BlueBubblesAccountResolveOpts = { +type BlueBubblesAccountResolveOpts = { serverUrl?: string; password?: string; accountId?: string; diff --git a/extensions/bluebubbles/src/attachments.ts b/extensions/bluebubbles/src/attachments.ts index c10822a2c0e..88f5fd3fb89 100644 --- a/extensions/bluebubbles/src/attachments.ts +++ b/extensions/bluebubbles/src/attachments.ts @@ -23,7 +23,7 @@ import { extractBlueBubblesMessageId, resolveBlueBubblesSendTarget } from "./sen import { createChatForHandle, resolveChatGuidForTarget } from "./send.js"; import { type BlueBubblesAttachment } from "./types.js"; -export type BlueBubblesAttachmentOpts = { +type BlueBubblesAttachmentOpts = { serverUrl?: string; password?: string; accountId?: string; @@ -111,7 +111,7 @@ export async function downloadBlueBubblesAttachment( }); } -export type SendBlueBubblesAttachmentResult = { +type SendBlueBubblesAttachmentResult = { messageId: string; }; diff --git a/extensions/bluebubbles/src/client.ts b/extensions/bluebubbles/src/client.ts index ff8052f2d10..9d56256b87c 100644 --- a/extensions/bluebubbles/src/client.ts +++ b/extensions/bluebubbles/src/client.ts @@ -41,7 +41,7 @@ const DEFAULT_MULTIPART_TIMEOUT_MS = 60_000; * - `blueBubblesHeaderAuth` — header-based auth; flip the default here when * BB Server ships the header-auth change for #66869. */ -export interface BlueBubblesAuthStrategy { +interface BlueBubblesAuthStrategy { /** * Stable identifier for this strategy. Used by the client cache fingerprint * so two clients for the same account + credential that differ only in auth @@ -149,7 +149,7 @@ export function resolveBlueBubblesClientSsrfPolicy(params: { // --- Client ---------------------------------------------------------------- -export type BlueBubblesClientOptions = { +type BlueBubblesClientOptions = { cfg?: OpenClawConfig; accountId?: string; serverUrl?: string; diff --git a/extensions/bluebubbles/src/history.ts b/extensions/bluebubbles/src/history.ts index 988e8dae5c9..b24af811854 100644 --- a/extensions/bluebubbles/src/history.ts +++ b/extensions/bluebubbles/src/history.ts @@ -2,14 +2,14 @@ import { resolveBlueBubblesServerAccount } from "./account-resolve.js"; import { createBlueBubblesClientFromParts } from "./client.js"; import type { OpenClawConfig } from "./runtime-api.js"; -export type BlueBubblesHistoryEntry = { +type BlueBubblesHistoryEntry = { sender: string; body: string; timestamp?: number; messageId?: string; }; -export type BlueBubblesHistoryFetchResult = { +type BlueBubblesHistoryFetchResult = { entries: BlueBubblesHistoryEntry[]; /** * True when at least one API path returned a recognized response shape. @@ -18,7 +18,7 @@ export type BlueBubblesHistoryFetchResult = { resolved: boolean; }; -export type BlueBubblesMessageData = { +type BlueBubblesMessageData = { guid?: string; text?: string; handle_id?: string; @@ -32,7 +32,7 @@ export type BlueBubblesMessageData = { }; }; -export type BlueBubblesChatOpts = { +type BlueBubblesChatOpts = { serverUrl?: string; password?: string; accountId?: string; diff --git a/extensions/bluebubbles/src/inbound-dedupe.ts b/extensions/bluebubbles/src/inbound-dedupe.ts index 064680d4edc..b94db99b08d 100644 --- a/extensions/bluebubbles/src/inbound-dedupe.ts +++ b/extensions/bluebubbles/src/inbound-dedupe.ts @@ -159,7 +159,7 @@ export function resolveBlueBubblesInboundDedupeKey( return base; } -export type InboundDedupeClaim = +type InboundDedupeClaim = | { kind: "claimed"; finalize: () => Promise; release: () => void } | { kind: "duplicate" } | { kind: "inflight" } diff --git a/extensions/bluebubbles/src/monitor-debounce.ts b/extensions/bluebubbles/src/monitor-debounce.ts index 04abebfe283..5ea9cf73bdb 100644 --- a/extensions/bluebubbles/src/monitor-debounce.ts +++ b/extensions/bluebubbles/src/monitor-debounce.ts @@ -29,12 +29,12 @@ function sanitizeDebounceEntry(entry: BlueBubblesDebounceEntry): BlueBubblesDebo }; } -export type BlueBubblesDebouncer = { +type BlueBubblesDebouncer = { enqueue: (item: BlueBubblesDebounceEntry) => Promise; flushKey: (key: string) => Promise; }; -export type BlueBubblesDebounceRegistry = { +type BlueBubblesDebounceRegistry = { getOrCreateDebouncer: (target: WebhookTarget) => BlueBubblesDebouncer; removeDebouncer: (target: WebhookTarget) => void; }; diff --git a/extensions/bluebubbles/src/monitor-processing.ts b/extensions/bluebubbles/src/monitor-processing.ts index b4ae8596393..5b80b7e9887 100644 --- a/extensions/bluebubbles/src/monitor-processing.ts +++ b/extensions/bluebubbles/src/monitor-processing.ts @@ -355,7 +355,7 @@ export function logVerbose( } } -export type BlueBubblesInboundChatResolveTarget = +type BlueBubblesInboundChatResolveTarget = | { readonly kind: "chat_id"; readonly chatId: number } | { readonly kind: "chat_identifier"; readonly chatIdentifier: string } | { readonly kind: "handle"; readonly address: string }; diff --git a/extensions/bluebubbles/src/monitor-reply-fetch.ts b/extensions/bluebubbles/src/monitor-reply-fetch.ts index 05713594ced..ab09df6f47f 100644 --- a/extensions/bluebubbles/src/monitor-reply-fetch.ts +++ b/extensions/bluebubbles/src/monitor-reply-fetch.ts @@ -20,7 +20,7 @@ const REPLY_TO_ID_MAX_LENGTH = 128; const PART_INDEX_REPLY_TO_ID_PATTERN = /^p:\d{1,10}\/([A-Za-z0-9._:-]+)$/; const PART_INDEX_REPLY_TO_ID_MAX_LENGTH = REPLY_TO_ID_MAX_LENGTH + "p:".length + 10 + "/".length; -export type BlueBubblesReplyFetchResult = { +type BlueBubblesReplyFetchResult = { body?: string; sender?: string; }; @@ -41,7 +41,7 @@ export function _resetBlueBubblesReplyFetchState(): void { inflight.clear(); } -export type FetchBlueBubblesReplyContextParams = { +type FetchBlueBubblesReplyContextParams = { accountId: string; replyToId: string; baseUrl: string; diff --git a/extensions/bluebubbles/src/multipart.ts b/extensions/bluebubbles/src/multipart.ts index b178e493164..4e0ce57b209 100644 --- a/extensions/bluebubbles/src/multipart.ts +++ b/extensions/bluebubbles/src/multipart.ts @@ -1,7 +1,7 @@ import type { SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime"; import { blueBubblesFetchWithTimeout } from "./types.js"; -export function concatUint8Arrays(parts: Uint8Array[]): Uint8Array { +function concatUint8Arrays(parts: Uint8Array[]): Uint8Array { const totalLength = parts.reduce((acc, part) => acc + part.length, 0); const body = new Uint8Array(totalLength); let offset = 0; diff --git a/extensions/bluebubbles/src/probe.ts b/extensions/bluebubbles/src/probe.ts index b8b13d545e1..9ad32a8378b 100644 --- a/extensions/bluebubbles/src/probe.ts +++ b/extensions/bluebubbles/src/probe.ts @@ -8,7 +8,7 @@ export type BlueBubblesProbe = BaseProbeResult & { status?: number | null; }; -export type BlueBubblesServerInfo = { +type BlueBubblesServerInfo = { os_version?: string; server_version?: string; private_api?: boolean; @@ -80,7 +80,7 @@ export async function fetchBlueBubblesServerInfo(params: { * Get cached server info synchronously (for use in describeMessageTool). * Returns null if not cached or expired. */ -export function getCachedBlueBubblesServerInfo(accountId?: string): BlueBubblesServerInfo | null { +function getCachedBlueBubblesServerInfo(accountId?: string): BlueBubblesServerInfo | null { const cacheKey = normalizeOptionalString(accountId) || "default"; const cached = serverInfoCache.get(cacheKey); if (cached && cached.expires > Date.now()) { @@ -112,7 +112,7 @@ export function isBlueBubblesPrivateApiEnabled(accountId?: string): boolean { /** * Parse macOS version string (e.g., "15.0.1" or "26.0") into major version number. */ -export function parseMacOSMajorVersion(version?: string | null): number | null { +function parseMacOSMajorVersion(version?: string | null): number | null { if (!version) { return null; } diff --git a/extensions/bluebubbles/src/targets.ts b/extensions/bluebubbles/src/targets.ts index 9a7b1424386..3a54716c2db 100644 --- a/extensions/bluebubbles/src/targets.ts +++ b/extensions/bluebubbles/src/targets.ts @@ -11,9 +11,9 @@ import { normalizeOptionalString, } from "openclaw/plugin-sdk/text-runtime"; -export type BlueBubblesService = "imessage" | "sms" | "auto"; +type BlueBubblesService = "imessage" | "sms" | "auto"; -export type BlueBubblesTarget = +type BlueBubblesTarget = | { kind: "chat_id"; chatId: number } | { kind: "chat_guid"; chatGuid: string } | { kind: "chat_identifier"; chatIdentifier: string }