midnight-mcp 0.2.8 → 0.2.10

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.
@@ -851,7 +851,11 @@ var GitHubClient = class {
851
851
  }
852
852
  }
853
853
  /**
854
- * Filter files by patterns
854
+ * Filter files by patterns (glob matching)
855
+ *
856
+ * SECURITY NOTE: Patterns come from trusted REPOSITORIES config, not user input.
857
+ * The glob-to-regex conversion only handles **, *, and . characters.
858
+ * This is safe because malicious patterns could only come from internal config.
855
859
  */
856
860
  filterFilesByPatterns(files, patterns, exclude) {
857
861
  const matchPattern = (file, pattern) => {
@@ -1016,6 +1020,20 @@ var GitHubClient = class {
1016
1020
  var githubClient = new GitHubClient();
1017
1021
 
1018
1022
  // src/pipeline/parser.ts
1023
+ var LANGUAGES = {
1024
+ COMPACT: "compact",
1025
+ TYPESCRIPT: "typescript",
1026
+ MARKDOWN: "markdown"
1027
+ };
1028
+ var EXTENSION_LANGUAGE_MAP = {
1029
+ compact: LANGUAGES.COMPACT,
1030
+ ts: LANGUAGES.TYPESCRIPT,
1031
+ tsx: LANGUAGES.TYPESCRIPT,
1032
+ js: LANGUAGES.TYPESCRIPT,
1033
+ jsx: LANGUAGES.TYPESCRIPT,
1034
+ md: LANGUAGES.MARKDOWN,
1035
+ mdx: LANGUAGES.MARKDOWN
1036
+ };
1019
1037
  function parseCompactFile(path, content) {
1020
1038
  const lines = content.split("\n");
1021
1039
  const codeUnits = [];
@@ -1024,10 +1042,19 @@ function parseCompactFile(path, content) {
1024
1042
  let hasLedger = false;
1025
1043
  let hasCircuits = false;
1026
1044
  let hasWitnesses = false;
1027
- const importRegex = /^include\s+["']([^"']+)["'];?/gm;
1028
- let importMatch;
1029
- while ((importMatch = importRegex.exec(content)) !== null) {
1030
- imports.push(importMatch[1]);
1045
+ const importPatterns = [
1046
+ /^import\s+([A-Za-z_][A-Za-z0-9_]*)\s*;/gm,
1047
+ // import CompactStandardLibrary;
1048
+ /^import\s+["']([^"']+)["']\s*(?:prefix\s+\w+_)?\s*;?/gm,
1049
+ // import "path" prefix X_;
1050
+ /^include\s+["']([^"']+)["'];?/gm
1051
+ // legacy: include "std";
1052
+ ];
1053
+ for (const importRegex of importPatterns) {
1054
+ let importMatch;
1055
+ while ((importMatch = importRegex.exec(content)) !== null) {
1056
+ imports.push(importMatch[1]);
1057
+ }
1031
1058
  }
1032
1059
  const ledgerRegex = /ledger\s*\{([^}]*(?:\{[^}]*\}[^}]*)*)\}/gs;
1033
1060
  let ledgerMatch;
@@ -1161,7 +1188,7 @@ function parseCompactFile(path, content) {
1161
1188
  }
1162
1189
  return {
1163
1190
  path,
1164
- language: "compact",
1191
+ language: LANGUAGES.COMPACT,
1165
1192
  content,
1166
1193
  codeUnits,
1167
1194
  imports,
@@ -1594,7 +1621,7 @@ async function checkGitHubAPI() {
1594
1621
  }
1595
1622
  async function checkVectorStore() {
1596
1623
  try {
1597
- const { vectorStore: vectorStore2 } = await import("./db-7F5YOZB7.js");
1624
+ const { vectorStore: vectorStore2 } = await import("./db-BCMNMI6F.js");
1598
1625
  if (vectorStore2) {
1599
1626
  return {
1600
1627
  status: "pass",
@@ -2069,7 +2096,7 @@ function serialize(data) {
2069
2096
  }
2070
2097
 
2071
2098
  // src/utils/version.ts
2072
- var CURRENT_VERSION = "0.2.8";
2099
+ var CURRENT_VERSION = "0.2.10";
2073
2100
 
2074
2101
  // src/db/vectorStore.ts
2075
2102
  var VectorStore = class {
@@ -2278,4 +2305,4 @@ export {
2278
2305
  serialize,
2279
2306
  CURRENT_VERSION
2280
2307
  };
2281
- //# sourceMappingURL=chunk-VQTI7YUU.js.map
2308
+ //# sourceMappingURL=chunk-C23TNY65.js.map
@@ -0,0 +1,7 @@
1
+ import {
2
+ vectorStore
3
+ } from "./chunk-C23TNY65.js";
4
+ export {
5
+ vectorStore
6
+ };
7
+ //# sourceMappingURL=db-BCMNMI6F.js.map
package/dist/index.d.ts CHANGED
@@ -85,6 +85,13 @@ interface PropertySchema {
85
85
  properties?: Record<string, PropertySchema>;
86
86
  enum?: string[];
87
87
  }
88
+ /**
89
+ * Extended tool definition with handler
90
+ *
91
+ * Note: Handler uses `unknown` for input to allow flexibility in tool implementations.
92
+ * Each tool module defines its own specific input/output types via Zod schemas.
93
+ * The MCP server validates inputs against the inputSchema before calling handlers.
94
+ */
88
95
  interface ExtendedToolDefinition {
89
96
  name: string;
90
97
  description: string;
@@ -95,7 +102,15 @@ interface ExtendedToolDefinition {
95
102
  };
96
103
  outputSchema?: OutputSchema;
97
104
  annotations?: ToolAnnotations;
98
- handler: (input: any) => Promise<any>;
105
+ /**
106
+ * Handler function that processes tool inputs
107
+ * Input is validated against inputSchema before this is called
108
+ * Output should match outputSchema if defined
109
+ *
110
+ * Using `unknown` allows specific handler types to be assigned.
111
+ * Type safety is enforced by Zod schema validation at runtime.
112
+ */
113
+ handler: (input: any) => Promise<unknown>;
99
114
  }
100
115
 
101
116
  /**
package/dist/index.js CHANGED
@@ -9,10 +9,10 @@ import {
9
9
  promptDefinitions,
10
10
  startHttpServer,
11
11
  startServer
12
- } from "./chunk-QPQOD3S6.js";
12
+ } from "./chunk-7KJSVMFI.js";
13
13
  import {
14
14
  logger
15
- } from "./chunk-VQTI7YUU.js";
15
+ } from "./chunk-C23TNY65.js";
16
16
  export {
17
17
  allResources,
18
18
  allTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midnight-mcp",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Model Context Protocol Server for Midnight Blockchain Development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,7 +0,0 @@
1
- import {
2
- vectorStore
3
- } from "./chunk-VQTI7YUU.js";
4
- export {
5
- vectorStore
6
- };
7
- //# sourceMappingURL=db-7F5YOZB7.js.map