/**
 * k8s-context-discovery.ts — kubeconfig context enumeration + reachability + idleness probes.
 *
 * Used by `olam setup` Phase 0.5 (ADR 021) to detect existing reachable
 * Kubernetes contexts and offer to reuse them instead of provisioning a
 * new k3d cluster.
 *
 * All external I/O is injected via the `KubeContextDeps` interface for
 * testability. Production callers use the default implementations which
 * shell out to `kubectl`.
 */
export interface KubeContextProbe {
    readonly reachable: boolean;
    readonly error?: string;
    readonly serverUrl?: string;
}
export interface KubeContextDeps {
    /**
     * Return all context names from `~/.kube/config` (or `$KUBECONFIG`).
     * Default: `kubectl config get-contexts -o name`
     */
    readonly getContexts?: () => string[];
    /**
     * Probe one context for reachability.
     * Default: `kubectl --context=<name> cluster-info --request-timeout=3s`
     */
    readonly clusterInfo?: (context: string) => KubeContextProbe;
    /**
     * Check whether a context is idle (no `olam` namespace, or `olam` ns
     * present but no running pods).
     * Default: `kubectl --context=<name> get namespace olam --ignore-not-found`
     *          + `kubectl --context=<name> get pods -n olam`
     */
    readonly isIdle?: (context: string) => boolean;
}
/**
 * Context names provisioned by `olam setup` — never offered for reuse.
 * These are ours to manage (create/destroy via k3d).
 */
export declare const OLAM_MANAGED_CONTEXT_PREFIX = "k3d-olam-";
export declare function isOlamManagedContext(name: string): boolean;
/**
 * Default implementation: enumerate kubeconfig contexts via
 * `kubectl config get-contexts -o name`.
 * Returns an empty array when kubectl is absent or returns no contexts.
 */
export declare function defaultGetContexts(): string[];
/**
 * Default implementation: probe a context via
 * `kubectl --context=<name> cluster-info --request-timeout=3s`.
 *
 * Returns reachable:true when exit status is 0.
 * Returns reachable:false + the stderr text otherwise.
 */
export declare function defaultClusterInfo(context: string): KubeContextProbe;
/**
 * Default implementation: a context is idle when there is no `olam`
 * namespace OR the namespace exists but has no running pods.
 *
 * "Idle" means we haven't deployed Olam there yet — safe to offer for reuse.
 */
export declare function defaultIsIdle(context: string): boolean;
export interface DiscoveryResult {
    /** All reachable idle contexts that are not k3d-olam-* managed contexts. */
    readonly offerable: readonly string[];
    /** All contexts that were probed (for diagnostics). */
    readonly allContexts: readonly string[];
}
/**
 * Discover reachable idle kubeconfig contexts that could be offered for reuse.
 *
 * Steps:
 *   1. Enumerate all contexts from kubeconfig.
 *   2. Filter out k3d-olam-* (olam-managed).
 *   3. For each remaining context, probe reachability (3s timeout).
 *   4. For reachable contexts, check idleness.
 *   5. Return the offerable set.
 */
export declare function discoverOfferableContexts(deps?: KubeContextDeps): DiscoveryResult;
//# sourceMappingURL=k8s-context-discovery.d.ts.map