/**
 * `olam kg build` — pristine workspace KG build via kg-service `/build`.
 *
 * kg-service-container-v2 Phase F (2026-05-14) migrates this command
 * from the legacy host-side scratch-copy + docker-run-graphify pattern
 * to a single HTTP POST to the always-running `olam-kg-service`
 * container. The scratch-copy now happens INSIDE the container as root
 * (no host UID permission issues), so multi-submodule workspaces with
 * non-operator-owned `.git/objects/pack/*` files and broken symlinks
 * build cleanly — closes Samuel's atlas-core failure from 2026-05-13.
 *
 * Flow:
 *   1. Resolve workspace name + source path (cwd by default).
 *   2. Translate cwd to container-side path under `/host-home/…`
 *      (kg-service container mounts $HOME read-only at /host-home).
 *   3. POST {workspace, repo_path} to localhost:9997/build.
 *   4. Server-side: cp source → /tmp/scratch (root-perms), graphify
 *      update, move output to /kg-data/<workspace>/graphify-out/, clean.
 *   5. Write host-side freshness.json mirroring the server's response.
 *
 * Failure modes surfaced with remedies:
 *   - kg-service not reachable → "run `olam services up`".
 *   - cwd not under $HOME → operator hint (mount path is $HOME:/host-home).
 *   - graphify timeout / failure / scratch_copy_failed → pass-through error.
 *
 * Out of scope (v1 behaviour retained):
 *   - Workspace-catalog lookup (deferred follow-on); cwd-as-source.
 *   - Watching / progress streaming — `/build` is synchronous, blocking.
 */
import type { Command } from 'commander';
interface KgBuildOptions {
    readonly json?: boolean;
}
export interface QueueEntry {
    path: string;
    addedAt: number;
    failedAt?: number;
    failedReason?: string;
}
export type ReadQueueFn = (queuePath: string) => QueueEntry[];
export type WriteQueueFn = (queuePath: string, entries: QueueEntry[]) => void;
export interface KgPendingOptions {
    readonly queuePath?: string;
    readonly readQueueFn?: ReadQueueFn;
    readonly writeQueueFn?: WriteQueueFn;
}
export interface KgPendingResult {
    readonly exitCode: number;
    readonly built: string[];
    readonly failed: string[];
}
/**
 * Drain the kg-pending.jsonl queue: build each entry sequentially via kg-service,
 * remove successfully-built entries from the queue, leave failures with failedAt/failedReason.
 */
export declare function runKgBuildPending(opts?: KgPendingOptions): Promise<KgPendingResult>;
interface FreshnessRecord {
    readonly built_at: string;
    readonly duration_ms: number;
    readonly node_count: number | null;
    readonly edge_count: number | null;
    readonly workspace: string;
    readonly graphify_path: 'container';
}
export interface KgBuildResult {
    readonly exitCode: number;
    readonly freshness?: FreshnessRecord;
    readonly outputDir?: string;
}
/**
 * Programmatic entry point — exported so tests can drive without spawning
 * a sub-process.
 */
export declare function runKgBuild(workspaceArg: string | undefined, options?: KgBuildOptions): Promise<KgBuildResult>;
/**
 * `olam kg <subcommand>` group — registers the kg subcommand tree.
 */
export declare function registerKg(program: Command): void;
export {};
//# sourceMappingURL=kg-build.d.ts.map