mcp-docs-service 0.3.6 → 0.3.8

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.
Files changed (44) hide show
  1. package/README.md +18 -6
  2. package/cursor-wrapper.cjs +111 -0
  3. package/dist/index.js +28 -13
  4. package/npx-wrapper.cjs +112 -0
  5. package/package.json +7 -3
  6. package/dist/cli/bin.d.ts +0 -8
  7. package/dist/cli/bin.js +0 -133
  8. package/dist/cli/bin.js.map +0 -1
  9. package/dist/handlers/docs.d.ts +0 -26
  10. package/dist/handlers/docs.js +0 -513
  11. package/dist/handlers/docs.js.map +0 -1
  12. package/dist/handlers/file.d.ts +0 -32
  13. package/dist/handlers/file.js +0 -222
  14. package/dist/handlers/file.js.map +0 -1
  15. package/dist/handlers/index.d.ts +0 -1
  16. package/dist/handlers/index.js +0 -3
  17. package/dist/handlers/index.js.map +0 -1
  18. package/dist/schemas/index.d.ts +0 -1
  19. package/dist/schemas/index.js +0 -3
  20. package/dist/schemas/index.js.map +0 -1
  21. package/dist/schemas/tools.d.ts +0 -164
  22. package/dist/schemas/tools.js +0 -53
  23. package/dist/schemas/tools.js.map +0 -1
  24. package/dist/types/docs.d.ts +0 -74
  25. package/dist/types/docs.js +0 -2
  26. package/dist/types/docs.js.map +0 -1
  27. package/dist/types/file.d.ts +0 -21
  28. package/dist/types/file.js +0 -2
  29. package/dist/types/file.js.map +0 -1
  30. package/dist/types/index.d.ts +0 -44
  31. package/dist/types/index.js +0 -4
  32. package/dist/types/index.js.map +0 -1
  33. package/dist/types/tools.d.ts +0 -11
  34. package/dist/types/tools.js +0 -2
  35. package/dist/types/tools.js.map +0 -1
  36. package/dist/utils/file.d.ts +0 -24
  37. package/dist/utils/file.js +0 -94
  38. package/dist/utils/file.js.map +0 -1
  39. package/dist/utils/index.d.ts +0 -1
  40. package/dist/utils/index.js +0 -3
  41. package/dist/utils/index.js.map +0 -1
  42. package/dist/utils/path.d.ts +0 -16
  43. package/dist/utils/path.js +0 -70
  44. package/dist/utils/path.js.map +0 -1
package/README.md CHANGED
@@ -19,9 +19,11 @@ npm install -g mcp-docs-service
19
19
  Or use directly with npx:
20
20
 
21
21
  ```bash
22
- npx mcp-docs-service
22
+ npx mcp-docs-service-npx /path/to/docs
23
23
  ```
24
24
 
25
+ > **Note**: When using with npx, use the `mcp-docs-service-npx` command to ensure proper stdio handling.
26
+
25
27
  ## Usage
26
28
 
27
29
  ### Command Line
@@ -48,23 +50,33 @@ To use with Cursor, create a `.cursor/mcp.json` file with:
48
50
  {
49
51
  "mcpServers": {
50
52
  "docs-manager": {
51
- "command": "npx",
52
- "args": ["-y", "mcp-docs-service", "./docs"]
53
+ "command": "mcp-docs-service-cursor",
54
+ "args": ["/path/to/your/docs"],
55
+ "env": {
56
+ "NODE_ENV": "production",
57
+ "DEBUG": "mcp:*"
58
+ }
53
59
  }
54
60
  }
55
61
  }
56
62
  ```
57
63
 
58
- This configuration specifies the `docs` directory in your project root. The docs directory path is provided directly as an argument, similar to how the filesystem MCP server works.
64
+ > **Note**: For Cursor integration, use the `mcp-docs-service-cursor` command instead of `mcp-docs-service`. This special wrapper ensures proper stdio handling for Cursor's MCP protocol communication.
65
+
66
+ ### NPX Integration
59
67
 
60
- For a custom docs directory:
68
+ For Cursor integration with npx, use:
61
69
 
62
70
  ```json
