export type KbxCommandGroup = 'query' | 'edit' | 'workflow' | 'output' | 'more'
export type KbxCommandVariant = 'primary' | 'secondary' | 'danger' | 'ghost'
export interface KbxCommandConfirmDefinition { title:string; detail:string; level?:'low'|'medium'|'high'; confirmLabel?:string }

export interface KbxCommandDefinition {
  id: string
  label: string
  group: KbxCommandGroup
  variant?: KbxCommandVariant
  shortcut?: string
  permission?: string
  /** Optional state-specific authorization for one visual command (e.g. create vs update save). */
  permissionByStatus?: Record<string, string>
  icon?: string
  /** Optional standard output menu. Keeps Excel actions consistent across screens. */
  menu?: 'excel'
  requiresSelection?: boolean
  minSelection?: number
  maxSelection?: number
  /** Keep the command visible but disabled outside these business states. */
  allowedStatuses?: string[]
  /** Save-like commands can be disabled until the page is dirty. */
  requiresDirty?: boolean
  /** Workflow commits can require the current record to be saved first. */
  requiresClean?: boolean
  disabledReason?: string
  confirm?: KbxCommandConfirmDefinition
}
