/**
 * Visual Policy Builder
 *
 * Provides a visual, no-code interface for building governance policies.
 * Implements FR144-150 for Epic 4.
 *
 * Features:
 * - Field registry with dropdown options
 * - Visual block to DSL conversion
 * - Real-time validation
 * - Policy templates
 * - Policy inheritance
 *
 * @packageDocumentation
 */
import type { ControlAction } from '../../common/types.js';
import type { PolicyDefinition, ConditionOperator, LogicalOperator } from '../types.js';
/**
 * Field data types for validation and UI rendering
 */
export declare const FieldDataType: {
    readonly STRING: "string";
    readonly NUMBER: "number";
    readonly BOOLEAN: "boolean";
    readonly ARRAY: "array";
    readonly DATE: "date";
    readonly ENUM: "enum";
    readonly TRUST_LEVEL: "trust_level";
};
export type FieldDataType = (typeof FieldDataType)[keyof typeof FieldDataType];
/**
 * Field definition for the registry
 */
export interface FieldDefinition {
    /** Field path (e.g., "intent.action", "entity.trustScore") */
    path: string;
    /** Display label */
    label: string;
    /** Field description */
    description: string;
    /** Data type */
    dataType: FieldDataType;
    /** Category for grouping in UI */
    category: 'intent' | 'entity' | 'trust' | 'time' | 'custom';
    /** Available operators for this field type */
    operators: ConditionOperator[];
    /** Enum values if dataType is 'enum' */
    enumValues?: {
        value: string;
        label: string;
    }[];
    /** Example values for the UI */
    examples?: string[];
    /** Is this field required for evaluation? */
    required?: boolean;
}
/**
 * Operator definition with metadata
 */
export interface OperatorDefinition {
    value: ConditionOperator;
    label: string;
    description: string;
    /** Number of operands (1 for unary like 'exists', 2 for binary like 'equals') */
    arity: 1 | 2;
    /** Compatible data types */
    compatibleTypes: FieldDataType[];
}
/**
 * Registry of all available fields for policy conditions
 */
export declare const FIELD_REGISTRY: FieldDefinition[];
/**
 * Registry of all available operators
 */
export declare const OPERATOR_REGISTRY: OperatorDefinition[];
/**
 * Visual condition block for the UI
 */
export interface VisualConditionBlock {
    id: string;
    type: 'field' | 'trust' | 'time' | 'group';
    field?: string;
    operator?: ConditionOperator | LogicalOperator;
    value?: unknown;
    children?: VisualConditionBlock[];
}
/**
 * Visual action block for the UI
 */
export interface VisualActionBlock {
    action: ControlAction;
    reason?: string;
    escalateTo?: string;
    escalationTimeout?: string;
    requireJustification?: boolean;
    constraints?: Record<string, unknown>;
}
/**
 * Visual rule block for the UI
 */
export interface VisualRuleBlock {
    id: string;
    name: string;
    description?: string;
    priority: number;
    enabled: boolean;
    condition: VisualConditionBlock;
    action: VisualActionBlock;
}
/**
 * Visual policy block for the UI
 */
export interface VisualPolicyBlock {
    name: string;
    description?: string;
    target?: {
        intentTypes?: string[];
        entityTypes?: string[];
        trustLevels?: number[];
        namespaces?: string[];
    };
    rules: VisualRuleBlock[];
    defaultAction: ControlAction;
    defaultReason?: string;
    parentPolicyId?: string;
    templateId?: string;
}
export interface BuilderValidationError {
    blockId: string;
    field: string;
    message: string;
    severity: 'error' | 'warning';
}
export interface BuilderValidationResult {
    valid: boolean;
    errors: BuilderValidationError[];
    warnings: BuilderValidationError[];
}
/**
 * Visual Policy Builder Service
 *
 * Converts visual blocks to PolicyDefinition and vice versa.
 * Provides field registry and validation.
 */
export declare class VisualPolicyBuilder {
    /**
     * Get all available fields for dropdowns
     */
    getFields(): FieldDefinition[];
    /**
     * Get fields by category
     */
    getFieldsByCategory(category: FieldDefinition['category']): FieldDefinition[];
    /**
     * Get operators for a specific field
     */
    getOperatorsForField(fieldPath: string): OperatorDefinition[];
    /**
     * Get all operators
     */
    getAllOperators(): OperatorDefinition[];
    /**
     * Build PolicyDefinition from visual blocks
     */
    buildPolicy(visual: VisualPolicyBlock): {
        policy: PolicyDefinition;
        validation: BuilderValidationResult;
    };
    /**
     * Convert PolicyDefinition to visual blocks
     */
    toVisualBlocks(policy: PolicyDefinition, name: string, description?: string): VisualPolicyBlock;
    /**
     * Validate a visual policy
     */
    validateVisualPolicy(visual: VisualPolicyBlock): BuilderValidationResult;
    /**
     * Create an empty visual rule block
     */
    createEmptyRule(): VisualRuleBlock;
    /**
     * Create a condition group (AND/OR)
     */
    createConditionGroup(operator: 'and' | 'or'): VisualConditionBlock;
    /**
     * Create a field condition
     */
    createFieldCondition(fieldPath: string): VisualConditionBlock;
    private convertRule;
    private convertCondition;
    private conditionToVisual;
    private extractTimeField;
    private validateRule;
    private validateCondition;
}
/**
 * Create a visual policy builder instance
 */
export declare function createVisualPolicyBuilder(): VisualPolicyBuilder;
//# sourceMappingURL=index.d.ts.map