/**
 * Common types used throughout Vorion
 *
 * @packageDocumentation
 */
/**
 * Unique identifier type
 */
export type ID = string;
/**
 * Timestamp in ISO 8601 format
 */
export type Timestamp = string;
/**
 * Trust level (T0-T7)
 *
 * Updated to 8 levels per Vorion trust tier specification:
 * - 0 (T0_SANDBOX): Isolated sandbox, no external access
 * - 1 (T1_OBSERVED): Observation period, human oversight required
 * - 2 (T2_PROVISIONAL): Limited autonomy with strict constraints
 * - 3 (T3_MONITORED): Continuous monitoring, expanding autonomy
 * - 4 (T4_STANDARD): Standard operations without individual approval
 * - 5 (T5_TRUSTED): Expanded capabilities with minimal oversight
 * - 6 (T6_CERTIFIED): Independent operation with audit trail
 * - 7 (T7_AUTONOMOUS): Full autonomy for mission-critical operations
 *
 * @deprecated Prefer importing RuntimeTier from @vorionsys/contracts for new code.
 *             This type is maintained for backwards compatibility.
 */
export type TrustLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
/**
 * Trust score (0-1000)
 *
 * Canonical trust scores use 0-1000 scale for precision:
 * - 0-199: T0_SANDBOX
 * - 200-349: T1_OBSERVED
 * - 350-499: T2_PROVISIONAL
 * - 500-649: T3_MONITORED
 * - 650-799: T4_STANDARD
 * - 800-875: T5_TRUSTED
 * - 876-950: T6_CERTIFIED
 * - 951-1000: T7_AUTONOMOUS
 *
 * All trust dimensions and composite scores use this unified 0-1000 scale.
 */
export type TrustScore = number;
/**
 * Entity types that can be governed
 */
export type EntityType = 'agent' | 'user' | 'service' | 'system';
/**
 * Allowed intent statuses.
 */
export declare const INTENT_STATUSES: readonly ["pending", "evaluating", "approved", "denied", "escalated", "executing", "completed", "failed", "cancelled"];
/**
 * Intent status
 */
export type IntentStatus = (typeof INTENT_STATUSES)[number];
/**
 * Control action types for enforcement decisions.
 *
 * @deprecated For governance/authorization actions, use `ControlAction` from
 *             `@vorionsys/contracts/canonical/governance`. This type is maintained
 *             for backwards compatibility with existing enforcement logic.
 *             Note: The canonical type has different values:
 *             ['allow', 'deny', 'constrain', 'clarify', 'escalate', 'log', 'audit']
 */
export type ControlAction = 'allow' | 'deny' | 'escalate' | 'limit' | 'constrain' | 'monitor' | 'terminate';
/**
 * Entity identity
 *
 * @deprecated Prefer using Component from @vorionsys/contracts for agent registry.
 *             This interface is maintained for backwards compatibility.
 */
export interface Entity {
    id: ID;
    type: EntityType;
    name: string;
    /** Trust score (0-1000 scale) */
    trustScore: TrustScore;
    /** Trust level (0-7, maps to RuntimeTier T0-T7) */
    trustLevel: TrustLevel;
    metadata: Record<string, unknown>;
    createdAt: Timestamp;
    updatedAt: Timestamp;
}
/**
 * Intent representing a goal to be governed
 *
 * Note: This is the internal Intent type which maintains backwards compatibility
 * while adding canonical fields from @vorion/contracts. The canonical names are:
 * - intentId (internal: id)
 * - agentId (internal: entityId)
 * - action (internal: goal)
 *
 * @deprecated Prefer using Intent from @vorionsys/contracts for new integrations.
 *             This interface is maintained for internal backwards compatibility.
 *             Use the adapters in src/intent/adapters.ts to convert between formats.
 */
export interface Intent {
    /** Unique intent identifier (canonical: intentId) */
    id: ID;
    /** Tenant this intent belongs to */
    tenantId: ID;
    /** Entity (agent) making the request (canonical: agentId) */
    entityId: ID;
    /** Goal/action to be performed (canonical: action) */
    goal: string;
    /** Optional intent type categorization */
    intentType?: string | null;
    /** Additional context for evaluation */
    context: Record<string, unknown>;
    /** Additional metadata */
    metadata: Record<string, unknown>;
    /** Priority level (0-10) */
    priority?: number;
    /** Trust state snapshot at intent creation */
    trustSnapshot?: Record<string, unknown> | null;
    /** Trust level at evaluation (0-7) */
    trustLevel?: TrustLevel | null;
    /** Trust score at evaluation (0-1000) */
    trustScore?: TrustScore | null;
    /** Current status */
    status: IntentStatus;
    /** Creation timestamp */
    createdAt: Timestamp;
    /** Last update timestamp */
    updatedAt: Timestamp;
    /** Soft delete timestamp for GDPR compliance */
    deletedAt?: Timestamp | null;
    /** Reason for cancellation if status is 'cancelled' */
    cancellationReason?: string | null;
    /** Correlation ID for end-to-end distributed tracing */
    correlationId?: ID | null;
    /** Action type category: read, write, delete, execute, communicate, transfer */
    actionType?: string | null;
    /** Resources this intent accesses/modifies (URN format) */
    resourceScope?: string[] | null;
    /** Data sensitivity level: PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED */
    dataSensitivity?: string | null;
    /** Whether action can be undone: REVERSIBLE, PARTIALLY_REVERSIBLE, IRREVERSIBLE */
    reversibility?: string | null;
    /** When this intent expires (auto-deny after this time) */
    expiresAt?: Timestamp | null;
    /** Reason for denial if status is 'denied' */
    denialReason?: string | null;
    /** Reason for failure if status is 'failed' */
    failureReason?: string | null;
    /** Link to decision record */
    decisionId?: ID | null;
    /** Link to execution record */
    executionId?: ID | null;
    /** Source system that generated this intent */
    source?: string | null;
}
/**
 * Evaluation stages in the intent lifecycle
 */
