/**
 * @fileoverview Pure helpers for the Entity Admin dashboard's AI-agent integration.
 *
 * These functions are intentionally free of Angular / component dependencies so they
 * can be unit-tested in isolation. The component ({@link EntityAdminDashboardComponent})
 * supplies a plain snapshot of its current ERD-browser state and these helpers shape it
 * into the key-value `AgentContext` object that flows to the async chat agent and the
 * realtime co-agent via `NavigationService.SetAgentContext`.
 *
 * The deep ("hardcore", Data-Explorer depth) enrichment here mirrors the Data Explorer
 * pattern: bounded name lists (cap {@link ENTITY_ADMIN_NAME_LIST_CAP} with a companion
 * `*Count` flag when truncated), a relationship summary for the selected entity, the
 * schema-grouping landscape, the active filter state, and a tolerant id→display-name
 * resolver so the agent can refer to entities the way the user sees them (the on-screen
 * DISPLAY name — e.g. "AI Models", not the registered "MJ: AI Models").
 *
 * 🔒 SAFETY BOUNDARY: The Entity Admin surface is a metadata BROWSER (the ERD entity
 * explorer). Both the context shaped here and the tools wired in the component are
 * strictly read-only / navigational. No helper in this file describes — and no tool may
 * perform — entity-metadata create/edit/delete, schema changes, or any other mutation.
 */
/**
 * The "MJ: " schema prefix carried by newer core entities (e.g. "MJ: AI Models",
 * "MJ: ML Models"). The ERD strips it when an entity has no explicit DisplayName, and
 * users almost always say the stripped form ("AI Models") rather than the full
 * registered Name. See {@link entityDisplayName} / {@link stripMJPrefix}.
 */
export declare const MJ_ENTITY_NAME_PREFIX = "MJ: ";
/**
 * Upper bound on how many names we publish in a name-list context field
 * (AvailableEntities, RelatedEntities, SchemaGroups). Keeping the streamed note
 * bounded avoids flooding the co-agent with hundreds of names; when the underlying
 * list is larger we surface a companion total-count field instead.
 */
export declare const ENTITY_ADMIN_NAME_LIST_CAP = 25;
/**
 * Strip the leading "MJ: " schema prefix from an entity Name, if present.
 * Pure + deterministic. Returns the input unchanged when the prefix is absent.
 */
export declare function stripMJPrefix(name: string): string;
/**
 * The display label the ERD shows for an entity — the entity's DisplayName when set,
 * else the registered Name with the "MJ: " schema prefix stripped. This is what the
 * user reads on screen and therefore what they say ("AI Models", not "MJ: AI Models").
 */
export declare function entityDisplayName(name: string, displayName?: string | null): string;
/**
 * A minimal name-bearing entity descriptor, supplied by the component so the pure
 * resolver can match agent input against what the user sees. Mirrors the salient
 * slice of `EntityInfo`.
 */
export interface EntityNameCandidate {
    ID: string;
    Name: string;
    DisplayName?: string | null;
}
/**
 * Resolve an agent-supplied entity reference to one of the available entities. The
 * agent may pass either an entity ID (GUID) or a name the way the user sees it. We try,
 * in order:
 *   1. exact ID (case-insensitive — UUIDs may differ in case across SQL Server / PG)
 *   2. exact registered Name (case-insensitive)
 *   3. display name (case-insensitive) — DisplayName, else the prefix-stripped Name
 *   4. display name ignoring the "MJ: " prefix (covers an input carrying the prefix)
 *   5. partial (contains) match on the display name
 *
 * Pure + deterministic over the supplied candidate list, so it's unit-testable in
 * isolation; the component passes its `EntityInfo[]` (structurally `EntityNameCandidate[]`).
 *
 * @param input - whatever the agent passed (an entity ID or the on-screen display name)
 * @param candidates - the entities available in the ERD
 * @returns the matched candidate, or null on a miss
 */
