/** * Local-file backed env-config store. * * Layout: `~/.log10x/envs/${env_id}.json`, mode 0600. The directory is created * lazily on first write (mkdir -p with 0700). The store assumes `$HOME` is * writeable and so reports `isAvailable: true` unconditionally — it sits at * the bottom of the resolver chain as the dev/local fallback under k8s, SSM, * GCP Secret Manager, and Azure App Configuration. * * Reads accept either an env_id (filename match) or a nickname (scan + match * on the parsed `nickname` field). Writes always key by env_id, so renaming a * nickname does not orphan the file. Documents are validated against * `environmentConfigSchema` on the way in AND out so a hand-edited file with * a busted shape fails loudly at read time rather than poisoning downstream * tools. */ import { type EnvironmentConfig } from './types.js'; import type { EnvConfigStore, StoreKind } from './store-interface.js'; export declare class LocalFileStore implements EnvConfigStore { readonly kind: StoreKind; private readonly dir; constructor(dir?: string); /** * Always available — assumes `$HOME` is writeable. The actual write may * still fail on a read-only home directory, but that surfaces as a thrown * error from `write()` rather than a silent skip. */ isAvailable(): Promise<{ available: boolean; reason: string; }>; /** * Resolve by env_id (filename match) first, then fall back to a directory * scan for nickname match. Returns `null` when nothing matches. */ read(envIdOrNickname: string): Promise; /** * Write the document keyed by env_id. Creates the directory on first write * (mode 0700). File is written with mode 0600. */ write(config: EnvironmentConfig): Promise; /** * Returns every parseable document in the directory. Files that fail schema * validation are skipped silently — a single hand-edited bad file should not * blind the resolver to its neighbours. (Read-by-id still surfaces the * parse error for the specific file the caller asked for.) */ list(): Promise; delete(envId: string): Promise; private fileFor; private readFile; }