/**
 * @module service
 * @description Central service for managing agent-guided user journeys
 *
 * The FormService is the journey controller. It ensures agents stay on
 * the path defined by form definitions, guiding users reliably to outcomes.
 */
import { type IAgentRuntime, type JsonValue, type UUID } from "../../../types/index.ts";
import { Service } from "../../../types/service.ts";
import type { ControlType, ExternalActivation, FieldState, FormContextState, FormControl, FormDefinition, FormSession, FormSubmission, TypeHandler } from "./types.ts";
export declare class FormService extends Service {
    static serviceType: string;
    capabilityDescription: string;
    private forms;
    private controlTypes;
    static start(runtime: IAgentRuntime): Promise<Service>;
    stop(): Promise<void>;
    registerForm(definition: FormDefinition): void;
    getForm(formId: string): FormDefinition | undefined;
    listForms(): FormDefinition[];
    /** @deprecated Use registerControlType instead */
    registerType(type: string, handler: TypeHandler): void;
    /** @deprecated Use getControlType instead */
    getTypeHandler(type: string): TypeHandler | undefined;
    registerControlType(type: ControlType, options?: {
        allowOverride?: boolean;
    }): void;
    getControlType(typeId: string): ControlType | undefined;
    listControlTypes(): ControlType[];
    isCompositeType(typeId: string): boolean;
    isExternalType(typeId: string): boolean;
    getSubControls(control: FormControl): FormControl[];
    startSession(formId: string, entityId: UUID, roomId: UUID, options?: {
        context?: Record<string, JsonValue>;
        initialValues?: Record<string, JsonValue>;
        locale?: string;
    }): Promise<FormSession>;
    getActiveSession(entityId: UUID, roomId: UUID): Promise<FormSession | null>;
    getAllActiveSessions(entityId: UUID): Promise<FormSession[]>;
    getStashedSessions(entityId: UUID): Promise<FormSession[]>;
    saveSession(session: FormSession): Promise<void>;
    updateField(sessionId: string, entityId: UUID, field: string, value: JsonValue, confidence: number, source: FieldState["source"], messageId?: string): Promise<void>;
    undoLastChange(sessionId: string, entityId: UUID): Promise<{
        field: string;
        restoredValue: JsonValue;
    } | null>;
    skipField(sessionId: string, entityId: UUID, field: string): Promise<boolean>;
    confirmField(sessionId: string, entityId: UUID, field: string, accepted: boolean): Promise<void>;
    updateSubField(sessionId: string, entityId: UUID, parentField: string, subField: string, value: JsonValue, confidence: number, messageId?: string): Promise<void>;
    areSubFieldsFilled(session: FormSession, parentField: string): boolean;
    getSubFieldValues(session: FormSession, parentField: string): Record<string, JsonValue>;
    activateExternalField(sessionId: string, entityId: UUID, field: string): Promise<ExternalActivation>;
    confirmExternalField(sessionId: string, entityId: UUID, field: string, value: JsonValue, externalData?: Record<string, JsonValue>): Promise<void>;
    cancelExternalField(sessionId: string, entityId: UUID, field: string, reason: string): Promise<void>;
    submit(sessionId: string, entityId: UUID): Promise<FormSubmission>;
    stash(sessionId: string, entityId: UUID): Promise<void>;
    restore(sessionId: string, entityId: UUID): Promise<FormSession>;
    cancel(sessionId: string, entityId: UUID, force?: boolean): Promise<boolean>;
    getSubmissions(entityId: UUID, formId?: string): Promise<FormSubmission[]>;
    getAutofill(entityId: UUID, formId: string): Promise<Record<string, JsonValue> | null>;
    applyAutofill(session: FormSession): Promise<string[]>;
    getSessionContext(session: FormSession): FormContextState;
    getValues(session: FormSession): Record<string, JsonValue>;
    getMappedValues(session: FormSession): Record<string, JsonValue>;
    calculateTTL(session: FormSession): number;
    shouldConfirmCancel(session: FormSession): boolean;
    private executeHook;
    private checkAllRequiredFilled;
}
//# sourceMappingURL=service.d.ts.map