import { OnInit, OnDestroy, AfterViewInit, ChangeDetectorRef } from '@angular/core';
import { Subject } from 'rxjs';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { EntityInfo } from '@memberjunction/core';
import { ResourceData } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
interface EntityNode {
    Name: string;
    ID: string;
    SchemaName: string;
    ReferencedByCount: number;
    DependsOnCount: number;
    IsSelected: boolean;
}
interface RelationshipEdge {
    FromEntity: string;
    ToEntity: string;
    RelatedEntityJoinField: string;
    Type: string;
}
export declare class VersionHistoryGraphResourceComponent extends BaseResourceComponent implements OnInit, OnDestroy, AfterViewInit {
    private cdr;
    IsLoading: boolean;
    AllEntities: EntityNode[];
    FilteredEntities: EntityNode[];
    SearchText: string;
    SchemaFilter: string;
    AvailableSchemas: string[];
    SelectedEntity: EntityNode | null;
    SelectedEntityInfo: EntityInfo | null;
    ReferencedByEntities: RelationshipEdge[];
    DependsOnEntities: RelationshipEdge[];
    TotalEntities: number;
    EntitiesWithDependents: number;
    TotalRelationships: number;
    private static readonly PREFS_KEY;
    private preferencesLoaded;
    private metadata;
    protected destroy$: Subject<void>;
    constructor(cdr: ChangeDetectorRef);
    ngOnInit(): void;
    ngOnDestroy(): void;
    /**
     * After the view initializes, publish the initial agent context and register
     * the client tools the AI agent can invoke against this surface. The ongoing
     * context re-emit happens in {@link applyFilter} and {@link SelectEntity}.
     */
    ngAfterViewInit(): void;
    /**
     * Publish the current Dependency-Graph state to the AI agent via
     * NavigationService. Shaping lives in the pure
     * {@link buildVersionHistoryGraphAgentContext} helper so it stays
     * unit-testable. Called on load, on filter changes, and on entity selection.
     */
    private publishAgentContext;
    /**
     * Build the selected entity's dependency summary for the agent context, or
     * null when no entity is selected. Reads the already-derived ReferencedBy /
     * DependsOn relationship lists so the co-agent can describe the entity's place
     * in the graph and suggest neighbours as next selections.
     */
    private buildSelectedEntitySummary;
    /**
     * Register the read-only client tools the AI agent can invoke against the
     * Dependency Graph. Each handler is tolerant — it never throws and returns a
     * typed `{ Success, Data?, ErrorMessage? }` result.
     *
     * Tools:
     * - SelectEntityForDependencyView: select an entity by name to inspect its
     *   dependencies (delegates to {@link NavigateToEntity}, which clears any
     *   schema filter so the entity is reachable).
     * - FilterEntitiesBySchema: filter the entity list to a single schema.
     * - SearchEntities: filter the entity list by an entity-name substring.
     */
    private registerAgentClientTools;
    /**
     * Resolve an entity by ID or name (exact ID → exact name → name-contains) and
     * select it for the dependency view. View-only.
     */
    private toolSelectEntity;
    /** Apply a schema filter deterministically (no toggle), validating it exists. */
    private toolFilterBySchema;
    /** Apply an entity-name search filter. */
    private toolSearchEntities;
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    GetResourceIconClass(data: ResourceData): Promise<string>;
    LoadData(): void;
    /** Count entities that reference this entity (have FKs pointing to it), excluding self-references */
    private countReferencedBy;
    /** Count entities this entity depends on (has FKs pointing to), excluding self-references */
    private countDependsOn;
    OnSearchChange(text: string): void;
    OnSchemaFilterChange(schema: string): void;
    private loadUserPreferences;
    private persistPreferences;
    private applyFilter;
    SelectEntity(entityNode: EntityNode): void;
    /** Entities that have FKs pointing TO the selected entity (it is the "one" side) */
    private buildReferencedByList;
    /** Entities the selected entity has FKs pointing to (it is the "many" side) */
    private buildDependsOnList;
    NavigateToEntity(entityName: string): void;
    GetDependencyLevel(count: number): string;
    GetSchemaEntityCount(schema: string): number;
    Refresh(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<VersionHistoryGraphResourceComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<VersionHistoryGraphResourceComponent, "mj-version-history-graph-resource", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=graph-resource.component.d.ts.map