mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:30:43 +00:00
refactor: trim channel dead exports
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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<string, NostrBusHandle> {
|
||||
return new Map(activeBuses);
|
||||
}
|
||||
|
||||
@@ -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<typeof import("./bridge/gateway.js")> | undefined;
|
||||
|
||||
Reference in New Issue
Block a user