From 9f5537874507599c4f6fb81748c6bb117e176409 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 14:51:27 +0100 Subject: [PATCH] refactor: trim channel dead exports --- extensions/msteams/src/channel-api.ts | 9 --------- extensions/nostr/src/gateway.ts | 11 ----------- extensions/qqbot/src/channel.ts | 17 ----------------- 3 files changed, 37 deletions(-) diff --git a/extensions/msteams/src/channel-api.ts b/extensions/msteams/src/channel-api.ts index 50d0b1c8285..3ef39a737d2 100644 --- a/extensions/msteams/src/channel-api.ts +++ b/extensions/msteams/src/channel-api.ts @@ -1,10 +1 @@ -export type { ChannelMessageActionName } from "openclaw/plugin-sdk/channel-contract"; export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core"; -export { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status"; -export type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; -export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id"; -export { - buildProbeChannelStatusSummary, - createDefaultChannelRuntimeState, -} from "openclaw/plugin-sdk/status-helpers"; -export { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking"; diff --git a/extensions/nostr/src/gateway.ts b/extensions/nostr/src/gateway.ts index 7fbe957005a..348617c50db 100644 --- a/extensions/nostr/src/gateway.ts +++ b/extensions/nostr/src/gateway.ts @@ -3,7 +3,6 @@ import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; import { createPreCryptoDirectDmAuthorizer, - DEFAULT_ACCOUNT_ID, type ChannelOutboundAdapter, resolveInboundDirectDmAccessWithRuntime, type ChannelPlugin, @@ -298,16 +297,6 @@ export const nostrOutboundAdapter: NostrOutboundAdapter = { }, }; -export function getNostrMetrics( - accountId: string = DEFAULT_ACCOUNT_ID, -): MetricsSnapshot | undefined { - const bus = activeBuses.get(accountId); - if (bus) { - return bus.getMetrics(); - } - return metricsSnapshots.get(accountId); -} - export function getActiveNostrBuses(): Map { return new Map(activeBuses); } diff --git a/extensions/qqbot/src/channel.ts b/extensions/qqbot/src/channel.ts index 87a5153b027..866b2ab83f0 100644 --- a/extensions/qqbot/src/channel.ts +++ b/extensions/qqbot/src/channel.ts @@ -23,23 +23,6 @@ import { } from "./engine/messaging/target-parser.js"; import type { ResolvedQQBotAccount } from "./types.js"; -/** Maximum text length for a single QQ Bot message. */ -export const TEXT_CHUNK_LIMIT = 5000; - -/** - * Naive text chunking fallback. - * - * The outbound pipeline normally uses `runtime.channel.text.chunkMarkdownText`; - * this remains exported for callers that need the legacy channel helper. - */ -export function chunkText(text: string, limit: number = TEXT_CHUNK_LIMIT): string[] { - const chunks: string[] = []; - for (let i = 0; i < text.length; i += limit) { - chunks.push(text.slice(i, i + limit)); - } - return chunks.length > 0 ? chunks : [text]; -} - // Shared promise so concurrent multi-account startups serialize the dynamic // import of the gateway module, avoiding an ESM circular-dependency race. let _gatewayModulePromise: Promise | undefined;