/**
 * @module xregistry/schema
 * JSON Schema-compatible type definitions and validation for tool parameters.
 *
 * Provides declarative schema definitions for tool inputs with runtime
 * validation. Pre-built schemas cover common tool types (payments, CRM,
 * analytics). Custom schemas can be registered for domain-specific tools.
 */
import type { Result } from '@private.me/shared';
/** JSON Schema primitive types. */
export type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
/** Validation constraint for a field. */
export interface FieldConstraints {
    readonly minLength?: number;
    readonly maxLength?: number;
    readonly minimum?: number;
    readonly maximum?: number;
    readonly pattern?: string;
    readonly format?: 'email' | 'uri' | 'date' | 'date-time' | 'uuid' | 'ipv4' | 'ipv6';
    readonly enum?: readonly (string | number)[];
}
/** Field definition within a tool schema. */
export interface FieldSchema extends FieldConstraints {
    readonly type: JsonSchemaType;
    readonly description?: string;
    readonly default?: unknown;
    readonly items?: FieldSchema;
    readonly properties?: Readonly<Record<string, FieldSchema>>;
}
/** Complete tool parameter schema (JSON Schema subset). */
export interface ToolParamSchema {
    readonly required: readonly string[];
    readonly properties: Readonly<Record<string, FieldSchema>>;
    readonly additionalProperties?: boolean;
}
/** Detailed validation error with field path and reason. */
export interface ValidationError {
    readonly code: 'VALIDATION_FAILED';
    readonly message: string;
    readonly field?: string;
    readonly reason?: string;
}
/**
 * Validate parameters against a tool schema.
 *
 * Checks required fields, type constraints, and field-level validation rules.
 *
 * @param schema - Tool schema to validate against
 * @param params - Parameters to validate
 * @returns Success or detailed validation error
 */
export declare function validateParams(schema: ToolParamSchema, params: unknown): Result<void, ValidationError>;
/**
 * Schema for payment tool parameters.
 *
 * Fields:
 * - amount (required): Payment amount (positive number)
 * - currency (required): ISO 4217 currency code
 * - description (optional): Payment description
 */
export declare const PAYMENTS_SCHEMA: ToolParamSchema;
/**
 * Schema for CRM tool parameters.
 *
 * Fields:
 * - name (required): Contact name
 * - email (required): Email address
 * - phone (optional): Phone number
 * - company (optional): Company name
 */
export declare const CRM_SCHEMA: ToolParamSchema;
/**
 * Schema for analytics tool parameters.
 *
 * Fields:
 * - event (required): Event name
 * - properties (optional): Event properties object
 * - timestamp (optional): Event timestamp (ISO 8601)
 */
export declare const ANALYTICS_SCHEMA: ToolParamSchema;
//# sourceMappingURL=schema.d.ts.map