/**
 * Onboarding Service
 *
 * Manages the secrets onboarding flow across platforms (Discord, Telegram, etc.)
 * Supports both conversational and form-based collection modes.
 *
 * Integrates with the unified OnboardingStateMachine for
 * consistent state management across CLI and conversational interfaces.
 */
import { OnboardingStateMachine } from "../../../services/onboarding-state.ts";
import type { IAgentRuntime, Memory, OnboardingContext, OnboardingStep, ServiceTypeName, UUID, World } from "../../../types/index.ts";
import { Service } from "../../../types/index.ts";
import { type OnboardingConfig } from "./config.ts";
export declare const ONBOARDING_SERVICE_TYPE: ServiceTypeName;
/**
 * Onboarding session state.
 */
interface OnboardingSession {
    worldId: UUID;
    userId: UUID;
    roomId: UUID;
    config: OnboardingConfig;
    currentSettingKey: string | null;
    startedAt: number;
    lastActivityAt: number;
    platform: "discord" | "telegram" | "other";
    mode: "conversational" | "form" | "hybrid";
    /** Unified state machine instance */
    stateMachine?: OnboardingStateMachine;
}
/**
 * Onboarding Service for secrets collection.
 */
export declare class OnboardingService extends Service {
    static serviceType: ServiceTypeName;
    capabilityDescription: string;
    private secretsService;
    private sessions;
    /** State machine instances keyed by worldId */
    private stateMachines;
    /**
     * Start the service
     */
    static start(runtime: IAgentRuntime): Promise<OnboardingService>;
    /**
     * Initialize the service
     */
    private initialize;
    stop(): Promise<void>;
    /**
     * Get or create a state machine for a specific world.
     * This ensures state is persisted per world and can resume across restarts.
     */
    getOrCreateStateMachine(worldId: UUID, userId?: UUID, platform?: "discord" | "telegram" | "other"): Promise<OnboardingStateMachine>;
    /**
     * Persist the state machine state to world metadata.
     */
    private persistStateMachine;
    /**
     * Get the current onboarding step from the state machine.
     */
    getOnboardingStep(worldId: UUID): OnboardingStep | null;
    /**
     * Get the full onboarding context from the state machine.
     */
    getOnboardingContext(worldId: UUID): OnboardingContext | null;
    /**
     * Check if onboarding is complete via the state machine.
     */
    isStateMachineComplete(worldId: UUID): boolean;
    /**
     * Register platform-specific event handlers.
     */
    private registerEvents;
    /**
     * Initialize onboarding for a world with the given config.
     */
    initializeOnboarding(world: World, config: OnboardingConfig): Promise<void>;
    /**
     * Start onboarding via DM (Discord).
     */
    startDiscordOnboardingDM(serverId: string, ownerId: string, worldId: UUID, config: OnboardingConfig): Promise<void>;
    /**
     * Start onboarding via deep link (Telegram).
     */
    startTelegramOnboarding(_world: World, chat: {
        id: string | number;
    }, entities: Array<{
        metadata?: {
            telegram?: {
                id: string;
                username: string;
                adminTitle?: string;
            };
        };
    }>, botUsername: string): Promise<void>;
    /**
     * Start a new onboarding session.
     */
    startSession(worldId: UUID, userId: UUID, roomId: UUID, config: OnboardingConfig, platform?: "discord" | "telegram" | "other", mode?: "conversational" | "form" | "hybrid"): Promise<OnboardingSession>;
    /**
     * Get an active session by room ID.
     */
    getSession(roomId: UUID): OnboardingSession | null;
    /**
     * Process a user message during onboarding.
     */
    processMessage(roomId: UUID, message: Memory): Promise<{
        shouldRespond: boolean;
        response?: string;
        updatedKey?: string;
        complete?: boolean;
    }>;
    /**
     * End an onboarding session.
     */
    endSession(roomId: UUID): void;
    /**
     * Get the onboarding status for a world.
     */
    getOnboardingStatus(worldId: UUID): Promise<{
        initialized: boolean;
        complete: boolean;
        configuredCount: number;
        requiredCount: number;
        missingRequired: string[];
    }>;
    /**
     * Generate the SETTINGS provider context for LLM.
     */
    generateSettingsContext(config: OnboardingConfig, isOnboarding: boolean, agentName: string): string;
}
export {};
//# sourceMappingURL=service.d.ts.map