{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} -- : out omni-agent-core 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 } deriving (Show, Eq, Generic) instance ToJSON Worker instance FromJSON Worker