export type EvaluationStage = 'trust-snapshot' | 'trust-gate' | 'basis' | 'decision' | 'error' | 'cancelled';
/**
 * Strongly typed evaluation result by stage
 * Note: basis.evaluation and decision.decision use unknown to accept
 * external types (EvaluationResult from BASIS, Decision from ENFORCE)
 */
export type EvaluationPayload = {
    stage: 'trust-snapshot';
    result: Record<string, unknown> | null;
} | {
    stage: 'trust-gate';
    passed: boolean;
    requiredLevel: number;
    actualLevel: number;
} | {
    stage: 'basis';
    evaluation: unknown;
    namespace: string;
} | {
    stage: 'decision';
    decision: unknown;
} | {
    stage: 'error';
    error: {
        message: string;
        timestamp: string;
    };
} | {
    stage: 'cancelled';
    reason: string;
    cancelledBy?: string;
};
export interface IntentEvaluationRecord {
    id: ID;
    intentId: ID;
    tenantId: ID;
    /** Strongly typed result payload */
    result: EvaluationPayload;
    createdAt: Timestamp;
}
/**
 * Constraint definition
 */
export interface Constraint {
    id: ID;
    namespace: string;
    name: string;
    description: string;
    version: string;
    rule: ConstraintRule;
    enabled: boolean;
    createdAt: Timestamp;
    updatedAt: Timestamp;
}
/**
 * Constraint rule definition
 */
export interface ConstraintRule {
    when: ConstraintCondition;
    evaluate: ConstraintEvaluation[];
}
/**
 * Constraint condition
 */
export interface ConstraintCondition {
    intentType?: string;
    entityType?: EntityType;
    conditions?: Record<string, unknown>;
}
/**
 * Constraint evaluation step
 */
export interface ConstraintEvaluation {
    condition: string;
    result: ControlAction;
    reason?: string;
}
/**
 * Result of evaluating a single constraint/rule
 */
export interface ConstraintEvaluationResult {
    constraintId: ID;
    passed: boolean;
    action: ControlAction;
    reason: string;
    details: Record<string, unknown>;
    durationMs: number;
    evaluatedAt: Timestamp;
}
/**
 * Decision from ENFORCE
 *
 * Note: The canonical Decision type in @vorionsys/contracts uses:
 * - decisionId, intentId, agentId, correlationId
 * - permitted: boolean (instead of action)
 * - constraints: DecisionConstraints
 * - trustBand: TrustBand (instead of trustLevel)
 *
 * @deprecated Prefer using Decision from @vorionsys/contracts for new integrations.
 *             This interface is maintained for backwards compatibility.
 */
export interface Decision {
    intentId: ID;
    action: ControlAction;
    constraintsEvaluated: ConstraintEvaluationResult[];
    /** Trust score (0-1000 scale) */
    trustScore: TrustScore;
    /** Trust level (0-5, maps to canonical TrustBand) */
    trustLevel: TrustLevel;
    escalation?: EscalationRequest;
    decidedAt: Timestamp;
}
/**
 * Escalation request
 */
export interface EscalationRequest {
    id: ID;
    intentId: ID;
    reason: string;
    escalatedTo: string;
    timeout: string;
    status: 'pending' | 'approved' | 'rejected' | 'timeout';
    createdAt: Timestamp;
}
/**
 * Proof record for audit trail
 */
export interface Proof {
    id: ID;
    chainPosition: number;
    intentId: ID;
    entityId: ID;
    decision: Decision;
    inputs: Record<string, unknown>;
    outputs: Record<string, unknown>;
    hash: string;
    previousHash: string;
    signature: string;
    createdAt: Timestamp;
}
/**
 * Trust signal for scoring
 *
 * @deprecated Prefer using TrustEvidence from @vorionsys/contracts for new code.
 *             This interface is maintained for backwards compatibility.
 */
export interface TrustSignal {
    /** Unique signal identifier */
    id: ID;
    /** Entity this signal is for */
    entityId: ID;
    /** Type/category of signal */
    type: string;
    /** Signal value (impact on trust) */
    value: number;
    /** Weight multiplier for this signal (default: 1.0) */
    weight: number;
    /** Source system that generated this signal */
    source: string;
    /** When this signal was recorded */
    timestamp: Timestamp;
    /** Additional context */
    metadata?: Record<string, unknown>;
}
/**
 * Trust score breakdown
 */
export interface TrustComponents {
    behavioral: number;
    compliance: number;
    identity: number;
    context: number;
}
/**
 * Error types
 */
export declare class VorionError extends Error {
    code: string;
    details?: Record<string, unknown>;
    constructor(message: string, code: string, details?: Record<string, unknown>);
}
export declare class ConstraintViolationError extends VorionError {
    constraintId: ID;
    constraintName: string;
    suggestion?: string;
    constructor(constraintId: ID, constraintName: string, message: string, suggestion?: string);
}
export declare class TrustInsufficientError extends VorionError {
    required: TrustLevel;
    actual: TrustLevel;
    constructor(required: TrustLevel, actual: TrustLevel);
}
//# sourceMappingURL=types.d.ts.map