import { isChannelVisibleInConfiguredLists } from "../channels/plugins/exposure.js"; import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js"; import {
getChannelPlugin,
listChannelPlugins,
normalizeChannelId,
} from "../channels/plugins/index.js"; import type { ChannelId } from "../channels/plugins/types.public.js"; import type { AgentBinding } from "../config/types.js"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js";
export function summarizeBindings(cfg: OpenClawConfig, bindings: AgentBinding[]): string[] { if (bindings.length === 0) { return [];
} const seen = new Map<string, string>(); for (const binding of bindings) { const channel = normalizeChannelId(binding.match.channel); if (!channel) { continue;
} const accountId = binding.match.accountId ?? resolveDefaultAccountId(cfg, channel); const key = providerAccountKey(channel, accountId); if (!seen.has(key)) { const label = formatChannelAccountLabel({
provider: channel,
accountId,
});
seen.set(key, label);
}
} return [...seen.values()];
}
export function listProvidersForAgent(params: {
summaryIsDefault: boolean;
cfg: OpenClawConfig;
bindings: AgentBinding[];
providerStatus: Map<string, ProviderAccountStatus>;
}): string[] { const allProviderEntries = [...params.providerStatus.values()]; const providerLines: string[] = []; if (params.bindings.length > 0) { const seen = new Set<string>(); for (const binding of params.bindings) { const channel = normalizeChannelId(binding.match.channel); if (!channel) { continue;
} const accountId = binding.match.accountId ?? resolveDefaultAccountId(params.cfg, channel); const key = providerAccountKey(channel, accountId); if (seen.has(key)) { continue;
}
seen.add(key); const status = params.providerStatus.get(key); if (status) {
providerLines.push(formatProviderEntry(status));
} else {
providerLines.push(
`${formatChannelAccountLabel({ provider: channel, accountId })}: unknown`,
);
}
} return providerLines;
}
if (params.summaryIsDefault) { for (const entry of allProviderEntries) { if (shouldShowProviderEntry(entry, params.cfg)) {
providerLines.push(formatProviderEntry(entry));
}
}
}
return providerLines;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.