tricorder-mcp 0.1.3.0 → 0.1.3.1
raw patch · 4 files changed
+118/−84 lines, 4 filesdep +tasty-hunitdep −hspecdep −tasty-hspecdep ~atelier-coredep ~tricorder-typesPVP ok
version bump matches the API change (PVP)
Dependencies added: tasty-hunit
Dependencies removed: hspec, tasty-hspec
Dependency ranges changed: atelier-core, tricorder-types
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−0
- src/Tricorder/MCP/Tools.hs +21/−7
- test/Unit/Tricorder/MCP/ToolsSpec.hs +82/−70
- tricorder-mcp.cabal +6/−7
CHANGELOG.md view
@@ -7,6 +7,15 @@ ## [Unreleased] +## [0.1.3.1] - 2026-10-20++### Fixed++- Pre-built binaries on GitHub were built against paths in `/nix/store`, and+ were not portable to systems that did not have Nix installed. The binaries are+ now correctly linked to be used on non-Nix machines, and NixOS machines with+ `nix-ld` enabled.+ ## [0.1.3.0] - 2026-09-17 ### Added
src/Tricorder/MCP/Tools.hs view
@@ -24,12 +24,15 @@ import System.Exit (ExitCode (..)) import System.Posix (getWorkingDirectory) import System.Process.Typed (proc, readProcess, setWorkingDir)+import Tricorder.CLI.Command.OutputFormat (OutputFormat (..))+import Tricorder.CLI.Command.WaitMode (WaitMode) import Tricorder.SourceLookup.SourceQuery (parseSourceQuery) import Prelude hiding (force) import Data.ByteString.Lazy qualified as BSL import Data.List qualified as List import Tricorder.CLI.Command qualified as CLI+import Tricorder.CLI.Command.WaitMode qualified as WaitMode data Tool@@ -158,7 +161,7 @@ , defaultDefinitionOptions { optDescription = Just- "Print the Haskell source of one or more installed modules. Prefer this over downloading tarballs."+ "Print the Haskell source of one or more project or installed modules. Prefer this over downloading tarballs." , optTitle = Just "Lookup source" , optFieldDescriptions = [ ("modules", "Module names to look up, e.g. Data.Map.Strict or Data.Map.Strict#insert.")@@ -221,7 +224,7 @@ $ CLI.Status CLI.StatusOptions { wait = toWaitMode wait- , format = CLI.JsonOutput+ , format = JsonOutput , verbosity = toVerbosity verbose , expand }@@ -229,21 +232,29 @@ (TestResults (TestResultsOptions {failed, wait, projectRoot})) -> ( projectRoot , CLI.commandToArgs- $ CLI.Test+ $ CLI.TestResults CLI.TestOptions { failedOnly = fromMaybe False failed , wait = toWaitMode wait } ) (Source (SourceOptions {modules, projectRoot})) ->- (projectRoot, CLI.commandToArgs $ CLI.Source $ parseSourceQuery <$> modules)+ ( projectRoot+ , CLI.commandToArgs+ $ CLI.Source+ CLI.SourceOptions+ { queries = parseSourceQuery <$> modules+ , maxDepth = Nothing+ , maxModules = Nothing+ }+ ) (EvalComments (EvalCommentsOptions {wait, projectRoot})) -> ( projectRoot , CLI.commandToArgs $ CLI.EvalComments CLI.EvalCommentsOptions { wait = toWaitMode wait- , format = CLI.JsonOutput+ , format = JsonOutput } ) LogPath (LogPathOptions {projectRoot}) ->@@ -256,8 +267,11 @@ toForce = maybe CLI.NoForce (\enabled -> if enabled then CLI.Force else CLI.NoForce) -toWaitMode :: Maybe Bool -> CLI.WaitMode-toWaitMode = maybe CLI.ShowCurrent (\enabled -> if enabled then CLI.WaitForBuild else CLI.ShowCurrent)+toWaitMode :: Maybe Bool -> WaitMode+toWaitMode =+ maybe+ WaitMode.ShowCurrent+ (\enabled -> if enabled then WaitMode.WaitForBuild else WaitMode.ShowCurrent) toVerbosity :: Maybe Bool -> CLI.Verbosity
test/Unit/Tricorder/MCP/ToolsSpec.hs view
@@ -1,77 +1,89 @@-module Unit.Tricorder.MCP.ToolsSpec (spec_Tools) where+module Unit.Tricorder.MCP.ToolsSpec (test_Tools) where -import Test.Hspec (Spec, describe, it, shouldBe)+import Test.Tasty (TestTree, testGroup)+import Test.Tasty.HUnit (testCase, (@?=)) import Tricorder.MCP.Tools+ ( EvalCommentsOptions (..)+ , LogContentsOptions (..)+ , LogPathOptions (..)+ , RestartOptions (..)+ , SourceOptions (..)+ , StartOptions (..)+ , StatusOptions (..)+ , StopOptions (..)+ , TestResultsOptions (..)+ , Tool (..)+ , reportsBuildOutcome+ , toolCommand+ ) -spec_Tools :: Spec-spec_Tools = do- describe "toolCommand" do- it "starts with just the directory" do- toolCommand (Start StartOptions {projectRoot = Nothing})- `shouldBe` (Nothing, ["start"])-- it "omits --force when unset" do- toolCommand (Stop (StopOptions {force = Nothing, projectRoot = Nothing}))- `shouldBe` (Nothing, ["stop"])-- it "omits --force when explicitly false" do- toolCommand (Restart (RestartOptions {force = Just False, projectRoot = Nothing}))- `shouldBe` (Nothing, ["restart"])-- it "includes --force when true" do- toolCommand- ( Stop- ( StopOptions- { force = Just True- , projectRoot = Nothing- }+test_Tools :: TestTree+test_Tools =+ testGroup+ "Tools"+ [ testGroup+ "toolCommand"+ [ testCase "starts with just the directory"+ $ toolCommand (Start StartOptions {projectRoot = Nothing})+ @?= (Nothing, ["start"])+ , testCase "omits --force when unset"+ $ toolCommand (Stop (StopOptions {force = Nothing, projectRoot = Nothing}))+ @?= (Nothing, ["stop"])+ , testCase "omits --force when explicitly false"+ $ toolCommand (Restart (RestartOptions {force = Just False, projectRoot = Nothing}))+ @?= (Nothing, ["restart"])+ , testCase "includes --force when true"+ $ toolCommand+ ( Stop+ ( StopOptions+ { force = Just True+ , projectRoot = Nothing+ }+ ) )- )- `shouldBe` (Nothing, ["stop", "--force"])-- it "combines status flags in order, with --expand carrying its argument" do- toolCommand- ( Status- StatusOptions- { wait = Just True- , verbose = Nothing- , expand = Just 3- , projectRoot = Nothing- }- )- `shouldBe` (Nothing, ["status", "--wait", "--json", "--expand", "3"])-- it "turns modules into positional arguments" do- toolCommand- ( Source- ( SourceOptions- { projectRoot = Nothing- , modules = ["Data.Map.Strict", "Foo#bar"]- }+ @?= (Nothing, ["stop", "--force"])+ , testCase "combines status flags in order, with --expand carrying its argument"+ $ toolCommand+ ( Status+ StatusOptions+ { wait = Just True+ , verbose = Nothing+ , expand = Just 3+ , projectRoot = Nothing+ } )- )- `shouldBe` (Nothing, ["source", "Data.Map.Strict", "Foo#bar"])-- it "maps log_path to --print-path" do- toolCommand (LogPath LogPathOptions {projectRoot = Nothing})- `shouldBe` (Nothing, ["log", "--print-path"])-- it "maps log_contents to plain log" do- toolCommand (LogContents LogContentsOptions {projectRoot = Nothing})- `shouldBe` (Nothing, ["log"])-- describe "reportsBuildOutcome" do- it "is true for status, test_results and eval_comments" do- reportsBuildOutcome (Status (StatusOptions Nothing Nothing Nothing Nothing)) `shouldBe` True- reportsBuildOutcome (TestResults (TestResultsOptions Nothing Nothing Nothing)) `shouldBe` True- reportsBuildOutcome (EvalComments (EvalCommentsOptions Nothing Nothing)) `shouldBe` True-- it "is false for commands whose exit code reflects process failure" do- reportsBuildOutcome (Start $ StartOptions Nothing) `shouldBe` False- reportsBuildOutcome (Stop $ StopOptions Nothing Nothing) `shouldBe` False- reportsBuildOutcome (Restart $ RestartOptions Nothing Nothing) `shouldBe` False- reportsBuildOutcome (Source $ SourceOptions [] Nothing) `shouldBe` False- reportsBuildOutcome (LogPath $ LogPathOptions Nothing) `shouldBe` False- reportsBuildOutcome (LogContents $ LogContentsOptions Nothing) `shouldBe` False+ @?= (Nothing, ["status", "--wait", "--json", "--expand", "3"])+ , testCase "turns modules into positional arguments"+ $ toolCommand+ ( Source+ ( SourceOptions+ { projectRoot = Nothing+ , modules = ["Data.Map.Strict", "Foo#bar"]+ }+ )+ )+ @?= (Nothing, ["source", "Data.Map.Strict", "Foo#bar"])+ , testCase "maps log_path to --print-path"+ $ toolCommand (LogPath LogPathOptions {projectRoot = Nothing})+ @?= (Nothing, ["log", "--print-path"])+ , testCase "maps log_contents to plain log"+ $ toolCommand (LogContents LogContentsOptions {projectRoot = Nothing})+ @?= (Nothing, ["log"])+ ]+ , testGroup+ "reportsBuildOutcome"+ [ testCase "is true for status, test_results and eval_comments" do+ reportsBuildOutcome (Status (StatusOptions Nothing Nothing Nothing Nothing)) @?= True+ reportsBuildOutcome (TestResults (TestResultsOptions Nothing Nothing Nothing)) @?= True+ reportsBuildOutcome (EvalComments (EvalCommentsOptions Nothing Nothing)) @?= True+ , testCase "is false for commands whose exit code reflects process failure" do+ reportsBuildOutcome (Start $ StartOptions Nothing) @?= False+ reportsBuildOutcome (Stop $ StopOptions Nothing Nothing) @?= False+ reportsBuildOutcome (Restart $ RestartOptions Nothing Nothing) @?= False+ reportsBuildOutcome (Source $ SourceOptions [] Nothing) @?= False+ reportsBuildOutcome (LogPath $ LogPathOptions Nothing) @?= False+ reportsBuildOutcome (LogContents $ LogContentsOptions Nothing) @?= False+ ]+ ]
tricorder-mcp.cabal view
@@ -5,14 +5,14 @@ -- see: https://github.com/sol/hpack name: tricorder-mcp-version: 0.1.3.0+version: 0.1.3.1 synopsis: MCP server for Tricorder description: Model Context Protocol server for Tricorder. category: AI, Development homepage: https://github.com/tweag/tricorder#readme bug-reports: https://github.com/tweag/tricorder/issues-author: Victor Nascimento Bakke+author: Christian Georgii maintainer: victor.bakke@tweag.io license: MIT license-file: LICENSE@@ -60,7 +60,7 @@ TypeFamilies ghc-options: -Weverything -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-import-lists -Wno-implicit-prelude -Wno-unticked-promoted-constructors -Wno-unused-packages -Wno-all-missed-specialisations -Wno-missed-specialisations -fplugin=Effectful.Plugin -threaded build-depends:- atelier-core ==0.7.*+ atelier-core ==0.8.* , atelier-prelude ==0.4.* , base >=4.18 && <4.23 , bytestring >=0.11 && <0.13@@ -69,7 +69,7 @@ , effectful-plugin ==2.2.* , mcp-server ==0.2.* , process ==1.6.*- , tricorder-types ==0.4.*+ , tricorder-types ==0.5.* , typed-process ==0.2.* , unix ==2.8.* mixins:@@ -147,14 +147,13 @@ build-tool-depends: tasty-discover:tasty-discover build-depends:- atelier-core ==0.7.*+ atelier-core ==0.8.* , atelier-prelude ==0.4.* , base >=4.18 && <4.23 , effectful-core ==2.7.* , effectful-plugin ==2.2.*- , hspec ==2.11.* , tasty ==1.5.*- , tasty-hspec ==1.2.*+ , tasty-hunit >=0.10.2 && <0.11 , tricorder-mcp-internal mixins: base hiding (Prelude)