/**
 * Workflow discovery and per-workflow operations for the gxwf-web HTTP server.
 *
 * Discovery mirrors Python's `discover_workflows` in workflow_tree.py:
 *   - scans for .ga, .gxwf.yml, .gxwf.yaml files
 *   - validates content (a_galaxy_workflow / class: GalaxyWorkflow)
 *   - category = first parent directory of relative path, or "" for root
 *
 * Operations delegate to @galaxy-tool-util/schema and @galaxy-tool-util/cli.
 *
 * All six operation endpoints are POST. clean/export/convert are mutating by
 * default — dry_run=true returns the would-be content without touching disk.
 * validate/lint/roundtrip are read-only regardless.
 *
 * ## Parity status vs Python server
 *
 * | Endpoint  | Python params                          | TS status                                |
 * |-----------|----------------------------------------|------------------------------------------|
 * | validate  | strict, connections, mode, allow, deny | strict wired; rest accepted (no-op)      |
 * | lint      | strict, allow, deny                    | strict wired; allow/deny accepted (no-op)|
 * | clean     | preserve, strip, dry_run               | writes back; dry_run wired; preserve/strip no-op |
 * | export    | dry_run                                | full parity                              |
 * | convert   | dry_run                                | full parity                              |
 * | roundtrip | strict_structure, strict_encoding, strict_state, include_content | full parity |
 *
 * TS extension not in Python spec: GET /api/schemas/structural?format=...
 * mode=pydantic (Python default) maps to effect (TS default); mode=json-schema accepted (no-op).
 * allow/deny/preserve/strip require StaleKeyPolicy — tracked as future work in stale-keys.ts.
 */
import type { ToolCache } from "@galaxy-tool-util/core";
import { type WorkflowFormat, type WorkflowIndex, type SingleValidationReport, type SingleLintReport, type SingleCleanReport, type SingleRoundTripReport } from "@galaxy-tool-util/schema";
import { type ResolvedToolSpec } from "@galaxy-tool-util/cli";
import type { EdgeAnnotation } from "@galaxy-tool-util/connection-validation";
import type { ConvertResult, ExportResult } from "./models.js";
/** Scan directory for workflow files, returning a WorkflowIndex (matches Python's discover_workflows). */
export declare function discoverWorkflows(directory: string): WorkflowIndex;
export interface WorkflowFile {
    absPath: string;
    data: Record<string, unknown>;
    format: WorkflowFormat;
}
/**
 * Resolve a relative workflow path within a directory and load its data.
 * Throws HttpError 404 if not found, 400 if unreadable.
 */
export declare function loadWorkflowFile(directory: string, relPath: string): WorkflowFile;
export interface ValidateOptions {
    /** Reject unknown keys at envelope/step level (mirrors Python strict_structure). */
    strict_structure?: boolean;
    /** Reject JSON-string tool_state and format2 field misuse (mirrors Python strict_encoding). */
    strict_encoding?: boolean;
    /**
     * Validate connections between steps. Not yet implemented in TS — accepted
     * for API parity but silently ignored.
     */
    connections?: boolean;
    /**
     * Validation mode: "effect" (default) uses Effect Schema decode;
     * "json-schema" uses AJV against the generated JSON Schema (mirrors Python --mode json-schema).
     * Python default "pydantic" is treated as "effect".
     */
    mode?: string;
    /**
     * Run clean in-memory before validating. Results are embedded in the
     * returned report as clean_report.
     */
    clean_first?: boolean;
    /**
     * Tool IDs whose stale keys are allowed. Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    allow?: string[];
    /**
     * Tool IDs whose stale keys are denied. Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    deny?: string[];
}
/** Validate a workflow's tool state. */
export declare function operateValidate(wf: WorkflowFile, cache: ToolCache, opts?: ValidateOptions): Promise<SingleValidationReport>;
export interface LintOptions {
    strict_structure?: boolean;
    strict_encoding?: boolean;
    /**
     * Tool IDs whose stale keys are allowed. Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    allow?: string[];
    /**
     * Tool IDs whose stale keys are denied. Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    deny?: string[];
}
/** Lint a workflow — structural checks, best practices, tool state validation. */
export declare function operateLint(wf: WorkflowFile, cache: ToolCache, opts?: LintOptions): Promise<SingleLintReport>;
export interface CleanOptions {
    /**
     * Keys to preserve (not strip). Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    preserve?: string[];
    /**
     * Keys to always strip. Accepted for API parity; requires
     * StaleKeyPolicy (future work) — currently ignored.
     */
    strip?: string[];
    /** When true, return the cleaned content without writing it back to disk. */
    dry_run?: boolean;
}
/** Clean stale tool state keys in a workflow; writes back to disk unless dry_run. */
export declare function operateClean(wf: WorkflowFile, opts?: CleanOptions): Promise<SingleCleanReport>;
export interface ExportConvertOptions {
    dry_run?: boolean;
}
/** Export: write converted workflow alongside the original (or return content on dry_run). */
export declare function operateExport(wf: WorkflowFile, cache: ToolCache, opts?: ExportConvertOptions): Promise<ExportResult>;
/** Convert: like export, but also removes the original file. */
export declare function operateConvert(wf: WorkflowFile, cache: ToolCache, opts?: ExportConvertOptions): Promise<ConvertResult>;
export interface RoundtripOptions {
    strict_structure?: boolean;
    strict_encoding?: boolean;
    strict_state?: boolean;
    include_content?: boolean;
}
/** Run roundtrip validation (native → format2 → native). */
export declare function operateRoundtrip(wf: WorkflowFile, cache: ToolCache, opts?: RoundtripOptions): Promise<SingleRoundTripReport>;
export interface EdgeAnnotationsResponse {
    annotations: Record<string, EdgeAnnotation>;
    /**
     * Tools the validator consumed, keyed by `${toolId}@${toolVersion}`. Co-resident
     * browsers can write these into IndexedDB to warm `useToolInfoService` for the
     * next workflow load — avoids a second cold-start fanout to ToolShed.
     */
    tool_specs: Record<string, ResolvedToolSpec>;
}
/** Build edge annotations (map-over depth, reductions) for visualizers. */
export declare function operateEdgeAnnotations(wf: WorkflowFile, cache: ToolCache): Promise<EdgeAnnotationsResponse>;
//# sourceMappingURL=workflows.d.ts.map