import { createPiece } from '@activepieces/pieces-framework';
import { crowdstrikeAuth } from './auth';

// Import incident actions
import { searchIncidents } from './actions/incidents/search-incidents';
import { getIncidentDetails } from './actions/incidents/get-incident-details';
import { updateIncidents } from './actions/incidents/update-incidents';

// Import host isolation actions
import { isolateHost } from './actions/hosts/isolate-host';
import { liftHostIsolation } from './actions/hosts/lift-host-isolation';
import { checkHostIsolationStatus } from './actions/hosts/check-isolation-status';

// Import real-time response actions
import { initializeRtrSession } from './actions/rtr/initialize-session';
import { executeRtrCommand } from './actions/rtr/execute-command';
import { checkRtrCommandStatus } from './actions/rtr/check-command-status';
import { getRtrFileContents } from './actions/rtr/get-file-contents';

/**
 * CrowdStrike Falcon integration for Active Pieces
 * Provides capabilities for incident management, host isolation, and real-time response
 * Designed for MSSP environments with custom authentication per environment
 */
export const crowdstrikeFalcon = createPiece({
  name: 'crowdstrike-falcon',
  displayName: 'CrowdStrike Falcon',
  logoUrl: 'https://cdn.activepieces.com/pieces/crowdstrike.png',
  authors: ['activepieces'],
  version: '0.1.0',
  minimumSupportedRelease: '0.5.0',
  auth: crowdstrikeAuth,
  actions: [
    // Incident actions
    searchIncidents,
    getIncidentDetails,
    updateIncidents,
    
    // Host isolation actions
    isolateHost,
    liftHostIsolation,
    checkHostIsolationStatus,
    
    // Real-time response actions
    initializeRtrSession,
    executeRtrCommand,
    checkRtrCommandStatus,
    getRtrFileContents,
  ],
  triggers: [],
});
