The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { ConfigError } from "@distilled.cloud/core/errors"; |
| 2 | import { Credentials } from "@distilled.cloud/neon"; |
| 3 | import { lazyCredentials } from "alchemy/Auth/Resolve"; |
| 4 | import * as Layer from "effect/Layer"; |
| 5 | import { NEON_AUTH_PROVIDER_NAME, type NeonResolvedCredentials } from "./AuthProvider.ts"; |
| 6 | |
| 7 | export { Credentials } from "@distilled.cloud/neon"; |
| 8 | |
| 9 | const DEFAULT_BASE_URL = "https://console.neon.tech/api/v2"; |
| 10 | |
| 11 | export const fromAuthProvider = () => |
| 12 | Layer.effect( |
| 13 | Credentials, |
| 14 | lazyCredentials<NeonResolvedCredentials, ConfigError>()(NEON_AUTH_PROVIDER_NAME, (creds) => ({ |
| 15 | apiKey: creds.apiKey, |
| 16 | apiBaseUrl: DEFAULT_BASE_URL, |
| 17 | })), |
| 18 | ); |