63
71
  {
64
72
  "mcpServers": {
65
73
  "docs-manager": {
66
74
  "command": "npx",
67
- "args": ["-y", "mcp-docs-service", "./my-custom-docs"]
75
+ "args": ["-y", "mcp-docs-service-npx", "/path/to/your/docs"],
76
+ "env": {
77
+ "NODE_ENV": "production",
78
+ "DEBUG": "mcp:*"
79
+ }
68
80
  }
69
81
  }
70
82
  }
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MCP Cursor Wrapper
5
+ *
6
+ * This script is a wrapper for the MCP Docs Service that ensures proper stdio handling for Cursor.
7
+ * It redirects all console.log output to stderr to avoid interfering with the JSON communication.
8
+ */
9
+
10
+ const { spawn } = require("child_process");
11
+ const path = require("path");
12
+ const fs = require("fs");
13
+
14
+ // Create a debug log file
15
+ const logDir = path.join(
16
+ process.env.HOME || process.env.USERPROFILE,
17
+ ".mcp-docs-service"
18
+ );
19
+ try {
20
+ if (!fs.existsSync(logDir)) {
21
+ fs.mkdirSync(logDir, { recursive: true });
22
+ }
23
+ } catch (err) {
24
+ // Ignore errors creating log directory
25
+ }
26
+
27
+ const logFile = path.join(logDir, "cursor-debug.log");
28
+ try {
29
+ fs.writeFileSync(
30
+ logFile,
31
+ `MCP Cursor Wrapper called at ${new Date().toISOString()}\n`
32
+ );
33
+ } catch (err) {
34
+ // Ignore errors writing to log file
35
+ }
36
+
37
+ // Helper function to log to the file
38
+ const logToFile = (message) => {
39
+ try {
40
+ fs.appendFileSync(logFile, `${message}\n`);
41
+ } catch (err) {
42
+ // Ignore errors writing to log file
43
+ }
44
+ };
45
+
46
+ // Log debug information
47
+ logToFile(`Process arguments: ${JSON.stringify(process.argv)}`);
48
+ logToFile(`Working directory: ${process.cwd()}`);
49
+ logToFile(`Script directory: ${__dirname}`);
50
+
51
+ // Find the path to the actual service script
52
+ const servicePath = path.resolve(path.join(__dirname, "dist", "index.js"));
53
+ logToFile(`Service path: ${servicePath}`);
54
+
55
+ // Check if the service script exists
56
+ if (!fs.existsSync(servicePath)) {
57
+ logToFile(`ERROR: Service script not found at ${servicePath}`);
58
+ console.error(`ERROR: Service script not found at ${servicePath}`);
59
+ process.exit(1);
60
+ }
61
+
62
+ // Get command line arguments, skipping the first two (node and script path)
63
+ const args = process.argv.slice(2);
64
+ logToFile(`Command line arguments: ${JSON.stringify(args)}`);
65
+
66
+ // Set environment variables
67
+ const env = {
68
+ ...process.env,
69
+ MCP_CURSOR_WRAPPER: "true",
70
+ // Redirect console.log to stderr
71
+ NODE_OPTIONS: `${process.env.NODE_OPTIONS || ""} --redirect-warnings=stderr`,
72
+ };
73
+
74
+ // Create a child process with piped stdio
75
+ // This is critical for Cursor - we need to control stdin/stdout directly
76
+ const child = spawn("node", [servicePath, ...args], {
77
+ stdio: ["pipe", "pipe", "pipe"],
78
+ env,
79
+ });
80
+
81
+ // Redirect child's stderr to our stderr
82
+ child.stderr.on("data", (data) => {
83
+ process.stderr.write(data);
84
+
85
+ // Also log to file for debugging
86
+ try {
87
+ logToFile(`STDERR: ${data.toString()}`);
88
+ } catch (err) {
89
+ // Ignore errors
90
+ }
91
+ });
92
+
93
+ // Pipe our stdin directly to child's stdin
94
+ process.stdin.pipe(child.stdin);
95
+
96
+ // Pipe child's stdout directly to our stdout
97
+ // This is the critical part - we don't want to modify the JSON communication
98
+ child.stdout.pipe(process.stdout);
99
+
100
+ // Handle process exit
101
+ child.on("exit", (code) => {
102
+ logToFile(`Child process exited with code ${code}`);
103
+ process.exit(code || 0);
104
+ });
105
+
106
+ // Handle errors
107
+ child.on("error", (err) => {
108
+ logToFile(`Error spawning child process: ${err.message}`);
109
+ console.error(`Error spawning MCP Docs Service: ${err.message}`);
110
+ process.exit(1);
111
+ });
package/dist/index.js CHANGED
@@ -15,6 +15,21 @@ import { z } from "zod";
15
15
  import { zodToJsonSchema } from "zod-to-json-schema";
