import { Context, Crypto, Effect, Layer, Option, Redacted, Schema } from "effect"; /** @experimental */ export declare const issuer = "https://auth.openai.com"; /** @experimental */ export declare const clientId = "app_EMoamEEZ73f0CkXaXp7hrann"; /** @experimental */ export declare const redirectUri = "http://localhost:1455/auth/callback"; /** @experimental */ export declare const scopes = "openid profile email offline_access api.connectors.read api.connectors.invoke"; /** @experimental */ export declare const originator = "codex_cli_rs"; /** @experimental */ export declare const deviceVerificationUrl = "https://auth.openai.com/codex/device"; /** @experimental */ export declare const deviceExchangeRedirect = "https://auth.openai.com/deviceauth/callback"; /** @experimental */ export declare const credentialFormatVersion = 1; declare const AuthError_base: Schema.Class; readonly message: Schema.String; }>, import("effect/Cause").YieldableError>; /** @experimental */ export declare class AuthError extends AuthError_base { } declare const StoreError_base: Schema.Class; readonly message: Schema.String; }>, import("effect/Cause").YieldableError>; /** @experimental */ export declare class StoreError extends StoreError_base { } /** @experimental */ export type Error = AuthError | StoreError; /** @experimental */ export interface AuthorizationResult { readonly code: Redacted.Redacted; readonly state: Redacted.Redacted; } /** @experimental */ export interface HostInterface { readonly authorize: (url: URL, expectedState: Redacted.Redacted) => Effect.Effect; } declare const OpenAiAccountAuthHost_base: Context.ServiceClass; /** @experimental */ export declare class OpenAiAccountAuthHost extends OpenAiAccountAuthHost_base { } /** @experimental */ export interface DevicePrompt { readonly verificationUrl: string; readonly userCode: string; readonly warning: string; } /** @experimental */ export interface PresenterInterface { readonly device: (prompt: DevicePrompt) => Effect.Effect; } declare const OpenAiAccountDevicePresenter_base: Context.ServiceClass; /** @experimental */ export declare class OpenAiAccountDevicePresenter extends OpenAiAccountDevicePresenter_base { } /** @experimental */ export declare const TokenResponse: Schema.Struct<{ readonly access_token: Schema.optionalKey; readonly id_token: Schema.optionalKey; readonly refresh_token: Schema.optionalKey; readonly expires_in: Schema.optionalKey; }>; /** @experimental */ export type TokenResponse = typeof TokenResponse.Type; /** @experimental */ export declare const DeviceStartResponse: Schema.Struct<{ readonly device_auth_id: Schema.String; readonly user_code: Schema.String; readonly interval: Schema.String; }>; /** @experimental */ export declare const DevicePollResponse: Schema.Struct<{ readonly authorization_code: Schema.String; readonly code_challenge: Schema.String; readonly code_verifier: Schema.String; }>; /** @experimental */ export interface HttpInterface { readonly exchange: (input: { readonly code: Redacted.Redacted; readonly verifier: Redacted.Redacted; readonly redirectUri: string; }) => Effect.Effect; readonly refresh: (refreshToken: Redacted.Redacted) => Effect.Effect; readonly deviceStart: Effect.Effect; readonly devicePoll: (deviceAuthId: Redacted.Redacted, userCode: string) => Effect.Effect, AuthError>; } declare const OpenAiAccountAuthHttp_base: Context.ServiceClass; /** @experimental */ export declare class OpenAiAccountAuthHttp extends OpenAiAccountAuthHttp_base { } /** @experimental */ export declare const CredentialDisk: Schema.Struct<{ readonly formatVersion: Schema.Literal<1>; readonly accessToken: Schema.String; readonly idToken: Schema.String; readonly refreshToken: Schema.String; readonly accountId: Schema.String; readonly fingerprint: Schema.String; readonly generation: Schema.String; readonly expiresAt: Schema.Finite; readonly refreshedAt: Schema.Finite; }>; type CredentialDisk = typeof CredentialDisk.Type; /** @experimental */ export interface Credential { readonly accessToken: Redacted.Redacted; readonly idToken: Redacted.Redacted; readonly refreshToken: Redacted.Redacted; readonly accountId: Redacted.Redacted; readonly fingerprint: string; readonly generation: string; readonly expiresAt: number; readonly refreshedAt: number; } /** @experimental */ export interface StoreInterface { readonly load: Effect.Effect, StoreError>; readonly save: (credential: CredentialDisk) => Effect.Effect; readonly remove: Effect.Effect; readonly serialized: (effect: Effect.Effect) => Effect.Effect; } declare const OpenAiAccountCredentialStore_base: Context.ServiceClass; /** @experimental */ export declare class OpenAiAccountCredentialStore extends OpenAiAccountCredentialStore_base { } /** @experimental */ export declare const makePkce: Effect.Effect<{ verifier: Redacted.Redacted; challenge: string; state: Redacted.Redacted; }, AuthError, Crypto.Crypto>; /** @experimental */ export declare const authorizationUrl: { (challenge: string, state: Redacted.Redacted, redirect?: string): URL; (state: Redacted.Redacted, redirect?: string): (challenge: string) => URL; }; /** @experimental */ export type Status = { readonly _tag: "Unauthenticated"; } | { readonly _tag: "Present"; readonly fingerprint: string; } | { readonly _tag: "RefreshRequired"; readonly fingerprint: string; } | { readonly _tag: "Corrupt"; }; /** @experimental */ export interface ServiceInterface { readonly loginBrowser: (redirect?: string) => Effect.Effect; readonly loginDevice: Effect.Effect; readonly status: Effect.Effect; readonly logout: Effect.Effect<{ readonly removed: boolean; readonly revocationSupported: false; }, StoreError>; readonly acquire: Effect.Effect; readonly refreshRejected: (generation: string) => Effect.Effect; } declare const OpenAiAccountAuth_base: Context.ServiceClass; /** @experimental */ export declare class OpenAiAccountAuth extends OpenAiAccountAuth_base { } /** @experimental */ export interface TimingOptions { readonly deviceTimeout?: number; } /** @experimental */ export declare const layer: (options?: TimingOptions) => Layer.Layer; /** @experimental */ export declare const layerHostTest: (implementation: HostInterface) => Layer.Layer; /** @experimental */ export declare const layerPresenterTest: (implementation: PresenterInterface) => Layer.Layer; /** @experimental */ export declare const layerHttpTest: (implementation: HttpInterface) => Layer.Layer; /** @experimental */ export declare const layerStoreTest: (implementation: StoreInterface) => Layer.Layer; export {};