import type { AutomationRouteBinding } from '@pellux/goodvibes-sdk/platform/automation/routes';
import type { SharedApprovalRecord } from '../control-plane/index.js';
import type { Tool } from '@pellux/goodvibes-sdk/platform/types/tools';
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 '@pellux/goodvibes-sdk/platform/channels/types';
export interface ChannelPlugin {
    readonly id: string;
    readonly surface: ChannelSurface;
    readonly displayName: string;
    readonly capabilities: readonly ChannelCapability[];
    readonly setupVersion?: number;
    readonly webhookPath?: string;
    readonly handleInbound?: (req: Request) => Promise<Response>;
    readonly renderPolicy?: () => ChannelRenderPolicy | Promise<ChannelRenderPolicy>;
    readonly renderEvent?: (request: ChannelRenderRequest) => Promise<ChannelRenderResult | void>;
    readonly deliverReply?: (pending: unknown, message: string) => Promise<void>;
    readonly deliverProgress?: (pending: unknown, progress: string) => Promise<void>;
    readonly notifyApproval?: (approval: SharedApprovalRecord, binding: AutomationRouteBinding) => Promise<void>;
    readonly getSetupSchema?: (accountId?: string) => Promise<ChannelSetupSchema> | ChannelSetupSchema;
    readonly doctor?: (accountId?: string) => Promise<ChannelDoctorReport> | ChannelDoctorReport;
    readonly listRepairActions?: (accountId?: string) => Promise<readonly ChannelRepairAction[]> | readonly ChannelRepairAction[];
    readonly getLifecycleState?: (accountId?: string) => Promise<ChannelLifecycleState> | ChannelLifecycleState;
    readonly migrateLifecycle?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelLifecycleState> | ChannelLifecycleState;
    readonly resolveAllowlist?: (input: ChannelAllowlistEditInput) => Promise<ChannelAllowlistResolution> | ChannelAllowlistResolution;
    readonly editAllowlist?: (input: ChannelAllowlistEditInput) => Promise<ChannelAllowlistEditResult> | ChannelAllowlistEditResult;
    readonly getStatus?: () => Promise<ChannelStatusSnapshot>;
    readonly listAccounts?: () => Promise<readonly ChannelAccountRecord[]>;
    readonly getAccount?: (accountId: string) => Promise<ChannelAccountRecord | null>;
    readonly startAccount?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly stopAccount?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly loginAccount?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly loginWithQrStart?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly loginWithQrWait?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly logoutAccount?: (accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly runAccountAction?: (action: ChannelAccountLifecycleAction, accountId?: string, input?: Record<string, unknown>) => Promise<ChannelAccountLifecycleResult>;
    readonly authorizeActorAction?: (request: ChannelActorAuthorizationRequest) => Promise<ChannelActorAuthorizationResult>;
    readonly getActionAvailabilityState?: (request: ChannelActorAuthorizationRequest) => Promise<ChannelActorAuthorizationResult>;
    readonly listCapabilities?: () => Promise<readonly ChannelCapabilityDescriptor[]> | readonly ChannelCapabilityDescriptor[];
    readonly listTools?: () => Promise<readonly ChannelToolDescriptor[]> | readonly ChannelToolDescriptor[];
    readonly runTool?: (toolId: string, input?: Record<string, unknown>) => Promise<unknown>;
    readonly listOperatorActions?: () => Promise<readonly ChannelOperatorActionDescriptor[]> | readonly ChannelOperatorActionDescriptor[];
    readonly runOperatorAction?: (actionId: string, input?: Record<string, unknown>) => Promise<unknown>;
    readonly lookupDirectory?: (query: string, options?: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>;
    readonly queryDirectory?: (query: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>;
    readonly listGroupMembers?: (groupId: string, options?: ChannelDirectoryQueryOptions) => Promise<readonly ChannelDirectoryEntry[]>;
    readonly parseExplicitTarget?: (input: string, options?: ChannelTargetResolveOptions) => Promise<ChannelResolvedTarget | null> | ChannelResolvedTarget | null;
    readonly inferTargetConversationKind?: (input: string, options?: ChannelTargetResolveOptions) => Promise<ChannelConversationKind | null> | ChannelConversationKind | null;
    readonly resolveTarget?: (options: ChannelTargetResolveOptions) => Promise<ChannelResolvedTarget | null>;
    readonly resolveSessionTarget?: (target: ChannelResolvedTarget, options?: ChannelTargetResolveOptions) => Promise<string | null> | string | null;
    readonly resolveParentConversationCandidates?: (options: ChannelTargetResolveOptions) => Promise<readonly ChannelResolvedTarget[]>;
    readonly listAgentTools?: () => readonly Tool[];
}
export declare class ChannelPluginRegistry {
    private readonly plugins;
    private readonly pluginsBySurface;
    private readonly pluginsByPath;
    private version;
    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>;
    migrateLifecycle(surface: ChannelSurface, accountId?: string, input?: Record<string, unknown>): 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