{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} module Omni.Agent.Core where import Alpha import Data.Aeson (FromJSON, ToJSON) -- | Status of a worker agent data WorkerStatus = Idle | Syncing | -- | Task ID Working Text | -- | Task ID Submitting Text | -- | Error message Error Text deriving (Show, Eq, Generic) instance ToJSON WorkerStatus instance FromJSON WorkerStatus -- | Representation of a worker agent data Worker = Worker { workerName :: Text, workerPid :: Maybe Int, workerStatus :: WorkerStatus, workerPath :: FilePath, workerQuiet :: Bool -- Disable ANSI status bar (for loop mode) } deriving (Show, Eq, Generic) instance ToJSON Worker instance FromJSON Worker