/** * Shared device-code login flow for auth commands and guards. * * @experimental This API is unstable and may change without notice. */ import * as Effect from "effect/Effect"; import * as Schema from "effect/Schema"; import * as ServiceMap from "effect/Context"; import * as Layer from "effect/Layer"; import { CliRenderer } from "../cli-renderer/index.js"; import { AuthClient } from "./auth-client.js"; import { CredentialStore } from "./credential-store.js"; import { PendingDeviceLoginStore } from "./pending-device-login-store.js"; export interface DeviceLoginInteractionService { readonly openBrowser: (url: string) => Effect.Effect; readonly copyToClipboard: (text: string) => Effect.Effect; } declare const DeviceLoginInteraction_base: ServiceMap.ServiceClass; export declare class DeviceLoginInteraction extends DeviceLoginInteraction_base { } export interface DeviceLoginInteractionTestState { readonly openBrowserCalls: Array; readonly copyToClipboardCalls: Array; } export declare const DeviceLoginInteractionTest: (overrides?: { readonly openBrowser?: (url: string) => Effect.Effect; readonly copyToClipboard?: (text: string) => Effect.Effect; }) => { layer: Layer.Layer; state: DeviceLoginInteractionTestState; }; export interface RunDeviceLoginOptions { readonly emitPendingResult?: boolean; readonly openBrowser?: boolean; readonly restart?: boolean; readonly scopes?: ReadonlyArray; } export interface ResumeDeviceLoginOptions { readonly timeoutSeconds?: number; } export declare const DeviceLoginPendingResultSchema: Schema.Struct<{ readonly status: Schema.Literal<"pending-human">; readonly blockedOn: Schema.Literal<"human">; readonly retryable: Schema.Literal; readonly flow: Schema.Literals; readonly registryHost: Schema.String; readonly verificationUri: Schema.String; readonly verificationUriComplete: Schema.String; readonly requestedScopes: Schema.$Array; readonly userCode: Schema.String; readonly expiresAt: Schema.String; readonly interval: Schema.Number; readonly resume: Schema.String; readonly action: Schema.Struct<{ readonly kind: Schema.Literal<"open-url">; readonly url: Schema.String; readonly fallbackUrl: Schema.String; readonly code: Schema.String; readonly expiresAt: Schema.String; readonly resume: Schema.String; }>; }>; export type DeviceLoginPendingResult = typeof DeviceLoginPendingResultSchema.Type; export declare const initiateDeviceLogin: (registryUrl: string, options?: RunDeviceLoginOptions) => Effect.Effect<{ readonly status: "pending-human"; readonly blockedOn: "human"; readonly retryable: true; readonly flow: "started" | "re-emitted"; readonly registryHost: string; readonly verificationUri: string; readonly verificationUriComplete: string; readonly requestedScopes: readonly string[]; readonly userCode: string; readonly expiresAt: string; readonly interval: number; readonly resume: string; readonly action: { readonly kind: "open-url"; readonly url: string; readonly fallbackUrl: string; readonly code: string; readonly expiresAt: string; readonly resume: string; }; }, import("../app-error/app-error.ts").AppError, CliRenderer | CredentialStore | PendingDeviceLoginStore | AuthClient | DeviceLoginInteraction>; export declare const resumeDeviceLogin: (registryUrl: string, options?: ResumeDeviceLoginOptions) => Effect.Effect; export declare const runDeviceLogin: (registryUrl: string, options?: RunDeviceLoginOptions) => Effect.Effect; export {}; //# sourceMappingURL=device-login.d.ts.map