export declare function resolveEntityByIdOrName<T extends EntityNameCandidate>(input: string, candidates: readonly T[]): T | null;
/**
 * Build a tolerant "not found" error for an ID-or-name lookup miss, listing a bounded
 * sample of available entity DISPLAY names so the agent can correct itself.
 */
export declare function buildEntityNotFoundError(input: string, candidates: readonly EntityNameCandidate[]): string;
/**
 * A summary of one related entity for the selected entity — the related entity's
 * display name and the relationship type (e.g. "One To Many"). The component derives
 * these from `EntityInfo.RelatedEntities`.
 */
export interface RelatedEntitySummary {
    Name: string;
    RelationshipType: string;
}
/**
 * A summary of one schema grouping in the ERD — the schema name and how many entities
 * fall under it (after the active filter). Lets the co-agent see the schema landscape.
 */
export interface SchemaGroupSummary {
    SchemaName: string;
    EntityCount: number;
}
/**
 * The plain, component-supplied snapshot used to build the agent context.
 * Mirrors the salient slice of the Entity Admin dashboard's ERD-browser state.
 */
export interface EntityAdminAgentContextInput {
    /** Total unfiltered entity count available in the ERD. */
    TotalEntityCount: number;
    /** Entity count after the current ERD filter is applied. */
    FilteredEntityCount: number;
    /** ID of the currently selected entity in the ERD, or null. */
    SelectedEntityId: string | null;
    /**
     * Registered Name of the currently selected entity, or null. We also publish the
     * display name separately so the agent can read it the way the user sees it.
     */
    SelectedEntityName: string | null;
    /** Display name of the currently selected entity (DisplayName, else prefix-stripped Name), or null. */
    SelectedEntityDisplayName: string | null;
    /** Schema of the currently selected entity, or null. */
    SelectedEntitySchema: string | null;
    /** Description of the currently selected entity, or null. */
    SelectedEntityDescription: string | null;
    /** Field count of the currently selected entity, or null. */
    SelectedEntityFieldCount: number | null;
    /**
     * Related-entity summaries for the selected entity (from EntityInfo.RelatedEntities).
     * Empty when nothing is selected. The component supplies the full list; this helper
     * bounds it — see {@link ENTITY_ADMIN_NAME_LIST_CAP}.
     */
    RelatedEntities: RelatedEntitySummary[];
    /** Whether the ERD filter panel is currently visible. */
    FilterPanelVisible: boolean;
    /** Active schema filter (null when no schema filter is applied). */
    SchemaFilter: string | null;
    /** Active entity-name search text (empty when none). */
    SearchText: string;
    /** Active status filter (null when none). */
    StatusFilter: string | null;
    /**
     * DISPLAY names of the entities currently visible in the ERD (after the filter),
     * so the agent knows what's selectable via the SelectEntity / NavigateToEntityRecord
     * tools. The component supplies the full filtered list; this helper bounds it.
     */
    AvailableEntityNames: string[];
    /**
     * Schema-grouping summaries across the currently-visible entities. The component
     * supplies the full list; this helper bounds it — see {@link ENTITY_ADMIN_NAME_LIST_CAP}.
     */
    SchemaGroups: SchemaGroupSummary[];
}
/**
 * Build the agent-visible context object for the Entity Admin ERD browser.
 *
 * Reports how the ERD is currently scoped (total vs. filtered entity counts, whether a
 * filter is narrowing the set + the active filter values), what (if anything) is selected
 * (id + registered name + display name + schema + description + field count + a bounded
 * relationship summary), whether the filter panel is open, the bounded available-entity
 * DISPLAY-name list, and the schema-grouping landscape. `HasActiveFilters` is derived so
 * the agent can tell the user is looking at a subset without re-deriving it.
 *
 * Keeping this a pure function (no `this`) makes the context shape unit-testable and
 * decouples it from change-detection timing.
 *
 * @param input - the component's current ERD-browser state snapshot
 * @returns a flat key-value object suitable for `SetAgentContext`
 */
export declare function buildEntityAdminAgentContext(input: EntityAdminAgentContextInput): Record<string, unknown>;
//# sourceMappingURL=entity-admin-agent-context.d.ts.map