import type { Config } from '../../types/config.schema.js'; /** * Node port of `hula-read-config.sh` (a sourced bash helper). Resolves the * git repo root and the effective `worktreeBasePath` for the other ported * scripts, replacing the `grep`/`sed` config parsing and the * `git rev-parse --show-toplevel` shell-out with cross-platform Node. */ /** * Resolve the git repository root. Mirrors the shell-out * `git rev-parse --show-toplevel` with the same non-fatal fallback the bash * scripts used (`|| REPO_ROOT="$(pwd)"`). On Windows + Git Bash, git may return * a Unix-style path (`/d/foo`); normalize it to a native path. */ export declare function resolveRepoRoot(cwd?: string): Promise; /** * Read `worktreeBasePath` from `.hublaunch/hublaunch.config.js` and resolve it * to an absolute path, exactly as `hula-read-config.sh` did: * - falls back to `.hula-worktrees` when the key is absent/empty or the config * file does not exist / cannot be loaded; * - resolves relative values against the repo root. * * The value is read by loading the config module (the config is generated by * `hula init` as valid ESM) instead of regex-scraping the file. Loading is done * silently — no logger/spinner — to preserve the "JSON only on stdout" contract. */ export declare function getWorktreeBasePath(repoRoot: string): Promise; /** * Why a remote-sync attempt resolved to a config or to `null`. * * There is no `unparsable` reason: an existing-but-unusable config is no longer * a quiet skip — it fails loud (see {@link failUnusableConfig}), consistent with * `ConfigLoader.load()`. */ export type HulaApiConfigReason = 'ok' | 'no-config-file' | 'no-api-key'; /** * Read the hula-project remote config from `.hublaunch/hublaunch.config.js` and * report *why* a config could or couldn't be resolved, following the exact * loading pattern of {@link getWorktreeBasePath} (cache-busted dynamic import, * never hard-fails on a bad config). * * The gate is `hulaApiKey` alone: when it is a non-empty string the sync is * enabled, and the base URL defaults to {@link HULA_PROJECT_URL} (the same * fallback every command uses) when `hulaProjectUrl` is absent/empty. This * fixes the silent no-op in the common post-`hula init` state where the API key * is set but no project URL is. * * Reasons: * - `ok` — config resolved; `config` is non-null. * - `no-config-file` — `.hublaunch/hublaunch.config.js` does not exist. * - `no-api-key` — config loaded but `hulaApiKey` is missing/empty. * * An existing-but-unusable config (import throw, or the empty-namespace * CommonJS-in-ESM case) fails loud rather than resolving to a reason. */ export declare function getHulaApiConfigDetailed(repoRoot: string): Promise<{ config: { apiKey: string; baseUrl: string; } | null; reason: HulaApiConfigReason; }>; /** * Convenience wrapper around {@link getHulaApiConfigDetailed} that returns just * the config (or `null`). Remote sync is enabled whenever `hulaApiKey` is * present; the base URL defaults to {@link HULA_PROJECT_URL} when unset. */ export declare function getHulaApiConfig(repoRoot: string): Promise<{ apiKey: string; baseUrl: string; } | null>; /** * Load and validate the full `.hublaunch/hublaunch.config.js` for the planning * commands, following the exact cache-busted dynamic-import pattern of * {@link getHulaApiConfig}. The raw config object is validated through * {@link ConfigSchema} (which applies {@link DEFAULT_CONFIG} defaults for every * omitted field), so callers get a fully-typed {@link Config}. * * Returns `null` only when the config file is **missing**. An existing config * that cannot be loaded, exposes no usable object, or fails schema validation * fails loud (consistent with `ConfigLoader.load()`): the actionable message is * written to stderr (preserving the "JSON only on stdout" contract of the * `hula plan` command group) and the reader throws so the caller exits non-zero. */ export declare function readPlanningConfig(repoRoot: string): Promise; //# sourceMappingURL=read-config.d.ts.map