import { EventEmitter, OnInit } from '@angular/core';
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
import { MJMLTrainingPipelineEntity } from '@memberjunction/core-entities';
import type { SourceBinding, FeatureStep, FeatureStepKind, AsOfStrategy, LeakageGuard, ValidationStrategy, ProblemType } from '@memberjunction/predictive-studio-core';
import { PredictiveStudioEngine } from '../engine/predictive-studio.engine';
import * as i0 from "@angular/core";
type NodeType = 'src' | 'feat' | 'emb' | 'target' | 'algo' | 'output';
interface DagNode {
    id: string;
    type: NodeType;
    title: string;
    icon: string;
    tag?: string;
    rows: {
        k: string;
        v: string;
    }[];
    x: number;
    y: number;
    hasIn: boolean;
    hasOut: boolean;
}
interface DagEdge {
    from: string;
    to: string;
}
/**
 * Training Pipelines panel — a LIVE, **editable** visual DAG builder over `MJ: ML Training Pipelines`.
 * The whole graph is persisted as JSON (`SourceBindings` + `FeatureSteps` + `AlgorithmID` +
 * `TargetVariable` + `AsOfStrategy`/`LeakageGuard`/`ValidationStrategy`), so the editor reads/writes the
 * REAL spec. The parsed spec is the editable state; nodes/edges are derived from it for rendering, so an
 * edit → re-derive → re-layout. Save serializes back to the entity; Train runs the pipeline. Editing is
 * inspector-driven (explicit controls, no fiddly port-dragging) — better for a structured, persisted DAG.
 * Fully entity-agnostic — every node derives from the pipeline's own refs. See
 * plans/predictive-studio-pipeline-builder.md.
 */
export declare class PSPipelinesComponent implements OnInit {
    engine: PredictiveStudioEngine;
    provider: IMetadataProvider | null;
    currentUser: UserInfo | null;
    askAgent: EventEmitter<string>;
    private cdr;
    private notifications;
    readonly starterPrompt: string;
    readonly sourceKinds: ("Entity" | "Query" | "ExternalEntity" | "VectorSet" | "FeaturePipeline")[];
    readonly stepKinds: FeatureStepKind[];
    readonly problemTypes: ProblemType[];
    readonly imputeStrategies: ("mode" | "mean" | "median" | "constant")[];
    pipelines: MJMLTrainingPipelineEntity[];
    selectedPipelineId: string;
    private editSources;
    private editSteps;
    editTargetVariable: string;
    editProblemType: ProblemType;
    editAlgorithmId: string;
    editHyperparams: string;
    editLeakage: LeakageGuard;
    editAsOf: AsOfStrategy;
    editValidation: ValidationStrategy;
    nodes: DagNode[];
    edges: DagEdge[];
    selectedId: string;
    canvasW: number;
    canvasH: number;
    dirty: boolean;
    busy: boolean;
    private nodeById;
    private stepSeq;
    ngOnInit(): void;
    selectPipeline(id: string): void;
    private get selectedPipeline();
    isSelectedPipeline(p: MJMLTrainingPipelineEntity): boolean;
    private parse;
    private markDirty;
    private rebuild;
    private sourceNode;
    private stepNode;
    private stepRows;
    private targetNode;
    private algoNode;
    private markPorts;
    selectNode(id: string): void;
    get selectedNode(): DagNode;
    get selectedSourceIndex(): number;
    get selectedSource(): SourceBinding | null;
    get selectedStep(): FeatureStep | null;
    get otherSteps(): FeatureStep[];
    get algorithms(): import("@memberjunction/core-entities").MJMLAlgorithmEntity[];
    setSourceKind(kind: string): void;
    setSourceRef(ref: string): void;
    setSourceAlias(alias: string): void;
    get columnsText(): string;
    setColumns(text: string): void;
    /** Read an arbitrary field off the selected step for display (narrowed by template @switch). */
    stepField(field: string): string;
    setStepStr(field: string, value: string): void;
    setStepNum(field: string, value: string): void;
    setStepLabel(label: string): void;
    /** Change a step's Kind, resetting its config to that Kind's defaults (preserving Id/Label/Inputs). */
    setStepKind(kind: string): void;
    hasInput(stepId: string): boolean;
    /** Toggle an upstream step input, preventing cycles. */
    toggleInput(stepId: string): void;
    /** True if making `target` depend on `from` would create a cycle (from is downstream of target). */
    private createsCycle;
    setTargetVariable(v: string): void;
    setProblemType(v: string): void;
    setAlgorithm(id: string): void;
    setHyperparams(v: string): void;
    get denyText(): string;
    setDeny(text: string): void;
    setThreshold(v: string): void;
    setAsOfMode(v: string): void;
    setAsOfColumn(v: string): void;
    setAsOfOffset(v: string): void;
    setValStrategy(v: string): void;
    setTestSize(v: string): void;
    setK(v: string): void;
    setHoldout(v: string): void;
    addSource(): void;
    addStep(): void;
    deleteSelected(): void;
    private defaultStep;
    /** Serialize the editable state back onto the pipeline entity and Save(). */
    save(): Promise<void>;
    /** Client-side spec sanity check before training. */
    validate(): void;
    /** Run the pipeline via the Train Remote Op, then refresh the engine. */
    train(): Promise<void>;
    refine(): void;
    statusClass(status: string | null): string;
    nodeTypeLabel(type: NodeType): string;
    private layoutDag;
    private computeLayers;
    private positionColumns;
    edgePath(edge: DagEdge): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<PSPipelinesComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<PSPipelinesComponent, "ps-pipelines", never, { "engine": { "alias": "engine"; "required": false; }; "provider": { "alias": "provider"; "required": false; }; "currentUser": { "alias": "currentUser"; "required": false; }; }, { "askAgent": "askAgent"; }, never, never, true, never>;
}
export {};
//# sourceMappingURL=ps-pipelines.component.d.ts.map