summaryrefslogtreecommitdiff
path: root/Omni/Agent/Core.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-11 19:50:20 -0500
committerBen Sima <ben@bensima.com>2025-12-11 19:50:20 -0500
commit276a27f27aeff7781a25e13fad0d568f5455ce05 (patch)
tree6a7957986d14a9424f9e7f438dbd47a402b414fe /Omni/Agent/Core.hs
parent225e5b7a24f0b30f6de1bd7418bf834ad345b0f3 (diff)
t-247: Add Provider abstraction for multi-backend LLM support
- Create Omni/Agent/Provider.hs with unified Provider interface - Support OpenRouter (cloud), Ollama (local), Amp (subprocess stub) - Add runAgentWithProvider to Engine.hs for Provider-based execution - Add EngineType to Core.hs (EngineOpenRouter, EngineOllama, EngineAmp) - Add --engine flag to 'jr work' command - Worker.hs dispatches to appropriate provider based on engine type Usage: jr work <task-id> # OpenRouter (default) jr work <task-id> --engine=ollama # Local Ollama jr work <task-id> --engine=amp # Amp CLI (stub)
Diffstat (limited to 'Omni/Agent/Core.hs')
-rw-r--r--Omni/Agent/Core.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Omni/Agent/Core.hs b/Omni/Agent/Core.hs
index 88f7237..fb4a4b3 100644
--- a/Omni/Agent/Core.hs
+++ b/Omni/Agent/Core.hs
@@ -6,6 +6,17 @@ module Omni.Agent.Core where
import Alpha
import Data.Aeson (FromJSON, ToJSON)
+-- | Engine/provider selection for agent
+data EngineType
+ = EngineOpenRouter
+ | EngineOllama
+ | EngineAmp
+ deriving (Show, Eq, Generic)
+
+instance ToJSON EngineType
+
+instance FromJSON EngineType
+
-- | Status of a worker agent
data WorkerStatus
= Idle
@@ -28,7 +39,8 @@ data Worker = Worker
workerPid :: Maybe Int,
workerStatus :: WorkerStatus,
workerPath :: FilePath,
- workerQuiet :: Bool -- Disable ANSI status bar (for loop mode)
+ workerQuiet :: Bool, -- Disable ANSI status bar (for loop mode)
+ workerEngine :: EngineType -- Which LLM backend to use
}
deriving (Show, Eq, Generic)