/**
 * olam init — Initialize olam configuration in the current project.
 *
 * Delegates to the same init logic as the MCP server's olam_init tool.
 * Works without an existing OlamContext (that is the whole point).
 *
 * B6 (Phase 2 dogfood recovery): auto-write host.kubectl_context_pinned to
 * ~/.olam/config.json when exactly ONE ^k3d-olam- context is detected.
 * Decision #7: regex ^k3d-olam- (not ^k3d-) to avoid false-positives.
 * Multiple matches → stderr error, skip. Zero matches → silent skip.
 * Existing value → never overwrite.
 */
import * as fs from "node:fs";
import type { Command } from "commander";
/** Exec function shape used by detectK3dOlamContext for injection in tests. */
export type ExecFn = (cmd: string, opts?: {
    encoding: "utf-8";
}) => string;
/**
 * Detect `^k3d-olam-` kubectl contexts from the operator's kubeconfig.
 *
 * Returns:
 *   { contexts: string[] } — list of matching context names (may be empty).
 *   { contexts: null }     — kubectl not found / kubeconfig unreadable (skip silently).
 *
 * Exported for unit testing.
 */
export declare function detectK3dOlamContexts(execFn?: ExecFn): {
    contexts: string[] | null;
};
/**
 * Write host.kubectl_context_pinned to ~/.olam/config.json when exactly one
 * ^k3d-olam- context is detected. Reads the file raw so unknown fields are
 * preserved (OlamConfig strict type doesn't include kubectl_context_pinned).
 *
 * Returns:
 *   { pinned: string }  — field written.
 *   { skipped: string } — reason it was not written (informational; not an error).
 *   { refused: string } — multiple contexts detected (emit to stderr).
 *
 * Exported for unit testing.
 */
export declare function applyKubectlContextPin(contexts: string[], opts?: {
    configPath?: string;
    readFileSyncFn?: typeof fs.readFileSync;
    writeFileSyncFn?: typeof fs.writeFileSync;
    mkdirSyncFn?: typeof fs.mkdirSync;
}): {
    pinned: string;
} | {
    skipped: string;
} | {
    refused: string;
};
/**
 * Walk UP from `startDir` to the nearest `.git` directory; return that root
 * (or `startDir` if no .git is found en route to filesystem root).
 *
 * Exported so `olam setup` Phase 5 can resolve `.olam/config.yaml` using
 * the SAME walk semantics as `olam init` — otherwise re-running setup
 * from a subdir of a git repo fails Phase 5's idempotency contract
 * (audit finding HIGH on Phase C CP3).
 */
export declare function findProjectRoot(startDir: string): string;
export declare function registerInit(program: Command): void;
//# sourceMappingURL=init.d.ts.map