import * as react_jsx_runtime from 'react/jsx-runtime';
import { ReactNode } from 'react';
import { z } from 'zod';

declare const ResourceGovernanceStatusSchema: z.ZodEnum<{
    active: "active";
    deprecated: "deprecated";
    archived: "archived";
}>;
type ResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>;

declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
    objectTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        storage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    linkTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        from: z.ZodString;
        to: z.ZodString;
        cardinality: z.ZodOptional<z.ZodString>;
        via: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
    actionTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
        input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, z.core.$loose>>>>;
    catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        kind: z.ZodOptional<z.ZodString>;
        appliesTo: z.ZodOptional<z.ZodString>;
        entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    eventTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    interfaceTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.core.$loose>>>>;
    valueTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        primitive: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
    sharedProperties: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        valueType: z.ZodOptional<z.ZodString>;
        searchable: z.ZodOptional<z.ZodBoolean>;
        pii: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$loose>>>>;
    groups: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        members: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
    }, z.core.$loose>>>>;
    endpoints: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
        id: z.ZodString;
        label: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        ownerSystemId: z.ZodOptional<z.ZodString>;
        aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
        route: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>>>>;
}, z.core.$strip>>;
type OntologyScope = z.infer<typeof OntologyScopeSchema>;

declare const SystemApiInterfaceSchema: z.ZodObject<{
    lifecycle: z.ZodDefault<z.ZodEnum<{
        active: "active";
        deprecated: "deprecated";
        draft: "draft";
        archived: "archived";
        disabled: "disabled";
    }>>;
    readinessProfile: z.ZodOptional<z.ZodEnum<{
        "sales.lead-gen.api": "sales.lead-gen.api";
        "sales.crm.api": "sales.crm.api";
        "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
    }>>;
    resourceIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
}, z.core.$strict>;
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonValue[] | {
    [key: string]: JsonValue;
};
/** Explicit interface needed to annotate the recursive SystemEntrySchema. */
interface SystemEntry {
    id: string;
    label?: string;
    title?: string;
    description?: string;
    kind?: 'product' | 'operational' | 'platform' | 'diagnostic';
    parentSystemId?: string;
    ui?: {
        path: string;
        surfaces: string[];
        icon?: string;
        order?: number;
    };
    lifecycle?: 'draft' | 'beta' | 'active' | 'deprecated' | 'archived';
    responsibleRoleId?: string;
    governedByKnowledge?: string[];
    actions?: {
        actionId: string;
        intent: 'exposes' | 'consumes';
        invocation?: unknown;
    }[];
    policies?: string[];
    drivesGoals?: string[];
    apiInterface?: z.infer<typeof SystemApiInterfaceSchema>;
    /** @deprecated Use lifecycle. Accepted for one publish cycle. */
    status?: 'active' | 'deprecated' | 'archived';
    path?: string;
    icon?: string;
    uiPosition?: 'sidebar-primary' | 'sidebar-bottom';
    enabled?: boolean;
    devOnly?: boolean;
    requiresAdmin?: boolean;
    order: number;
    config?: Record<string, JsonValue>;
    ontology?: OntologyScope;
    systems?: Record<string, SystemEntry>;
    subsystems?: Record<string, SystemEntry>;
}

declare const LinkSchema: z.ZodObject<{
    nodeId: z.ZodString;
    kind: z.ZodEnum<{
        affects: "affects";
        actions: "actions";
        effects: "effects";
        links: "links";
        reads: "reads";
        writes: "writes";
        emits: "emits";
        triggers: "triggers";
        uses: "uses";
        approval: "approval";
        contains: "contains";
        references: "references";
        maps_to: "maps_to";
        governs: "governs";
        originates_from: "originates_from";
        applies_to: "applies_to";
        uses_catalog: "uses_catalog";
    }>;
}, z.core.$strip>;
type Link = z.infer<typeof LinkSchema>;

/**
 * Time range selector for dashboard metrics
 */
type TimeRange = '1h' | '24h' | '7d' | '30d';
/**
 * Execution health metrics response
 * Success rate, P95 duration, execution counts, and trend data
 * trendData includes executionCount for throughput visualization (eliminates separate API call)
 */
