diff options
| author | Omni Worker <bot@omni.agent> | 2025-11-21 05:14:53 -0500 |
|---|---|---|
| committer | Omni Worker <bot@omni.agent> | 2025-11-21 05:21:19 -0500 |
| commit | c3ab8403df5e5ed99e6769dcdc152408d57026a7 (patch) | |
| tree | cbbb86ff96bea7b16e9cb458cede274e6dc0c38a /Omni/Agent/Core.hs | |
| parent | d0c03d25d5d81b83fc2a8e3928e85bdd4b5b1ee0 (diff) | |
feat: implement Omni.Agent.Worker loop logic
Amp-Thread-ID:
https://ampcode.com/threads/T-4f2905ef-a042-4880-b146-f6809ce83751
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Agent/Core.hs')
| -rw-r--r-- | Omni/Agent/Core.hs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Omni/Agent/Core.hs b/Omni/Agent/Core.hs new file mode 100644 index 0000000..7299d51 --- /dev/null +++ b/Omni/Agent/Core.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# 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 + | Working Text -- ^ Task ID + | Submitting Text -- ^ Task ID + | Error Text -- ^ Error message + 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 |
