{-# 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.Message
  ( Message(..)
  , AbsoluteFilePath
  , Files
  , Filter
  )
where

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

import           Internal.LLM ( AbsoluteFilePath, Files, Filter )

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

data Message
  = Atom !String !Files
  | List !(Maybe Filter)
  | Path !Bool !(Maybe AbsoluteFilePath)
  | Repo
  | Root
  | Send ![String]
  | Text !String
  | Tmpl !(Maybe [AbsoluteFilePath])

instance Show Message where
  show :: Message -> String
show (Atom String
_ Files
_) = String
"Atom"
  show (List Maybe Filter
_)   = String
"List"
  show (Path Bool
_ Maybe AbsoluteFilePath
_) = String
"Path"
  show  Message
Repo      = String
"Repo"
  show  Message
Root      = String
"Root"
  show (Send [String]
_)   = String
"Send"
  show (Text String
_)   = String
"Text"
  show (Tmpl Maybe [AbsoluteFilePath]
_)   = String
"Tmpl"