import { AppConfig, AppVariables } from "./types/app.js";
import "./types/index.js";
import { createAgentsHono } from "./createApp.js";
import { NativeSandboxConfig, SandboxConfig, VercelSandboxConfig } from "./domains/run/types/executionContext.js";
import { createAuth0Provider, createOIDCProvider } from "./ssoHelpers.js";
import { SSOProviderConfig, UserAuthConfig, createAgentsApp } from "./factory.js";
import { Hono } from "hono";
import * as zod344 from "zod";
import * as hono_types2 from "hono/types";
import * as better_auth99 from "better-auth";
import * as better_auth_plugins35 from "better-auth/plugins";
import * as _better_auth_sso11 from "@better-auth/sso";

//#region src/index.d.ts
declare const auth: better_auth99.Auth<{
  baseURL: string;
  secret: string;
  database: (options: better_auth99.BetterAuthOptions) => better_auth99.DBAdapter<better_auth99.BetterAuthOptions>;
  emailAndPassword: {
    enabled: true;
    minPasswordLength: number;
    maxPasswordLength: number;
    requireEmailVerification: false;
    autoSignIn: true;
    resetPasswordTokenExpiresIn: number;
    sendResetPassword: ({
      user,
      url,
      token
    }: {
      user: better_auth99.User;
      url: string;
      token: string;
    }) => Promise<void>;
  };
  account: {
    accountLinking: {
      enabled: true;
      trustedProviders: ("google" | "email-password" | "auth0")[];
    };
  };
  databaseHooks: {
    session: {
      create: {
        before: (session: {
          id: string;
          createdAt: Date;
          updatedAt: Date;
          userId: string;
          expiresAt: Date;
          token: string;
          ipAddress?: string | null | undefined;
          userAgent?: string | null | undefined;
        } & Record<string, unknown>) => Promise<{
          data: {
            activeOrganizationId: string | null;
            id: string;
            createdAt: Date;
            updatedAt: Date;
            userId: string;
            expiresAt: Date;
            token: string;
            ipAddress?: string | null | undefined;
            userAgent?: string | null | undefined;
          };
        }>;
      };
    };
  };
  socialProviders: {
    google: {
      redirectURI?: string | undefined;
      clientId: string;
      accessType?: ("offline" | "online") | undefined;
      display?: ("page" | "popup" | "touch" | "wap") | undefined;
      hd?: string | undefined;
      clientSecret?: string | undefined;
      scope?: string[] | undefined;
      disableDefaultScope?: boolean | undefined;
      authorizationEndpoint?: string | undefined;
      clientKey?: string | undefined;
      disableIdTokenSignIn?: boolean | undefined;
      verifyIdToken?: ((token: string, nonce?: string) => Promise<boolean>) | undefined;
      getUserInfo?: ((token: better_auth99.OAuth2Tokens) => Promise<{
        user: {
          id: string;
          name?: string;
          email?: string | null;
          image?: string;
          emailVerified: boolean;
          [key: string]: any;
        };
        data: any;
      } | null>) | undefined;
      refreshAccessToken?: ((refreshToken: string) => Promise<better_auth99.OAuth2Tokens>) | undefined;
      mapProfileToUser?: ((profile: better_auth99.GoogleProfile) => {
        id?: string;
        name?: string;
        email?: string | null;
        image?: string;
        emailVerified?: boolean;
        [key: string]: any;
      } | Promise<{
        id?: string;
        name?: string;
        email?: string | null;
        image?: string;
        emailVerified?: boolean;
        [key: string]: any;
      }>) | undefined;
      disableImplicitSignUp?: boolean | undefined;
      disableSignUp?: boolean | undefined;
      prompt?: ("select_account" | "consent" | "login" | "none" | "select_account consent") | undefined;
      responseMode?: ("query" | "form_post") | undefined;
      overrideUserInfoOnSignIn?: boolean | undefined;
    };
  } | undefined;
  session: {
    expiresIn: number;
    updateAge: number;
    cookieCache: {
      enabled: true;
      maxAge: number;
      strategy: "compact";
    };
  };
  advanced: {
    ipAddress?: {
      ipAddressHeaders?: string[];
      disableIpTracking?: boolean;
      ipv6Subnet?: 128 | 64 | 48 | 32 | undefined;
    } | undefined;
    useSecureCookies?: boolean | undefined;
    disableCSRFCheck?: boolean | undefined;
    disableOriginCheck?: boolean | undefined;
    crossSubDomainCookies?: {
      enabled: boolean;
      additionalCookies?: string[];
      domain?: string;
    } | undefined;
    cookies?: {
      [key: string]: {
        name?: string;
        attributes?: better_auth99.CookieOptions;
      };
    } | undefined;
    defaultCookieAttributes: better_auth99.CookieOptions;
    cookiePrefix?: string | undefined;
    database?: {
      defaultFindManyLimit?: number;
      useNumberId?: boolean;
      generateId?: better_auth99.GenerateIdFn | false | "serial" | "uuid";
    } | undefined;
    trustedProxyHeaders?: boolean | undefined;
    backgroundTasks?: {
      handler: (promise: Promise<unknown>) => void;
    };
    skipTrailingSlashes?: boolean | undefined;
  };
  trustedOrigins: string[];
  plugins: [{
    id: "bearer";
    hooks: {
      before: {
        matcher(context: better_auth99.HookEndpointContext): boolean;
        handler: (inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          context: {
            headers: Headers;
          };
        } | undefined>;
      }[];
      after: {
        matcher(context: better_auth99.HookEndpointContext): true;
        handler: (inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<void>;
      }[];
    };
    options: better_auth_plugins35.BearerOptions | undefined;
  }, {
    id: "sso";
    endpoints: {
      spMetadata: ReturnType<() => better_auth99.StrictEndpoint<"/sso/saml2/sp/metadata", {
        method: "GET";
        query: zod344.ZodObject<{
          providerId: zod344.ZodString;
          format: zod344.ZodDefault<zod344.ZodEnum<{
            xml: "xml";
            json: "json";
          }>>;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
              };
            };
          };
        };
      }, Response>>;
      registerSSOProvider: better_auth99.StrictEndpoint<"/sso/register", {
        method: "POST";
        body: zod344.ZodObject<{
          providerId: zod344.ZodString;
          issuer: zod344.ZodString;
          domain: zod344.ZodString;
          oidcConfig: zod344.ZodOptional<zod344.ZodObject<{
            clientId: zod344.ZodString;
            clientSecret: zod344.ZodString;
            authorizationEndpoint: zod344.ZodOptional<zod344.ZodString>;
            tokenEndpoint: zod344.ZodOptional<zod344.ZodString>;
            userInfoEndpoint: zod344.ZodOptional<zod344.ZodString>;
            tokenEndpointAuthentication: zod344.ZodOptional<zod344.ZodEnum<{
              client_secret_post: "client_secret_post";
              client_secret_basic: "client_secret_basic";
            }>>;
            jwksEndpoint: zod344.ZodOptional<zod344.ZodString>;
            discoveryEndpoint: zod344.ZodOptional<zod344.ZodString>;
            skipDiscovery: zod344.ZodOptional<zod344.ZodBoolean>;
            scopes: zod344.ZodOptional<zod344.ZodArray<zod344.ZodString>>;
            pkce: zod344.ZodOptional<zod344.ZodDefault<zod344.ZodBoolean>>;
            mapping: zod344.ZodOptional<zod344.ZodObject<{
              id: zod344.ZodString;
              email: zod344.ZodString;
              emailVerified: zod344.ZodOptional<zod344.ZodString>;
              name: zod344.ZodString;
              image: zod344.ZodOptional<zod344.ZodString>;
              extraFields: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            }, better_auth99.$strip>>;
          }, better_auth99.$strip>>;
          samlConfig: zod344.ZodOptional<zod344.ZodObject<{
            entryPoint: zod344.ZodString;
            cert: zod344.ZodString;
            callbackUrl: zod344.ZodString;
            audience: zod344.ZodOptional<zod344.ZodString>;
            idpMetadata: zod344.ZodOptional<zod344.ZodObject<{
              metadata: zod344.ZodOptional<zod344.ZodString>;
              entityID: zod344.ZodOptional<zod344.ZodString>;
              cert: zod344.ZodOptional<zod344.ZodString>;
              privateKey: zod344.ZodOptional<zod344.ZodString>;
              privateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              isAssertionEncrypted: zod344.ZodOptional<zod344.ZodBoolean>;
              encPrivateKey: zod344.ZodOptional<zod344.ZodString>;
              encPrivateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              singleSignOnService: zod344.ZodOptional<zod344.ZodArray<zod344.ZodObject<{
                Binding: zod344.ZodString;
                Location: zod344.ZodString;
              }, better_auth99.$strip>>>;
            }, better_auth99.$strip>>;
            spMetadata: zod344.ZodObject<{
              metadata: zod344.ZodOptional<zod344.ZodString>;
              entityID: zod344.ZodOptional<zod344.ZodString>;
              binding: zod344.ZodOptional<zod344.ZodString>;
              privateKey: zod344.ZodOptional<zod344.ZodString>;
              privateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              isAssertionEncrypted: zod344.ZodOptional<zod344.ZodBoolean>;
              encPrivateKey: zod344.ZodOptional<zod344.ZodString>;
              encPrivateKeyPass: zod344.ZodOptional<zod344.ZodString>;
            }, better_auth99.$strip>;
            wantAssertionsSigned: zod344.ZodOptional<zod344.ZodBoolean>;
            signatureAlgorithm: zod344.ZodOptional<zod344.ZodString>;
            digestAlgorithm: zod344.ZodOptional<zod344.ZodString>;
            identifierFormat: zod344.ZodOptional<zod344.ZodString>;
            privateKey: zod344.ZodOptional<zod344.ZodString>;
            decryptionPvk: zod344.ZodOptional<zod344.ZodString>;
            additionalParams: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            mapping: zod344.ZodOptional<zod344.ZodObject<{
              id: zod344.ZodString;
              email: zod344.ZodString;
              emailVerified: zod344.ZodOptional<zod344.ZodString>;
              name: zod344.ZodString;
              firstName: zod344.ZodOptional<zod344.ZodString>;
              lastName: zod344.ZodOptional<zod344.ZodString>;
              extraFields: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            }, better_auth99.$strip>>;
          }, better_auth99.$strip>>;
          organizationId: zod344.ZodOptional<zod344.ZodString>;
          overrideUserInfo: zod344.ZodOptional<zod344.ZodDefault<zod344.ZodBoolean>>;
        }, better_auth99.$strip>;
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        issuer: {
                          type: string;
                          format: string;
                          description: string;
                        };
                        domain: {
                          type: string;
                          description: string;
                        };
                        domainVerified: {
                          type: string;
                          description: string;
                        };
                        domainVerificationToken: {
                          type: string;
                          description: string;
                        };
                        oidcConfig: {
                          type: string;
                          properties: {
                            issuer: {
                              type: string;
                              format: string;
                              description: string;
                            };
                            pkce: {
                              type: string;
                              description: string;
                            };
                            clientId: {
                              type: string;
                              description: string;
                            };
                            clientSecret: {
                              type: string;
                              description: string;
                            };
                            authorizationEndpoint: {
                              type: string;
                              format: string;
                              nullable: boolean;
                              description: string;
                            };
                            discoveryEndpoint: {
                              type: string;
                              format: string;
                              description: string;
                            };
                            userInfoEndpoint: {
                              type: string;
                              format: string;
                              nullable: boolean;
                              description: string;
                            };
                            scopes: {
                              type: string;
                              items: {
                                type: string;
                              };
                              nullable: boolean;
                              description: string;
                            };
                            tokenEndpoint: {
                              type: string;
                              format: string;
                              nullable: boolean;
                              description: string;
                            };
                            tokenEndpointAuthentication: {
                              type: string;
                              enum: string[];
                              nullable: boolean;
                              description: string;
                            };
                            jwksEndpoint: {
                              type: string;
                              format: string;
                              nullable: boolean;
                              description: string;
                            };
                            mapping: {
                              type: string;
                              nullable: boolean;
                              properties: {
                                id: {
                                  type: string;
                                  description: string;
                                };
                                email: {
                                  type: string;
                                  description: string;
                                };
                                emailVerified: {
                                  type: string;
                                  nullable: boolean;
                                  description: string;
                                };
                                name: {
                                  type: string;
                                  description: string;
                                };
                                image: {
                                  type: string;
                                  nullable: boolean;
                                  description: string;
                                };
                                extraFields: {
                                  type: string;
                                  additionalProperties: {
                                    type: string;
                                  };
                                  nullable: boolean;
                                  description: string;
                                };
                              };
                              required: string[];
                            };
                          };
                          required: string[];
                          description: string;
                        };
                        organizationId: {
                          type: string;
                          nullable: boolean;
                          description: string;
                        };
                        userId: {
                          type: string;
                          description: string;
                        };
                        providerId: {
                          type: string;
                          description: string;
                        };
                        redirectURI: {
                          type: string;
                          format: string;
                          description: string;
                        };
                      };
                      required: string[];
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        redirectURI: string;
        oidcConfig: _better_auth_sso11.OIDCConfig | null;
        samlConfig: _better_auth_sso11.SAMLConfig | null;
      } & Omit<{
        issuer: string;
        oidcConfig?: _better_auth_sso11.OIDCConfig | undefined;
        samlConfig?: _better_auth_sso11.SAMLConfig | undefined;
        userId: string;
        providerId: string;
        organizationId?: string | undefined;
        domain: string;
      }, "oidcConfig" | "samlConfig">>;
      signInSSO: ReturnType<(options?: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sign-in/sso", {
        method: "POST";
        body: zod344.ZodObject<{
          email: zod344.ZodOptional<zod344.ZodString>;
          organizationSlug: zod344.ZodOptional<zod344.ZodString>;
          providerId: zod344.ZodOptional<zod344.ZodString>;
          domain: zod344.ZodOptional<zod344.ZodString>;
          callbackURL: zod344.ZodString;
          errorCallbackURL: zod344.ZodOptional<zod344.ZodString>;
          newUserCallbackURL: zod344.ZodOptional<zod344.ZodString>;
          scopes: zod344.ZodOptional<zod344.ZodArray<zod344.ZodString>>;
          loginHint: zod344.ZodOptional<zod344.ZodString>;
          requestSignUp: zod344.ZodOptional<zod344.ZodBoolean>;
          providerType: zod344.ZodOptional<zod344.ZodEnum<{
            saml: "saml";
            oidc: "oidc";
          }>>;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            requestBody: {
              content: {
                "application/json": {
                  schema: {
                    type: "object";
                    properties: {
                      email: {
                        type: string;
                        description: string;
                      };
                      issuer: {
                        type: string;
                        description: string;
                      };
                      providerId: {
                        type: string;
                        description: string;
                      };
                      callbackURL: {
                        type: string;
                        description: string;
                      };
                      errorCallbackURL: {
                        type: string;
                        description: string;
                      };
                      newUserCallbackURL: {
                        type: string;
                        description: string;
                      };
                      loginHint: {
                        type: string;
                        description: string;
                      };
                    };
                    required: string[];
                  };
                };
              };
            };
            responses: {
              "200": {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        url: {
                          type: string;
                          format: string;
                          description: string;
                        };
                        redirect: {
                          type: string;
                          description: string;
                          enum: boolean[];
                        };
                      };
                      required: string[];
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        url: string;
        redirect: boolean;
      }>>;
      callbackSSO: ReturnType<(options?: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/callback/:providerId", {
        method: "GET";
        query: zod344.ZodObject<{
          code: zod344.ZodOptional<zod344.ZodString>;
          state: zod344.ZodString;
          error: zod344.ZodOptional<zod344.ZodString>;
          error_description: zod344.ZodOptional<zod344.ZodString>;
        }, better_auth99.$strip>;
        allowedMediaTypes: string[];
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "302": {
                description: string;
              };
            };
          };
          scope: "server";
        };
      }, never>>;
      callbackSSOSAML: ReturnType<(options?: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/saml2/callback/:providerId", {
        method: ("POST" | "GET")[];
        body: zod344.ZodOptional<zod344.ZodObject<{
          SAMLResponse: zod344.ZodString;
          RelayState: zod344.ZodOptional<zod344.ZodString>;
        }, better_auth99.$strip>>;
        query: zod344.ZodOptional<zod344.ZodObject<{
          RelayState: zod344.ZodOptional<zod344.ZodString>;
        }, better_auth99.$strip>>;
        metadata: {
          allowedMediaTypes: string[];
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "302": {
                description: string;
              };
              "400": {
                description: string;
              };
              "401": {
                description: string;
              };
            };
          };
          scope: "server";
        };
      }, never>>;
      acsEndpoint: ReturnType<(options?: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/saml2/sp/acs/:providerId", {
        method: "POST";
        body: zod344.ZodObject<{
          SAMLResponse: zod344.ZodString;
          RelayState: zod344.ZodOptional<zod344.ZodString>;
        }, better_auth99.$strip>;
        metadata: {
          allowedMediaTypes: string[];
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "302": {
                description: string;
              };
            };
          };
          scope: "server";
        };
      }, never>>;
      listSSOProviders: ReturnType<() => better_auth99.StrictEndpoint<"/sso/providers", {
        method: "GET";
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
              };
            };
          };
        };
      }, {
        providers: {
          providerId: string;
          type: string;
          issuer: string;
          domain: string;
          organizationId: string | null;
          domainVerified: boolean;
          oidcConfig: {
            discoveryEndpoint: string;
            clientIdLastFour: string;
            pkce: boolean;
            authorizationEndpoint: string | undefined;
            tokenEndpoint: string | undefined;
            userInfoEndpoint: string | undefined;
            jwksEndpoint: string | undefined;
            scopes: string[] | undefined;
            tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
          } | undefined;
          samlConfig: {
            entryPoint: string;
            callbackUrl: string;
            audience: string | undefined;
            wantAssertionsSigned: boolean | undefined;
            identifierFormat: string | undefined;
            signatureAlgorithm: string | undefined;
            digestAlgorithm: string | undefined;
            certificate: {
              fingerprintSha256: string;
              notBefore: string;
              notAfter: string;
              publicKeyAlgorithm: string;
            } | {
              error: string;
            };
          } | undefined;
          spMetadataUrl: string;
        }[];
      }>>;
      getSSOProvider: ReturnType<() => better_auth99.StrictEndpoint<"/sso/providers/:providerId", {
        method: "GET";
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
        params: zod344.ZodObject<{
          providerId: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
              };
              "404": {
                description: string;
              };
              "403": {
                description: string;
              };
            };
          };
        };
      }, {
        providerId: string;
        type: string;
        issuer: string;
        domain: string;
        organizationId: string | null;
        domainVerified: boolean;
        oidcConfig: {
          discoveryEndpoint: string;
          clientIdLastFour: string;
          pkce: boolean;
          authorizationEndpoint: string | undefined;
          tokenEndpoint: string | undefined;
          userInfoEndpoint: string | undefined;
          jwksEndpoint: string | undefined;
          scopes: string[] | undefined;
          tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
        } | undefined;
        samlConfig: {
          entryPoint: string;
          callbackUrl: string;
          audience: string | undefined;
          wantAssertionsSigned: boolean | undefined;
          identifierFormat: string | undefined;
          signatureAlgorithm: string | undefined;
          digestAlgorithm: string | undefined;
          certificate: {
            fingerprintSha256: string;
            notBefore: string;
            notAfter: string;
            publicKeyAlgorithm: string;
          } | {
            error: string;
          };
        } | undefined;
        spMetadataUrl: string;
      }>>;
      updateSSOProvider: ReturnType<(options: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/providers/:providerId", {
        method: "PATCH";
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
        params: zod344.ZodObject<{
          providerId: zod344.ZodString;
        }, better_auth99.$strip>;
        body: zod344.ZodObject<{
          issuer: zod344.ZodOptional<zod344.ZodString>;
          domain: zod344.ZodOptional<zod344.ZodString>;
          oidcConfig: zod344.ZodOptional<zod344.ZodObject<{
            clientId: zod344.ZodOptional<zod344.ZodString>;
            clientSecret: zod344.ZodOptional<zod344.ZodString>;
            authorizationEndpoint: zod344.ZodOptional<zod344.ZodString>;
            tokenEndpoint: zod344.ZodOptional<zod344.ZodString>;
            userInfoEndpoint: zod344.ZodOptional<zod344.ZodString>;
            tokenEndpointAuthentication: zod344.ZodOptional<zod344.ZodEnum<{
              client_secret_post: "client_secret_post";
              client_secret_basic: "client_secret_basic";
            }>>;
            jwksEndpoint: zod344.ZodOptional<zod344.ZodString>;
            discoveryEndpoint: zod344.ZodOptional<zod344.ZodString>;
            scopes: zod344.ZodOptional<zod344.ZodArray<zod344.ZodString>>;
            pkce: zod344.ZodOptional<zod344.ZodBoolean>;
            overrideUserInfo: zod344.ZodOptional<zod344.ZodBoolean>;
            mapping: zod344.ZodOptional<zod344.ZodObject<{
              id: zod344.ZodOptional<zod344.ZodString>;
              email: zod344.ZodOptional<zod344.ZodString>;
              emailVerified: zod344.ZodOptional<zod344.ZodString>;
              name: zod344.ZodOptional<zod344.ZodString>;
              image: zod344.ZodOptional<zod344.ZodString>;
              extraFields: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            }, better_auth99.$strip>>;
          }, better_auth99.$strip>>;
          samlConfig: zod344.ZodOptional<zod344.ZodObject<{
            entryPoint: zod344.ZodOptional<zod344.ZodString>;
            cert: zod344.ZodOptional<zod344.ZodString>;
            callbackUrl: zod344.ZodOptional<zod344.ZodString>;
            audience: zod344.ZodOptional<zod344.ZodString>;
            idpMetadata: zod344.ZodOptional<zod344.ZodObject<{
              metadata: zod344.ZodOptional<zod344.ZodString>;
              entityID: zod344.ZodOptional<zod344.ZodString>;
              cert: zod344.ZodOptional<zod344.ZodString>;
              privateKey: zod344.ZodOptional<zod344.ZodString>;
              privateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              isAssertionEncrypted: zod344.ZodOptional<zod344.ZodBoolean>;
              encPrivateKey: zod344.ZodOptional<zod344.ZodString>;
              encPrivateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              singleSignOnService: zod344.ZodOptional<zod344.ZodArray<zod344.ZodObject<{
                Binding: zod344.ZodString;
                Location: zod344.ZodString;
              }, better_auth99.$strip>>>;
            }, better_auth99.$strip>>;
            spMetadata: zod344.ZodOptional<zod344.ZodObject<{
              metadata: zod344.ZodOptional<zod344.ZodString>;
              entityID: zod344.ZodOptional<zod344.ZodString>;
              binding: zod344.ZodOptional<zod344.ZodString>;
              privateKey: zod344.ZodOptional<zod344.ZodString>;
              privateKeyPass: zod344.ZodOptional<zod344.ZodString>;
              isAssertionEncrypted: zod344.ZodOptional<zod344.ZodBoolean>;
              encPrivateKey: zod344.ZodOptional<zod344.ZodString>;
              encPrivateKeyPass: zod344.ZodOptional<zod344.ZodString>;
            }, better_auth99.$strip>>;
            wantAssertionsSigned: zod344.ZodOptional<zod344.ZodBoolean>;
            signatureAlgorithm: zod344.ZodOptional<zod344.ZodString>;
            digestAlgorithm: zod344.ZodOptional<zod344.ZodString>;
            identifierFormat: zod344.ZodOptional<zod344.ZodString>;
            privateKey: zod344.ZodOptional<zod344.ZodString>;
            decryptionPvk: zod344.ZodOptional<zod344.ZodString>;
            additionalParams: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            mapping: zod344.ZodOptional<zod344.ZodObject<{
              id: zod344.ZodOptional<zod344.ZodString>;
              email: zod344.ZodOptional<zod344.ZodString>;
              emailVerified: zod344.ZodOptional<zod344.ZodString>;
              name: zod344.ZodOptional<zod344.ZodString>;
              firstName: zod344.ZodOptional<zod344.ZodString>;
              lastName: zod344.ZodOptional<zod344.ZodString>;
              extraFields: zod344.ZodOptional<zod344.ZodRecord<zod344.ZodString, zod344.ZodAny>>;
            }, better_auth99.$strip>>;
          }, better_auth99.$strip>>;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
              };
              "404": {
                description: string;
              };
              "403": {
                description: string;
              };
            };
          };
        };
      }, {
        providerId: string;
        type: string;
        issuer: string;
        domain: string;
        organizationId: string | null;
        domainVerified: boolean;
        oidcConfig: {
          discoveryEndpoint: string;
          clientIdLastFour: string;
          pkce: boolean;
          authorizationEndpoint: string | undefined;
          tokenEndpoint: string | undefined;
          userInfoEndpoint: string | undefined;
          jwksEndpoint: string | undefined;
          scopes: string[] | undefined;
          tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
        } | undefined;
        samlConfig: {
          entryPoint: string;
          callbackUrl: string;
          audience: string | undefined;
          wantAssertionsSigned: boolean | undefined;
          identifierFormat: string | undefined;
          signatureAlgorithm: string | undefined;
          digestAlgorithm: string | undefined;
          certificate: {
            fingerprintSha256: string;
            notBefore: string;
            notAfter: string;
            publicKeyAlgorithm: string;
          } | {
            error: string;
          };
        } | undefined;
        spMetadataUrl: string;
      }>>;
      deleteSSOProvider: ReturnType<() => better_auth99.StrictEndpoint<"/sso/providers/:providerId", {
        method: "DELETE";
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
        params: zod344.ZodObject<{
          providerId: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            operationId: string;
            summary: string;
            description: string;
            responses: {
              "200": {
                description: string;
              };
              "404": {
                description: string;
              };
              "403": {
                description: string;
              };
            };
          };
        };
      }, {
        success: boolean;
      }>>;
    } & {
      requestDomainVerification: ReturnType<(options: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/request-domain-verification", {
        method: "POST";
        body: zod344.ZodObject<{
          providerId: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            summary: string;
            description: string;
            responses: {
              "404": {
                description: string;
              };
              "409": {
                description: string;
              };
              "201": {
                description: string;
              };
            };
          };
        };
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
      }, {
        domainVerificationToken: string;
      }>>;
      verifyDomain: ReturnType<(options: _better_auth_sso11.SSOOptions) => better_auth99.StrictEndpoint<"/sso/verify-domain", {
        method: "POST";
        body: zod344.ZodObject<{
          providerId: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            summary: string;
            description: string;
            responses: {
              "404": {
                description: string;
              };
              "409": {
                description: string;
              };
              "502": {
                description: string;
              };
              "204": {
                description: string;
              };
            };
          };
        };
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<{
          session: {
            session: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              userId: string;
              expiresAt: Date;
              token: string;
              ipAddress?: string | null | undefined;
              userAgent?: string | null | undefined;
            };
            user: Record<string, any> & {
              id: string;
              createdAt: Date;
              updatedAt: Date;
              email: string;
              emailVerified: boolean;
              name: string;
              image?: string | null | undefined;
            };
          };
        }>)[];
      }, void>>;
    };
    schema: NonNullable<better_auth99.BetterAuthPlugin["schema"]>;
    options: _better_auth_sso11.SSOOptions & {
      domainVerification?: {
        enabled: true;
      };
    };
  }, {
    id: "oauth-proxy";
    options: NoInfer<{
      productionURL: string;
    }>;
    endpoints: {
      oAuthProxy: better_auth99.StrictEndpoint<"/oauth-proxy-callback", {
        method: "GET";
        operationId: string;
        query: zod344.ZodObject<{
          callbackURL: zod344.ZodString;
          cookies: zod344.ZodString;
        }, better_auth99.$strip>;
        use: ((inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<void>)[];
        metadata: {
          openapi: {
            operationId: string;
            description: string;
            parameters: {
              in: "query";
              name: string;
              required: true;
              description: string;
            }[];
            responses: {
              302: {
                description: string;
                headers: {
                  Location: {
                    description: string;
                    schema: {
                      type: string;
                    };
                  };
                };
              };
            };
          };
        };
      }, never>;
    };
    hooks: {
      before: {
        matcher(context: better_auth99.HookEndpointContext): boolean;
        handler: (inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<void>;
      }[];
      after: {
        matcher(context: better_auth99.HookEndpointContext): boolean;
        handler: (inputContext: better_auth99.MiddlewareInputContext<better_auth99.MiddlewareOptions>) => Promise<void>;
      }[];
    };
  }, better_auth_plugins35.DefaultOrganizationPlugin<{
    allowUserToCreateOrganization: true;
    ac: better_auth_plugins35.AccessControl;
    roles: {
      member: {
        authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key] | {
          actions: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key];
          connector: "OR" | "AND";
        } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
        statements: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>;
      };
      admin: {
        authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key] | {
          actions: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key];
          connector: "OR" | "AND";
        } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
        statements: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>;
      };
      owner: {
        authorize<K_1 extends "organization" | "member" | "project" | "team" | "ac" | "invitation">(request: K_1 extends infer T extends K ? { [key in T]?: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key] | {
          actions: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>[key];
          connector: "OR" | "AND";
        } | undefined } : never, connector?: "OR" | "AND"): better_auth_plugins35.AuthorizeResponse;
        statements: better_auth_plugins35.Subset<"organization" | "member" | "project" | "team" | "ac" | "invitation", better_auth_plugins35.Statements>;
      };
    };
    creatorRole: "admin";
    membershipLimit: number;
    invitationLimit: number;
    invitationExpiresIn: number;
    sendInvitationEmail(data: {
      id: string;
      role: string;
      email: string;
      organization: better_auth_plugins35.Organization;
      invitation: better_auth_plugins35.Invitation;
      inviter: better_auth_plugins35.Member & {
        user: better_auth99.User;
      };
    }): Promise<void>;
    schema: {
      invitation: {
        additionalFields: {
          authMethod: {
            type: "string";
            input: true;
            required: false;
          };
        };
      };
      organization: {
        additionalFields: {
          preferredAuthMethod: {
            type: "string";
            input: true;
            required: false;
          };
          serviceAccountUserId: {
            type: "string";
            input: true;
            required: false;
          };
        };
      };
    };
    organizationHooks: {
      afterAcceptInvitation: ({
        member,
        user,
        organization: org
      }: {
        invitation: better_auth_plugins35.Invitation & Record<string, any>;
        member: better_auth_plugins35.Member & Record<string, any>;
        user: better_auth99.User & Record<string, any>;
        organization: better_auth_plugins35.Organization & Record<string, any>;
      }) => Promise<void>;
      beforeUpdateMemberRole: ({
        member,
        organization: org,
        newRole
      }: {
        member: better_auth_plugins35.Member & Record<string, any>;
        newRole: string;
        user: better_auth99.User & Record<string, any>;
        organization: better_auth_plugins35.Organization & Record<string, any>;
      }) => Promise<void>;
      beforeRemoveMember: ({
        member,
        organization: org
      }: {
        member: better_auth_plugins35.Member & Record<string, any>;
        user: better_auth99.User & Record<string, any>;
        organization: better_auth_plugins35.Organization & Record<string, any>;
      }) => Promise<void>;
    };
  }>, {
    id: "device-authorization";
    schema: {
      deviceCode: {
        fields: {
          deviceCode: {
            type: "string";
            required: true;
          };
          userCode: {
            type: "string";
            required: true;
          };
          userId: {
            type: "string";
            required: false;
          };
          expiresAt: {
            type: "date";
            required: true;
          };
          status: {
            type: "string";
            required: true;
          };
          lastPolledAt: {
            type: "date";
            required: false;
          };
          pollingInterval: {
            type: "number";
            required: false;
          };
          clientId: {
            type: "string";
            required: false;
          };
          scope: {
            type: "string";
            required: false;
          };
        };
      };
    };
    endpoints: {
      deviceCode: better_auth99.StrictEndpoint<"/device/code", {
        method: "POST";
        body: zod344.ZodObject<{
          client_id: zod344.ZodString;
          scope: zod344.ZodOptional<zod344.ZodString>;
        }, better_auth99.$strip>;
        error: zod344.ZodObject<{
          error: zod344.ZodEnum<{
            invalid_request: "invalid_request";
            invalid_client: "invalid_client";
          }>;
          error_description: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            description: string;
            responses: {
              200: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        device_code: {
                          type: string;
                          description: string;
                        };
                        user_code: {
                          type: string;
                          description: string;
                        };
                        verification_uri: {
                          type: string;
                          format: string;
                          description: string;
                        };
                        verification_uri_complete: {
                          type: string;
                          format: string;
                          description: string;
                        };
                        expires_in: {
                          type: string;
                          description: string;
                        };
                        interval: {
                          type: string;
                          description: string;
                        };
                      };
                    };
                  };
                };
              };
              400: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        error: {
                          type: string;
                          enum: string[];
                        };
                        error_description: {
                          type: string;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        device_code: string;
        user_code: string;
        verification_uri: string;
        verification_uri_complete: string;
        expires_in: number;
        interval: number;
      }>;
      deviceToken: better_auth99.StrictEndpoint<"/device/token", {
        method: "POST";
        body: zod344.ZodObject<{
          grant_type: zod344.ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">;
          device_code: zod344.ZodString;
          client_id: zod344.ZodString;
        }, better_auth99.$strip>;
        error: zod344.ZodObject<{
          error: zod344.ZodEnum<{
            invalid_request: "invalid_request";
            authorization_pending: "authorization_pending";
            slow_down: "slow_down";
            expired_token: "expired_token";
            access_denied: "access_denied";
            invalid_grant: "invalid_grant";
          }>;
          error_description: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            description: string;
            responses: {
              200: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        session: {
                          $ref: string;
                        };
                        user: {
                          $ref: string;
                        };
                      };
                    };
                  };
                };
              };
              400: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        error: {
                          type: string;
                          enum: string[];
                        };
                        error_description: {
                          type: string;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        access_token: string;
        token_type: string;
        expires_in: number;
        scope: string;
      }>;
      deviceVerify: better_auth99.StrictEndpoint<"/device", {
        method: "GET";
        query: zod344.ZodObject<{
          user_code: zod344.ZodString;
        }, better_auth99.$strip>;
        error: zod344.ZodObject<{
          error: zod344.ZodEnum<{
            invalid_request: "invalid_request";
          }>;
          error_description: zod344.ZodString;
        }, better_auth99.$strip>;
        metadata: {
          openapi: {
            description: string;
            responses: {
              200: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        user_code: {
                          type: string;
                          description: string;
                        };
                        status: {
                          type: string;
                          enum: string[];
                          description: string;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        user_code: string;
        status: string;
      }>;
      deviceApprove: better_auth99.StrictEndpoint<"/device/approve", {
        method: "POST";
        body: zod344.ZodObject<{
          userCode: zod344.ZodString;
        }, better_auth99.$strip>;
        error: zod344.ZodObject<{
          error: zod344.ZodEnum<{
            unauthorized: "unauthorized";
            invalid_request: "invalid_request";
            expired_token: "expired_token";
            access_denied: "access_denied";
            device_code_already_processed: "device_code_already_processed";
          }>;
          error_description: zod344.ZodString;
        }, better_auth99.$strip>;
        requireHeaders: true;
        metadata: {
          openapi: {
            description: string;
            responses: {
              200: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        success: {
                          type: string;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        success: boolean;
      }>;
      deviceDeny: better_auth99.StrictEndpoint<"/device/deny", {
        method: "POST";
        body: zod344.ZodObject<{
          userCode: zod344.ZodString;
        }, better_auth99.$strip>;
        error: zod344.ZodObject<{
          error: zod344.ZodEnum<{
            unauthorized: "unauthorized";
            invalid_request: "invalid_request";
            expired_token: "expired_token";
            access_denied: "access_denied";
          }>;
          error_description: zod344.ZodString;
        }, better_auth99.$strip>;
        requireHeaders: true;
        metadata: {
          openapi: {
            description: string;
            responses: {
              200: {
                description: string;
                content: {
                  "application/json": {
                    schema: {
                      type: "object";
                      properties: {
                        success: {
                          type: string;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        };
      }, {
        success: boolean;
      }>;
    };
    $ERROR_CODES: {
      readonly INVALID_DEVICE_CODE: "Invalid device code";
      readonly EXPIRED_DEVICE_CODE: "Device code has expired";
      readonly EXPIRED_USER_CODE: "User code has expired";
      readonly AUTHORIZATION_PENDING: "Authorization pending";
      readonly ACCESS_DENIED: "Access denied";
      readonly INVALID_USER_CODE: "Invalid user code";
      readonly DEVICE_CODE_ALREADY_PROCESSED: "Device code already processed";
      readonly POLLING_TOO_FREQUENTLY: "Polling too frequently";
      readonly USER_NOT_FOUND: "User not found";
      readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
      readonly INVALID_DEVICE_CODE_STATUS: "Invalid device code status";
      readonly AUTHENTICATION_REQUIRED: "Authentication required";
    };
    options: Partial<{
      expiresIn: better_auth_plugins35.TimeString;
      interval: better_auth_plugins35.TimeString;
      deviceCodeLength: number;
      userCodeLength: number;
      schema: {
        deviceCode?: {
          modelName?: string | undefined;
          fields?: {
            deviceCode?: string | undefined;
            userCode?: string | undefined;
            userId?: string | undefined;
            expiresAt?: string | undefined;
            status?: string | undefined;
            lastPolledAt?: string | undefined;
            pollingInterval?: string | undefined;
            clientId?: string | undefined;
            scope?: string | undefined;
          } | undefined;
        } | undefined;
      };
      generateDeviceCode?: (() => string | Promise<string>) | undefined;
      generateUserCode?: (() => string | Promise<string>) | undefined;
      validateClient?: ((clientId: string) => boolean | Promise<boolean>) | undefined;
      onDeviceAuthRequest?: ((clientId: string, scope: string | undefined) => void | Promise<void>) | undefined;
      verificationUri?: string | undefined;
    }>;
  }];
}>;
declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
//#endregion
export { type AppConfig, type AppVariables, Hono, type NativeSandboxConfig, type SSOProviderConfig, type SandboxConfig, type UserAuthConfig, type VercelSandboxConfig, auth, createAgentsApp, createAgentsHono, createAuth0Provider, createOIDCProvider, app as default };