mcp-docs-service 0.4.0 → 0.5.1

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,222 +0,0 @@
1
- import fs from "fs/promises";
2
- import path from "path";
3
- import { validatePath } from "../utils/path.js";
4
- import { getFileStats, searchFiles, applyFileEdits } from "../utils/file.js";
5
- /**
6
- * Reads a file and returns its content
7
- */
8
- export async function readFile(filePath, allowedDirectories) {
9
- try {
10
- const normalizedPath = await validatePath(filePath, allowedDirectories);
11
- const content = await fs.readFile(normalizedPath, "utf-8");
12
- return {
13
- content: [{ type: "text", text: "File read successfully" }],
14
- metadata: {
15
- path: filePath,
16
- content,
17
- },
18
- };
19
- }
20
- catch (error) {
21
- return {
22
- content: [{ type: "text", text: `Error reading file: ${error.message}` }],
23
- isError: true,
24
- };
25
- }
26
- }
27
- /**
28
- * Writes content to a file
29
- */
30
- export async function writeFile(filePath, content, allowedDirectories) {
31
- try {
32
- const normalizedPath = await validatePath(filePath, allowedDirectories);
33
- // Ensure the directory exists
34
- const dirPath = path.dirname(normalizedPath);
35
- await fs.mkdir(dirPath, { recursive: true });
36
- // Write the file
37
- await fs.writeFile(normalizedPath, content);
38
- return {
39
- content: [{ type: "text", text: "File written successfully" }],
40
- metadata: {
41
- path: filePath,
42
- },
43
- };
44
- }
45
- catch (error) {
46
- return {
47
- content: [{ type: "text", text: `Error writing file: ${error.message}` }],
48
- isError: true,
49
- };
50
- }
51
- }
52
- /**
53
- * Lists files in a directory
54
- */
55
- export async function listFiles(dirPath, allowedDirectories) {
56
- try {
57
- const normalizedPath = await validatePath(dirPath, allowedDirectories);
58
- const entries = await fs.readdir(normalizedPath, { withFileTypes: true });
59
- const files = entries.map((entry) => ({
60
- name: entry.name,
61
- isDirectory: entry.isDirectory(),
62
- isFile: entry.isFile(),
63
- }));
64
- return {
65
- content: [
66
- { type: "text", text: `Listed ${files.length} files in ${dirPath}` },
67
- ],
68
- metadata: {
69
- path: dirPath,
70
- files,
71
- },
72
- };
73
- }
74
- catch (error) {
75
- return {
76
- content: [
77
- { type: "text", text: `Error listing files: ${error.message}` },
78
- ],
79
- isError: true,
80
- };
81
- }
82
- }
83
- /**
84
- * Gets information about a file
85
- */
86
- export async function getFileInfo(filePath, allowedDirectories) {
87
- try {
88
- const normalizedPath = await validatePath(filePath, allowedDirectories);
89
- const fileInfo = await getFileStats(normalizedPath);
90
- return {
91
- content: [
92
- { type: "text", text: "File information retrieved successfully" },
93
- ],
94
- metadata: {
95
- path: filePath,
96
- info: fileInfo,
97
- },
98
- };
99
- }
100
- catch (error) {
101
- return {
102
- content: [
103
- { type: "text", text: `Error getting file info: ${error.message}` },
104
- ],
105
- isError: true,
106
- };
107
- }
108
- }
109
- /**
110
- * Searches for files matching a pattern
111
- */
112
- export async function searchForFiles(rootPath, pattern, excludePatterns = [], allowedDirectories) {
113
- try {
114
- const normalizedPath = await validatePath(rootPath, allowedDirectories);
115
- const files = await searchFiles(normalizedPath, pattern, excludePatterns);
116
- return {
117
- content: [
118
- {
119
- type: "text",
120
- text: `Found ${files.length} files matching pattern "${pattern}"`,
121
- },
122
- ],
123
- metadata: {
124
- rootPath,
125
- pattern,
126
- excludePatterns,
127
- files,
128
- },
129
- };
130
- }
131
- catch (error) {
132
- return {
133
- content: [
134
- { type: "text", text: `Error searching files: ${error.message}` },
135
- ],
136
- isError: true,
137
- };
138
- }
139
- }
140
- /**
141
- * Applies edits to a file
142
- */
143
- export async function editFile(filePath, edits, allowedDirectories) {
144
- try {
145
- const normalizedPath = await validatePath(filePath, allowedDirectories);
146
- const diff = await applyFileEdits(normalizedPath, edits, false);
147
- return {
148
- content: [{ type: "text", text: "File edited successfully" }],
149
- metadata: {
150
- path: filePath,
151
- diff,
152
- },
153
- };
154
- }
155
- catch (error) {
156
- return {
157
- content: [{ type: "text", text: `Error editing file: ${error.message}` }],
158
- isError: true,
159
- };
160
- }
161
- }
162
- /**
163
- * Gets the directory structure as a tree
164
- */
165
- export async function getDirectoryTree(dirPath, allowedDirectories) {
166
- try {
167
- const normalizedPath = await validatePath(dirPath, allowedDirectories);
168
- async function buildTree(currentPath) {
169
- const entries = await fs.readdir(currentPath, { withFileTypes: true });
170
- const result = [];
171
- for (const entry of entries) {
172
- const entryPath = path.join(currentPath, entry.name);
173
- if (entry.isDirectory()) {
174
- const children = await buildTree(entryPath);
175
- result.push({
176
- name: entry.name,
177
- path: entryPath,
178
- type: "directory",
179
- children,
180
- });
181
- }
182
- else {
183
- result.push({
184
- name: entry.name,
185
- path: entryPath,
186
- type: "file",
187
- });
188
- }
189
- }
190
- // Sort entries: directories first, then files, both alphabetically
191
- result.sort((a, b) => {
192
- if (a.type !== b.type) {
193
- return a.type === "directory" ? -1 : 1;
194
- }
195
- return a.name.localeCompare(b.name);
196
- });
197
- return result;
198
- }
199
- const tree = await buildTree(normalizedPath);
200
- return {
201
- content: [
202
- { type: "text", text: "Directory tree retrieved successfully" },
203
- ],
204
- metadata: {
205
- path: dirPath,
206
- tree,
207
- },
208
- };
209
- }
210
- catch (error) {
211
- return {
212
- content: [
213
- {
214
- type: "text",
215
- text: `Error getting directory tree: ${error.message}`,
216
- },
217
- ],
218
- isError: true,
219
- };
220
- }
221
- }
222
- //# sourceMappingURL=file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/handlers/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAI7E;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,QAAgB,EAChB,kBAA4B;IAE5B,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAA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AAI,EAAE,SAAS;wBACf,IAAI,EAAE,WAAW;wBACjB,QAAQ;qBACT,CAAC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,CAAC;wBACV,IAAI,EAAE,KAAK,CAAC,IAAI;wBAChB,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,MAAM;qBACb,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,mEAAmE;YACnE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACnB,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;oBACtB,OAAO,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzC,CAAC;gBACD,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;YAEH,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,cAAc,CAAC,CAAC;QAE7C,OAAO;YACL,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,uCAAuC,EAAE;aAChE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,IAAI;aACL;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,iCAAiC,KAAK,CAAC,OAAO,EAAE;iBACvD;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./docs.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,cAAc,WAAW,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./tools.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,cAAc,YAAY,CAAC"}
@@ -1,164 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ToolInputSchema: z.ZodObject<{
3
- path: z.ZodOptional<z.ZodString>;
4
- }, "strip", z.ZodTypeAny, {
5
- path?: string | undefined;
6
- }, {
7
- path?: string | undefined;
8
- }>;
9
- export declare const ReadDocumentSchema: z.ZodObject<z.objectUtil.extendShape<{
10
- path: z.ZodOptional<z.ZodString>;
11
- }, {
12
- path: z.ZodString;
13
- }>, "strip", z.ZodTypeAny, {
14
- path: string;
15
- }, {
16
- path: string;
17
- }>;
18
- export declare const ListDocumentsSchema: z.ZodObject<z.objectUtil.extendShape<{
19
- path: z.ZodOptional<z.ZodString>;
20
- }, {
21
- basePath: z.ZodOptional<z.ZodString>;
22
- }>, "strip", z.ZodTypeAny, {
23
- path?: string | undefined;
24
- basePath?: string | undefined;
25
- }, {
26
- path?: string | undefined;
27
- basePath?: string | undefined;
28
- }>;
29
- export declare const GetStructureSchema: z.ZodObject<z.objectUtil.extendShape<{
30
- path: z.ZodOptional<z.ZodString>;
31
- }, {
32
- basePath: z.ZodOptional<z.ZodString>;
33
- }>, "strip", z.ZodTypeAny, {
34
- path?: string | undefined;
35
- basePath?: string | undefined;
36
- }, {
37
- path?: string | undefined;
38
- basePath?: string | undefined;
39
- }>;
40
- export declare const GetNavigationSchema: z.ZodObject<z.objectUtil.extendShape<{
41
- path: z.ZodOptional<z.ZodString>;
42
- }, {
43
- basePath: z.ZodOptional<z.ZodString>;
44
- }>, "strip", z.ZodTypeAny, {
45
- path?: string | undefined;
46
- basePath?: string | undefined;
47
- }, {
48
- path?: string | undefined;
49
- basePath?: string | undefined;
50
- }>;
51
- export declare const GetDocsKnowledgeBaseSchema: z.ZodObject<z.objectUtil.extendShape<{
52
- path: z.ZodOptional<z.ZodString>;
53
- }, {
54
- basePath: z.ZodOptional<z.ZodString>;
55
- includeSummaries: z.ZodOptional<z.ZodBoolean>;
56
- maxSummaryLength: z.ZodOptional<z.ZodNumber>;
57
- }>, "strip", z.ZodTypeAny, {
58
- path?: string | undefined;
59
- basePath?: string | undefined;
60
- includeSummaries?: boolean | undefined;
61
- maxSummaryLength?: number | undefined;
62
- }, {
63
- path?: string | undefined;
64
- basePath?: string | undefined;
65
- includeSummaries?: boolean | undefined;
66
- maxSummaryLength?: number | undefined;
67
- }>;
68
- export declare const WriteDocumentSchema: z.ZodObject<z.objectUtil.extendShape<{
69
- path: z.ZodOptional<z.ZodString>;
70
- }, {
71
- path: z.ZodString;
72
- content: z.ZodString;
73
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
74
- }>, "strip", z.ZodTypeAny, {
75
- content: string;
76
- path: string;
77
- metadata?: Record<string, any> | undefined;
78
- }, {
79
- content: string;
80
- path: string;
81
- metadata?: Record<string, any> | undefined;
82
- }>;
83
- export declare const EditDocumentSchema: z.ZodObject<z.objectUtil.extendShape<{
84
- path: z.ZodOptional<z.ZodString>;
85
- }, {
86
- path: z.ZodString;
87
- edits: z.ZodArray<z.ZodObject<{
88
- oldText: z.ZodString;
89
- newText: z.ZodString;
90
- }, "strip", z.ZodTypeAny, {
91
- oldText: string;
92
- newText: string;
93
- }, {
94
- oldText: string;
95
- newText: string;
96
- }>, "many">;
97
- }>, "strip", z.ZodTypeAny, {
98
- path: string;
99
- edits: {
100
- oldText: string;
101
- newText: string;
102
- }[];
103
- }, {
104
- path: string;
105
- edits: {
106
- oldText: string;
107
- newText: string;
108
- }[];
109
- }>;
110
- export declare const DeleteDocumentSchema: z.ZodObject<z.objectUtil.extendShape<{
111
- path: z.ZodOptional<z.ZodString>;
112
- }, {
113
- path: z.ZodString;
114
- }>, "strip", z.ZodTypeAny, {
115
- path: string;
116
- }, {
117
- path: string;
118
- }>;
119
- export declare const SearchDocumentsSchema: z.ZodObject<z.objectUtil.extendShape<{
120
- path: z.ZodOptional<z.ZodString>;
121
- }, {
122
- basePath: z.ZodOptional<z.ZodString>;
123
- query: z.ZodOptional<z.ZodString>;
124
- excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
125
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
126
- status: z.ZodOptional<z.ZodString>;
127
- }>, "strip", z.ZodTypeAny, {
128
- tags?: string[] | undefined;
129
- status?: string | undefined;
130
- path?: string | undefined;
131
- basePath?: string | undefined;
132
- query?: string | undefined;
133
- excludePatterns?: string[] | undefined;
134
- }, {
135
- tags?: string[] | undefined;
136
- status?: string | undefined;
137
- path?: string | undefined;
138
- basePath?: string | undefined;
139
- query?: string | undefined;
140
- excludePatterns?: string[] | undefined;
141
- }>;
142
- export declare const CheckDocumentationHealthSchema: z.ZodObject<z.objectUtil.extendShape<{
143
- path: z.ZodOptional<z.ZodString>;
144
- }, {
145
- basePath: z.ZodOptional<z.ZodString>;
146
- checkLinks: z.ZodOptional<z.ZodBoolean>;
147
- checkMetadata: z.ZodOptional<z.ZodBoolean>;
148
- checkOrphans: z.ZodOptional<z.ZodBoolean>;
149
- requiredMetadataFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
150
- }>, "strip", z.ZodTypeAny, {
151
- path?: string | undefined;
152
- basePath?: string | undefined;
153
- checkLinks?: boolean | undefined;
154
- checkMetadata?: boolean | undefined;
155
- checkOrphans?: boolean | undefined;
156
- requiredMetadataFields?: string[] | undefined;
157
- }, {
158
- path?: string | undefined;
159
- basePath?: string | undefined;
160
- checkLinks?: boolean | undefined;
161
- checkMetadata?: boolean | undefined;
162
- checkOrphans?: boolean | undefined;
163
- requiredMetadataFields?: string[] | undefined;
164
- }>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/schemas/tools.ts"],"names":[],"mappings":"AAAA,OAAO,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;IACpC,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Metadata for documentation files
3
- */
4
- export interface DocumentMetadata {
5
- title?: string;
6
- order?: number;
7
- description?: string;
8
- author?: string;
9
- date?: Date;
10
- tags?: string[];
11
- status?: string;
12
- [key: string]: any;
13
- }
14
- /**
15
- * Entry for a documentation file
16
- */
17
- export interface DocumentEntry {
18
- path: string;
19
- name: string;
20
- metadata: DocumentMetadata;
21
- }
22
- /**
23
- * Tree entry for documentation structure
24
- */
25
- export interface TreeEntry {
26
- name: string;
27
- path: string;
28
- type: string;
29
- metadata?: DocumentMetadata;
30
- children: TreeEntry[];
31
- error?: string;
32
- }
33
- /**
34
- * Navigation item for documentation
35
- */
36
- export interface NavigationItem {
37
- title: string;
38
- path: string | null;
39
- order: number;
40
- items?: NavigationItem[];
41
- }
42
- /**
43
- * Navigation section for documentation
44
- */
45
- export interface NavigationSection {
46
- title: string;
47
- path: string | null;
48
- items: NavigationItem[];
49
- order: number;
50
- }
51
- /**
52
- * Health issue for documentation
53
- */
54
- export interface HealthIssue {
55
- path: string;
56
- type: "missing_metadata" | "broken_link" | "orphaned" | "missing_reference";
57
- severity: "error" | "warning" | "info";
58
- message: string;
59
- details?: any;
60
- }
61
- /**
62
- * Health check result for documentation
63
- */
64
- export interface HealthCheckResult {
65
- score: number;
66
- totalDocuments: number;
67
- issues: HealthIssue[];
68
- metadataCompleteness: number;
69
- brokenLinks: number;
70
- orphanedDocuments: number;
71
- missingReferences: number;
72
- documentsByStatus?: Record<string, number>;
73
- documentsByTag?: Record<string, number>;
74
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/types/docs.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- /**
2
- * File information structure
3
- */
4
- export interface FileInfo {
5
- size: number;
6
- created: Date;
7
- modified: Date;
8
- accessed: Date;
9
- isDirectory: boolean;
10
- isFile: boolean;
11
- permissions: string;
12
- }
13
- /**
14
- * Tree entry for directory structure
15
- */
16
- export interface FileTreeEntry {
17
- name: string;
18
- path: string;
19
- type: "file" | "directory";
20
- children?: FileTreeEntry[];
21
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/types/file.ts"],"names":[],"mappings":""}
@@ -1,44 +0,0 @@
1
- export interface DocumentMetadata {
2
- title?: string;
3
- order?: number;
4
- description?: string;
5
- author?: string;
6
- date?: Date;
7
- tags?: string[];
8
- status?: string;
9
- [key: string]: any;
10
- }
11
- export interface DocumentEntry {
12
- path: string;
13
- name: string;
14
- metadata: DocumentMetadata;
15
- }
16
- export interface TreeEntry {
17
- name: string;
18
- path: string;
19
- type: string;
20
- metadata?: DocumentMetadata;
21
- children: TreeEntry[];
22
- error?: string;
23
- }
24
- export interface NavigationItem {
25
- title: string;
26
- path: string | null;
27
- order: number;
28
- }
29
- export interface NavigationSection {
30
- title: string;
31
- path: string | null;
32
- items: NavigationItem[];
33
- order: number;
34
- }
35
- export type ToolResponse = {
36
- content: Array<{
37
- type: string;
38
- text: string;
39
- }>;
40
- metadata?: Record<string, any>;
41
- isError?: boolean;
42
- };
43
- export * from "./docs.js";
44
- export * from "./tools.js";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAiDA,+CAA+C;AAC/C,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Standard response format for tools
3
- */
4
- export type ToolResponse = {
5
- content: Array<{
6
- type: string;
7
- text: string;
8
- }>;
9
- metadata?: Record<string, any>;
10
- isError?: boolean;
11
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { FileInfo } from "../types/file.js";
2
- /**
3
- * Gets file statistics and information
4
- */
5
- export declare function getFileStats(filePath: string): Promise<FileInfo>;
6
- /**
7
- * Searches for files matching a pattern
8
- */
9
- export declare function searchFiles(rootPath: string, pattern: string, excludePatterns?: string[]): Promise<string[]>;
10
- /**
11
- * Normalizes line endings to LF
12
- */
13
- export declare function normalizeLineEndings(text: string): string;
14
- /**
15
- * Creates a unified diff between two text contents
16
- */
17
- export declare function createUnifiedDiff(originalContent: string, newContent: string, filepath?: string): string;
18
- /**
19
- * Applies edits to a file
20
- */
21
- export declare function applyFileEdits(filePath: string, edits: Array<{
22
- oldText: string;
23
- newText: string;
24
- }>, dryRun?: boolean): Promise<string>;