/**
 * @fileoverview Pure helpers for the Scheduling 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 ../Scheduling/scheduling-dashboard.component.ts SchedulingDashboardComponent})
 * supplies a plain snapshot of its current 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 shape follows the "hardcore" / Data-Explorer-depth pattern: the active tab
 * decides which deep slice is published (mode-scoped context), every list is
 * bounded (cap 25) with a companion total-count when truncated, and the selected
 * job is reported by id AND name so the co-agent can refer to it the way a user
 * does.
 *
 * 🔒 SAFETY: the Scheduling surface exposes ONLY navigational / filter / search /
 * read-only / select tools to the agent. Job state mutation (pause/resume via
 * updateJobStatus), job deletion, job creation, and lock release are intentionally
 * NOT exposed — see the SAFETY BOUNDARY comment in the component. These helpers
 * shape read-only context and validate/resolve input; they perform no mutation and
 * surface no secrets (no lock tokens, no raw configuration blobs).
 */
/** The three tabs the Scheduling dashboard supports. */
export declare const SCHEDULING_TABS: readonly ["dashboard", "jobs", "activity"];
/** A Scheduling tab id. */
export type SchedulingTab = (typeof SCHEDULING_TABS)[number];
/** Human-readable label for each tab, in {@link SCHEDULING_TABS} order. */
export declare const SCHEDULING_TAB_LABELS: Record<SchedulingTab, string>;
/**
 * The job status values the agent may filter by on the Jobs tab. `''` clears the
 * filter (all statuses). Mirrors the StatusOptions the jobs resource renders.
 */
export declare const SCHEDULING_JOB_STATUSES: readonly ["", "Active", "Paused", "Disabled", "Pending", "Expired"];
/** A Scheduling job-status filter value (empty string = no filter). */
export type SchedulingJobStatus = (typeof SCHEDULING_JOB_STATUSES)[number];
/**
 * The execution status values the agent may filter by on the Activity tab. `''`
 * clears the filter (all statuses). Mirrors the StatusOptions the activity
 * resource renders.
 */
export declare const SCHEDULING_ACTIVITY_STATUSES: readonly ["", "Running", "Completed", "Failed", "Cancelled", "Timeout"];
/** A Scheduling activity (execution) status filter value (empty string = no filter). */
export type SchedulingActivityStatus = (typeof SCHEDULING_ACTIVITY_STATUSES)[number];
/**
 * Upper bound on how many display names / row summaries we publish in any one
 * context list field (visible jobs, visible executions, unique job names). Bounded
 * so the streamed note stays small even when a surface holds hundreds of rows; a
 * companion total-count field reports the true number when the list is truncated.
 */
export declare const SCHEDULING_CONTEXT_LIST_CAP = 25;
/**
 * Cap an array of names/summaries to {@link SCHEDULING_CONTEXT_LIST_CAP} entries.
 * Pure + deterministic; returns a new array and never mutates the input.
 *
 * @param items - the full list (caller owns ordering / de-duplication)
 * @returns the first N entries, where N is the cap
 */
export declare function capSchedulingList<T>(items: readonly T[]): T[];
/**
 * Type-guard / validator for a Scheduling tab string. Keeps the
 * `SwitchSchedulingTab` client tool tolerant of arbitrary agent input — only the
 * three known tabs are accepted.
 *
 * @param tab - candidate tab string (may be anything the agent passes)
 * @returns true when `tab` is one of dashboard | jobs | activity
 */
export declare function isValidSchedulingTab(tab: unknown): tab is SchedulingTab;
/** Resolve a tab id to its human-readable label, falling back to a default. */
export declare function schedulingTabLabel(tab: string): string;
/** A minimal, component-supplied view of a single scheduled job (read-only, no secrets). */
export interface SchedulingJobSnapshot {
    JobId: string;
    JobName: string;
    JobType: string;
    Status: string;
    SuccessRate: number;
    TotalRuns: number;
    CronExpression: string;
    Timezone: string;
}
/** A minimal, component-supplied view of a single execution / activity row (read-only). */
export interface SchedulingExecutionSnapshot {
    ExecutionId: string;
    JobId: string;
    JobName: string;
    Status: string;
}
/** A minimal id+name descriptor for a selectable item (a job). */
export interface SchedulingItemCandidate {
    ID: string;
    Name: string;
}
/**
 * Resolve an agent-supplied job reference (by id or display name) to one of the
 * available jobs. Tries, in order:
 *   1. exact id (case-insensitive — handles SQL-Server-uppercase vs PG-lowercase UUIDs)
 *   2. exact display name (case-insensitive)
 *   3. first case-insensitive *contains* match on the display name
 *
 * Pure + deterministic over the supplied candidate list, so it's unit-testable in
 * isolation. Returns the matched candidate, or null on a miss.
 *
 * @param input - whatever the agent passed (an id or the on-screen name)
 * @param candidates - the items currently available on the surface
 */
