@happyvertical/smrt-dev-mcp 0.40.58 → 0.40.60

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,EAEP,MAAM,8BAA8B,CAAC;AAqBtC,eAAO,MAAM,cAAc,QAAuB,CAAC;AAcnD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgbjB,CAAC;AAEF,wBAAgB,YAAY,IAAI,MAAM,CAmerC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,EACN,KAAK,IAAI,EACV,MAAM,8BAA8B,CAAC;AAqBtC,eAAO,MAAM,cAAc,QAAuB,CAAC;AAydnD,eAAO,MAAM,KAAK,EAAE,IAAI,EAOrB,CAAC;AAEJ,wBAAgB,YAAY,IAAI,MAAM,CA0erC"}
package/dist/index.js CHANGED
@@ -733,7 +733,7 @@ async function buildPackageContexts(projectPath) {
733
733
  packageJsonPath,
734
734
  json,
735
735
  dependencies: collectDependencies(json),
736
- scripts: isRecord(json.scripts) ? json.scripts : {},
736
+ scripts: isRecord$1(json.scripts) ? json.scripts : {},
737
737
  imports: /* @__PURE__ */ new Map(),
738
738
  sourceFiles: []
739
739
  };
@@ -967,7 +967,7 @@ function collectDependencies(packageJson) {
967
967
  const dependencies = /* @__PURE__ */ new Set();
968
968
  for (const sectionName of DEPENDENCY_SECTIONS) {
969
969
  const section = packageJson[sectionName];
970
- if (!isRecord(section)) continue;
970
+ if (!isRecord$1(section)) continue;
971
971
  for (const dependencyName of Object.keys(section)) dependencies.add(dependencyName);
972
972
  }
973
973
  return dependencies;
@@ -1037,7 +1037,7 @@ function lineNumber(content, needle) {
1037
1037
  if (index < 0) return void 0;
1038
1038
  return content.slice(0, index).split("\n").length;
1039
1039
  }
1040
- function isRecord(value) {
1040
+ function isRecord$1(value) {
1041
1041
  return !!value && typeof value === "object" && !Array.isArray(value);
1042
1042
  }
1043
1043
  async function pathExists(path) {
@@ -1067,6 +1067,38 @@ var DOMAIN_CODE_REVIEW_PROMPT = "domain-code-review";
1067
1067
  var DOMAIN_ARCHITECTURE_PROMPT = "domain-architecture";
1068
1068
  var KNOWLEDGE_PROJECT_URI = "smrt://knowledge/project";
1069
1069
  var KNOWLEDGE_PACKAGE_PREFIX = "smrt://knowledge/package/";
1070
+ var JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
1071
+ /**
1072
+ * Stable success/error envelope for development tools. `data` preserves each
1073
+ * tool's existing payload exactly; coverage/diagnostics are promoted only when
1074
+ * the underlying result actually reports them.
1075
+ */
1076
+ var DEV_MCP_OUTPUT_SCHEMA = {
1077
+ $schema: JSON_SCHEMA_2020_12,
1078
+ type: "object",
1079
+ additionalProperties: false,
1080
+ required: [
1081
+ "ok",
1082
+ "coverage",
1083
+ "diagnostics",
1084
+ "data"
1085
+ ],
1086
+ properties: {
1087
+ ok: { type: "boolean" },
1088
+ coverage: {
1089
+ type: ["object", "null"],
1090
+ additionalProperties: true
1091
+ },
1092
+ diagnostics: {
1093
+ type: "array",
1094
+ items: {
1095
+ type: "object",
1096
+ additionalProperties: true
1097
+ }
1098
+ },
1099
+ data: {}
1100
+ }
1101
+ };
1070
1102
  var TOOLS = [
1071
1103
  {
1072
1104
  name: "generate-smrt-class",
@@ -1518,7 +1550,14 @@ var TOOLS = [
1518
1550
  required: ["name"]
1519
1551
  }
1520
1552
  }
1521
- ];
1553
+ ].map((tool) => ({
1554
+ ...tool,
1555
+ inputSchema: {
1556
+ ...tool.inputSchema,
1557
+ $schema: JSON_SCHEMA_2020_12
1558
+ },
1559
+ outputSchema: DEV_MCP_OUTPUT_SCHEMA
1560
+ }));
1522
1561
  function createServer() {
1523
1562
  if (DEBUG) console.error(`[${SERVER_NAME}] Starting server v${SERVER_VERSION}`);
1524
1563
  const server = new Server({
@@ -1781,10 +1820,13 @@ function createServer() {
1781
1820
  break;
1782
1821
  default: throw new Error(`Unknown tool: ${name}`);
1783
1822
  }
1784
- return { content: [{
1785
- type: "text",
1786
- text: result
1787
- }] };
1823
+ return {
1824
+ content: [{
1825
+ type: "text",
1826
+ text: result
1827
+ }],
1828
+ structuredContent: toDevToolStructuredContent(result)
1829
+ };
1788
1830
  } catch (error) {
1789
1831
  const errorMessage = error instanceof Error ? error.message : "Unknown error";
1790
1832
  console.error(`[${SERVER_NAME}] Error:`, error);
@@ -1793,7 +1835,16 @@ function createServer() {
1793
1835
  type: "text",
1794
1836
  text: `Error executing tool ${name}: ${errorMessage}`
1795
1837
  }],
1796
- isError: true
1838
+ isError: true,
1839
+ structuredContent: {
1840
+ ok: false,
1841
+ coverage: null,
1842
+ diagnostics: [{
1843
+ severity: "error",
1844
+ message: errorMessage
1845
+ }],
1846
+ data: null
1847
+ }
1797
1848
  };
1798
1849
  }
1799
1850
  });
@@ -1925,6 +1976,22 @@ function detailArg(args) {
1925
1976
  const detail = args?.detail;
1926
1977
  return typeof detail === "string" ? detail : void 0;
1927
1978
  }
1979
+ function toDevToolStructuredContent(result) {
1980
+ let data = result;
1981
+ try {
1982
+ data = JSON.parse(result);
1983
+ } catch {}
1984
+ const source = isRecord(data) ? data : void 0;
1985
+ return {
1986
+ ok: true,
1987
+ coverage: isRecord(source?.coverage) ? source.coverage : null,
1988
+ diagnostics: Array.isArray(source?.diagnostics) ? source.diagnostics.filter(isRecord) : [],
1989
+ data
1990
+ };
1991
+ }
1992
+ function isRecord(value) {
1993
+ return !!value && typeof value === "object" && !Array.isArray(value);
1994
+ }
1928
1995
  function sanitizeKnowledgePackage(pkg) {
1929
1996
  const { directory: _directory, objects, checkedObjectPaths, ...rest } = pkg;
1930
1997
  return {