refactor: trim channel dead exports · openclaw/openclaw@9f55378
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type { ChannelMessageActionName } from "openclaw/plugin-sdk/channel-contract"; |
2 | 1 | export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core"; |
3 | | -export { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status"; |
4 | | -export type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; |
5 | | -export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id"; |
6 | | -export { |
7 | | -buildProbeChannelStatusSummary, |
8 | | -createDefaultChannelRuntimeState, |
9 | | -} from "openclaw/plugin-sdk/status-helpers"; |
10 | | -export { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,6 @@ import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
3 | 3 | import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types"; |
4 | 4 | import { |
5 | 5 | createPreCryptoDirectDmAuthorizer, |
6 | | -DEFAULT_ACCOUNT_ID, |
7 | 6 | type ChannelOutboundAdapter, |
8 | 7 | resolveInboundDirectDmAccessWithRuntime, |
9 | 8 | type ChannelPlugin, |
@@ -298,16 +297,6 @@ export const nostrOutboundAdapter: NostrOutboundAdapter = {
|
298 | 297 | }, |
299 | 298 | }; |
300 | 299 | |
301 | | -export function getNostrMetrics( |
302 | | -accountId: string = DEFAULT_ACCOUNT_ID, |
303 | | -): MetricsSnapshot | undefined { |
304 | | -const bus = activeBuses.get(accountId); |
305 | | -if (bus) { |
306 | | -return bus.getMetrics(); |
307 | | -} |
308 | | -return metricsSnapshots.get(accountId); |
309 | | -} |
310 | | - |
311 | 300 | export function getActiveNostrBuses(): Map<string, NostrBusHandle> { |
312 | 301 | return new Map(activeBuses); |
313 | 302 | } |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,23 +23,6 @@ import {
|
23 | 23 | } from "./engine/messaging/target-parser.js"; |
24 | 24 | import type { ResolvedQQBotAccount } from "./types.js"; |
25 | 25 | |
26 | | -/** Maximum text length for a single QQ Bot message. */ |
27 | | -export const TEXT_CHUNK_LIMIT = 5000; |
28 | | - |
29 | | -/** |
30 | | - * Naive text chunking fallback. |
31 | | - * |
32 | | - * The outbound pipeline normally uses `runtime.channel.text.chunkMarkdownText`; |
33 | | - * this remains exported for callers that need the legacy channel helper. |
34 | | - */ |
35 | | -export function chunkText(text: string, limit: number = TEXT_CHUNK_LIMIT): string[] { |
36 | | -const chunks: string[] = []; |
37 | | -for (let i = 0; i < text.length; i += limit) { |
38 | | -chunks.push(text.slice(i, i + limit)); |
39 | | -} |
40 | | -return chunks.length > 0 ? chunks : [text]; |
41 | | -} |
42 | | - |
43 | 26 | // Shared promise so concurrent multi-account startups serialize the dynamic |
44 | 27 | // import of the gateway module, avoiding an ESM circular-dependency race. |
45 | 28 | let _gatewayModulePromise: Promise<typeof import("./bridge/gateway.js")> | undefined; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。