/**
 * api-client/build-request.ts — Build a PipelineRequest from local state.
 *
 * Translates the user's local `.ailf/tasks/` directory and resolved CLI
 * config into a `PipelineRequest` payload ready for the API. Reuses the
 * existing `RepoTaskSource` adapter for YAML parsing — no duplicated
 * parsing logic.
 *
 * The built request is validated against `PipelineRequestSchema` before
 * return (fail-fast on malformed payloads).
 *
 * @see packages/core/src/schemas/pipeline-request.ts — shared schema
 * @see packages/eval/src/adapters/task-sources/repo-task-source.ts
 */
import { type PipelineRequest } from "../../_vendor/ailf-core/index.d.ts";
/**
 * Thrown when `buildRemoteRequest` can't find any runnable tasks.
 *
 * The CLI catches this separately from ZodError so it can print the
 * message without an accompanying stack trace — the message is already
 * the whole story for the user.
 */
export declare class NoRunnableTasksError extends Error {
    readonly name = "NoRunnableTasksError";
}
/** Options for building a remote pipeline request. */
export interface BuildRequestOptions {
    /** Path to .ailf/tasks/ directory. */
    tasksDir: string;
    /** Resolved CLI config for mode, scoping, and source overrides. */
    config: RemoteConfigSlice;
}
/**
 * Subset of ResolvedConfig fields needed for building a remote request.
 * Defined as a standalone interface so the build function doesn't depend
 * on the full ResolvedConfig type (keeps the api-client adapter decoupled).
 */
export interface RemoteConfigSlice {
    mode?: string;
    variant?: string;
    debug?: {
        enabled?: boolean;
        firstN?: number;
        pattern?: string;
        sample?: number;
    };
    areas?: string[];
    tasks?: string[];
    tags?: string[];
    changedDocs?: string[];
    source?: string;
    compareEnabled?: boolean;
    compareThreshold?: number;
    publishEnabled?: boolean;
    publishTag?: string;
    concurrency?: number;
    datasetOverride?: string;
    projectIdOverride?: string;
    perspectiveOverride?: string;
    graderContext?: "rubric-only" | "with-docs";
    graderReplications?: number;
    borderlineReplications?: number;
    gapAnalysisEnabled?: boolean;
    noRemoteCache?: boolean;
    /**
     * D0037 / W0069 — CLI-flag overrides for the caller envelope. These
     * take precedence over the equivalent env vars when set. When both a
     * flag and its env var are unset the field is omitted from the
     * request (server applies its own defaults).
     */
    classificationOption?: string;
    ownerTeamOption?: string;
    ownerIndividualOption?: string;
    purposeOption?: string;
    /** Repeatable --label values; appended to AILF_LABELS env values. */
    labelOptions?: string[];
}
/**
 * Build a PipelineRequest from local tasks and config.
 *
 * 1. Loads tasks via RepoTaskSource (validates via Zod automatically)
 * 2. Applies filter options (areas, task IDs) from config
 * 3. Maps tasks to inline format
 * 4. Builds the full PipelineRequest
 * 5. Validates against PipelineRequestSchema
 *
 * Throws on validation errors (from RepoTaskSource or PipelineRequestSchema).
 */
export declare function buildRemoteRequest(options: BuildRequestOptions): Promise<{
    request: PipelineRequest;
    taskCount: number;
}>;
/**
 * Find the tasks directory, trying in order:
 * 1. Explicit path (from --repo-tasks-path)
 * 2. .ailf/tasks/ relative to rootDir
 *
 * Returns the resolved path or throws if not found.
 */
export declare function resolveTasksDir(rootDir: string, explicitPath?: string): string;
/**
 * Build the D0037 caller envelope payload from CLI flags + env vars.
 *
 * Precedence, highest first:
 *   1. Explicit CLI flag (--classification, --owner-team, --purpose, …)
 *   2. Env var (AILF_CLASSIFICATION, AILF_OWNER_TEAM, AILF_PURPOSE, …)
 *   3. Omit — server applies its own defaults (ad-hoc / unknown).
 *
 * Labels are additive: --label values concatenate with AILF_LABELS.
 *
 * `executor` is always set on remote submissions because we know the
 * invocation is a user-driven CLI call. Surface defaults to `"cli"`
 * unless AILF_EXECUTOR_SURFACE explicitly overrides; name falls back to
 * GITHUB_ACTOR when available.
 *
 * Returns partial `PipelineRequest` fields only. Omits any key whose
 * source (flag + env) was unset.
 */
export declare function buildCallerEnvelope(config: RemoteConfigSlice): Partial<PipelineRequest>;
