import type { AutomationRouteBinding } from '../automation/routes.js';
import type { SharedApprovalRecord } from '../control-plane/index.js';
import type { Tool } from '../types/tools.js';
import type { ChannelAdapterDescriptor, ChannelAllowlistEditInput, ChannelAllowlistEditResult, ChannelAllowlistResolution, ChannelAccountRecord, ChannelAccountLifecycleAction, ChannelAccountLifecycleResult, ChannelActorAuthorizationRequest, ChannelActorAuthorizationResult, ChannelCapabilityDescriptor, ChannelCapability, ChannelConversationKind, ChannelDirectoryEntry, ChannelDirectoryQueryOptions, ChannelDoctorReport, ChannelLifecycleState, ChannelOperatorActionDescriptor, ChannelRenderPolicy, ChannelRenderRequest, ChannelRenderResult, ChannelResolvedTarget, ChannelRepairAction, ChannelSetupSchema, ChannelStatusSnapshot, ChannelSurface, ChannelTargetResolveOptions, ChannelToolDescriptor } from './types.js';
import type { FeatureFlagReader } from '../runtime/feature-flags/index.js';
export interface ChannelPlugin {
    readonly id: string;
    readonly surface: ChannelSurface;
    readonly displayName: string;
    readonly capabilities: readonly ChannelCapability[];
    readonly setupVersion?: number | undefined;
    readonly webhookPath?: string | undefined;
    readonly handleInbound?: ((req: Request) => Promise<Response>) | undefined;
    readonly renderPolicy?: (() => ChannelRenderPolicy | Promise<ChannelRenderPolicy>) | undefined;
    readonly renderEvent?: ((request: ChannelRenderRequest) => Promise<ChannelRenderResult | void>) | undefined;
    readonly deliverReply?: ((pending: unknown, message: string) => Promise<void>) | undefined;
    readonly deliverProgress?: ((pending: unknown, progress: string) => Promise<void>) | undefined;
    readonly notifyApproval?: ((approval: SharedApprovalRecord, binding: AutomationRouteBinding) => Promise<void>) | undefined;
    readonly getSetupSchema?: ((accountId?: string) => Promise<ChannelSetupSchema> | ChannelSetupSchema) | undefined;
    readonly doctor?: ((accountId?: string) => Promise<ChannelDoctorReport> | ChannelDoctorReport) | undefined;
    readonly listRepairActions?: ((accountId?: string) => Promise<readonly ChannelRepairAction[]> | readonly ChannelRepairAction[]) | undefined;
    readonly getLifecycleState?: ((accountId?: string) => Promise<ChannelLifecycleState> | ChannelLifecycleState) | undefined;
    readonly resolveAllowlist?: ((input: ChannelAllowlistEditInput) => Promise<ChannelAllowlistResolution> | ChannelAllowlistResolution) | undefined;
    readonly editAllowlist?: ((input: ChannelAllowlistEditInput) => Promise<ChannelAllowlistEditResult> | ChannelAllowlistEditResult) | undefined;
    readonly getStatus?: (() => Promise<ChannelStatusSnapshot>) | undefined;
    readonly listAccounts?: (() => Promise<readonly ChannelAccountRecord[]>) | undefined;
    readonly getAccount?: ((accountId: string) => Promise<ChannelAccountRecord | null>) | undefined;
    readonly startAccount?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly stopAccount?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly loginAccount?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly loginWithQrStart?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly loginWithQrWait?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly logoutAccount?: ((accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>) | undefined;
    readonly runAccountAction?: (action: ChannelAccountLifecycleAction, accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly authorizeActorAction?: ((request: ChannelActorAuthorizationRequest) => Promise<ChannelActorAuthorizationResult>) | undefined;
    readonly getActionAvailabilityState?: ((request: ChannelActorAuthorizationRequest) => Promise<ChannelActorAuthorizationResult>) | undefined;
    readonly listCapabilities?: (() => Promise<readonly ChannelCapabilityDescriptor[]> | readonly ChannelCapabilityDescriptor[]) | undefined;
    readonly listTools?: (() => Promise<readonly ChannelToolDescriptor[]> | readonly ChannelToolDescriptor[]) | undefined;
    readonly runTool?: ((toolId: string, input?: Record<string, unknown>) => Promise<unknown>) | undefined;
    readonly listOperatorActions?: (() => Promise<readonly ChannelOperatorActionDescriptor[]> | readonly ChannelOperatorActionDescriptor[]) | undefined;
    readonly runOperatorAction?: ((actionId: string, input?: Record<string, unknown>) => Promise<unknown>) | undefined;
    readonly lookupDirectory?: ((query: string, options?: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>) | undefined;
    readonly queryDirectory?: ((query: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>) | undefined;
    readonly listGroupMembers?: ((groupId: string, options?: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>) | undefined;
    readonly parseExplicitTarget?: ((input: string, options?: ChannelTargetResolveOptions) => Promise<ChannelResolvedTarget | null> | ChannelResolvedTarget | null) | undefined;
    readonly inferTargetConversationKind?: ((input: string, options?: ChannelTargetResolveOptions) => Promise<ChannelConversationKind | null> | ChannelConversationKind | null) | undefined;
    readonly resolveTarget?: ((options: ChannelTargetResolveOptions) => Promise<ChannelResolvedTarget | null>) | undefined;
    readonly resolveSessionTarget?: ((target: ChannelResolvedTarget, options?: ChannelTargetResolveOptions) => Promise<string | null> | string | null) | undefined;
    readonly resolveParentConversationCandidates?: ((options: ChannelTargetResolveOptions) => Promise<readonly ChannelResolvedTarget[]>) | undefined;
    readonly listAgentTools?: (() => readonly Tool[]) | undefined;
}
export declare class ChannelPluginRegistry {
    private readonly plugins;
    private readonly pluginsBySurface;
    private readonly pluginsByPath;
    private readonly featureFlags;
    private version;
    constructor(options?: {
        readonly featureFlags?: FeatureFlagReader;
    });
    private isPluginEnabled;
    register(plugin: ChannelPlugin): void;
    unregister(pluginId: string): boolean;
    getVersion(): number;
    list(): ChannelPlugin[];
    listDescriptors(): ChannelAdapterDescriptor[];
    getBySurface(surface: ChannelSurface): ChannelPlugin | null;
    get(pluginId: string): ChannelPlugin | null;
    getByPath(pathname: string): ChannelPlugin | null;
    handleInbound(pathname: string, req: Request): Promise<Response | null>;
    deliverReply(surface: ChannelSurface, pending: unknown, message: string): Promise<boolean>;
    deliverProgress(surface: ChannelSurface, pending: unknown, progress: string): Promise<boolean>;
    notifyApproval(surface: ChannelSurface, approval: SharedApprovalRecord, binding: AutomationRouteBinding): Promise<boolean>;
    getRenderPolicy(surface: ChannelSurface): Promise<ChannelRenderPolicy | null>;
    render(surface: ChannelSurface, request: ChannelRenderRequest): Promise<ChannelRenderResult | null>;
    getSetupSchema(surface: ChannelSurface, accountId?: string): Promise<ChannelSetupSchema | null>;
    doctor(surface: ChannelSurface, accountId?: string): Promise<ChannelDoctorReport | null>;
    listRepairActions(surface: ChannelSurface, accountId?: string): Promise<readonly ChannelRepairAction[]>;
    getLifecycleState(surface: ChannelSurface, accountId?: string): Promise<ChannelLifecycleState | null>;
    resolveAllowlist(surface: ChannelSurface, input: ChannelAllowlistEditInput): Promise<ChannelAllowlistResolution | null>;
    editAllowlist(surface: ChannelSurface, input: ChannelAllowlistEditInput): Promise<ChannelAllowlistEditResult | null>;
    listStatus(): Promise<ChannelStatusSnapshot[]>;
    listAccounts(surface?: ChannelSurface): Promise<ChannelAccountRecord[]>;
    getAccount(surface: ChannelSurface, accountId: string): Promise<ChannelAccountRecord | null>;
    runAccountAction(surface: ChannelSurface, action: ChannelAccountLifecycleAction, accountId?: string, input?: Record<string, unknown>): Promise<ChannelAccountLifecycleResult | null>;
    authorizeActorAction(surface: ChannelSurface, request: ChannelActorAuthorizationRequest): Promise<ChannelActorAuthorizationResult | null>;
    listCapabilities(surface?: ChannelSurface): Promise<ChannelCapabilityDescriptor[]>;
    listTools(surface?: ChannelSurface): Promise<ChannelToolDescriptor[]>;
    runTool(surface: ChannelSurface, toolId: string, input?: Record<string, unknown>): Promise<unknown>;
    listOperatorActions(surface?: ChannelSurface): Promise<ChannelOperatorActionDescriptor[]>;
    runOperatorAction(surface: ChannelSurface, actionId: string, input?: Record<string, unknown>): Promise<unknown>;
    listAgentTools(surface?: ChannelSurface): Tool[];
    resolveTarget(surface: ChannelSurface, options: ChannelTargetResolveOptions): Promise<ChannelResolvedTarget | null>;
    resolveSessionTarget(surface: ChannelSurface, target: ChannelResolvedTarget, options?: ChannelTargetResolveOptions): Promise<string | null>;
    resolveParentConversationCandidates(surface: ChannelSurface, options: ChannelTargetResolveOptions): Promise<readonly ChannelResolvedTarget[]>;
    lookupDirectory(surface: ChannelSurface, query: string, options?: ChannelDirectoryQueryOptions): Promise<readonly ChannelDirectoryEntry[]>;
    queryDirectory(surface: ChannelSurface, options: ChannelDirectoryQueryOptions): Promise<readonly ChannelDirectoryEntry[]>;
    listGroupMembers(surface: ChannelSurface, groupId: string, options?: ChannelDirectoryQueryOptions): Promise<readonly ChannelDirectoryEntry[]>;
}
//# sourceMappingURL=plugin-registry.d.ts.map