import type { NormalizedScanQuery } from './scan-query'; export type ScanPredicateClauseSet = 'anyOf' | 'exclude'; export type ScanPredicateField = 'peers' | 'addresses' | 'services' | 'names' | 'manufacturerData' | 'serviceData' | 'rssi' | 'connectable'; export type ScanPredicateOperator = 'any' | 'all' | 'exact' | 'prefixes' | 'minimum' | 'maximum' | 'equals'; /** A bounded, payload-free description of one normalized query predicate. */ export interface ScanPredicateDescription { readonly clauseSet: ScanPredicateClauseSet; readonly clauseIndex: number; readonly field: ScanPredicateField; readonly operator: ScanPredicateOperator; } /** The predicates assigned to a native or residual projection. */ export interface ScanPlanProjection { readonly predicates: readonly ScanPredicateDescription[]; /** True only when this projection exactly represents its assigned semantics. */ readonly complete: boolean; } /** The canonical PR4 query retained for the one and only residual matcher. */ export type ScanPlanningNormalizedQuery = NormalizedScanQuery; export interface ScanPlanResidualProjection extends ScanPlanProjection { readonly query: NormalizedScanQuery; } export type ScanPlanLimitationCode = 'native-filter-incomplete' | 'native-predicate-unavailable' | 'observation-field-unavailable' | 'host-predicate-restricted'; export type ScanPlanLimitationExplanation = 'predicate remains in the canonical residual matcher' | 'required observation field is unavailable on this host' | 'host restriction prevents native evaluation' | 'native filter is a safe superset'; export interface ScanPlanLimitation { readonly code: ScanPlanLimitationCode; readonly predicate: ScanPredicateDescription; readonly explanation: ScanPlanLimitationExplanation; readonly effect: 'performance-only' | 'field-unavailable' | 'host-restriction'; } export interface ScanPlan { readonly sourceQuery: NormalizedScanQuery; readonly queryDigest: string; readonly residualQueryDigest: string; readonly nativeGuarantee: 'exact' | 'safe-superset'; readonly native: ScanPlanProjection; readonly residual: ScanPlanResidualProjection; readonly unavailable: readonly ScanPredicateDescription[]; readonly limitations: readonly ScanPlanLimitation[]; readonly estimatedCost: 'native-only' | 'low' | 'moderate' | 'high'; } export type ScanObservationField = 'peerReference' | 'address' | 'localName' | 'rssi' | 'connectable' | 'serviceUuids' | 'manufacturerData' | 'serviceData'; /** Context is intentionally host-neutral; platform-specific fields belong to later planner slices. */ export interface ScanPlanningContext { readonly backendId: string; readonly platformId: string; readonly availableObservationFields: readonly ScanObservationField[]; } export interface BackendScanExecutionPlan extends ScanPlan { readonly nativeFilter: NativeFilter; } export interface BackendScanPlanner { plan(query: NormalizedScanQuery, context: Context): BackendScanExecutionPlan; } /** Describes every normalized predicate without evaluating it. */ export declare function describeScanPredicates(query: NormalizedScanQuery): readonly ScanPredicateDescription[]; /** * Snapshots plan diagnostics without changing the canonical residual query. The native * projection is descriptive only; this helper does not evaluate any predicate. */ export declare function snapshotScanPlan(plan: ScanPlan): ScanPlan; export declare function snapshotScanExecutionPlan(plan: BackendScanExecutionPlan, snapshotNativeFilter: (nativeFilter: NativeFilter) => NativeFilter): BackendScanExecutionPlan; //# sourceMappingURL=scan-planning.d.ts.map