mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-19 09:01:39 -06:00
ccee629359
* refactor(plugins): delete registry compat scaffolding * test(plugins): update CLI registry handle mock * fix(plugins): preserve explicitly initialized hook registries * test(plugins): update registry ownership fixtures * fix(channels): restore registry snapshot memo
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { PLUGIN_REGISTRY_STATE } from "./runtime-state-key.js";
|
|
// Stores plugin runtime registry state for the current process lifecycle.
|
|
import { getActivePluginRegistryWorkspaceDirFromState as getWorkspaceDirFromState } from "./runtime-workspace-state.js";
|
|
|
|
export { PLUGIN_REGISTRY_STATE };
|
|
|
|
type PluginRegistry = import("./registry-types.js").PluginRegistry;
|
|
|
|
export type RegistryState = {
|
|
activeRegistry: PluginRegistry | null;
|
|
activeVersion: number;
|
|
agentEventBridgeUnsubscribe?: (() => void) | undefined;
|
|
key: string | null;
|
|
workspaceDir: string | null;
|
|
runtimeSubagentMode: "default" | "explicit" | "gateway-bindable";
|
|
importedPluginIds: Set<string>;
|
|
registrationContext?: { registry: PluginRegistry; pluginId: string };
|
|
};
|
|
|
|
type GlobalRegistryState = typeof globalThis & {
|
|
[PLUGIN_REGISTRY_STATE]?: RegistryState;
|
|
};
|
|
|
|
export function getPluginRegistryState(): RegistryState | undefined {
|
|
return (globalThis as GlobalRegistryState)[PLUGIN_REGISTRY_STATE];
|
|
}
|
|
export function getActivePluginRegistryWorkspaceDirFromState(): string | undefined {
|
|
return getWorkspaceDirFromState();
|
|
}
|