never executed always true always false
    1 module PureClaw.Agent.Env
    2   ( -- * Agent environment
    3     AgentEnv (..)
    4   ) where
    5 
    6 import Data.IORef
    7 import Data.Text (Text)
    8 
    9 import PureClaw.Core.Types
   10 import PureClaw.Handles.Channel
   11 import PureClaw.Handles.Log
   12 import PureClaw.Providers.Class
   13 import PureClaw.Security.Vault
   14 import PureClaw.Security.Vault.Plugin
   15 import PureClaw.Tools.Registry
   16 
   17 -- | All runtime dependencies for the agent loop, gathered into a single record.
   18 -- This replaces the multi-parameter signature of 'runAgentLoop' and
   19 -- 'executeSlashCommand', making it easy to add new capabilities (e.g.
   20 -- 'VaultHandle') in later work units without touching call sites.
   21 data AgentEnv = AgentEnv
   22   { _env_provider     :: IORef (Maybe SomeProvider)
   23     -- ^ The LLM provider. 'Nothing' when no credentials are configured yet.
   24   , _env_model        :: ModelId
   25     -- ^ The model to use for completions.
   26   , _env_channel      :: ChannelHandle
   27     -- ^ The channel to read messages from and write responses to.
   28   , _env_logger       :: LogHandle
   29     -- ^ Structured logger for diagnostic output.
   30   , _env_systemPrompt :: Maybe Text
   31     -- ^ Optional system prompt prepended to every conversation.
   32   , _env_registry     :: ToolRegistry
   33     -- ^ All registered tools available for the agent to call.
   34   , _env_vault        :: IORef (Maybe VaultHandle)
   35     -- ^ Optional secrets vault. 'Nothing' if no vault is configured.
   36   , _env_pluginHandle :: PluginHandle
   37     -- ^ Handle for detecting and generating age plugin identities.
   38   }