/**
 * n8n workflow JSON import — read-format-only translator (plan M5 §2.1: "导入 n8n workflow JSON
 * (读格式,不打包其代码)"), deepened for IT-11 (spec D35).
 *
 * Converts an n8n workflow export (its public JSON shape: `nodes` + `connections`) into our own
 * WorkflowDef. This reads n8n's data FORMAT only — it links/embeds NONE of n8n's runtime code, so
 * the SUL licensing concern (plan §2.1 / risk register) does not apply.
 *
 * Error model (IT-11): STRUCTURAL problems (malformed JSON, duplicate/missing node names, dangling
 * connections) stay fail-loud — the graph identity itself is broken, nothing useful survives.
 * SEMANTIC gaps (unmapped node type, inconvertible expression, Code-node JS) DEGRADE EXPLICITLY:
 * the node lands as kind "manual" (its executor throws at run time — never silently passes
 * through), the original n8n type/params are preserved for the human, and every degradation is
 * itemized in the returned ConversionReport. Nothing is silently dropped; no JS is ever executed
 * (D6 hard line — n8n Code nodes are flagged manual, not emulated).
 *
 * Credentials: n8n nodes carry `credentials: {type: {id,name}}` references. The secrets are NOT
 * in the export — we extract them as CredentialRequirement entries (mapped to vault types, D29)
 * so the import UI can walk the user through re-binding.
 */
import type { WorkflowDef } from "./node-schema.js";
export interface N8nNodeReport {
    id: string;
    n8nType: string;
    /** converted=faithful; partial=landed but params need attention; manual=placeholder node; skipped=annotation dropped. */
    outcome: "converted" | "partial" | "manual" | "skipped";
    notes: string[];
}
export interface N8nCredentialRequirement {
    nodeId: string;
    n8nCredentialType: string;
    /** n8n-side display name of the credential (helps the user recognize which secret to re-create). */
    label?: string;
    /** Suggested vault credential type (D29). */
    suggestedVaultType: string;
}
export interface N8nConversionReport {
    /** full=everything faithful; partial=some degradations; manual=at least one manual placeholder. */
    status: "full" | "partial" | "manual";
    nodes: N8nNodeReport[];
    expressions: {
        converted: number;
        manual: Array<{
            nodeId: string;
            path: string;
            raw: string;
            reason: string;
        }>;
    };
    credentials: N8nCredentialRequirement[];
    notes: string[];
}
export interface N8nImportResult {
    name: string;
    def: WorkflowDef;
    report: N8nConversionReport;
}
/** Thrown when an n8n workflow is STRUCTURALLY untranslatable. Carries every problem found. */
export declare class N8nImportError extends Error {
    readonly errors: string[];
    constructor(errors: string[]);
}
/**
 * Convert an n8n workflow (a JSON string or already-parsed object) into a WorkflowDef + report.
 * The returned def is NOT yet graph-validated — pass it to `validateWorkflowDef` / a controller
 * write path, which is the single existing invariant gate.
 */
export declare function convertN8nWorkflow(input: string | unknown, workflowId: string): N8nImportResult;
