"""
ID Wispera Python SDK
Credential governance for AI agents

The passport/visa model for managing AI agent credentials with:
- 30+ detection patterns for common credential types
- AES-256-GCM encrypted vault storage
- Audit logging and delegation chains
- Policy engine for credential governance
- Secure sharing primitives
- Credential location scanning
- Programmatic provisioning via vendor APIs
- LangChain and CrewAI integrations
"""

__version__ = "0.1.0"

from id_wispera.types import (
    Passport,
    PassportStatus,
    VisaType,
    CredentialType,
    Platform,
    DelegationHop,
    AuditEntry,
    AuditAction,
    RiskLevel,
    DetectionResult,
    CreatePassportInput,
    ShareScope,
    PolicyEffect,
    PolicyCondition,
    PolicyRule,
    PolicyDecision,
    ValidationResult,
    ShareOptions,
    SharePayload,
)
from id_wispera.detection import (
    detect_credentials,
    classify_credential,
    might_contain_credentials,
    mask_credentials_in_text,
)
from id_wispera.vault import (
    Vault,
    create_vault,
    unlock_vault,
    vault_exists,
    get_default_vault_path,
)
from id_wispera.passport import (
    create_passport,
    get_passport,
    list_passports,
    update_passport,
    revoke_passport,
)
from id_wispera.audit import (
    log_action,
    get_audit_log,
    get_passport_history,
    get_recent_activity,
    export_audit_log,
    get_audit_stats,
    get_access_history,
    was_accessed_recently,
    search_audit_log,
    get_suspicious_activity,
)
from id_wispera.policy import (
    DEFAULT_POLICY_RULES,
    evaluate_policy,
    validate_passport,
    create_policy_rule,
    merge_policy_rules,
    get_enabled_rules,
    has_valid_human_owner,
    is_within_validity_period,
    has_excessive_delegation,
    has_broad_scope,
    has_privileged_access,
    PolicyBuilder,
    policy,
)
from id_wispera.delegation import (
    add_delegation,
    revoke_delegation,
    clear_delegations,
    get_delegation_depth,
    get_current_holder,
    get_original_issuer,
    get_all_delegation_parties,
    is_in_delegation_chain,
    get_delegation_path,
    has_expired_delegation,
    get_expired_delegations,
    get_expiring_delegations,
    get_effective_scope,
    is_scope_permitted,
    get_scope_restrictions,
    validate_delegation_chain,
)
from id_wispera.sharing import (
    create_share_link,
    resolve_share_link,
    get_share_info,
    is_share_valid,
    create_share_url,
    parse_share_url,
    create_one_time_share,
    create_metadata_share,
)
from id_wispera.locations import (
    get_provider as get_location_provider,
    get_provider_ids as get_location_provider_ids,
    detect_installed_providers,
    sort_by_risk,
    get_risk_label,
    expand_path,
)
from id_wispera.auth import (
    PassphraseProvider,
    PassphraseResult,
    SessionTokenManager,
    KeychainProvider,
)

__all__ = [
    # Version
    "__version__",
    # Types
    "Passport",
    "PassportStatus",
    "VisaType",
    "CredentialType",
    "Platform",
    "DelegationHop",
    "AuditEntry",
    "AuditAction",
    "RiskLevel",
    "DetectionResult",
    "CreatePassportInput",
    "ShareScope",
    "PolicyEffect",
    "PolicyCondition",
    "PolicyRule",
    "PolicyDecision",
    "ValidationResult",
    "ShareOptions",
    "SharePayload",
    # Detection
    "detect_credentials",
    "classify_credential",
    "might_contain_credentials",
    "mask_credentials_in_text",
    # Vault
    "Vault",
    "create_vault",
    "unlock_vault",
    "vault_exists",
    "get_default_vault_path",
    # Passport
    "create_passport",
    "get_passport",
    "list_passports",
    "update_passport",
    "revoke_passport",
    # Audit
    "log_action",
    "get_audit_log",
    "get_passport_history",
    "get_recent_activity",
    "export_audit_log",
    "get_audit_stats",
    "get_access_history",
    "was_accessed_recently",
    "search_audit_log",
    "get_suspicious_activity",
    # Policy
    "DEFAULT_POLICY_RULES",
    "evaluate_policy",
    "validate_passport",
    "create_policy_rule",
    "merge_policy_rules",
    "get_enabled_rules",
    "has_valid_human_owner",
    "is_within_validity_period",
    "has_excessive_delegation",
    "has_broad_scope",
    "has_privileged_access",
    "PolicyBuilder",
    "policy",
    # Delegation
    "add_delegation",
    "revoke_delegation",
    "clear_delegations",
    "get_delegation_depth",
    "get_current_holder",
    "get_original_issuer",
    "get_all_delegation_parties",
    "is_in_delegation_chain",
    "get_delegation_path",
    "has_expired_delegation",
    "get_expired_delegations",
    "get_expiring_delegations",
    "get_effective_scope",
    "is_scope_permitted",
    "get_scope_restrictions",
    "validate_delegation_chain",
    # Sharing
    "create_share_link",
    "resolve_share_link",
    "get_share_info",
    "is_share_valid",
    "create_share_url",
    "parse_share_url",
    "create_one_time_share",
    "create_metadata_share",
    # Locations
    "get_location_provider",
    "get_location_provider_ids",
    "detect_installed_providers",
    "sort_by_risk",
    "get_risk_label",
    "expand_path",
    # Auth
    "PassphraseProvider",
    "PassphraseResult",
    "SessionTokenManager",
    "KeychainProvider",
]
