packages feed

pms-infra-serial 0.0.1.0 → 0.0.2.0

raw patch · 4 files changed

+13/−8 lines, 4 files

Files

CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for pms-infra-serial +## 0.0.2.0 -- 2025-07-20++* Added proc tool.++ ## 0.0.1.0 -- 2025-07-14  * First version.
pms-infra-serial.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.0.1.0+version:            0.0.2.0  -- A short (one-line) description of the package. synopsis:           pms-infra-serial
src/PMS/Infra/Serial/DS/Core.hs view
@@ -60,17 +60,18 @@ -- cmd2task :: ConduitT DM.SerialCommand (IOTask ()) AppContext () cmd2task = await >>= \case-  Just cmd -> flip catchError errHdl $ do+  Just cmd -> flip catchError (errHdl cmd) $ do     lift (go cmd) >>= yield >> cmd2task   Nothing -> do     $logWarnS DM._LOGTAG "cmd2task: await returns nothing. skip."     cmd2task    where-    errHdl :: String -> ConduitT DM.SerialCommand (IOTask ()) AppContext ()-    errHdl msg = do+    errHdl :: DM.SerialCommand -> String -> ConduitT DM.SerialCommand (IOTask ()) AppContext ()+    errHdl serialCmd msg = do+      let jsonrpc = DM.getJsonRpcSerialCommand serialCmd       $logWarnS DM._LOGTAG $ T.pack $ "cmd2task: exception occurred. skip. " ++ msg-      lift $ errorToolsCallResponse $ "cmd2task: exception occurred. skip. " ++ msg+      lift $ errorToolsCallResponse jsonrpc $ "cmd2task: exception occurred. skip. " ++ msg       cmd2task      go :: DM.SerialCommand -> AppContext (IOTask ())
src/PMS/Infra/Serial/DS/Utility.hs view
@@ -66,9 +66,8 @@  -- | ---errorToolsCallResponse :: String -> AppContext ()-errorToolsCallResponse errStr = do-  jsonRpc <- view jsonrpcAppData <$> ask+errorToolsCallResponse :: DM.JsonRpcRequest -> String -> AppContext ()+errorToolsCallResponse jsonRpc errStr = do   let content = [ DM.McpToolsCallResponseResultContent "text" errStr ]       result = DM.McpToolsCallResponseResult {                   DM._contentMcpToolsCallResponseResult = content