packages feed

A-gent-0.11.0.13: src/Agent/LLM/Action.hs

{-# OPTIONS_GHC -Wall -Werror #-}

{-# LANGUAGE NoGeneralizedNewtypeDeriving #-}
{-# LANGUAGE Safe                         #-}

--------------------------------------------------------------------------------

-- |
-- Copyright  : (c) 2026 SPISE MISU ApS
-- License    : SSPL-1.0 OR AGPL-3.0-only
-- Maintainer : SPISE MISU <mail+hackage@spisemisu.com>
-- Stability  : experimental

--------------------------------------------------------------------------------

module Agent.LLM.Action
  ( -- * Type signatures
    Action
  , TextToFile
  , File
  , FilePaths
  , Root
    -- * Methods
  , none
  , exit
  , file
  , paths
  , root
  , template
  , text
  )
where

--------------------------------------------------------------------------------

import           Internal.LLM        ( File, FilePaths, Root )
import qualified Internal.LLM        as INT
import           Internal.LLM.Action ( Action, TextToFile )
import qualified Internal.LLM.Action as ACT

import qualified Agent.LLM.Message   as MSG

--------------------------------------------------------------------------------

none :: Action
none =
  ACT.None

exit :: Action
exit =
  ACT.Exit

file :: File -> Action
file =
  ACT.File

paths :: FilePaths -> Action
paths =
  ACT.Paths

root :: Root -> Action
root (INT.Root afp) =
  ACT.Paths $ INT.FilePaths [afp]

template
  :: TextToFile
  -> [File]
  -> [File]
  -> [File]
  -> Action
template =
  ACT.Template

text :: String -> Action
text =
  ACT.Message . MSG.Text