import { contextBridge, ipcRenderer } from 'electron';

contextBridge.exposeInMainWorld('aetherNative', {
  get_seed_config: () => ipcRenderer.invoke('get-seed-config'),
  get_device_config: () => ipcRenderer.invoke('get-device-config'),
  get_jwt: () => ipcRenderer.invoke('get-jwt'),
  get_device_info: () => ipcRenderer.invoke('get-device-info'),
  
  open_folder: (path: string) => ipcRenderer.invoke('native:open-folder', path),
  run_cmd: (args: any) => ipcRenderer.invoke('native:run-cmd', args),
  run_cmd_sync: (args: any) => ipcRenderer.invoke('native:run-cmd-sync', args),
  run_osascript: (script: string) => ipcRenderer.invoke('native:run-osascript', script),
  kill_processes: (args: any) => ipcRenderer.invoke('native:kill-processes', args),
  open_local_file_v2: (path: string) => ipcRenderer.invoke('native:open-local-file-v2', path),

  check_cache: (args: any) => ipcRenderer.invoke('native:check-cache', args),
  download_to_cache: (args: any) => ipcRenderer.invoke('native:download-to-cache', args),
  copy_from_cache_to_temp: (args: any) => ipcRenderer.invoke('native:copy-from-cache-to-temp', args),
  launch_from_cache: (args: any) => ipcRenderer.invoke('native:launch-from-cache', args),
  launch_presentation: (args: any) => ipcRenderer.invoke('native:launch-presentation', args),
  control_presentation: (args: any) => ipcRenderer.invoke('native:control-presentation', args),
  list_tools: () => ipcRenderer.invoke('native:list-tools'),

  // System Handlers (V5)
  set_wallpaper: (args: any) => ipcRenderer.invoke('native:set-wallpaper', args),
  update_app: (args: any) => ipcRenderer.invoke('native:update-app', args),
  window_control: (args: any) => ipcRenderer.invoke('native:window-control', args),
  manage_recording: (args: any) => ipcRenderer.invoke('native:manage-recording', args),
  set_display_layout: (args: any) => ipcRenderer.invoke('native:set-display-layout', args),
  power_control: (args: any) => ipcRenderer.invoke('native:power-control', args),
  open_external: (args: any) => ipcRenderer.invoke('native:open-external', args),
});
