@decantr/mcp-server 3.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-PFLHZF35.js";
2
+ import "./chunk-JGU5VKY7.js";
@@ -8,7 +8,7 @@ import { execFileSync } from "child_process";
8
8
  import { createHash } from "crypto";
9
9
  import { existsSync, readdirSync, readFileSync } from "fs";
10
10
  import { readFile as readFile2 } from "fs/promises";
11
- import { basename as basename2, dirname as dirname2, isAbsolute as isAbsolute2, join as join2, relative as relative2 } from "path";
11
+ import { basename as basename2, dirname as dirname2, isAbsolute as isAbsolute2, join as join2, relative as relative2, resolve as resolve2 } from "path";
12
12
  import {
13
13
  buildGraphImpactContext,
14
14
  buildGraphRouteContext,
@@ -670,9 +670,10 @@ function buildTaskTypedGraphContext(projectRoot, route, task = "", changedFiles
670
670
  function changedFilesForTask(projectRoot) {
671
671
  const changed = /* @__PURE__ */ new Set();
672
672
  try {
673
+ const gitRoot = gitTopLevelForTask(projectRoot) ?? projectRoot;
673
674
  for (const args of [
674
- ["diff", "--name-only"],
675
- ["diff", "--name-only", "--cached"]
675
+ ["diff", "--name-only", "--relative"],
676
+ ["diff", "--name-only", "--relative", "--cached"]
676
677
  ]) {
677
678
  const output = execFileSync("git", args, {
678
679
  cwd: projectRoot,
@@ -681,13 +682,38 @@ function changedFilesForTask(projectRoot) {
681
682
  });
682
683
  for (const entry of output.split(/\r?\n/)) {
683
684
  const file = entry.trim();
684
- if (file) changed.add(file);
685
+ const projectFile = changedFileForProject(projectRoot, gitRoot, file);
686
+ if (projectFile) changed.add(projectFile);
685
687
  }
686
688
  }
687
689
  } catch {
688
690
  }
689
691
  return [...changed].sort();
690
692
  }
693
+ function gitTopLevelForTask(projectRoot) {
694
+ try {
695
+ return execFileSync("git", ["rev-parse", "--show-toplevel"], {
696
+ cwd: projectRoot,
697
+ encoding: "utf-8",
698
+ stdio: ["ignore", "pipe", "ignore"]
699
+ }).trim();
700
+ } catch {
701
+ return null;
702
+ }
703
+ }
704
+ function changedFileForProject(projectRoot, gitRoot, file) {
705
+ if (!file) return null;
706
+ const absoluteProjectRoot = resolve2(projectRoot);
707
+ const candidateAbsoluteFiles = isAbsolute2(file) ? [file] : [join2(absoluteProjectRoot, file), join2(gitRoot, file)];
708
+ for (const absoluteFile of candidateAbsoluteFiles) {
709
+ const projectRelative = relative2(absoluteProjectRoot, absoluteFile).replace(/\\/g, "/");
710
+ if (!projectRelative || projectRelative.startsWith("../") || projectRelative === "..") {
711
+ continue;
712
+ }
713
+ return projectRelative;
714
+ }
715
+ return null;
716
+ }
691
717
  function impactedRoutesForFiles(projectRoot, files) {
692
718
  const analysis = readJsonIfExists(join2(projectRoot, ".decantr", "analysis.json"));
693
719
  const routeEntries = analysis?.routes?.routes ?? [];
@@ -1249,7 +1275,7 @@ function mcpCommandsForFinding(source) {
1249
1275
  case "graph":
1250
1276
  return ["decantr graph", "decantr health --evidence"];
1251
1277
  case "interaction":
1252
- return ["decantr check --strict", "decantr health"];
1278
+ return ["decantr verify --brownfield --local-patterns", "decantr verify --evidence"];
1253
1279
  case "pack":
1254
1280
  return [
1255
1281
  "decantr refresh",
@@ -4898,7 +4924,7 @@ function describeUpdate(operation, payload) {
4898
4924
  }
4899
4925
 
4900
4926
  // src/index.ts
4901
- var VERSION = "3.0.1";
4927
+ var VERSION = "3.1.0";
4902
4928
  var server = new Server({ name: "decantr", version: VERSION }, { capabilities: { tools: {} } });
4903
4929
  server.setRequestHandler(ListToolsRequestSchema, async () => {
4904
4930
  return { tools: TOOLS };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import "./chunk-PFLHZF35.js";
1
+ import "./chunk-JGU5VKY7.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decantr/mcp-server",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "mcpName": "io.github.decantr-ai/mcp-server",
5
5
  "description": "MCP server for Decantr — exposes Contract context, typed graph artifacts, and verification evidence to AI coding assistants",
6
6
  "keywords": [
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
- "@decantr/essence-spec": "3.0.2",
55
- "@decantr/verifier": "3.0.2",
56
- "@decantr/registry": "3.0.2",
57
- "@decantr/core": "3.0.2"
54
+ "@decantr/registry": "3.1.0",
55
+ "@decantr/core": "3.1.0",
56
+ "@decantr/essence-spec": "3.1.0",
57
+ "@decantr/verifier": "3.1.0"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsup",