import type { PluginRegistry } from "./registry-types.js" ;
export const PLUGIN_REGISTRY_STATE = Symbol.for ("openclaw.pluginRegistryState" );
export type RuntimeTrackedPluginRegistry = PluginRegistry;
export type RegistrySurfaceState = {
registry: RuntimeTrackedPluginRegistry | null ;
pinned: boolean ;
version: number;
};
export type RegistryState = {
activeRegistry: RuntimeTrackedPluginRegistry | null ;
activeVersion: number;
httpRoute: RegistrySurfaceState;
channel: RegistrySurfaceState;
key: string | null ;
workspaceDir: string | null ;
runtimeSubagentMode: "default" | "explicit" | "gateway-bindable" ;
importedPluginIds: Set<string>;
};
type GlobalRegistryState = typeof globalThis & {
[PLUGIN_REGISTRY_STATE]?: RegistryState;
};
export function getPluginRegistryState(): RegistryState | undefined {
return (globalThis as GlobalRegistryState)[PLUGIN_REGISTRY_STATE];
}
export function getActivePluginChannelRegistryFromState(): RuntimeTrackedPluginRegistry | null {
const state = getPluginRegistryState();
return state?.channel.registry ?? state?.activeRegistry ?? null ;
}
export function getActivePluginRegistryWorkspaceDirFromState(): string | undefined {
const state = getPluginRegistryState();
return state?.workspaceDir ?? undefined;
}
Messung V0.5 in Prozent C=99 H=95 G=96
¤ Dauer der Verarbeitung: 0.2 Sekunden
¤
*© Formatika GbR, Deutschland