From 4cbd1b53cf86e73086c6ed2022840fb2f5beac78 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 09:56:32 +0100 Subject: [PATCH] refactor: prune unused exported types --- .../src/mattermost/monitor-helpers.ts | 8 ------ extensions/slack/src/shared.ts | 7 +---- extensions/speech-core/src/audio-transcode.ts | 8 +----- .../synology-chat/src/inbound-context.ts | 2 -- extensions/tlon/src/monitor/utils.ts | 15 ---------- .../twitch/src/client-manager-registry.ts | 28 ------------------- extensions/whatsapp/src/quoted-message.ts | 8 ------ extensions/whatsapp/src/reaction-level.ts | 7 +---- 8 files changed, 3 insertions(+), 80 deletions(-) diff --git a/extensions/mattermost/src/mattermost/monitor-helpers.ts b/extensions/mattermost/src/mattermost/monitor-helpers.ts index 193f001f33e..e625e4d1acd 100644 --- a/extensions/mattermost/src/mattermost/monitor-helpers.ts +++ b/extensions/mattermost/src/mattermost/monitor-helpers.ts @@ -5,14 +5,6 @@ import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress"; export { createDedupeCache, rawDataToString }; -export type ResponsePrefixContext = { - model?: string; - modelFull?: string; - provider?: string; - thinkingLevel?: string; - identityName?: string; -}; - export const formatInboundFromLabel = formatInboundFromLabelShared; export function resolveThreadSessionKeys(params: { diff --git a/extensions/slack/src/shared.ts b/extensions/slack/src/shared.ts index 257e13cbfde..86d95e9e605 100644 --- a/extensions/slack/src/shared.ts +++ b/extensions/slack/src/shared.ts @@ -21,12 +21,7 @@ import { collectRuntimeConfigAssignments, secretTargetRegistryEntries } from "./ import { slackSecurityAdapter } from "./security.js"; import { SLACK_CHANNEL } from "./setup-shared.js"; -export { - buildSlackSetupLines, - isSlackSetupAccountConfigured, - setSlackChannelAllowlist, - SLACK_CHANNEL, -} from "./setup-shared.js"; +export { setSlackChannelAllowlist, SLACK_CHANNEL } from "./setup-shared.js"; export function isSlackPluginAccountConfigured(account: ResolvedSlackAccount): boolean { const mode = account.config.mode ?? "socket"; diff --git a/extensions/speech-core/src/audio-transcode.ts b/extensions/speech-core/src/audio-transcode.ts index 6627204bbf6..1ca18780e38 100644 --- a/extensions/speech-core/src/audio-transcode.ts +++ b/extensions/speech-core/src/audio-transcode.ts @@ -3,10 +3,6 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "nod import { join } from "node:path"; import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/sandbox"; -/** Container token (file-extension shape, no leading dot) the host knows how - * to pre-transcode into. Update in lockstep with `pickAfconvertRecipe`. */ -export type HostTranscodableContainer = "caf"; - export type TranscodeOutcome = | { ok: true; buffer: Buffer } | { @@ -93,9 +89,7 @@ function normalizeExt(ext: string): string | undefined { } function pickAfconvertRecipe(source: string, target: string): string[] | undefined { - // Currently only the MP3→CAF path used by BlueBubbles voice memos. Keep - // this in lockstep with `HostTranscodableContainer` above so a typo at the - // channel-capability declaration site is a compile-time error. + // Currently only the MP3→CAF path used by BlueBubbles voice memos. if (target === "caf") { // Opus-in-CAF, mono, 24 kHz. Validated against macOS 15.x Messages.app's // native voice-memo CAF descriptor (1 ch, 24000 Hz, opus); other CAF diff --git a/extensions/synology-chat/src/inbound-context.ts b/extensions/synology-chat/src/inbound-context.ts index c77d4ade101..10290870922 100644 --- a/extensions/synology-chat/src/inbound-context.ts +++ b/extensions/synology-chat/src/inbound-context.ts @@ -8,5 +8,3 @@ export type SynologyInboundMessage = { commandAuthorized: boolean; chatUserId?: string; }; - -export type { ResolvedSynologyChatAccount } from "./types.js"; diff --git a/extensions/tlon/src/monitor/utils.ts b/extensions/tlon/src/monitor/utils.ts index cd99e709b17..eb70be5f678 100644 --- a/extensions/tlon/src/monitor/utils.ts +++ b/extensions/tlon/src/monitor/utils.ts @@ -1,21 +1,6 @@ import { formatErrorMessage as sharedFormatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { normalizeShip } from "../targets.js"; -// Cite types for message references -export interface ChanCite { - chan: { nest: string; where: string }; -} -export interface GroupCite { - group: string; -} -export interface DeskCite { - desk: { flag: string; where: string }; -} -export interface BaitCite { - bait: { group: string; graph: string; where: string }; -} -export type Cite = ChanCite | GroupCite | DeskCite | BaitCite; - export interface ParsedCite { type: "chan" | "group" | "desk" | "bait"; nest?: string; diff --git a/extensions/twitch/src/client-manager-registry.ts b/extensions/twitch/src/client-manager-registry.ts index 1b7ae23f21f..5338cd85ee0 100644 --- a/extensions/twitch/src/client-manager-registry.ts +++ b/extensions/twitch/src/client-manager-registry.ts @@ -85,31 +85,3 @@ export async function removeClientManager(accountId: string): Promise { registry.delete(accountId); entry.logger.info(`Unregistered client manager for account: ${accountId}`); } - -/** - * Disconnect and remove all client managers from the registry. - * - * @returns Promise that resolves when all cleanup is complete - */ -export async function removeAllClientManagers(): Promise { - const promises = [...registry.keys()].map((accountId) => removeClientManager(accountId)); - await Promise.all(promises); -} - -/** - * Get the number of registered client managers. - * - * @returns The count of registered managers - */ -export function getRegisteredClientManagerCount(): number { - return registry.size; -} - -/** - * Clear all client managers without disconnecting. - * - * This is primarily for testing purposes. - */ -export function _clearAllClientManagersForTest(): void { - registry.clear(); -} diff --git a/extensions/whatsapp/src/quoted-message.ts b/extensions/whatsapp/src/quoted-message.ts index 4b369986115..7f06b47c96d 100644 --- a/extensions/whatsapp/src/quoted-message.ts +++ b/extensions/whatsapp/src/quoted-message.ts @@ -1,14 +1,6 @@ import type { MiscMessageGenerationOptions } from "@whiskeysockets/baileys"; import { jidToE164 } from "./text-runtime.js"; -export type QuotedMessageKey = { - id: string; - remoteJid: string; - fromMe: boolean; - participant?: string; - messageText?: string; -}; - // ── Inbound message metadata cache ────────────────────────────────────── // Maps messageId → { participant, participantE164, body, fromMe } so the // outbound adapter can diff --git a/extensions/whatsapp/src/reaction-level.ts b/extensions/whatsapp/src/reaction-level.ts index 2f82549a9ec..6e2e1483945 100644 --- a/extensions/whatsapp/src/reaction-level.ts +++ b/extensions/whatsapp/src/reaction-level.ts @@ -1,12 +1,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; -import { - resolveReactionLevel, - type ReactionLevel, - type ResolvedReactionLevel, -} from "openclaw/plugin-sdk/text-runtime"; +import { resolveReactionLevel, type ResolvedReactionLevel } from "openclaw/plugin-sdk/text-runtime"; import { resolveMergedWhatsAppAccountConfig } from "./account-config.js"; -export type WhatsAppReactionLevel = ReactionLevel; export type ResolvedWhatsAppReactionLevel = ResolvedReactionLevel; /** Resolve the effective reaction level and its implications for WhatsApp. */