mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 18:21:36 +00:00
20 lines
739 B
TypeScript
20 lines
739 B
TypeScript
// Runtime bridge for plugin-provided CLI backends.
|
|
import { getActiveRuntimePluginRegistry } from "./active-runtime-registry.js";
|
|
import type { CliBackendPlugin } from "./cli-backend.types.js";
|
|
|
|
/** Runtime CLI backend registration with owning plugin id. */
|
|
type PluginCliBackendEntry = CliBackendPlugin & {
|
|
pluginId: string;
|
|
builtWithOpenClawVersion?: string;
|
|
};
|
|
|
|
/** Resolves CLI backends from the active runtime plugin registry. */
|
|
export function resolveRuntimeCliBackends(): PluginCliBackendEntry[] {
|
|
return (getActiveRuntimePluginRegistry()?.cliBackends ?? []).map((entry) =>
|
|
Object.assign({}, entry.backend, {
|
|
pluginId: entry.pluginId,
|
|
builtWithOpenClawVersion: entry.builtWithOpenClawVersion,
|
|
}),
|
|
);
|
|
}
|