openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
213 lines • 9.67 kB
TypeScript
import "../types.openclaw-yUy4bDSr.js";
import { Ut as augmentModelCatalogWithProviderPlugins, ro as PluginLoadOptions, yo as PluginRegistry, zo as ProviderPlugin } from "../config-contracts-DzLaG7FV.js";
import { c as PluginMetadataRegistryView, d as DeclaredProviderOwnerIndex, l as PluginMetadataSnapshot, t as PluginRegistrySnapshot } from "../plugin-metadata-snapshot-kWD3XiQo.js";
import { n as PluginManifestRegistry } from "../manifest-registry-CMw7D_Sv.js";
import "../config-activation-shared-13EDgO7Z.js";
//#region src/plugins/providers.runtime.d.ts
declare const { isPluginProvidersLoadInFlight, resolvePluginProviderRegistryCore, resolvePluginProvidersCore }: Readonly<{
isPluginProvidersLoadInFlight: (params: Parameters<(params: Parameters<(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
}) => ReturnType<(registry: PluginRegistry, base: ReturnType<(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
} & {
env: NodeJS.ProcessEnv;
}, manifestRegistry?: PluginLoadOptions["manifestRegistry"], declaredProviderOwners?: DeclaredProviderOwnerIndex, retained?: boolean) => {
pluginIds: string[] | undefined;
workspaceDir: string | undefined;
manifestRegistry: PluginManifestRegistry | undefined;
onlyPluginIds: string[] | undefined;
providerRefs: readonly string[] | undefined;
projectedPluginIds: string[] | undefined;
declaredProviderOwners: DeclaredProviderOwnerIndex;
providerOwners: {
provider: string;
ownerPluginIds: string[];
providerPluginIds: string[];
runtimePluginIds: string[];
}[];
providerRegistrationPluginIds: Set<string> | undefined;
runtimeRegistrationPluginIds: Set<string> | undefined;
unownedProviderRefs: readonly string[];
explicitOwnerPluginIds: string[];
}>, onlyPluginIds?: readonly string[]) => {
registry: PluginRegistry;
workspaceDir: string | undefined;
onlyPluginIds: readonly string[] | undefined;
isProviderOwnerEligible: (pluginId: string, provider: string) => boolean;
}> | undefined>[0], onSelectedRegistry?: (registry: PluginRegistry) => ((provider: ProviderPlugin, pluginId: string) => ProviderPlugin) | undefined) => ProviderPlugin[]>[0]) => boolean;
resolvePluginProviderRegistryCore: (params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
}) => ReturnType<(registry: PluginRegistry, base: ReturnType<(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
} & {
env: NodeJS.ProcessEnv;
}, manifestRegistry?: PluginLoadOptions["manifestRegistry"], declaredProviderOwners?: DeclaredProviderOwnerIndex, retained?: boolean) => {
pluginIds: string[] | undefined;
workspaceDir: string | undefined;
manifestRegistry: PluginManifestRegistry | undefined;
onlyPluginIds: string[] | undefined;
providerRefs: readonly string[] | undefined;
projectedPluginIds: string[] | undefined;
declaredProviderOwners: DeclaredProviderOwnerIndex;
providerOwners: {
provider: string;
ownerPluginIds: string[];
providerPluginIds: string[];
runtimePluginIds: string[];
}[];
providerRegistrationPluginIds: Set<string> | undefined;
runtimeRegistrationPluginIds: Set<string> | undefined;
unownedProviderRefs: readonly string[];
explicitOwnerPluginIds: string[];
}>, onlyPluginIds?: readonly string[]) => {
registry: PluginRegistry;
workspaceDir: string | undefined;
onlyPluginIds: readonly string[] | undefined;
isProviderOwnerEligible: (pluginId: string, provider: string) => boolean;
}> | undefined;
resolvePluginProvidersCore: (params: Parameters<(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
}) => ReturnType<(registry: PluginRegistry, base: ReturnType<(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
onlyPluginIds?: string[];
providerRefs?: readonly string[];
modelRefs?: readonly string[];
activate?: boolean;
cache?: boolean;
applyAutoEnable?: boolean;
pluginSdkResolution?: PluginLoadOptions["pluginSdkResolution"];
mode?: "runtime" | "setup";
includeUntrustedWorkspacePlugins?: boolean;
pluginMetadataSnapshot?: PluginMetadataRegistryView;
skipIfLoadInFlight?: boolean;
registryScope?: "exact" | "loaded";
} & {
env: NodeJS.ProcessEnv;
}, manifestRegistry?: PluginLoadOptions["manifestRegistry"], declaredProviderOwners?: DeclaredProviderOwnerIndex, retained?: boolean) => {
pluginIds: string[] | undefined;
workspaceDir: string | undefined;
manifestRegistry: PluginManifestRegistry | undefined;
onlyPluginIds: string[] | undefined;
providerRefs: readonly string[] | undefined;
projectedPluginIds: string[] | undefined;
declaredProviderOwners: DeclaredProviderOwnerIndex;
providerOwners: {
provider: string;
ownerPluginIds: string[];
providerPluginIds: string[];
runtimePluginIds: string[];
}[];
providerRegistrationPluginIds: Set<string> | undefined;
runtimeRegistrationPluginIds: Set<string> | undefined;
unownedProviderRefs: readonly string[];
explicitOwnerPluginIds: string[];
}>, onlyPluginIds?: readonly string[]) => {
registry: PluginRegistry;
workspaceDir: string | undefined;
onlyPluginIds: readonly string[] | undefined;
isProviderOwnerEligible: (pluginId: string, provider: string) => boolean;
}> | undefined>[0], onSelectedRegistry?: (registry: PluginRegistry) => ((provider: ProviderPlugin, pluginId: string) => ProviderPlugin) | undefined) => ProviderPlugin[];
}>;
//#endregion
//#region src/plugins/providers.d.ts
type ProviderManifestLoadParams = {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
registry?: PluginRegistrySnapshot;
manifestRegistry?: PluginManifestRegistry;
metadataSnapshot?: Pick<PluginMetadataSnapshot, "manifestRegistry"> & Partial<Pick<PluginMetadataSnapshot, "owners" | "byPluginId">>;
};
type ProviderOwnershipLookupParams = {
provider: string;
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
manifestRegistry?: PluginManifestRegistry;
metadataSnapshot?: Pick<PluginMetadataSnapshot, "owners" | "manifestRegistry" | "byPluginId">;
};
export declare function resolveOwningPluginIdsForProvider(params: ProviderOwnershipLookupParams): string[] | undefined;
export declare function resolveCatalogHookProviderPluginIds(params: {
config?: PluginLoadOptions["config"];
workspaceDir?: string;
env?: PluginLoadOptions["env"];
metadataSnapshot?: ProviderManifestLoadParams["metadataSnapshot"];
}): string[];
//#endregion
//#region src/plugin-sdk/provider-catalog-runtime.d.ts
/** Bare provider callbacks retain borrowed resources until their SDK host closes. */
declare function resolvePluginProvidersForSdk(params: Parameters<typeof resolvePluginProvidersCore>[0]): ProviderPlugin[];
//#endregion
export { augmentModelCatalogWithProviderPlugins, isPluginProvidersLoadInFlight, resolvePluginProvidersForSdk as resolvePluginProviders };