/**
 * Global Functions for Individual Task Actions
 * Extends the tasks manager with global action functions for individual tasks
 */

// Task global functions initialization is now handled by SystemLoader
// Global task functions will be set up centrally when TasksManager is available

function setupTaskGlobalFunctions() {
  if (window.TasksManager || window.tasksManager) {
    // Use whichever instance is available
    const tasksManager = window.tasksManager || window.TasksManager;
    
    // Add modular action functions to global scope
    window.installApp = (appName, config = '') => tasksManager.router.routeAction('install', { appName, config });
    window.uninstallApp = (appName) => tasksManager.router.routeAction('uninstall', { appName });
    window.restartApp = (appName) => tasksManager.router.routeAction('restart', { appName });
    window.startApp = (appName) => tasksManager.router.routeAction('start', { appName });
    window.stopApp = (appName) => tasksManager.router.routeAction('stop', { appName });
    window.backupApp = (appName) => tasksManager.router.routeAction('backup', { appName });
    window.updateConfig = (appName) => tasksManager.router.routeAction('update_config', { appName });
    window.systemUpdate = () => tasksManager.router.routeAction('system_update');
    
    //console.log('✅ Task action functions registered globally');
  } else {
    console.warn('⚠️ TasksManager not found, action functions not registered');
  }
}
