@mcptoolshop/file-forge 0.1.0 → 0.2.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/README.md +168 -54
- package/package.json +1 -1
- package/build/config/index.d.ts +0 -29
- package/build/config/index.d.ts.map +0 -1
- package/build/config/index.js +0 -229
- package/build/config/index.js.map +0 -1
- package/build/index.d.ts +0 -9
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -23
- package/build/index.js.map +0 -1
- package/build/security/index.d.ts +0 -8
- package/build/security/index.d.ts.map +0 -1
- package/build/security/index.js +0 -8
- package/build/security/index.js.map +0 -1
- package/build/security/read-only.d.ts +0 -32
- package/build/security/read-only.d.ts.map +0 -1
- package/build/security/read-only.js +0 -62
- package/build/security/read-only.js.map +0 -1
- package/build/security/sandbox.d.ts +0 -60
- package/build/security/sandbox.d.ts.map +0 -1
- package/build/security/sandbox.js +0 -231
- package/build/security/sandbox.js.map +0 -1
- package/build/server.d.ts +0 -20
- package/build/server.d.ts.map +0 -1
- package/build/server.js +0 -63
- package/build/server.js.map +0 -1
- package/build/tools/metadata.d.ts +0 -11
- package/build/tools/metadata.d.ts.map +0 -1
- package/build/tools/metadata.js +0 -423
- package/build/tools/metadata.js.map +0 -1
- package/build/tools/read.d.ts +0 -11
- package/build/tools/read.d.ts.map +0 -1
- package/build/tools/read.js +0 -335
- package/build/tools/read.js.map +0 -1
- package/build/tools/scaffold.d.ts +0 -11
- package/build/tools/scaffold.d.ts.map +0 -1
- package/build/tools/scaffold.js +0 -345
- package/build/tools/scaffold.js.map +0 -1
- package/build/tools/search.d.ts +0 -11
- package/build/tools/search.d.ts.map +0 -1
- package/build/tools/search.js +0 -250
- package/build/tools/search.js.map +0 -1
- package/build/tools/write.d.ts +0 -11
- package/build/tools/write.d.ts.map +0 -1
- package/build/tools/write.js +0 -538
- package/build/tools/write.js.map +0 -1
- package/build/types.d.ts +0 -402
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -146
- package/build/types.js.map +0 -1
- package/build/utils/errors.d.ts +0 -43
- package/build/utils/errors.d.ts.map +0 -1
- package/build/utils/errors.js +0 -125
- package/build/utils/errors.js.map +0 -1
- package/build/utils/index.d.ts +0 -10
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -9
- package/build/utils/index.js.map +0 -1
- package/build/utils/logger.d.ts +0 -88
- package/build/utils/logger.d.ts.map +0 -1
- package/build/utils/logger.js +0 -166
- package/build/utils/logger.js.map +0 -1
- package/build/utils/validation.d.ts +0 -43
- package/build/utils/validation.d.ts.map +0 -1
- package/build/utils/validation.js +0 -196
- package/build/utils/validation.js.map +0 -1
package/build/tools/metadata.js
DELETED
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP File Forge - File Metadata Tools
|
|
3
|
-
*
|
|
4
|
-
* Tools for getting file statistics and checking existence.
|
|
5
|
-
*/
|
|
6
|
-
import * as fs from 'node:fs/promises';
|
|
7
|
-
import * as path from 'node:path';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { FileStatInputSchema, FileExistsInputSchema } from '../types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Format bytes into human-readable size.
|
|
12
|
-
*/
|
|
13
|
-
function formatBytes(bytes) {
|
|
14
|
-
if (bytes === 0)
|
|
15
|
-
return '0 Bytes';
|
|
16
|
-
const k = 1024;
|
|
17
|
-
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
|
18
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
19
|
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get file or directory statistics.
|
|
23
|
-
*/
|
|
24
|
-
async function fileStatImpl(input) {
|
|
25
|
-
try {
|
|
26
|
-
const absolutePath = path.resolve(input.path);
|
|
27
|
-
const stats = await fs.stat(absolutePath);
|
|
28
|
-
const lstat = await fs.lstat(absolutePath);
|
|
29
|
-
const result = {
|
|
30
|
-
path: absolutePath,
|
|
31
|
-
name: path.basename(absolutePath),
|
|
32
|
-
size: stats.size,
|
|
33
|
-
isFile: stats.isFile(),
|
|
34
|
-
isDirectory: stats.isDirectory(),
|
|
35
|
-
isSymlink: lstat.isSymbolicLink(),
|
|
36
|
-
created: stats.birthtime.toISOString(),
|
|
37
|
-
modified: stats.mtime.toISOString(),
|
|
38
|
-
accessed: stats.atime.toISOString(),
|
|
39
|
-
};
|
|
40
|
-
// Add formatted size for convenience
|
|
41
|
-
const formattedResult = {
|
|
42
|
-
...result,
|
|
43
|
-
sizeFormatted: formatBytes(stats.size),
|
|
44
|
-
};
|
|
45
|
-
return {
|
|
46
|
-
content: [
|
|
47
|
-
{
|
|
48
|
-
type: 'text',
|
|
49
|
-
text: JSON.stringify(formattedResult, null, 2),
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
const err = error;
|
|
56
|
-
if (err.code === 'ENOENT') {
|
|
57
|
-
return {
|
|
58
|
-
isError: true,
|
|
59
|
-
content: [
|
|
60
|
-
{
|
|
61
|
-
type: 'text',
|
|
62
|
-
text: JSON.stringify({
|
|
63
|
-
code: 'FILE_NOT_FOUND',
|
|
64
|
-
message: `Path not found: ${input.path}`,
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
if (err.code === 'EACCES') {
|
|
71
|
-
return {
|
|
72
|
-
isError: true,
|
|
73
|
-
content: [
|
|
74
|
-
{
|
|
75
|
-
type: 'text',
|
|
76
|
-
text: JSON.stringify({
|
|
77
|
-
code: 'PERMISSION_DENIED',
|
|
78
|
-
message: `Permission denied: ${input.path}`,
|
|
79
|
-
}),
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
isError: true,
|
|
86
|
-
content: [
|
|
87
|
-
{
|
|
88
|
-
type: 'text',
|
|
89
|
-
text: JSON.stringify({
|
|
90
|
-
code: 'UNKNOWN_ERROR',
|
|
91
|
-
message: `Error getting stats: ${err.message}`,
|
|
92
|
-
}),
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Check if a file or directory exists.
|
|
100
|
-
*/
|
|
101
|
-
async function fileExistsImpl(input) {
|
|
102
|
-
try {
|
|
103
|
-
const absolutePath = path.resolve(input.path);
|
|
104
|
-
try {
|
|
105
|
-
const stats = await fs.stat(absolutePath);
|
|
106
|
-
// Check type if specified
|
|
107
|
-
if (input.type === 'file' && !stats.isFile()) {
|
|
108
|
-
return {
|
|
109
|
-
content: [
|
|
110
|
-
{
|
|
111
|
-
type: 'text',
|
|
112
|
-
text: JSON.stringify({
|
|
113
|
-
exists: false,
|
|
114
|
-
path: absolutePath,
|
|
115
|
-
reason: 'Path exists but is not a file',
|
|
116
|
-
actualType: stats.isDirectory() ? 'directory' : 'other',
|
|
117
|
-
}),
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
if (input.type === 'directory' && !stats.isDirectory()) {
|
|
123
|
-
return {
|
|
124
|
-
content: [
|
|
125
|
-
{
|
|
126
|
-
type: 'text',
|
|
127
|
-
text: JSON.stringify({
|
|
128
|
-
exists: false,
|
|
129
|
-
path: absolutePath,
|
|
130
|
-
reason: 'Path exists but is not a directory',
|
|
131
|
-
actualType: stats.isFile() ? 'file' : 'other',
|
|
132
|
-
}),
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
return {
|
|
138
|
-
content: [
|
|
139
|
-
{
|
|
140
|
-
type: 'text',
|
|
141
|
-
text: JSON.stringify({
|
|
142
|
-
exists: true,
|
|
143
|
-
path: absolutePath,
|
|
144
|
-
isFile: stats.isFile(),
|
|
145
|
-
isDirectory: stats.isDirectory(),
|
|
146
|
-
}),
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
catch {
|
|
152
|
-
return {
|
|
153
|
-
content: [
|
|
154
|
-
{
|
|
155
|
-
type: 'text',
|
|
156
|
-
text: JSON.stringify({
|
|
157
|
-
exists: false,
|
|
158
|
-
path: absolutePath,
|
|
159
|
-
}),
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
const err = error;
|
|
167
|
-
return {
|
|
168
|
-
isError: true,
|
|
169
|
-
content: [
|
|
170
|
-
{
|
|
171
|
-
type: 'text',
|
|
172
|
-
text: JSON.stringify({
|
|
173
|
-
code: 'UNKNOWN_ERROR',
|
|
174
|
-
message: `Error checking existence: ${err.message}`,
|
|
175
|
-
}),
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Get disk usage for a directory.
|
|
183
|
-
*/
|
|
184
|
-
async function getDiskUsageImpl(input) {
|
|
185
|
-
try {
|
|
186
|
-
const absolutePath = path.resolve(input.path);
|
|
187
|
-
const maxDepth = input.max_depth ?? 1;
|
|
188
|
-
const stats = await fs.stat(absolutePath);
|
|
189
|
-
if (!stats.isDirectory()) {
|
|
190
|
-
return {
|
|
191
|
-
content: [
|
|
192
|
-
{
|
|
193
|
-
type: 'text',
|
|
194
|
-
text: JSON.stringify({
|
|
195
|
-
path: absolutePath,
|
|
196
|
-
size: stats.size,
|
|
197
|
-
sizeFormatted: formatBytes(stats.size),
|
|
198
|
-
isFile: true,
|
|
199
|
-
}),
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
// Calculate directory size
|
|
205
|
-
const usage = await calculateDirSize(absolutePath, 0, maxDepth);
|
|
206
|
-
return {
|
|
207
|
-
content: [
|
|
208
|
-
{
|
|
209
|
-
type: 'text',
|
|
210
|
-
text: JSON.stringify({
|
|
211
|
-
path: absolutePath,
|
|
212
|
-
totalSize: usage.totalSize,
|
|
213
|
-
totalSizeFormatted: formatBytes(usage.totalSize),
|
|
214
|
-
fileCount: usage.fileCount,
|
|
215
|
-
directoryCount: usage.directoryCount,
|
|
216
|
-
breakdown: usage.breakdown,
|
|
217
|
-
}, null, 2),
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
catch (error) {
|
|
223
|
-
const err = error;
|
|
224
|
-
if (err.code === 'ENOENT') {
|
|
225
|
-
return {
|
|
226
|
-
isError: true,
|
|
227
|
-
content: [
|
|
228
|
-
{
|
|
229
|
-
type: 'text',
|
|
230
|
-
text: JSON.stringify({
|
|
231
|
-
code: 'FILE_NOT_FOUND',
|
|
232
|
-
message: `Path not found: ${input.path}`,
|
|
233
|
-
}),
|
|
234
|
-
},
|
|
235
|
-
],
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
return {
|
|
239
|
-
isError: true,
|
|
240
|
-
content: [
|
|
241
|
-
{
|
|
242
|
-
type: 'text',
|
|
243
|
-
text: JSON.stringify({
|
|
244
|
-
code: 'UNKNOWN_ERROR',
|
|
245
|
-
message: `Error calculating disk usage: ${err.message}`,
|
|
246
|
-
}),
|
|
247
|
-
},
|
|
248
|
-
],
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Recursively calculate directory size.
|
|
254
|
-
*/
|
|
255
|
-
async function calculateDirSize(dirPath, currentDepth, maxDepth) {
|
|
256
|
-
let totalSize = 0;
|
|
257
|
-
let fileCount = 0;
|
|
258
|
-
let directoryCount = 0;
|
|
259
|
-
const breakdown = [];
|
|
260
|
-
try {
|
|
261
|
-
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
262
|
-
for (const entry of entries) {
|
|
263
|
-
const entryPath = path.join(dirPath, entry.name);
|
|
264
|
-
try {
|
|
265
|
-
if (entry.isFile()) {
|
|
266
|
-
const stats = await fs.stat(entryPath);
|
|
267
|
-
totalSize += stats.size;
|
|
268
|
-
fileCount++;
|
|
269
|
-
if (currentDepth < maxDepth) {
|
|
270
|
-
breakdown.push({
|
|
271
|
-
name: entry.name,
|
|
272
|
-
size: stats.size,
|
|
273
|
-
sizeFormatted: formatBytes(stats.size),
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
else if (entry.isDirectory()) {
|
|
278
|
-
directoryCount++;
|
|
279
|
-
const subResult = await calculateDirSize(entryPath, currentDepth + 1, maxDepth);
|
|
280
|
-
totalSize += subResult.totalSize;
|
|
281
|
-
fileCount += subResult.fileCount;
|
|
282
|
-
directoryCount += subResult.directoryCount;
|
|
283
|
-
if (currentDepth < maxDepth) {
|
|
284
|
-
breakdown.push({
|
|
285
|
-
name: entry.name + '/',
|
|
286
|
-
size: subResult.totalSize,
|
|
287
|
-
sizeFormatted: formatBytes(subResult.totalSize),
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
catch {
|
|
293
|
-
// Skip entries we can't access
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
catch {
|
|
298
|
-
// Ignore permission errors on directories
|
|
299
|
-
}
|
|
300
|
-
// Sort breakdown by size descending
|
|
301
|
-
breakdown.sort((a, b) => b.size - a.size);
|
|
302
|
-
return { totalSize, fileCount, directoryCount, breakdown };
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Compare two files or directories.
|
|
306
|
-
*/
|
|
307
|
-
async function compareFilesImpl(input) {
|
|
308
|
-
try {
|
|
309
|
-
const path1 = path.resolve(input.path1);
|
|
310
|
-
const path2 = path.resolve(input.path2);
|
|
311
|
-
const [stats1, stats2] = await Promise.all([
|
|
312
|
-
fs.stat(path1).catch(() => null),
|
|
313
|
-
fs.stat(path2).catch(() => null),
|
|
314
|
-
]);
|
|
315
|
-
if (!stats1) {
|
|
316
|
-
return {
|
|
317
|
-
isError: true,
|
|
318
|
-
content: [
|
|
319
|
-
{
|
|
320
|
-
type: 'text',
|
|
321
|
-
text: JSON.stringify({
|
|
322
|
-
code: 'FILE_NOT_FOUND',
|
|
323
|
-
message: `First path not found: ${input.path1}`,
|
|
324
|
-
}),
|
|
325
|
-
},
|
|
326
|
-
],
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
if (!stats2) {
|
|
330
|
-
return {
|
|
331
|
-
isError: true,
|
|
332
|
-
content: [
|
|
333
|
-
{
|
|
334
|
-
type: 'text',
|
|
335
|
-
text: JSON.stringify({
|
|
336
|
-
code: 'FILE_NOT_FOUND',
|
|
337
|
-
message: `Second path not found: ${input.path2}`,
|
|
338
|
-
}),
|
|
339
|
-
},
|
|
340
|
-
],
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
const comparison = {
|
|
344
|
-
path1,
|
|
345
|
-
path2,
|
|
346
|
-
sameType: stats1.isFile() === stats2.isFile(),
|
|
347
|
-
sameSize: stats1.size === stats2.size,
|
|
348
|
-
file1: {
|
|
349
|
-
isFile: stats1.isFile(),
|
|
350
|
-
size: stats1.size,
|
|
351
|
-
sizeFormatted: formatBytes(stats1.size),
|
|
352
|
-
modified: stats1.mtime.toISOString(),
|
|
353
|
-
},
|
|
354
|
-
file2: {
|
|
355
|
-
isFile: stats2.isFile(),
|
|
356
|
-
size: stats2.size,
|
|
357
|
-
sizeFormatted: formatBytes(stats2.size),
|
|
358
|
-
modified: stats2.mtime.toISOString(),
|
|
359
|
-
},
|
|
360
|
-
newerFile: stats1.mtime > stats2.mtime ? 'path1' : 'path2',
|
|
361
|
-
sizeDifference: stats1.size - stats2.size,
|
|
362
|
-
sizeDifferenceFormatted: formatBytes(Math.abs(stats1.size - stats2.size)),
|
|
363
|
-
};
|
|
364
|
-
return {
|
|
365
|
-
content: [
|
|
366
|
-
{
|
|
367
|
-
type: 'text',
|
|
368
|
-
text: JSON.stringify(comparison, null, 2),
|
|
369
|
-
},
|
|
370
|
-
],
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
catch (error) {
|
|
374
|
-
const err = error;
|
|
375
|
-
return {
|
|
376
|
-
isError: true,
|
|
377
|
-
content: [
|
|
378
|
-
{
|
|
379
|
-
type: 'text',
|
|
380
|
-
text: JSON.stringify({
|
|
381
|
-
code: 'UNKNOWN_ERROR',
|
|
382
|
-
message: `Error comparing files: ${err.message}`,
|
|
383
|
-
}),
|
|
384
|
-
},
|
|
385
|
-
],
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Register file metadata tools with the MCP server.
|
|
391
|
-
*/
|
|
392
|
-
export function registerMetadataTools(server) {
|
|
393
|
-
// file_stat tool
|
|
394
|
-
server.tool('file_stat', 'Get file or directory statistics', {
|
|
395
|
-
path: z.string().describe('Path to file or directory'),
|
|
396
|
-
}, async (args) => {
|
|
397
|
-
const input = FileStatInputSchema.parse(args);
|
|
398
|
-
return await fileStatImpl(input);
|
|
399
|
-
});
|
|
400
|
-
// file_exists tool
|
|
401
|
-
server.tool('file_exists', 'Check if a file or directory exists', {
|
|
402
|
-
path: z.string().describe('Path to check'),
|
|
403
|
-
type: z.enum(['file', 'directory', 'any']).optional().describe('Type to check for'),
|
|
404
|
-
}, async (args) => {
|
|
405
|
-
const input = FileExistsInputSchema.parse(args);
|
|
406
|
-
return await fileExistsImpl(input);
|
|
407
|
-
});
|
|
408
|
-
// get_disk_usage tool
|
|
409
|
-
server.tool('get_disk_usage', 'Get disk usage for a directory', {
|
|
410
|
-
path: z.string().describe('Path to directory'),
|
|
411
|
-
max_depth: z.number().optional().describe('Max depth for breakdown'),
|
|
412
|
-
}, async (args) => {
|
|
413
|
-
return await getDiskUsageImpl(args);
|
|
414
|
-
});
|
|
415
|
-
// compare_files tool
|
|
416
|
-
server.tool('compare_files', 'Compare two files or directories', {
|
|
417
|
-
path1: z.string().describe('First path'),
|
|
418
|
-
path2: z.string().describe('Second path'),
|
|
419
|
-
}, async (args) => {
|
|
420
|
-
return await compareFilesImpl(args);
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
//# sourceMappingURL=metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/tools/metadata.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzE;;GAEG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAElC,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,YAAY,CAAC,KAAoB;IAC9C,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CA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C,CACF,CAAC;IAEF,qBAAqB;IACrB,MAAM,CAAC,IAAI,CACT,eAAe,EACf,kCAAkC,EAClC;QACE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;KAC1C,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,OAAO,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/build/tools/read.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP File Forge - File Reading Tools
|
|
3
|
-
*
|
|
4
|
-
* Tools for reading files and directories.
|
|
5
|
-
*/
|
|
6
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
-
/**
|
|
8
|
-
* Register file reading tools with the MCP server.
|
|
9
|
-
*/
|
|
10
|
-
export declare function registerReadTools(server: McpServer): void;
|
|
11
|
-
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuVpE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgDzD"}
|