packages feed

pms-domain-service 0.0.7.0 → 0.0.8.0

raw patch · 5 files changed

+29/−16 lines, 5 files

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for pms-domain-service +## 0.0.8.0 -- 2025-08-11++* Fixed encoding.+ ## 0.0.7.0 -- 2025-07-27  * Fixed resources templates.
pms-domain-service.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.0.7.0+version:            0.0.8.0  -- A short (one-line) description of the package. synopsis:           pms-domain-service
src/PMS/Domain/Service/DS/State/Run/PromptsGet.hs view
@@ -25,6 +25,7 @@ import qualified PMS.Domain.Model.DM.Constant as DM  import PMS.Domain.Service.DM.Type+import qualified PMS.Domain.Service.DS.Utility as U   -- |@@ -40,25 +41,24 @@     promptsDir <- view DM.promptsDirDomainData <$> lift ask     let promptsFile = pname ++ ".md"         promptsFilePath = promptsDir </> promptsFile-    +     argsDat <- liftEither $ eitherDecode $ argsBS     let args = unJsonObjectMap argsDat-        +     $logDebugS DM._LOGTAG $ T.pack $ "promptsFile : " ++ promptsFile     $logDebugS DM._LOGTAG $ T.pack $ "promptsFilePath : " ++ promptsFilePath     $logDebugS DM._LOGTAG $ T.pack $ "arguments : " ++ show args      tmplParams <- liftEither $ eitherDecode $ argsBS-    tmplTmp <- liftIO $ automaticCompile [promptsDir] promptsFile-    tmpl <- liftEither $ first show tmplTmp++    tmplText <- U.readFileText promptsFilePath+    tmpl <- liftEither $ first show $ compileTemplate promptsFile tmplText+     let rendered = substitute tmpl (tmplParams :: Aeson.Value)         cont = T.unpack rendered-    -    -- cont <- U.readFile promptsFilePath-    -- response $ TL.unpack $ TLE.decodeUtf8 cont      response cont-    +     return noStateTransition      where
src/PMS/Domain/Service/DS/State/Run/ToolsList.hs view
@@ -47,7 +47,7 @@     where       errHdl :: String -> AppContext (Maybe StateTransition)       errHdl msg = do-        $logErrorS DM._LOGTAG $ T.pack $ "PromptsListEventData: exception occurred. " ++ msg+        $logErrorS DM._LOGTAG $ T.pack $ "ToolsListEventData: exception occurred. " ++ msg         response $ BL8.pack msg         return noStateTransition 
src/PMS/Domain/Service/DS/Utility.hs view
@@ -9,8 +9,9 @@ import Control.Monad.Reader import System.Log.FastLogger import qualified Control.Exception.Safe as E-import qualified Data.Text.IO as T+-- import qualified Data.Text.IO as T import qualified Data.Text.Encoding as TE+import qualified Data.Text.Encoding.Error as TEE import qualified Data.ByteString.Lazy as BL import System.Directory import Control.Monad.Logger@@ -62,13 +63,21 @@ -- | -- readFile :: FilePath -> AppContext BL.ByteString-readFile path = isFileExists path-            >>= isReadable-            >>= go+readFile path = do+  txt <-  readFileText path+  return $ BL.fromStrict $ TE.encodeUtf8 txt++-- |+--+readFileText :: FilePath -> AppContext T.Text+readFileText path = isFileExists path+                >>= isReadable+                >>= go   where     go f = liftIOE $ do-      cont <- T.readFile f-      return $ BL.fromStrict $ TE.encodeUtf8 cont+      bytes <- BL.readFile f+      let txt = TE.decodeUtf8With TEE.lenientDecode (BL.toStrict bytes)+      return txt  -- | --