interface ExecutionHealthMetrics {
    successRate: number;
    p95Duration: number;
    totalExecutions: number;
    trendData: Array<{
        time: string;
        rate: number;
        successCount: number;
        errorCount: number;
        warningCount: number;
        executionCount: number;
    }>;
    statusCounts: {
        success: number;
        failed: number;
        pending: number;
        warning: number;
    };
    peakPeriod: string;
    granularity: 'hour' | 'day';
}
/**
 * Business impact metrics response
 * ROI, labor savings, and cost analysis
 */
interface BusinessImpactMetrics {
    totalSavingsUsd: number;
    totalCostUsd: number;
    netSavingsUsd: number;
    roi: number;
}
/**
 * Cost breakdown metrics response
 * Per-resource cost analysis
 */
interface CostBreakdownMetrics {
    resources: Array<{
        resourceId: string;
        totalCostUsd: number;
        executionCount: number;
        avgCostUsd: number;
    }>;
}
/**
 * Dashboard metrics response
 * Aggregates core observability metrics in a single response
 * Note: Throughput data is now included in executionHealth.trendData.executionCount
 */
interface DashboardMetrics {
    executionHealth: ExecutionHealthMetrics;
    costBreakdown: CostBreakdownMetrics;
    businessImpact: BusinessImpactMetrics;
    /** ISO timestamp of the currently active deployment, or null if none */
    activeDeploymentDate: string | null;
    /** Deployment version of the active deployment, or null if none */
    activeDeploymentVersion: string | null;
}
/**
 * Summary of executions for a single resource
 * Used by RecentExecutionsByResource dashboard component
 */
interface ResourceExecutionSummary {
    resourceId: string;
    resourceType: string;
    resourceName: string | null;
    lastExecution: string;
    totalExecutions: number;
    successCount: number;
    failureCount: number;
    warningCount: number;
    successRate: number;
}

/**
 * Resource Registry type definitions
 */

/**
 * Environment/deployment status for resources
 */
type ResourceStatus = 'dev' | 'prod';
/**
 * All resource types in the platform
 * Used as the discriminator field in ResourceDefinition
 */
type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'description' | 'kind' | 'lifecycle'>;
/**
 * Base interface for ALL platform resources
 * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
 */
interface ResourceDefinition {
    /** Unique resource identifier */
    resourceId: string;
    /** Display name */
    name: string;
    /** Purpose and functionality description */
    description: string;
    /** Version for change tracking and evolution */
    version: string;
    /** Resource type discriminator */
    type: ResourceType;
    /** Environment/deployment status */
    status: ResourceStatus;
    /** Graph links to Organization Model nodes */
    links?: ResourceLink[];
    /** Infrastructure category for filtering */
    category?: ResourceCategory;
    /** Whether the agent supports multi-turn sessions (agents only) */
    sessionCapable?: boolean;
    /** Whether the resource is local (monorepo) or remote (externally deployed) */
    origin?: 'local' | 'remote';
    /** OM System membership — dot-separated system path (e.g. "sys.lead-gen"), when backed by a Resource descriptor */
    systemPath?: string;
    /** Display metadata for the owning OM System */
    system?: ResourceSystemSummary;
    /** Governance lifecycle status from the OM Resource descriptor */
    governanceStatus?: ResourceGovernanceStatus;
    /** Whether this resource is archived and should be excluded from registration and deployment */
    archived?: boolean;
}

declare const ResourceCategorySchema: z.ZodEnum<{
    diagnostic: "diagnostic";
    production: "production";
    internal: "internal";
    testing: "testing";
}>;
type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
type ResourceLink = Link;

