import { AgentManager } from '../tools/agent/index.js';
import { ConfigManager } from '../config/manager.js';
import { ServiceRegistry } from '../config/service-registry.js';
import { UserAuthManager } from '@pellux/goodvibes-sdk/platform/security/user-auth';
import { AutomationDeliveryManager, AutomationManager } from '../automation/index.js';
import { ApprovalBroker, ControlPlaneGateway, SharedSessionBroker } from '../control-plane/index.js';
import { GatewayMethodCatalog } from '../control-plane/index.js';
import { BuiltinChannelRuntime, ChannelReplyPipeline, ChannelProviderRuntimeManager, ChannelPluginRegistry, ChannelPolicyManager, RouteBindingManager, SurfaceRegistry } from '../channels/index.js';
import { RuntimeEventBus } from '../runtime/events/index.js';
import { PlatformServiceManager } from './service-manager.js';
import { WatcherRegistry } from '../watchers/index.js';
import { type DistributedPeerAuth } from '../runtime/remote/index.js';
import { KnowledgeGraphqlService, KnowledgeService } from '../knowledge/index.js';
import type { IntegrationHelperService } from '../runtime/integration/helpers.js';
import { DaemonControlPlaneHelper } from './control-plane.js';
import { DaemonSurfaceDeliveryHelper } from './surface-delivery.js';
import { DaemonSurfaceActionHelper } from './surface-actions.js';
import { DaemonTransportEventsHelper } from './transport-events.js';
import { DaemonHttpRouter } from './http/router.js';
import { type RuntimeServices } from '../runtime/services.js';
import type { DaemonConfig, PendingSurfaceReply } from './types.js';
import type { ResolvedInboundTlsContext } from '../runtime/network/index.js';
type JsonBody = Record<string, unknown>;
export interface ResolvedDaemonFacadeRuntime {
    readonly configManager: ConfigManager;
    readonly runtimeServices: RuntimeServices;
    readonly integrationHelpers: IntegrationHelperService;
    readonly port: number;
    readonly host: string;
    readonly agentManager: AgentManager;
    readonly userAuth: UserAuthManager;
    readonly automationManager: AutomationManager;
    readonly runtimeBus: RuntimeEventBus;
    readonly runtimeStore: RuntimeServices['runtimeStore'];
    readonly runtimeDispatch: RuntimeServices['runtimeDispatch'];
    readonly controlPlaneGateway: ControlPlaneGateway;
    readonly gatewayMethods: GatewayMethodCatalog;
    readonly sessionBroker: SharedSessionBroker;
    readonly approvalBroker: ApprovalBroker;
    readonly routeBindings: RouteBindingManager;
    readonly deliveryManager: AutomationDeliveryManager;
    readonly surfaceRegistry: SurfaceRegistry;
    readonly channelPolicy: ChannelPolicyManager;
    readonly channelPlugins: ChannelPluginRegistry;
    readonly watcherRegistry: WatcherRegistry;
    readonly platformServiceManager: PlatformServiceManager;
    readonly distributedRuntime: RuntimeServices['distributedRuntime'];
    readonly voiceService: RuntimeServices['voiceService'];
    readonly webSearchService: RuntimeServices['webSearchService'];
    readonly knowledgeService: KnowledgeService;
    readonly knowledgeGraphqlService: KnowledgeGraphqlService;
    readonly mediaProviders: RuntimeServices['mediaProviders'];
    readonly multimodalService: RuntimeServices['multimodalService'];
    readonly artifactStore: RuntimeServices['artifactStore'];
    readonly serviceRegistry: ServiceRegistry;
    readonly serveFactory: typeof Bun.serve;
    readonly githubWebhookSecret: string | null;
}
export declare function resolveDaemonFacadeRuntime(config: DaemonConfig, fallbackConfigManager?: ConfigManager): ResolvedDaemonFacadeRuntime;
export interface DaemonFacadeCollaborators {
    readonly channelReplyPipeline: ChannelReplyPipeline;
    readonly controlPlaneHelper: DaemonControlPlaneHelper;
    readonly surfaceDeliveryHelper: DaemonSurfaceDeliveryHelper;
    readonly surfaceActionHelper: DaemonSurfaceActionHelper;
    readonly transportEventsHelper: DaemonTransportEventsHelper;
    readonly httpRouter: DaemonHttpRouter;
    readonly providerRuntime: ChannelProviderRuntimeManager;
    readonly builtinChannels: BuiltinChannelRuntime;
}
export interface CreateDaemonFacadeCollaboratorsOptions {
    readonly runtime: ResolvedDaemonFacadeRuntime;
    readonly pendingSurfaceReplies: Map<string, PendingSurfaceReply>;
    readonly authToken: () => string | null;
    readonly trustProxyEnabled: () => boolean;
    readonly dispatchApiRoutes: (req: Request) => Promise<Response | null>;
    readonly parseJsonBody: (req: Request) => Promise<JsonBody | Response>;
    readonly requireAuthenticatedSession: (req: Request) => {
        username: string;
        roles: readonly string[];
    } | null;
    readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => import('../tools/agent/index.js').AgentRecord | Response;
    readonly checkAuth: (req: Request) => boolean;
    readonly extractAuthToken: (req: Request) => string;
    readonly requireAdmin: (req: Request) => Response | null;
    readonly requireRemotePeer: (req: Request, scope?: string) => Promise<DistributedPeerAuth | Response>;
    readonly describeAuthenticatedPrincipal: (token: string) => {
        principalId: string;
        principalKind: 'user' | 'bot' | 'service' | 'token';
        admin: boolean;
        scopes: readonly string[];
    } | null;
    readonly invokeGatewayMethodCall: (input: {
        readonly authToken: string;
        readonly methodId: string;
        readonly query?: Record<string, unknown>;
        readonly body?: unknown;
        readonly context?: {
            readonly principalId?: string;
            readonly principalKind?: 'user' | 'bot' | 'service' | 'token' | 'remote-peer';
            readonly admin?: boolean;
            readonly scopes?: readonly string[];
            readonly clientKind?: string;
        };
    }) => Promise<{
        status: number;
        ok: boolean;
        body: unknown;
    }>;
    readonly syncSpawnedAgentTask: (record: import('../tools/agent/index.js').AgentRecord, sessionId?: string) => void;
    readonly syncFinishedAgentTask: (record: import('../tools/agent/index.js').AgentRecord) => void;
    readonly surfaceDeliveryEnabled: (surface: 'slack' | 'discord' | 'ntfy' | 'webhook' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix') => boolean;
    readonly signWebhookPayload: (body: string, secret: string) => string;
    readonly handleApprovalAction: (approvalId: string, action: 'claim' | 'approve' | 'deny' | 'cancel', req: Request) => Promise<Response>;
    readonly tlsState: () => ResolvedInboundTlsContext | null;
}
export declare function createDaemonFacadeCollaborators(options: CreateDaemonFacadeCollaboratorsOptions): DaemonFacadeCollaborators;
export declare function configureDaemonSessionContinuation(options: {
    readonly sessionBroker: SharedSessionBroker;
    readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => import('../tools/agent/index.js').AgentRecord | Response;
    readonly queueSurfaceReplyFromBinding: (binding: import('@pellux/goodvibes-sdk/platform/automation/routes').AutomationRouteBinding | undefined, input: {
        readonly agentId: string;
        readonly task: string;
        readonly sessionId?: string;
    }) => void;
}): void;
export {};
//# sourceMappingURL=facade-composition.d.ts.map