import { AfterViewInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { BaseDashboard } from '@memberjunction/ng-shared';
import { Subject } from 'rxjs';
import { ResourceData } from '@memberjunction/core-entities';
import { TestingDialogService, TestingExecutionService, ActiveRun } from '@memberjunction/ng-testing';
import { TabConfig } from '@memberjunction/ng-ui-components';
import { TestingInstrumentationService } from './services/testing-instrumentation.service';
import * as i0 from "@angular/core";
interface TestingDashboardState {
    activeTab: string;
    dashboardState: Record<string, unknown>;
    runsState: Record<string, unknown>;
    analyticsState: Record<string, unknown>;
    reviewState: Record<string, unknown>;
}
export declare class TestingDashboardComponent extends BaseDashboard implements AfterViewInit, OnDestroy {
    private cdr;
    testingDialogService: TestingDialogService;
    private executionService;
    private instrumentationService;
    isLoading: boolean;
    activeTab: string;
    selectedIndex: number;
    ActiveRuns: ActiveRun[];
    private latestKPIs;
    private lastRegisteredToolMode;
    dashboardState: Record<string, unknown> | null;
    runsState: Record<string, unknown> | null;
    analyticsState: Record<string, unknown> | null;
    reviewState: Record<string, unknown> | null;
    private visitedTabs;
    navigationItems: string[];
    navigationConfig: {
        text: string;
        icon: string;
        selected: boolean;
    }[];
    get Tabs(): TabConfig[];
    private stateChangeSubject;
    protected destroy$: Subject<void>;
    constructor(cdr: ChangeDetectorRef, testingDialogService: TestingDialogService, executionService: TestingExecutionService, instrumentationService: TestingInstrumentationService);
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    ngAfterViewInit(): void;
    ngOnDestroy(): void;
    onTabChange(tabId: string): void;
    hasVisited(tabId: string): boolean;
    private setupStateManagement;
    private emitStateChange;
    onDashboardStateChange(state: Record<string, unknown>): void;
    onRunsStateChange(state: Record<string, unknown>): void;
    onAnalyticsStateChange(state: Record<string, unknown>): void;
    onReviewStateChange(state: Record<string, unknown>): void;
    loadUserState(state: Partial<TestingDashboardState>): void;
    initDashboard(): void;
    loadData(): void;
    getCurrentTabLabel(): string;
    OnPanelClosed(): void;
    OnViewActiveRun(run: ActiveRun): void;
    OnViewRunningTestFromTab(testId: string): void;
    private updateNavigationSelection;
    /**
     * Report the current Testing surface state to the AI agent (async chat agent
     * + realtime co-agent). Re-emitted on tab switch, active-run changes, child
     * state changes, and on every kpis$ refresh. Always publishes the KPI slice;
     * additionally publishes the detailed slice for the ACTIVE tab (selected run
     * id+NAME, visible run names, analytics breakdowns, review queue depth, etc.)
     * via the pure {@link buildTestingAgentContext} helper.
     */
    private emitAgentContext;
    /** Derive the passing-run count from the KPI snapshot (total − failed − skipped, floored at 0). */
    private computePassedCount;
    /** Active-test-catalog count: prefer the KPI value, fall back to the engine cache. */
    private computeActiveTestCount;
    /** Read the Runs-surface slice from the child component's reported state. */
    private buildRunsSurfaceState;
    /** Read the Analytics-surface slice from the child component's reported state. */
    private buildAnalyticsSurfaceState;
    /** Read the Review-surface slice from the child component's reported state. */
    private buildReviewSurfaceState;
    /** Coerce an unknown value into a string[] (tolerant of non-array / mixed input). */
    private toStringArray;
    /**
     * Register the agent tool-set appropriate for the active tab.
     *
     * MODE-SCOPING (mirrors the Data Explorer's `syncAgentToolsForMode`): the tool
     * surface differs per tab — at Analytics the agent gets the analytics window
     * tool but not run-selection; on Runs it gets run filter/search/select/open;
     * on Review it gets the queue view + feedback tools. `SetAgentClientTools`
     * replaces the registered set wholesale, so we only re-register on a tab
     * transition (guarded by {@link lastRegisteredToolMode}).
     *
     * 🔒 SAFETY BOUNDARY: every tab exposes ONLY navigation, filter, refresh,
     * read-only, run-SELECTION (open the detail panel / open the run's record —
     * both read-only navigation), and the bounded human-feedback write. Test-
     * EXECUTING operations (StartNewTest / RerunTest) are intentionally NEVER
     * exposed on ANY tab — running a test has real side effects (cost, execution,
     * state changes) and must remain a deliberate user action from the UI.
     * SelectTestRun and SubmitTestFeedback are safe: the former is read-only
     * navigation, the latter a bounded evaluation write on an existing run. Do not
     * add execute/run tools without an explicit user-confirmation design.
     */
    private syncAgentToolsForMode;
    /** Compose the tool list for a given tab: common tools + per-tab tools. */
    private buildToolsForMode;
    /** Tools available on EVERY tab: tab switch, refresh, time-range, read-only lookup. */
    private buildCommonTools;
    /** Runs-tab tools: status filter, search, select-run, open-run (all read-only nav). */
    private buildRunsTools;
    /** Analytics-tab tools: read-only window narrowing (delegates to the shared time-range). */
    private buildAnalyticsTools;
    /** Review-tab tools: the bounded human-feedback write + select-run for review. */
    private buildReviewTools;
    /**
     * Validate a run-selection request and publish it as a {@link RunSelectionIntent}
     * for the Runs surface to act on. Switches to the Runs tab so the detail panel
     * is visible. Read-only navigation — no test execution.
     */
    private selectTestRun;
    /** Read-only lookup of a single test run from the current run-instrumentation cache. */
    private getTestRunDetails;
    /** Validate and submit human feedback for an existing test run. */
    private submitTestFeedback;
    static ɵfac: i0.ɵɵFactoryDeclaration<TestingDashboardComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TestingDashboardComponent, "mj-testing-dashboard", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=testing-dashboard.component.d.ts.map