16
16
  import { createTwoFilesPatch } from "diff";
17
17
  import { glob } from "glob";
18
+ // Setup logging to avoid interfering with MCP protocol
19
+ // When running under Cursor or NPX, we need to redirect console.log to stderr
20
+ const isCursorWrapper = process.env.MCP_CURSOR_WRAPPER === "true";
21
+ const isNpxWrapper = process.env.MCP_NPX_WRAPPER === "true";
22
+ const isInspector = process.env.MCP_INSPECTOR === "true";
23
+ // Create a safe logging function that won't interfere with MCP protocol
24
+ const safeLog = (...args) => {
25
+ // When running under Cursor or NPX, redirect all logs to stderr
26
+ if (isCursorWrapper || isNpxWrapper) {
27
+ console.error(...args);
28
+ }
29
+ else {
30
+ console.log(...args);
31
+ }
32
+ };
18
33
  // Command line argument parsing
19
34
  const args = process.argv.slice(2);
20
35
  let docsDir = path.join(process.cwd(), "docs");
@@ -42,7 +57,7 @@ docsDir = path.normalize(docsDir);
42
57
  try {
43
58
  const stats = await fs.stat(docsDir);
44
59
  if (!stats.isDirectory()) {
45
- console.error(`Error: ${docsDir} is not a directory`);
60
+ safeLog(`Error: ${docsDir} is not a directory`);
46
61
  process.exit(1);
47
62
  }
48
63
  }
