import type { FasedAgentConfig } from "../config/config.js";
import type { PluginRecord } from "./registry.js";
export type NormalizedPluginsConfig = {
    enabled: boolean;
    allow: string[];
    deny: string[];
    loadPaths: string[];
    slots: {
        memory?: string | null;
    };
    entries: Record<string, {
        enabled?: boolean;
        config?: unknown;
        runtime?: PluginRuntimeAccess;
    }>;
};
export declare const PLUGIN_ADMIN_RPC_ACTION_METHODS: readonly ["chat.inject", "push.test", "web.login.start", "web.login.wait"];
export type PluginAdminRpcActionMethod = (typeof PLUGIN_ADMIN_RPC_ACTION_METHODS)[number];
export type PluginAdminRpcActionGrant = {
    method: PluginAdminRpcActionMethod;
    sources: string[];
    requireOperatorApproval: boolean;
};
export type PluginRuntimeAccess = {
    helpers: {
        sessions: {
            read: boolean;
        };
    };
    adminRpcActions: {
        allow: PluginAdminRpcActionGrant[];
    };
};
export declare const BUNDLED_ENABLED_BY_DEFAULT: Set<string>;
export declare function isPluginRuntimeSessionReadAllowed(config: NormalizedPluginsConfig, pluginId: string): boolean;
export type PluginAdminRpcActionSource = {
    origin?: string;
    source?: string;
};
export type PluginAdminRpcActionGrantDecision = {
    allowed: true;
    pluginId: string;
    method: PluginAdminRpcActionMethod;
    grant: PluginAdminRpcActionGrant;
    matchedSource: string;
} | {
    allowed: false;
    pluginId: string;
    method: string;
    reason: "invalid-admin-rpc-method" | "missing-runtime-admin-rpc-grant" | "missing-source-allowlist" | "source-not-allowlisted" | "operator-approval-required";
    sourceKeys: string[];
};
export declare function resolvePluginAdminRpcActionSourceKeys(source?: PluginAdminRpcActionSource): string[];
export declare function resolvePluginAdminRpcActionGrant(params: {
    config: NormalizedPluginsConfig;
    pluginId: string;
    method: string;
    source?: PluginAdminRpcActionSource;
}): PluginAdminRpcActionGrantDecision;
export declare const normalizePluginsConfig: (config?: FasedAgentConfig["plugins"]) => NormalizedPluginsConfig;
export declare function applyTestPluginDefaults(cfg: FasedAgentConfig, env?: NodeJS.ProcessEnv): FasedAgentConfig;
export declare function isTestDefaultMemorySlotDisabled(cfg: FasedAgentConfig, env?: NodeJS.ProcessEnv): boolean;
export declare function resolveEnableState(id: string, origin: PluginRecord["origin"], config: NormalizedPluginsConfig): {
    enabled: boolean;
    reason?: string;
};
export declare function isBundledChannelEnabledByChannelConfig(cfg: FasedAgentConfig | undefined, pluginId: string): boolean;
export declare function resolveEffectiveEnableState(params: {
    id: string;
    origin: PluginRecord["origin"];
    config: NormalizedPluginsConfig;
    rootConfig?: FasedAgentConfig;
}): {
    enabled: boolean;
    reason?: string;
};
export declare function resolveMemorySlotDecision(params: {
    id: string;
    kind?: string;
    slot: string | null | undefined;
    selectedId: string | null;
}): {
    enabled: boolean;
    reason?: string;
    selected?: boolean;
};
