import type { ReactNode } from 'react'

/** Known categories: 'application' | 'exchange' | 'attribute' | 'route' | 'agent'. Custom categories are rendered with title-cased labels and a default icon. */
export type SearchCategory = string

export interface SearchResult {
  id: string
  category: SearchCategory
  title: string
  badges?: { label: string; color?: string }[]
  meta: string
  timestamp?: string
  icon?: ReactNode
  path?: string
  expandedContent?: string
  matchRanges?: [number, number][]
  /** Skip client-side query filtering (result already matched server-side) */
  serverFiltered?: boolean
  /** Server-side match snippet with <em> tags around matched text */
  matchContext?: string
}

export interface ScopeFilter {
  field: string
  value: string
}