@@ -51,7 +66,7 @@ catch (error) {
51
66
  if (createDir) {
52
67
  try {
53
68
  await fs.mkdir(docsDir, { recursive: true });
54
- console.log(`Created docs directory: ${docsDir}`);
69
+ safeLog(`Created docs directory: ${docsDir}`);
55
70
  // Create a sample README.md
56
71
  const readmePath = path.join(docsDir, "README.md");
57
72
  try {
@@ -68,22 +83,22 @@ description: Project documentation
68
83
  This is the documentation directory for your project.
69
84
  `;
70
85
  await fs.writeFile(readmePath, content);
71
- console.log(`Created sample README.md in ${docsDir}`);
86
+ safeLog(`Created sample README.md in ${docsDir}`);
72
87
  }
73
88
  }
74
89
  catch (error) {
75
- console.error(`Error creating docs directory: ${error}`);
90
+ safeLog(`Error creating docs directory: ${error}`);
76
91
  process.exit(1);
77
92
  }
78
93
  }
79
94
  else {
80
- console.error(`Error: Docs directory does not exist: ${docsDir}`);
81
- console.error(`Use --create-dir to create it automatically`);
95
+ safeLog(`Error: Docs directory does not exist: ${docsDir}`);
96
+ safeLog(`Use --create-dir to create it automatically`);
82
97
  process.exit(1);
83
98
  }
84
99
  }
85
- console.log("MCP Documentation Service initialized with docs directory:", docsDir);
86
- console.log("Directory will be created if it doesn't exist");
100
+ safeLog("MCP Documentation Service initialized with docs directory:", docsDir);
101
+ safeLog("Directory will be created if it doesn't exist");
87
102
  // Schema definitions
88
103
  const ReadDocumentArgsSchema = z.object({
89
104
  path: z
@@ -438,7 +453,7 @@ async function checkDocumentationHealth(basePath) {
438
453
  // Server setup
439
454
  const server = new Server({
440
455
  name: "mcp-docs-service",
441
- version: "0.3.6",
456
+ version: "0.3.8",
442
457
  }, {
443
458
  capabilities: {
444
459
  tools: {},
@@ -670,11 +685,11 @@ if (runHealthCheck) {
670
685
  async function runServer() {
671
686
  const transport = new StdioServerTransport();
672
687
  await server.connect(transport);
673
- console.log("MCP Documentation Management Service started.");
674
- console.log("Using docs directory:", docsDir);
675
- console.log("Reading from stdin, writing results to stdout...");
688
+ safeLog("MCP Documentation Management Service started.");
689
+ safeLog("Using docs directory:", docsDir);
690
+ safeLog("Reading from stdin, writing results to stdout...");
676
691
  }
677
692
  runServer().catch((error) => {
678
- console.error("Fatal error running server:", error);
693
+ safeLog("Fatal error running server:", error);
679
694
  process.exit(1);
680
695
  });
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MCP NPX Wrapper
5
+ *
6
+ * This script is a wrapper for the MCP Docs Service that ensures proper stdio handling when run via npx.
7
+ * It redirects all console.log output to stderr to avoid interfering with the JSON communication.
8
+ */
9
+
10
+ const { spawn } = require("child_process");
11
+ const path = require("path");
12
+ const fs = require("fs");
13
+
14
+ // Create a debug log file
15
+ const logDir = path.join(
16
+ process.env.HOME || process.env.USERPROFILE,
17
+ ".mcp-docs-service"
18
+ );
19
+ try {
20
+ if (!fs.existsSync(logDir)) {
21
+ fs.mkdirSync(logDir, { recursive: true });
22
+ }
23
+ } catch (err) {
24
+ // Ignore errors creating log directory
25
+ }
26
+
27
+ const logFile = path.join(logDir, "npx-debug.log");
28
+ try {
29
+ fs.writeFileSync(
30
+ logFile,
31
+ `MCP NPX Wrapper called at ${new Date().toISOString()}\n`
32
+ );
33
+ } catch (err) {
34
+ // Ignore errors writing to log file
35
+ }
36
+
37
+ // Helper function to log to the file
38
+ const logToFile = (message) => {
39
+ try {
40
+ fs.appendFileSync(logFile, `${message}\n`);
41
+ } catch (err) {
42
+ // Ignore errors writing to log file
43
+ }
44
+ };
45
+
46
+ // Log debug information
47
+ logToFile(`Process arguments: ${JSON.stringify(process.argv)}`);
48
+ logToFile(`Working directory: ${process.cwd()}`);
49
+ logToFile(`Script directory: ${__dirname}`);
50
+
51
+ // Find the path to the actual service script
52
+ // When run via npx, the script will be in the package's directory
53
+ const servicePath = path.resolve(path.join(__dirname, "dist", "index.js"));
54
+ logToFile(`Service path: ${servicePath}`);
55
+
56
+ // Check if the service script exists
57
+ if (!fs.existsSync(servicePath)) {
58
+ logToFile(`ERROR: Service script not found at ${servicePath}`);
59
+ console.error(`ERROR: Service script not found at ${servicePath}`);
60
+ process.exit(1);
61
+ }
62
+
63
+ // Get command line arguments, skipping the first two (node and script path)
64
+ const args = process.argv.slice(2);
65
+ logToFile(`Command line arguments: ${JSON.stringify(args)}`);
66
+
67
+ // Set environment variables
68
+ const env = {
69
+ ...process.env,
70
+ MCP_NPX_WRAPPER: "true",
71
+ // Redirect console.log to stderr
72
+ NODE_OPTIONS: `${process.env.NODE_OPTIONS || ""} --redirect-warnings=stderr`,
73
+ };
74
+
75
+ // Create a child process with piped stdio
76
+ // This is critical for MCP - we need to control stdin/stdout directly
77
+ const child = spawn("node", [servicePath, ...args], {
78
+ stdio: ["pipe", "pipe", "pipe"],
79
+ env,
80
+ });
81
+
82
+ // Redirect child's stderr to our stderr
83
+ child.stderr.on("data", (data) => {
84
+ process.stderr.write(data);
85
+
86
+ // Also log to file for debugging
87
+ try {
88
+ logToFile(`STDERR: ${data.toString()}`);
89
+ } catch (err) {
90
+ // Ignore errors
91
+ }
92
+ });
93
+
94
+ // Pipe our stdin directly to child's stdin
95
+ process.stdin.pipe(child.stdin);
96
+
97
+ // Pipe child's stdout directly to our stdout
98
+ // This is the critical part - we don't want to modify the JSON communication
99
+ child.stdout.pipe(process.stdout);
100
+
101
+ // Handle process exit
102
+ child.on("exit", (code) => {
103
+ logToFile(`Child process exited with code ${code}`);
104
+ process.exit(code || 0);
105
+ });
106
+
107
+ // Handle errors
108
+ child.on("error", (err) => {
109
+ logToFile(`Error spawning child process: ${err.message}`);
110
+ console.error(`Error spawning MCP Docs Service: ${err.message}`);
111
+ process.exit(1);
112
+ });
package/package.json CHANGED
@@ -1,16 +1,20 @@
1
1
  {
2
2
  "name": "mcp-docs-service",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "MCP Documentation Service - A Model Context Protocol implementation for documentation management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "mcp-docs-service": "dist/index.js"
8
+ "mcp-docs-service": "dist/index.js",
9
+ "mcp-docs-service-cursor": "cursor-wrapper.cjs",
10
+ "mcp-docs-service-npx": "npx-wrapper.cjs"
9
11
  },
10
12
  "files": [
11
13
  "dist",
12
14
  "README.md",
13
- "LICENSE"
15
+ "LICENSE",
16
+ "cursor-wrapper.cjs",
17
+ "npx-wrapper.cjs"
14
18
  ],
15
19
  "scripts": {
16
20
  "build": "tsc",
package/dist/cli/bin.d.ts DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MCP Docs Service CLI
4
- *
5
- * This is the entry point for the CLI version of the MCP Docs Service.
6
- * It simply imports and runs the main service.
7
- */
8
- import "../index.js";
package/dist/cli/bin.js DELETED
@@ -1,133 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MCP Docs Service CLI
4
- *
5
- * This is the entry point for the CLI version of the MCP Docs Service.
6
- * It simply imports and runs the main service.
7
- */
8
- import path from "path";
9
- import fs from "fs";
10
- import { fileURLToPath } from "url";
11
- // Get the current directory
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
- // Check if we're running under MCP Inspector
15
- const isMCPInspector = process.env.MCP_INSPECTOR === "true" ||
16
- process.argv.some((arg) => arg.includes("modelcontextprotocol/inspector"));
17
- // Create a logging function that respects MCP Inspector mode
18
- const log = (...args) => {
19
- if (!isMCPInspector) {
20
- console.log(...args);
21
- }
22
- };
23
- const errorLog = (...args) => {
24
- console.error(...args);
25
- };
26
- // Parse command line arguments
27
- const args = process.argv.slice(2);
28
- log("CLI Arguments:", JSON.stringify(args));
29
- let docsDir = path.join(process.cwd(), "docs");
30
- let createDir = false;
31
- let healthCheck = false;
32
- let showHelp = false;
33
- // MCP Inspector specific handling
34
- // When run through MCP Inspector, it might pass arguments in a different format
35
- if (isMCPInspector) {
36
- log("Detected MCP Inspector environment");
37
- // Try to find a valid docs directory in all arguments
38
- // This is a more aggressive approach but should work with various argument formats
39
- for (const arg of process.argv) {
40
- if (arg.endsWith("/docs") || arg.includes("/docs ")) {
41
- const potentialPath = arg.split(" ")[0];
42
- log("Found potential docs path in MCP Inspector args:", potentialPath);
43
- if (fs.existsSync(potentialPath)) {
44
- docsDir = path.resolve(potentialPath);
45
- log("Using docs directory from MCP Inspector:", docsDir);
46
- break;
47
- }
48
- }
49
- }
50
- // If we couldn't find a valid docs directory, use the default
51
- log("Using docs directory:", docsDir);
52
- }
53
- else {
54
- // Standard argument parsing
55
- for (let i = 0; i < args.length; i++) {
56
- log(`Processing arg[${i}]:`, args[i]);
57
- if (args[i] === "--docs-dir" && i + 1 < args.length) {
58
- docsDir = path.resolve(args[i + 1]);
59
- log("Setting docs dir from --docs-dir flag:", docsDir);
60
- i++; // Skip the next argument
61
- }
62
- else if (args[i] === "--create-dir") {
63
- createDir = true;
64
- }
65
- else if (args[i] === "--health-check") {
66
- healthCheck = true;
67
- }
68
- else if (args[i] === "--help" || args[i] === "-h") {
69
- showHelp = true;
70
- }
71
- else if (!args[i].startsWith("--")) {
72
- // Handle positional argument as docs directory
73
- const potentialPath = path.resolve(args[i]);
74
- log("Potential positional path:", potentialPath);
75
- log("Path exists?", fs.existsSync(potentialPath));
76
- if (fs.existsSync(potentialPath)) {
77
- docsDir = potentialPath;
78
- log("Setting docs dir from positional argument:", docsDir);
79
- }
80
- else {
81
- log("Path doesn't exist, not using as docs dir:", potentialPath);
82
- }
83
- }
84
- }
85
- }
86
- log("Final docs dir:", docsDir);
87
- // Show help if requested
88
- if (showHelp) {
89
- console.log(`
90
- MCP Docs Service - Documentation Management Service
91
-
92
- Usage:
93
- mcp-docs-service [options]
94
- mcp-docs-service <docs-directory> [options]
95
-
96
- Options:
97
- --docs-dir <path> Specify the docs directory (default: ./docs)
98
- --create-dir Create the docs directory if it doesn't exist
99
- --health-check Run a health check on the documentation
100
- --help, -h Show this help message
101
- `);
102
- process.exit(0);
103
- }
104
- // Create docs directory if it doesn't exist and --create-dir is specified
105
- if (createDir) {
106
- try {
107
- if (!fs.existsSync(docsDir)) {
108
- fs.mkdirSync(docsDir, { recursive: true });
109
- log(`Created docs directory: ${docsDir}`);
110
- }
111
- }
112
- catch (error) {
113
- errorLog(`Error creating docs directory: ${error}`);
114
- process.exit(1);
115
- }
116
- }
117
- // Ensure the docs directory exists
118
- if (!fs.existsSync(docsDir)) {
119
- errorLog(`Error: Docs directory does not exist: ${docsDir}`);
120
- errorLog(`Use --create-dir to create it automatically`);
121
- process.exit(1);
122
- }
123
- // Add the docs directory to process.argv so it's available to the main service
124
- process.argv.push(docsDir);
125
- // Add health check flag to process.argv if specified
126
- if (healthCheck) {
127
- process.argv.push("--health-check");
128
- }
129
- // Import the main service
130
- import "../index.js";
131
- // The main service will handle the CLI arguments and execution
132
- // No additional code needed here as the main index.ts already has CLI functionality
133
- //# sourceMappingURL=bin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/cli/bin.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,4BAA4B;AAC5B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,6CAA6C;AAC7C,MAAM,cAAc,GAClB,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM;IACpC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,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CAAC,6CAA6C,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,+EAA+E;AAC/E,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAE3B,qDAAqD;AACrD,IAAI,WAAW,EAAE,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC;AAED,0BAA0B;AAC1B,OAAO,aAAa,CAAC;AAErB,+DAA+D;AAC/D,oFAAoF"}
@@ -1,26 +0,0 @@
1
- import { ToolResponse } from "../types/tools.js";
2
- /**
3
- * Reads a markdown document and extracts its content and metadata
4
- */
5
- export declare function readDocument(docPath: string, allowedDirectories: string[]): Promise<ToolResponse>;
6
- /**
7
- * Lists all markdown documents in a directory
8
- */
9
- export declare function listDocuments(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
10
- /**
11
- * Gets the structure of the documentation directory
12
- */
13
- export declare function getStructure(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
14
- /**
15
- * Gets the navigation structure for the documentation
16
- */
17
- export declare function getNavigation(basePath: string, allowedDirectories: string[]): Promise<ToolResponse>;
18
- /**
19
- * Checks the health of documentation
20
- */
21
- export declare function checkDocumentationHealth(basePath: string, options: {
22
- checkLinks?: boolean;
23
- checkMetadata?: boolean;
24
- checkOrphans?: boolean;
25
- requiredMetadataFields?: string[];
26
- }, allowedDirectories: string[]): Promise<ToolResponse>;