import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { InstalledPluginIndex } from "./installed-plugin-index.js"; import type { PluginManifestRecord, PluginManifestRegistry } from "./manifest-registry.js"; import type { PluginDiagnostic } from "./manifest-types.js"; export type PluginMetadataSnapshotOwnerMaps = { channels: ReadonlyMap; channelConfigs: ReadonlyMap; providers: ReadonlyMap; modelCatalogProviders: ReadonlyMap; cliBackends: ReadonlyMap; setupProviders: ReadonlyMap; commandAliases: ReadonlyMap; contracts: ReadonlyMap; }; export type PluginMetadataSnapshotMetrics = { registrySnapshotMs: number; manifestRegistryMs: number; ownerMapsMs: number; totalMs: number; indexPluginCount: number; manifestPluginCount: number; }; export type PluginMetadataSnapshotRegistryDiagnostic = { level: "info" | "warn"; code: | "persisted-registry-disabled" | "persisted-registry-missing" | "persisted-registry-stale-policy" | "persisted-registry-stale-source"; message: string; }; export type PluginMetadataSnapshot = { policyHash: string; configFingerprint?: string; workspaceDir?: string; index: InstalledPluginIndex; registryDiagnostics: readonly PluginMetadataSnapshotRegistryDiagnostic[]; manifestRegistry: PluginManifestRegistry; plugins: readonly PluginManifestRecord[]; diagnostics: readonly PluginDiagnostic[]; byPluginId: ReadonlyMap; normalizePluginId: (pluginId: string) => string; owners: PluginMetadataSnapshotOwnerMaps; metrics: PluginMetadataSnapshotMetrics; }; export type PluginMetadataRegistryView = Pick; export type PluginMetadataManifestView = Pick; export type LoadPluginMetadataSnapshotParams = { config: OpenClawConfig; workspaceDir?: string; stateDir?: string; env: NodeJS.ProcessEnv; index?: InstalledPluginIndex; preferPersisted?: boolean; };