"""Grantex Python SDK — delegated authorization protocol for AI agents."""

from __future__ import annotations

from ._client import Grantex
from ._errors import (
    GrantexApiError,
    GrantexAuthError,
    GrantexError,
    GrantexNetworkError,
    GrantexTokenError,
)
from ._types import (
    Agent,
    RotateKeyResponse,
    SignupParams,
    SignupResponse,
    Anomaly,
    AuditEntry,
    AuthorizationRequest,
    AuthorizeParams,
    ChainIntegrity,
    DetectAnomaliesResponse,
    ListAnomaliesResponse,
    CheckoutResponse,
    ComplianceAuditExport,
    ComplianceExportAuditParams,
    ComplianceExportGrantsParams,
    ComplianceGrantsExport,
    ComplianceSummary,
    EvidencePack,
    EvidencePackMeta,
    EvidencePackParams,
    CreateCheckoutParams,
    CreatePortalParams,
    CreateWebhookParams,
    DelegateParams,
    ExchangeTokenParams,
    ExchangeTokenResponse,
    RefreshTokenParams,
    Grant,
    GrantTokenPayload,
    ListAgentsResponse,
    ListAuditParams,
    ListAuditResponse,
    ListGrantsParams,
    ListGrantsResponse,
    ListWebhooksResponse,
    LogAuditParams,
    CreatePolicyParams,
    ListPoliciesResponse,
    Policy,
    PortalResponse,
    SubscriptionStatus,
    UpdatePolicyParams,
    VerifiedGrant,
    VerifyGrantTokenOptions,
    VerifyTokenResponse,
    WebhookEndpoint,
    WebhookEndpointWithSecret,
    # SCIM
    ScimEmail,
    ScimUserMeta,
    ScimUser,
    ScimListResponse,
    CreateScimUserParams,
    ScimToken,
    ScimTokenWithSecret,
    ListScimTokensResponse,
    # SSO
    SsoConfig,
    CreateSsoConfigParams,
    SsoLoginResponse,
    SsoCallbackResponse,
)
from ._pkce import PkceChallenge, generate_pkce
from ._verify import verify_grant_token
from ._webhook import verify_webhook_signature

__version__ = "0.1.4"

__all__ = [
    # Main client
    "Grantex",
    # Signup
    "SignupParams",
    "SignupResponse",
    "RotateKeyResponse",
    # PKCE
    "PkceChallenge",
    "generate_pkce",
    # Standalone verify
    "verify_grant_token",
    # Webhook signature verification
    "verify_webhook_signature",
    # Errors
    "GrantexError",
    "GrantexApiError",
    "GrantexAuthError",
    "GrantexTokenError",
    "GrantexNetworkError",
    # Types
    "Agent",
    "Anomaly",
    "AuditEntry",
    "DetectAnomaliesResponse",
    "ListAnomaliesResponse",
    "AuthorizationRequest",
    "AuthorizeParams",
    "ChainIntegrity",
    "CheckoutResponse",
    "ComplianceAuditExport",
    "EvidencePack",
    "EvidencePackMeta",
    "EvidencePackParams",
    "ComplianceExportAuditParams",
    "ComplianceExportGrantsParams",
    "ComplianceGrantsExport",
    "ComplianceSummary",
    "CreateCheckoutParams",
    "CreatePolicyParams",
    "CreatePortalParams",
    "CreateWebhookParams",
    "DelegateParams",
    "ExchangeTokenParams",
    "ExchangeTokenResponse",
    "RefreshTokenParams",
    "Grant",
    "GrantTokenPayload",
    "ListAgentsResponse",
    "ListAuditParams",
    "ListAuditResponse",
    "ListGrantsParams",
    "ListGrantsResponse",
    "ListPoliciesResponse",
    "ListWebhooksResponse",
    "LogAuditParams",
    "Policy",
    "PortalResponse",
    "SubscriptionStatus",
    "VerifiedGrant",
    "VerifyGrantTokenOptions",
    "UpdatePolicyParams",
    "VerifyTokenResponse",
    "WebhookEndpoint",
    "WebhookEndpointWithSecret",
    # SCIM
    "ScimEmail",
    "ScimUserMeta",
    "ScimUser",
    "ScimListResponse",
    "CreateScimUserParams",
    "ScimToken",
    "ScimTokenWithSecret",
    "ListScimTokensResponse",
    # SSO
    "SsoConfig",
    "CreateSsoConfigParams",
    "SsoLoginResponse",
    "SsoCallbackResponse",
    # Version
    "__version__",
]
