export declare const FOLDER_ENVIRONMENT_MARKER = ".bitmagic-env"; export interface FolderEnvironment { /** The raw `env` value. Checking it against the environment table happens in environments.ts. */ environment: string; /** An optional api-server URL for that environment — see the note on `apiUrl` below. */ apiUrl?: string; /** Absolute path of the marker, so an error and `whoami` can both name the file that decided. */ file: string; } /** * Reads the nearest `.bitmagic-env`, walking up from `startDir`. * * Format is `key=value`, one per line, with `#` comments and blank lines skipped: * * # local-games/.bitmagic-env * env=local * apiUrl=http://localhost:3102 * * `apiUrl` is here rather than left to BITMAGIC_API_URL for the same reason the whole file exists: * an environment variable is invisible to an agent's shell. It matters most for `local`, whose * built-in URL assumes the default ports and is therefore wrong for any shifted clone. * * Every malformed case throws instead of falling through to the next input in the chain. The line * config/environments.ts draws is machine-written state versus a file a human typed: a bad STORED * default is treated as absent because it would otherwise wedge every command everywhere including * the recovery, but this file was typed deliberately, is visible, wedges only commands run beneath * its own folder, and `cd ..` or `--env` recovers in place. Falling through silently is exactly the * failure this feature was built to end — a folder that said `production` would quietly resolve to * whatever the last login happened to be. */ export declare function readFolderEnvironment(startDir?: string): FolderEnvironment | undefined;