export declare function resolveSchedulingItem<T extends SchedulingItemCandidate>(input: string, candidates: readonly T[]): T | null;
/**
 * Build a tolerant "not found" error message for a failed name/id resolution. Lists
 * the available names (bounded) so the co-agent can correct itself, with a companion
 * "(N total)" hint when the candidate list is truncated.
 *
 * @param input - the reference the agent passed
 * @param candidates - the candidates that were searched
 * @param noun - what the candidates are ("job"), for the message
 */
export declare function buildSchedulingNotFoundError(input: string, candidates: readonly SchedulingItemCandidate[], noun?: string): string;
/**
 * The plain, component-supplied snapshot used to build the agent context.
 * Mirrors the salient slice of the Scheduling dashboard state. The always-on KPI
 * slice (job counts by status, alerts, success rate) is published on every tab;
 * the ACTIVE tab additionally publishes its detailed surface slice.
 */
export interface SchedulingAgentContextInput {
    /** Active tab (dashboard / jobs / activity). */
    ActiveTab: string;
    /** Read-only snapshot of every scheduled job currently loaded. */
    Jobs: SchedulingJobSnapshot[];
    /** Count of active scheduling alerts (stale locks, high failure rate, etc.). */
    AlertCount: number;
    /** Count of jobs with a (stale or live) lock held. */
    LockedJobCount: number;
    /** Count of executions currently running (live). */
    RunningCount: number;
    /** Per-job-type breakdown (name + active count + total runs). */
    JobTypeBreakdown: {
        TypeName: string;
        ActiveJobsCount: number;
        TotalRuns: number;
    }[];
    /** The search term currently applied on the jobs tab. */
    JobsSearchTerm: string;
    /** The status filter currently applied on the jobs tab ('' = no filter). */
    StatusFilter: string;
    /** The job-type filter currently applied on the jobs tab ('' = no filter). */
    TypeFilter: string;
    /** The jobs visible after search + filters, in display order. */
    VisibleJobs: SchedulingJobSnapshot[];
    /** The selected job (open in the editor slideout), or null. */
    SelectedJob: SchedulingJobSnapshot | null;
    /** The search term currently applied on the activity tab. */
    ActivitySearchTerm: string;
    /** The execution status filter currently applied on the activity tab ('' = no filter). */
    ActivityStatusFilter: string;
    /** The job-name filter currently applied on the activity tab ('' = no filter). */
    ActivityJobNameFilter: string;
    /** The activity time range currently selected (24h / 7d / 30d / 90d). */
    ActivityTimeRange: string;
    /** The executions visible after search + filters, in display order. */
    VisibleExecutions: SchedulingExecutionSnapshot[];
    /** Distinct job names present in the loaded executions (unfiltered). */
    ActivityJobNames: string[];
}
/**
 * Build the agent-visible context object for the Scheduling dashboard.
 *
 * The always-on KPI slice (per-status job counts, alerts, locked/running counts,
 * overall success rate, job-type breakdown) is published on every tab. The ACTIVE
 * tab additionally publishes its detailed surface slice (Jobs: search/filters,
 * visible job names, selected job; Activity: search/filters, time range, visible
 * executions, distinct job names). All counts are derived purely from the supplied
 * snapshots so this stays unit-testable and decoupled from change-detection timing.
 *
 * @param input - the component's current state snapshot
 * @returns a flat key-value object suitable for `SetAgentContext`
 */
export declare function buildSchedulingAgentContext(input: SchedulingAgentContextInput): Record<string, unknown>;
//# sourceMappingURL=scheduling-agent-context.d.ts.map