import * as Config from "effect/Config"; import * as ConfigProvider from "effect/ConfigProvider"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; import * as Layer from "effect/Layer"; import type { PlatformError } from "effect/PlatformError"; import { AuthError } from "./AuthProvider.ts"; import type { AuthProvider, ConfigureContext } from "./AuthProvider.ts"; export declare const rootDir: string; export declare const configFilePath: string; /** * Config key consulted by the various `fromAuthProvider` / * `fromEnvironment` layers to pick which named profile in * `~/.alchemy/profiles.json` to use. Defaults to `"default"`. */ export declare const ALCHEMY_PROFILE: Config.Config; export declare const CONFIG_VERSION = 0; declare const AlchemyConfig_base: Context.ServiceClass; export declare class AlchemyConfig extends AlchemyConfig_base { } export interface AlchemyProfileProviders { [providerName: string]: { /** * The method used to login to the provider. Different providers may use different methods, but common ones are: * - oauth: OAuth authentication * - api-key: API key authentication * - username-password: Username and password authentication * - token: Token authentication * - certificate: Certificate authentication * - ssh: SSH authentication * - other: Other authentication methods */ method: string; }; } /** * Service exposing on-disk profile helpers. All methods have `R = never` — * the {@link FileSystem.FileSystem} requirement is captured by * {@link ProfileLive} when the layer is built, freeing call sites from * having to thread `FileSystem` through their own Effects. * * Use {@link AlchemyProfile} directly when you need profile helpers — yield it * from your `Effect.gen` and call its methods (each has `R = never`). */ export interface ProfileService { readonly readConfig: Effect.Effect; readonly writeConfig: (config: AlchemyConfig["Service"]) => Effect.Effect; readonly getProfile: (name: string) => Effect.Effect; readonly setProfile: (name: string, profile: AlchemyProfileProviders) => Effect.Effect; readonly deleteProfile: (name: string) => Effect.Effect; readonly loadOrConfigure: (auth: AuthProvider, profileName: string, ctx: ConfigureContext) => Effect.Effect; } declare const AlchemyProfile_base: Context.ServiceClass; export declare class AlchemyProfile extends AlchemyProfile_base { } /** * Layer that builds the {@link AlchemyProfile} service. Captures the * {@link FileSystem.FileSystem} dependency at layer-build time, so any * Effect that yields {@link AlchemyProfile} ends up with `R = Profile` (no * `FileSystem` leak). Provide this once at the top of your runtime * (alongside `PlatformServices` / `NodeContext`). */ export declare const ProfileLive: Layer.Layer; /** * Returns a `ConfigProvider` that overrides `ALCHEMY_PROFILE` with the * given `profile` (when explicitly passed via the CLI `--profile` flag), * falling through to `base` for everything else. * * Use this to let the CLI's `--profile ` win over `$ALCHEMY_PROFILE` * without disturbing other config lookups. */ export declare const withProfileOverride: (base: ConfigProvider.ConfigProvider, profile: string | undefined) => ConfigProvider.ConfigProvider; export {}; //# sourceMappingURL=Profile.d.ts.map