interface OperationsOverviewProps {
    /**
     * Active time range for all metrics queries.
     */
    timeRange: TimeRange;
    /**
     * Business-impact metrics computed by the CC wrapper.
     * Stays CC-local per decision lock #4.
     * TODO(Wave 2): thread to HeroStatsRow once the CC wrapper wires it through.
     */
    businessImpact?: ReturnType<() => {
        data: BusinessImpactMetrics | undefined;
        isLoading: boolean;
    }>;
    /**
     * Cost breakdown metrics computed by the CC wrapper.
     * Stays CC-local per decision lock #4.
     * TODO(Wave 2): thread to HeroStatsRow once the CC wrapper wires it through.
     */
    costBreakdown?: ReturnType<() => {
        data: CostBreakdownMetrics | undefined;
        isLoading: boolean;
    }>;
    /**
     * Called when the user clicks a resource card.
     */
    onResourceClick?: (params: {
        resourceId: string;
        resourceType?: string;
    }) => void;
    /**
     * Called when the user wants to drill into the unresolved errors view.
     */
    onErrorsNavigate?: () => void;
    /**
     * Called when the user wants to navigate to the command queue.
     * Minor refinement over locked props shape — OperationalOverview has this link target.
     */
    onCommandQueueNavigate?: () => void;
    /**
     * Called when the user wants to navigate to the task scheduler.
     * Minor refinement over locked props shape — OperationalOverview has this link target.
     */
    onScheduledTasksNavigate?: () => void;
    /**
     * Custom render function for the execution trend chart.
     * The wrapper owns the chart implementation (CC uses its monitoring-local CombinedTrendChart).
     * Receives executionHealth data, loading state, and error from useDashboardMetrics.
     * If omitted, the trend chart section is not rendered.
     */
    renderTrendChart?: (data: DashboardMetrics['executionHealth'] | undefined, isLoading: boolean, error?: Error) => ReactNode;
    /**
     * Optional override for the lower operational summary panel.
     * Command Center uses this to place the operational tabs beside app-local
     * widgets while keeping the same data-fetching and navigation contract.
     */
    renderOperationalOverview?: (props: OperationalOverviewPanelProps) => ReactNode;
}
declare function OperationsOverview({ timeRange, onResourceClick, onErrorsNavigate, onCommandQueueNavigate, onScheduledTasksNavigate, renderTrendChart, renderOperationalOverview }: OperationsOverviewProps): react_jsx_runtime.JSX.Element;
type DashboardProps = OperationsOverviewProps;
/**
 * @deprecated Use `OperationsOverview` instead. `Dashboard` remains as a
 * compatibility export while consumer apps migrate route ownership.
 */
declare const Dashboard: typeof OperationsOverview;
interface OperationalOverviewPanelProps {
    timeRange: TimeRange;
    onErrorsNavigate?: () => void;
    onCommandQueueNavigate?: () => void;
    onScheduledTasksNavigate?: () => void;
}
declare function DashboardOperationsOverview({ timeRange, onErrorsNavigate, onCommandQueueNavigate, onScheduledTasksNavigate }: OperationalOverviewPanelProps): react_jsx_runtime.JSX.Element;

interface DisplayResource {
    resourceId: string;
    name: string;
    type: string;
    status: string;
    active: boolean;
    execution?: ResourceExecutionSummary;
}
interface ResourceOverviewProps {
    recentExecutions?: ResourceExecutionSummary[];
    allResources?: {
        workflows: ResourceDefinition[];
        agents: ResourceDefinition[];
    };
    isLoading: boolean;
    limit?: number;
    onResourceClick?: (resource: DisplayResource) => void;
}
declare function ResourceOverview({ recentExecutions, allResources, isLoading, limit, onResourceClick }: ResourceOverviewProps): react_jsx_runtime.JSX.Element;

interface RecentExecutionsByResourceProps {
    timeRange: TimeRange;
    limit?: number;
    onResourceClick?: (params: {
        resourceType: string;
        resourceId: string;
    }) => void;
}
declare function RecentExecutionsByResource({ timeRange, limit, onResourceClick }: RecentExecutionsByResourceProps): react_jsx_runtime.JSX.Element;

interface UnresolvedErrorsTeaserProps {
    timeRange: TimeRange;
    onNavigateToAllErrors?: () => void;
}
declare function UnresolvedErrorsTeaser({ timeRange, onNavigateToAllErrors }: UnresolvedErrorsTeaserProps): react_jsx_runtime.JSX.Element;

export { Dashboard, DashboardOperationsOverview, OperationsOverview, RecentExecutionsByResource, ResourceOverview, UnresolvedErrorsTeaser };
export type { DashboardProps, DisplayResource, OperationalOverviewPanelProps, OperationsOverviewProps, RecentExecutionsByResourceProps, ResourceOverviewProps, UnresolvedErrorsTeaserProps };
