mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 22:10:21 +00:00
20 lines
677 B
TypeScript
20 lines
677 B
TypeScript
import type { OpenClawConfig } from "../config/config.js";
|
|
import { getChannelPlugin } from "./plugins/registry.js";
|
|
import type { ChannelId } from "./plugins/types.js";
|
|
|
|
export type ReadOnlyInspectedAccount = Record<string, unknown>;
|
|
|
|
export async function inspectReadOnlyChannelAccount(params: {
|
|
channelId: ChannelId;
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
}): Promise<ReadOnlyInspectedAccount | null> {
|
|
const inspectAccount = getChannelPlugin(params.channelId)?.config.inspectAccount;
|
|
if (!inspectAccount) {
|
|
return null;
|
|
}
|
|
return (await Promise.resolve(
|
|
inspectAccount(params.cfg, params.accountId),
|
|
)) as ReadOnlyInspectedAccount | null;
|
|
}
|