@perstack/base 0.0.21 → 0.0.22
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 +61 -0
- package/dist/bin/server.d.ts +1 -0
- package/dist/bin/server.js +53 -0
- package/dist/bin/server.js.map +1 -0
- package/dist/chunk-CDWG4Z4N.js +1125 -0
- package/dist/chunk-CDWG4Z4N.js.map +1 -0
- package/dist/src/index.d.ts +72 -277
- package/dist/src/index.js +1 -1003
- package/dist/src/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/path.ts","../src/lib/tool-result.ts","../src/tools/append-text-file.ts","../src/tools/attempt-completion.ts","../src/tools/create-directory.ts","../src/tools/delete-directory.ts","../src/tools/delete-file.ts","../src/tools/edit-text-file.ts","../src/tools/exec.ts","../src/tools/get-file-info.ts","../src/tools/list-directory.ts","../src/tools/move-file.ts","../src/tools/read-image-file.ts","../src/tools/read-pdf-file.ts","../src/tools/read-text-file.ts","../src/tools/think.ts","../src/tools/todo.ts","../src/tools/write-text-file.ts"],"names":["path","inputSchema","z","dedent","existsSync","statSync","dirname","mkdir","mime","stat","readFile","todo","writeFile"],"mappings":";;;;;;;;;;;AAKO,IAAM,gBAAgB,YAAA,CAAa,UAAA,CAAW,OAAA,CAAQ,GAAA,EAAK,CAAC,CAAA;AAEnE,SAAS,WAAW,QAAA,EAA0B;AAC5C,EAAA,IAAI,QAAA,CAAS,UAAA,CAAW,IAAI,CAAA,IAAK,aAAa,GAAA,EAAK;AACjD,IAAA,OAAO,IAAA,CAAK,KAAK,EAAA,CAAG,OAAA,IAAW,QAAA,CAAS,KAAA,CAAM,CAAC,CAAC,CAAA;AAAA,EAClD;AACA,EAAA,OAAO,QAAA;AACT;AAEA,eAAsB,aAAa,aAAA,EAAwC;AACzE,EAAA,MAAM,YAAA,GAAe,WAAW,aAAa,CAAA;AAC7C,EAAA,MAAM,QAAA,GAAW,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A;AAAA;AAAA;AAAA;AAAA,MAAA,CAAA;AAAA,MAmBb,aAAaF,aAAAA,CAAY;AAAA,KAC3B;AAAA,IACA,OAAO,KAAA,KAAuB;AAC5B,MAAA,IAAI;AACF,QAAA,OAAO,iBAAA,CAAkB,MAAM,aAAA,CAAc,KAAK,CAAC,CAAA;AAAA,MACrD,SAAS,CAAA,EAAG;AACV,QAAA,IAAI,CAAA,YAAa,KAAA,EAAO,OAAO,eAAA,CAAgB,CAAC,CAAA;AAChD,QAAA,MAAM,CAAA;AAAA,MACR;AAAA,IACF;AAAA,GACF;AACF","file":"chunk-CDWG4Z4N.js","sourcesContent":["import { realpathSync } from \"node:fs\"\nimport fs from \"node:fs/promises\"\nimport os from \"node:os\"\nimport path from \"node:path\"\n\nexport const workspacePath = realpathSync(expandHome(process.cwd()))\n\nfunction expandHome(filepath: string): string {\n if (filepath.startsWith(\"~/\") || filepath === \"~\") {\n return path.join(os.homedir(), filepath.slice(1))\n }\n return filepath\n}\n\nexport async function validatePath(requestedPath: string): Promise<string> {\n const expandedPath = expandHome(requestedPath)\n const absolute = path.isAbsolute(expandedPath)\n ? path.resolve(expandedPath)\n : path.resolve(process.cwd(), expandedPath)\n if (absolute === `${workspacePath}/perstack`) {\n throw new Error(\"Access denied - perstack directory is not allowed\")\n }\n try {\n const realAbsolute = await fs.realpath(absolute)\n if (!realAbsolute.startsWith(workspacePath)) {\n throw new Error(\"Access denied - symlink target outside allowed directories\")\n }\n return realAbsolute\n } catch (error) {\n const parentDir = path.dirname(absolute)\n try {\n const realParentPath = await fs.realpath(parentDir)\n if (!realParentPath.startsWith(workspacePath)) {\n throw new Error(\"Access denied - parent directory outside allowed directories\")\n }\n return absolute\n } catch {\n if (!absolute.startsWith(workspacePath)) {\n throw new Error(\n `Access denied - path outside allowed directories: ${absolute} not in ${workspacePath}`,\n )\n }\n throw new Error(`Parent directory does not exist: ${parentDir}`)\n }\n }\n}\n","import type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\"\n\nexport function successToolResult(result: unknown): CallToolResult {\n return { content: [{ type: \"text\", text: JSON.stringify(result) }] }\n}\n\nexport function errorToolResult(e: Error): CallToolResult {\n return {\n content: [{ type: \"text\", text: JSON.stringify({ error: e.name, message: e.message }) }],\n }\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { appendFile } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string().describe(\"Target file path to append to.\"),\n text: z.string().min(1).max(2_000).describe(\"Text to append to the file. Max 2000 characters.\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function appendTextFile(input: InputSchema) {\n const { path, text } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`File ${path} does not exist.`)\n }\n const stats = statSync(validatedPath)\n if (!(stats.mode & 0o200)) {\n throw new Error(`File ${path} is not writable`)\n }\n await appendFile(validatedPath, text)\n return { path: validatedPath, text }\n}\n\nexport function registerAppendTextFile(server: McpServer) {\n server.registerTool(\n \"appendTextFile\",\n {\n title: \"Append text file\",\n description: dedent`\n Adding content to the end of existing files.\n\n Use cases:\n - Adding entries to log files\n - Appending data to CSV or JSON files\n - Adding new sections to documentation\n - Extending configuration files\n - Building files incrementally\n\n How it works:\n - Appends text to the end of an existing file\n - Does not modify existing content\n - Creates a new line before appending if needed\n - Returns the appended file path\n\n Rules:\n - FILE MUST EXIST BEFORE APPENDING\n - YOU MUST PROVIDE A VALID UTF-8 STRING FOR THE TEXT\n - THERE IS A LIMIT ON THE NUMBER OF TOKENS THAT CAN BE GENERATED, SO DO NOT APPEND ALL THE CONTENT AT ONCE\n - IF YOU WANT TO APPEND MORE THAN 2000 CHARACTERS, USE THIS TOOL MULTIPLE TIMES\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await appendTextFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function attemptCompletion(_input: InputSchema) {\n return {\n message: \"End the agent loop and provide a final report\",\n }\n}\n\nexport function registerAttemptCompletion(server: McpServer) {\n server.registerTool(\n \"attemptCompletion\",\n {\n title: \"Attempt completion\",\n description: dedent`\n Task completion signal that triggers immediate final report generation.\n Use cases:\n - Signaling task completion to Perstack runtime\n - Triggering final report generation\n - Ending the current expert's work cycle\n How it works:\n - Sends completion signal to Perstack runtime\n - Runtime immediately proceeds to final report generation\n - No confirmation or approval step required\n - No parameters needed for this signal\n Notes:\n - Triggers immediate transition to final report\n - Should only be used when task is fully complete\n - Cannot be reverted once called\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await attemptCompletion(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { mkdir } from \"node:fs/promises\"\nimport { dirname } from \"node:path\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function createDirectory(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n const exists = existsSync(validatedPath)\n if (exists) {\n throw new Error(`Directory ${path} already exists`)\n }\n const parentDir = dirname(validatedPath)\n if (existsSync(parentDir)) {\n const parentStats = statSync(parentDir)\n if (!(parentStats.mode & 0o200)) {\n throw new Error(`Parent directory ${parentDir} is not writable`)\n }\n }\n await mkdir(validatedPath, { recursive: true })\n return {\n path: validatedPath,\n }\n}\n\nexport function registerCreateDirectory(server: McpServer) {\n server.registerTool(\n \"createDirectory\",\n {\n title: \"Create directory\",\n description: dedent`\n Directory creator for establishing folder structures in the workspace.\n\n Use cases:\n - Setting up project directory structure\n - Creating output folders for generated content\n - Organizing files into logical groups\n - Preparing directory hierarchies\n\n How it works:\n - Creates directories recursively\n - Handles existing directories gracefully\n - Creates parent directories as needed\n - Returns creation status\n \n Parameters:\n - path: Directory path to create\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await createDirectory(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { rm, rmdir } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n recursive: z\n .boolean()\n .optional()\n .describe(\"Whether to delete contents recursively. Required for non-empty directories.\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function deleteDirectory(input: InputSchema) {\n const { path, recursive } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`Directory ${path} does not exist.`)\n }\n const stats = statSync(validatedPath)\n if (!stats.isDirectory()) {\n throw new Error(`Path ${path} is not a directory. Use deleteFile tool instead.`)\n }\n if (!(stats.mode & 0o200)) {\n throw new Error(`Directory ${path} is not writable`)\n }\n if (recursive) {\n await rm(validatedPath, { recursive: true })\n } else {\n await rmdir(validatedPath)\n }\n return {\n path: validatedPath,\n }\n}\n\nexport function registerDeleteDirectory(server: McpServer) {\n server.registerTool(\n \"deleteDirectory\",\n {\n title: \"Delete directory\",\n description: dedent`\n Directory deleter for removing directories from the workspace.\n\n Use cases:\n - Removing temporary directories\n - Cleaning up build artifacts\n - Deleting empty directories after moving files\n\n How it works:\n - Validates directory existence and permissions\n - Removes directory (and contents if recursive is true)\n - Returns deletion status\n\n Parameters:\n - path: Directory path to delete\n - recursive: Set to true to delete non-empty directories\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await deleteDirectory(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { unlink } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function deleteFile(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`File ${path} does not exist.`)\n }\n const stats = statSync(validatedPath)\n if (stats.isDirectory()) {\n throw new Error(`Path ${path} is a directory. Use delete directory tool instead.`)\n }\n if (!(stats.mode & 0o200)) {\n throw new Error(`File ${path} is not writable`)\n }\n await unlink(validatedPath)\n return {\n path: validatedPath,\n }\n}\n\nexport function registerDeleteFile(server: McpServer) {\n server.registerTool(\n \"deleteFile\",\n {\n title: \"Delete file\",\n description: dedent`\n File deleter for removing files from the workspace.\n\n Use cases:\n - Removing temporary files\n - Cleaning up generated files\n - Deleting outdated configuration files\n - Removing unwanted artifacts\n\n How it works:\n - Validates file existence and permissions\n - Performs atomic delete operation\n - Returns deletion status\n \n Parameters:\n - path: File path to delete\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await deleteFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { readFile, writeFile } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string().describe(\"Target file path to edit.\"),\n newText: z\n .string()\n .min(1)\n .max(2_000)\n .describe(\"Text to append to the file. Max 2000 characters.\"),\n oldText: z\n .string()\n .min(1)\n .max(2_000)\n .describe(\"Exact text to find and replace. Max 2000 characters.\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function editTextFile(input: InputSchema) {\n const { path, newText, oldText } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`File ${path} does not exist.`)\n }\n const stats = statSync(validatedPath)\n if (!(stats.mode & 0o200)) {\n throw new Error(`File ${path} is not writable`)\n }\n await applyFileEdit(validatedPath, newText, oldText)\n return {\n path: validatedPath,\n newText,\n oldText,\n }\n}\n\nfunction normalizeLineEndings(text: string): string {\n return text.replace(/\\r\\n/g, \"\\n\")\n}\n\nasync function applyFileEdit(filePath: string, newText: string, oldText: string) {\n const content = normalizeLineEndings(await readFile(filePath, \"utf-8\"))\n const normalizedOld = normalizeLineEndings(oldText)\n const normalizedNew = normalizeLineEndings(newText)\n if (!content.includes(normalizedOld)) {\n throw new Error(`Could not find exact match for oldText in file ${filePath}`)\n }\n const modifiedContent = content.replace(normalizedOld, normalizedNew)\n await writeFile(filePath, modifiedContent, \"utf-8\")\n}\n\nexport function registerEditTextFile(server: McpServer) {\n server.registerTool(\n \"editTextFile\",\n {\n title: \"Edit text file\",\n description: dedent`\n Text file editor for modifying existing files with precise text replacement.\n\n Use cases:\n - Updating configuration values\n - Modifying code snippets\n - Replacing specific text blocks\n - Making targeted edits to files\n\n How it works:\n - Reads existing file content\n - Performs exact text replacement of oldText with newText\n - Normalizes line endings for consistent behavior\n - Returns summary of changes made\n - For appending text to files, use the appendTextFile tool instead\n \n Rules:\n - YOU MUST PROVIDE A VALID UTF-8 STRING FOR THE TEXT\n - THERE IS A LIMIT ON THE NUMBER OF TOKENS THAT CAN BE GENERATED, SO DO NOT WRITE ALL THE CONTENT AT ONCE (IT WILL CAUSE AN ERROR)\n - IF YOU WANT TO EDIT MORE THAN 2000 CHARACTERS, USE THIS TOOL MULTIPLE TIMES\n - DO NOT USE THIS TOOL FOR APPENDING TEXT TO FILES - USE appendTextFile TOOL INSTEAD\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await editTextFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { execFile } from \"node:child_process\"\nimport { promisify } from \"node:util\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { successToolResult } from \"../lib/tool-result.js\"\n\nconst execFileAsync = promisify(execFile)\n\nconst inputSchema = z.object({\n command: z.string().describe(\"The command to execute\"),\n args: z.array(z.string()).describe(\"The arguments to pass to the command\"),\n env: z.record(z.string(), z.string()).describe(\"The environment variables to set\"),\n cwd: z.string().describe(\"The working directory to execute the command in\"),\n stdout: z.boolean().describe(\"Whether to capture the standard output\"),\n stderr: z.boolean().describe(\"Whether to capture the standard error\"),\n timeout: z.number().optional().describe(\"Timeout in milliseconds\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function exec(input: InputSchema) {\n const validatedCwd = await validatePath(input.cwd)\n const { stdout, stderr } = await execFileAsync(input.command, input.args, {\n cwd: validatedCwd,\n env: { ...process.env, ...input.env },\n timeout: input.timeout,\n })\n let output = \"\"\n if (input.stdout) {\n output += stdout\n }\n if (input.stderr) {\n output += stderr\n }\n if (!output.trim()) {\n output = \"Command executed successfully, but produced no output.\"\n }\n return { output }\n}\n\nexport function registerExec(server: McpServer) {\n server.registerTool(\n \"exec\",\n {\n title: \"Execute Command\",\n description: dedent`\n Command executor for running system commands and scripts.\n\n Use cases:\n - Running system tasks or scripts\n - Automating command-line tools or utilities\n - Executing build commands or test runners\n\n How it works:\n - Executes the specified command with arguments\n - Captures stdout and/or stderr based on flags\n - Returns command output or error information\n\n Parameters:\n - command: The command to execute (e.g., ls, python)\n - args: Arguments to pass to the command\n - env: Environment variables for the execution\n - cwd: Working directory for command execution\n - stdout: Whether to capture standard output\n - stderr: Whether to capture standard error\n - timeout: Timeout in milliseconds (optional)\n\n Rules:\n - Only execute commands from trusted sources\n - Do not execute long-running foreground commands (e.g., tail -f)\n - Be cautious with resource-intensive commands\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await exec(input))\n } catch (error: unknown) {\n const execError = error as {\n message?: string\n stdout?: string\n stderr?: string\n killed?: boolean\n signal?: string\n }\n let message = \"\"\n if (\n execError &&\n (execError.killed || execError.signal === \"SIGTERM\") &&\n typeof input.timeout === \"number\"\n ) {\n message = `Command timed out after ${input.timeout}ms.`\n } else if (error instanceof Error) {\n if (error.message.includes(\"timeout\")) {\n message = `Command timed out after ${input.timeout}ms.`\n } else {\n message = error.message\n }\n } else {\n message = \"An unknown error occurred.\"\n }\n const result: { error: string; stdout?: string; stderr?: string } = { error: message }\n if (execError.stdout && input.stdout) {\n result.stdout = execError.stdout\n }\n if (execError.stderr && input.stderr) {\n result.stderr = execError.stderr\n }\n return { content: [{ type: \"text\", text: JSON.stringify(result) }] }\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { basename, dirname, extname, resolve } from \"node:path\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport mime from \"mime-types\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function getFileInfo(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`File or directory ${path} does not exist`)\n }\n const stats = statSync(validatedPath)\n const isDirectory = stats.isDirectory()\n const mimeType = isDirectory ? null : mime.lookup(validatedPath) || \"application/octet-stream\"\n const formatSize = (bytes: number): string => {\n if (bytes === 0) return \"0 B\"\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"]\n const i = Math.floor(Math.log(bytes) / Math.log(1024))\n return `${(bytes / 1024 ** i).toFixed(2)} ${units[i]}`\n }\n return {\n exists: true,\n path: validatedPath,\n absolutePath: resolve(validatedPath),\n name: basename(validatedPath),\n directory: dirname(validatedPath),\n extension: isDirectory ? null : extname(validatedPath),\n type: isDirectory ? \"directory\" : \"file\",\n mimeType,\n size: stats.size,\n sizeFormatted: formatSize(stats.size),\n created: stats.birthtime.toISOString(),\n modified: stats.mtime.toISOString(),\n accessed: stats.atime.toISOString(),\n permissions: {\n readable: true,\n writable: Boolean(stats.mode & 0o200),\n executable: Boolean(stats.mode & 0o100),\n },\n }\n}\n\nexport function registerGetFileInfo(server: McpServer) {\n server.registerTool(\n \"getFileInfo\",\n {\n title: \"Get file info\",\n description: dedent`\n File information retriever for detailed metadata about files and directories.\n\n Use cases:\n - Checking file existence and type\n - Getting file size and timestamps\n - Determining MIME types\n - Validating file accessibility\n\n How it works:\n - Retrieves comprehensive file system metadata\n - Detects MIME type from file extension\n - Provides both absolute and relative paths\n - Returns human-readable file sizes\n \n Parameters:\n - path: File or directory path to inspect\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await getFileInfo(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { readdir } from \"node:fs/promises\"\nimport { join } from \"node:path\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\ninterface DirectoryItem {\n name: string\n path: string\n type: \"directory\" | \"file\"\n size: number\n modified: string\n}\n\nexport async function listDirectory(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n if (!existsSync(validatedPath)) {\n throw new Error(`Directory ${path} does not exist.`)\n }\n const stats = statSync(validatedPath)\n if (!stats.isDirectory()) {\n throw new Error(`Path ${path} is not a directory.`)\n }\n const entries = await readdir(validatedPath)\n const items: DirectoryItem[] = []\n for (const entry of entries.sort()) {\n try {\n const fullPath = await validatePath(join(validatedPath, entry))\n const entryStats = statSync(fullPath)\n const item: DirectoryItem = {\n name: entry,\n path: entry,\n type: entryStats.isDirectory() ? \"directory\" : \"file\",\n size: entryStats.size,\n modified: entryStats.mtime.toISOString(),\n }\n items.push(item)\n } catch (e) {\n if (e instanceof Error && e.message.includes(\"perstack directory is not allowed\")) {\n continue\n }\n throw e\n }\n }\n return {\n path: validatedPath,\n items,\n }\n}\n\nexport function registerListDirectory(server: McpServer) {\n server.registerTool(\n \"listDirectory\",\n {\n title: \"List directory\",\n description: dedent`\n Directory content lister with detailed file information.\n\n Use cases:\n - Exploring project structure\n - Finding files in a directory\n - Checking directory contents before operations\n - Understanding file organization\n\n How it works:\n - Lists all files and subdirectories in specified directory only\n - Provides file type, size, and modification time\n - Sorts entries alphabetically\n - Handles empty directories\n \n Parameters:\n - path: Directory path to list (optional, defaults to workspace root)\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await listDirectory(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { mkdir, rename } from \"node:fs/promises\"\nimport { dirname } from \"node:path\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n source: z.string(),\n destination: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function moveFile(input: InputSchema) {\n const { source, destination } = input\n const validatedSource = await validatePath(source)\n const validatedDestination = await validatePath(destination)\n if (!existsSync(validatedSource)) {\n throw new Error(`Source file ${source} does not exist.`)\n }\n const sourceStats = statSync(validatedSource)\n if (!(sourceStats.mode & 0o200)) {\n throw new Error(`Source file ${source} is not writable`)\n }\n if (existsSync(validatedDestination)) {\n throw new Error(`Destination ${destination} already exists.`)\n }\n const destDir = dirname(validatedDestination)\n await mkdir(destDir, { recursive: true })\n await rename(validatedSource, validatedDestination)\n return {\n source: validatedSource,\n destination: validatedDestination,\n }\n}\n\nexport function registerMoveFile(server: McpServer) {\n server.registerTool(\n \"moveFile\",\n {\n title: \"Move file\",\n description: dedent`\n File mover for relocating or renaming files within the workspace.\n\n Use cases:\n - Renaming files to follow naming conventions\n - Moving files to different directories\n - Organizing project structure\n - Backing up files before modifications\n\n How it works:\n - Validates source file existence\n - Creates destination directory if needed\n - Performs atomic move operation\n - Preserves file permissions and timestamps\n \n Parameters:\n - source: Current file path\n - destination: Target file path\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await moveFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync } from \"node:fs\"\nimport { stat } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport mime from \"mime-types\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst MAX_IMAGE_SIZE = 15 * 1024 * 1024\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function readImageFile(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n const isFile = existsSync(validatedPath)\n if (!isFile) {\n throw new Error(`File ${path} does not exist.`)\n }\n const mimeType = mime.lookup(validatedPath)\n if (!mimeType || ![\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"].includes(mimeType)) {\n throw new Error(`File ${path} is not supported.`)\n }\n const fileStats = await stat(validatedPath)\n const fileSizeMB = fileStats.size / (1024 * 1024)\n if (fileStats.size > MAX_IMAGE_SIZE) {\n throw new Error(\n `Image file too large (${fileSizeMB.toFixed(1)}MB). Maximum supported size is ${MAX_IMAGE_SIZE / (1024 * 1024)}MB. Please use a smaller image file.`,\n )\n }\n return {\n path: validatedPath,\n mimeType,\n size: fileStats.size,\n }\n}\n\nexport function registerReadImageFile(server: McpServer) {\n server.registerTool(\n \"readImageFile\",\n {\n title: \"Read image file\",\n description: dedent`\n Image file reader that converts images to base64 encoded strings with MIME type validation.\n\n Use cases:\n - Loading images for LLM to process\n - Retrieving image data for analysis or display\n - Converting workspace image files to base64 format\n\n How it works:\n - Validates file existence and MIME type before reading\n - Encodes file content as base64 string\n - Returns image data with correct MIME type for proper handling\n - Rejects unsupported formats with clear error messages\n\n Supported formats:\n - PNG (image/png)\n - JPEG/JPG (image/jpeg)\n - GIF (image/gif) - static only, animated not supported\n - WebP (image/webp)\n \n Notes:\n - Maximum file size: 15MB (larger files will be rejected)\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await readImageFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync } from \"node:fs\"\nimport { stat } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport mime from \"mime-types\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst MAX_PDF_SIZE = 30 * 1024 * 1024\nconst inputSchema = z.object({\n path: z.string(),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function readPdfFile(input: InputSchema) {\n const { path } = input\n const validatedPath = await validatePath(path)\n const isFile = existsSync(validatedPath)\n if (!isFile) {\n throw new Error(`File ${path} does not exist.`)\n }\n const mimeType = mime.lookup(validatedPath)\n if (mimeType !== \"application/pdf\") {\n throw new Error(`File ${path} is not a PDF file.`)\n }\n const fileStats = await stat(validatedPath)\n const fileSizeMB = fileStats.size / (1024 * 1024)\n if (fileStats.size > MAX_PDF_SIZE) {\n throw new Error(\n `PDF file too large (${fileSizeMB.toFixed(1)}MB). Maximum supported size is ${MAX_PDF_SIZE / (1024 * 1024)}MB. Please use a smaller PDF file.`,\n )\n }\n return {\n path: validatedPath,\n mimeType,\n size: fileStats.size,\n }\n}\n\nexport function registerReadPdfFile(server: McpServer) {\n server.registerTool(\n \"readPdfFile\",\n {\n title: \"Read PDF file\",\n description: dedent`\n PDF file reader that converts documents to base64 encoded resources.\n\n Use cases:\n - Extracting content from PDF documents for analysis\n - Loading PDF files for LLM processing\n - Retrieving PDF data for conversion or manipulation\n\n How it works:\n - Validates file existence and MIME type (application/pdf)\n - Encodes PDF content as base64 blob\n - Returns as resource type with proper MIME type and URI\n - Rejects non-PDF files with clear error messages\n\n Notes:\n - Returns entire PDF content, no page range support\n - Maximum file size: 10MB (larger files will be rejected)\n - Text extraction not performed, returns raw PDF data\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await readPdfFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync } from \"node:fs\"\nimport { readFile } from \"node:fs/promises\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string(),\n from: z.number().optional().describe(\"The line number to start reading from.\"),\n to: z.number().optional().describe(\"The line number to stop reading at.\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function readTextFile(input: InputSchema) {\n const { path, from, to } = input\n const validatedPath = await validatePath(path)\n const isFile = existsSync(validatedPath)\n if (!isFile) {\n throw new Error(`File ${path} does not exist.`)\n }\n const fileContent = await readFile(validatedPath, \"utf-8\")\n const lines = fileContent.split(\"\\n\")\n const fromLine = from ?? 0\n const toLine = to ?? lines.length\n const selectedLines = lines.slice(fromLine, toLine)\n const content = selectedLines.join(\"\\n\")\n return {\n path,\n content,\n from: fromLine,\n to: toLine,\n }\n}\n\nexport function registerReadTextFile(server: McpServer) {\n server.registerTool(\n \"readTextFile\",\n {\n title: \"Read text file\",\n description: dedent`\n Text file reader with line range support for UTF-8 encoded files.\n\n Use cases:\n - Reading source code files for analysis\n - Extracting specific sections from large text files\n - Loading configuration or documentation files\n - Viewing log files or data files\n\n How it works:\n - Reads files as UTF-8 encoded text without format validation\n - Supports partial file reading via line number ranges\n - Returns content wrapped in JSON with metadata\n - WARNING: Binary files will cause errors or corrupted output\n\n Common file types:\n - Source code: .ts, .js, .py, .java, .cpp, etc.\n - Documentation: .md, .txt, .rst\n - Configuration: .json, .yaml, .toml, .ini\n - Data files: .csv, .log, .sql\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await readTextFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n thought: z.string().describe(\"Your current thinking step\"),\n nextThoughtNeeded: z\n .boolean()\n .optional()\n .describe(\"true if you need more thinking, even if at what seemed like the end\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nclass Thought {\n thoughtHistory: InputSchema[] = []\n branches: Record<string, InputSchema[]> = {}\n public processThought(input: InputSchema) {\n const { nextThoughtNeeded } = input\n this.thoughtHistory.push(input)\n return {\n nextThoughtNeeded,\n thoughtHistoryLength: this.thoughtHistory.length,\n }\n }\n}\nconst thought = new Thought()\n\nexport async function think(input: InputSchema) {\n return thought.processThought(input)\n}\n\nexport function registerThink(server: McpServer) {\n server.registerTool(\n \"think\",\n {\n title: \"think\",\n description: dedent`\n Sequential thinking tool for step-by-step problem analysis and solution development.\n\n Use cases:\n - Breaking down complex problems into manageable steps\n - Developing solutions through iterative reasoning\n - Analyzing problems that require multiple perspectives\n - Planning tasks with dependencies and considerations\n\n How it works:\n - Records each thinking step sequentially\n - Maintains thought history for context\n - Continues until solution is reached\n - Returns thought count and continuation status\n\n Parameters:\n - thought: Current reasoning step or analysis\n - nextThoughtNeeded: Whether additional thinking is required (optional)\n\n Best practices:\n - Use multiple calls for sophisticated reasoning chains\n - Progress from high-level overview to detailed analysis (drill-down approach)\n - Capture insights and eureka moments as they emerge\n - Engage in reflective introspection and constructive self-critique\n - Set nextThoughtNeeded to false only when fully satisfied with the solution\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await think(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst todoInputSchema = z.object({\n newTodos: z.array(z.string()).describe(\"New todos to add\").optional(),\n completedTodos: z.array(z.number()).describe(\"Todo ids that are completed\").optional(),\n})\ntype TodoInputSchema = z.infer<typeof todoInputSchema>\n\nconst clearTodoInputSchema = z.object({})\ntype ClearTodoInputSchema = z.infer<typeof clearTodoInputSchema>\n\nclass Todo {\n currentTodoId = 0\n todos: { id: number; title: string; completed: boolean }[] = []\n public processTodo(input: TodoInputSchema) {\n const { newTodos, completedTodos } = input\n if (newTodos) {\n this.todos.push(\n ...newTodos.map((title) => ({ id: this.currentTodoId++, title, completed: false })),\n )\n }\n if (completedTodos) {\n this.todos = this.todos.map((todo) => ({\n ...todo,\n completed: todo.completed || completedTodos.includes(todo.id),\n }))\n }\n return {\n todos: this.todos,\n }\n }\n public clearTodo() {\n this.todos = []\n this.currentTodoId = 0\n return {\n todos: this.todos,\n }\n }\n}\nconst todoSingleton = new Todo()\n\nexport async function todo(input: TodoInputSchema) {\n return todoSingleton.processTodo(input)\n}\n\nexport async function clearTodo(_input: ClearTodoInputSchema) {\n return todoSingleton.clearTodo()\n}\n\nexport function registerTodo(server: McpServer) {\n server.registerTool(\n \"todo\",\n {\n title: \"todo\",\n description: dedent`\n Todo list manager that tracks tasks and their completion status.\n\n Use cases:\n - Creating new tasks or action items\n - Marking tasks as completed\n - Viewing current task list and status\n\n How it works:\n - Each todo gets a unique ID when created\n - Returns the full todo list after every operation\n - Maintains state across multiple calls\n\n Parameters:\n - newTodos: Array of task descriptions to add\n - completedTodos: Array of todo IDs to mark as completed\n `,\n inputSchema: todoInputSchema.shape,\n },\n async (input: TodoInputSchema) => {\n try {\n return successToolResult(await todo(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n\nexport function registerClearTodo(server: McpServer) {\n server.registerTool(\n \"clearTodo\",\n {\n title: \"clearTodo\",\n description: dedent`\n Clears the todo list.\n\n Use cases:\n - Resetting the todo list to an empty state\n - Starting fresh with a new task list\n - Clearing all tasks for a new day or project\n\n How it works:\n - Resets the todo list to an empty state\n - Returns an empty todo list\n `,\n inputSchema: clearTodoInputSchema.shape,\n },\n async (input: ClearTodoInputSchema) => {\n try {\n return successToolResult(await clearTodo(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n","import { existsSync, statSync } from \"node:fs\"\nimport { mkdir, writeFile } from \"node:fs/promises\"\nimport { dirname } from \"node:path\"\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\"\nimport { dedent } from \"ts-dedent\"\nimport { z } from \"zod\"\nimport { validatePath } from \"../lib/path.js\"\nimport { errorToolResult, successToolResult } from \"../lib/tool-result.js\"\n\nconst inputSchema = z.object({\n path: z.string().describe(\"Target file path (relative or absolute).\"),\n text: z.string().max(10_000).describe(\"Text to write to the file. Max 10000 characters.\"),\n})\ntype InputSchema = z.infer<typeof inputSchema>\n\nexport async function writeTextFile(input: InputSchema) {\n const { path, text } = input\n const validatedPath = await validatePath(path)\n if (existsSync(validatedPath)) {\n const stats = statSync(validatedPath)\n if (!(stats.mode & 0o200)) {\n throw new Error(`File ${path} is not writable`)\n }\n }\n const dir = dirname(validatedPath)\n await mkdir(dir, { recursive: true })\n await writeFile(validatedPath, text, \"utf-8\")\n return {\n path: validatedPath,\n text,\n }\n}\n\nexport function registerWriteTextFile(server: McpServer) {\n server.registerTool(\n \"writeTextFile\",\n {\n title: \"writeTextFile\",\n description: dedent`\n Text file writer that creates or overwrites files with UTF-8 content.\n\n Use cases:\n - Creating new configuration files\n - Writing generated code or documentation\n - Saving processed data or results\n - Creating log files or reports\n\n How it works:\n - Writes content as UTF-8 encoded text\n - Returns success status with file path\n\n Rules:\n - IF THE FILE ALREADY EXISTS, IT WILL BE OVERWRITTEN\n - YOU MUST PROVIDE A VALID UTF-8 STRING FOR THE TEXT\n - THERE IS A LIMIT ON THE NUMBER OF TOKENS THAT CAN BE GENERATED, SO DO NOT WRITE ALL THE CONTENT AT ONCE (IT WILL CAUSE AN ERROR)\n - IF YOU WANT TO WRITE MORE THAN 10,000 CHARACTERS, USE \"appendTextFile\" TOOL AFTER THIS ONE\n `,\n inputSchema: inputSchema.shape,\n },\n async (input: InputSchema) => {\n try {\n return successToolResult(await writeTextFile(input))\n } catch (e) {\n if (e instanceof Error) return errorToolResult(e)\n throw e\n }\n },\n )\n}\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,163 +1,84 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const inputSchema$b: z.ZodObject<{
|
|
4
|
+
declare const inputSchema$e: z.ZodObject<{
|
|
6
5
|
path: z.ZodString;
|
|
7
6
|
text: z.ZodString;
|
|
8
|
-
},
|
|
9
|
-
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
type InputSchema$e = z.infer<typeof inputSchema$e>;
|
|
9
|
+
declare function appendTextFile(input: InputSchema$e): Promise<{
|
|
10
10
|
path: string;
|
|
11
|
-
}, {
|
|
12
11
|
text: string;
|
|
13
|
-
path: string;
|
|
14
12
|
}>;
|
|
15
|
-
|
|
16
|
-
declare function appendTextFileConfig(): {
|
|
17
|
-
title: string;
|
|
18
|
-
description: string;
|
|
19
|
-
inputSchema: {
|
|
20
|
-
path: z.ZodString;
|
|
21
|
-
text: z.ZodString;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
declare function appendTextFile(input: InputSchema$b): Promise<ToolResult>;
|
|
13
|
+
declare function registerAppendTextFile(server: McpServer): void;
|
|
25
14
|
|
|
26
|
-
declare
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
declare function
|
|
15
|
+
declare const inputSchema$d: z.ZodObject<{}, z.core.$strip>;
|
|
16
|
+
type InputSchema$d = z.infer<typeof inputSchema$d>;
|
|
17
|
+
declare function attemptCompletion(_input: InputSchema$d): Promise<{
|
|
18
|
+
message: string;
|
|
19
|
+
}>;
|
|
20
|
+
declare function registerAttemptCompletion(server: McpServer): void;
|
|
32
21
|
|
|
33
|
-
declare const inputSchema$
|
|
22
|
+
declare const inputSchema$c: z.ZodObject<{
|
|
34
23
|
path: z.ZodString;
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
path: string;
|
|
39
|
-
}>;
|
|
40
|
-
type InputSchema$a = z.infer<typeof inputSchema$a>;
|
|
41
|
-
declare function createDirectoryConfig(): {
|
|
42
|
-
title: string;
|
|
43
|
-
description: string;
|
|
44
|
-
inputSchema: {
|
|
45
|
-
path: z.ZodString;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
declare function createDirectory(input: InputSchema$a): Promise<{
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
type InputSchema$c = z.infer<typeof inputSchema$c>;
|
|
26
|
+
declare function createDirectory(input: InputSchema$c): Promise<{
|
|
49
27
|
path: string;
|
|
50
28
|
}>;
|
|
29
|
+
declare function registerCreateDirectory(server: McpServer): void;
|
|
51
30
|
|
|
52
|
-
declare const inputSchema$
|
|
31
|
+
declare const inputSchema$b: z.ZodObject<{
|
|
53
32
|
path: z.ZodString;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type InputSchema$b = z.infer<typeof inputSchema$b>;
|
|
36
|
+
declare function deleteDirectory(input: InputSchema$b): Promise<{
|
|
57
37
|
path: string;
|
|
58
38
|
}>;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
declare function deleteFile(input: InputSchema$9): Promise<{
|
|
39
|
+
declare function registerDeleteDirectory(server: McpServer): void;
|
|
40
|
+
|
|
41
|
+
declare const inputSchema$a: z.ZodObject<{
|
|
42
|
+
path: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
type InputSchema$a = z.infer<typeof inputSchema$a>;
|
|
45
|
+
declare function deleteFile(input: InputSchema$a): Promise<{
|
|
68
46
|
path: string;
|
|
69
47
|
}>;
|
|
48
|
+
declare function registerDeleteFile(server: McpServer): void;
|
|
70
49
|
|
|
71
|
-
declare const inputSchema$
|
|
50
|
+
declare const inputSchema$9: z.ZodObject<{
|
|
72
51
|
path: z.ZodString;
|
|
73
52
|
newText: z.ZodString;
|
|
74
53
|
oldText: z.ZodString;
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
oldText: string;
|
|
79
|
-
}, {
|
|
80
|
-
path: string;
|
|
81
|
-
newText: string;
|
|
82
|
-
oldText: string;
|
|
83
|
-
}>;
|
|
84
|
-
type InputSchema$8 = z.infer<typeof inputSchema$8>;
|
|
85
|
-
declare function editTextFileConfig(): {
|
|
86
|
-
title: string;
|
|
87
|
-
description: string;
|
|
88
|
-
inputSchema: {
|
|
89
|
-
path: z.ZodString;
|
|
90
|
-
newText: z.ZodString;
|
|
91
|
-
oldText: z.ZodString;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
declare function editTextFile(input: InputSchema$8): Promise<{
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
type InputSchema$9 = z.infer<typeof inputSchema$9>;
|
|
56
|
+
declare function editTextFile(input: InputSchema$9): Promise<{
|
|
95
57
|
path: string;
|
|
96
58
|
newText: string;
|
|
97
59
|
oldText: string;
|
|
98
60
|
}>;
|
|
61
|
+
declare function registerEditTextFile(server: McpServer): void;
|
|
99
62
|
|
|
100
|
-
declare const
|
|
63
|
+
declare const inputSchema$8: z.ZodObject<{
|
|
101
64
|
command: z.ZodString;
|
|
102
|
-
args: z.ZodArray<z.ZodString
|
|
65
|
+
args: z.ZodArray<z.ZodString>;
|
|
103
66
|
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
104
67
|
cwd: z.ZodString;
|
|
105
68
|
stdout: z.ZodBoolean;
|
|
106
69
|
stderr: z.ZodBoolean;
|
|
107
70
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
cwd: string;
|
|
113
|
-
stdout: boolean;
|
|
114
|
-
stderr: boolean;
|
|
115
|
-
timeout?: number | undefined;
|
|
116
|
-
}, {
|
|
117
|
-
command: string;
|
|
118
|
-
args: string[];
|
|
119
|
-
env: Record<string, string>;
|
|
120
|
-
cwd: string;
|
|
121
|
-
stdout: boolean;
|
|
122
|
-
stderr: boolean;
|
|
123
|
-
timeout?: number | undefined;
|
|
124
|
-
}>;
|
|
125
|
-
type ExecInput = z.infer<typeof execInputSchema>;
|
|
126
|
-
declare function execConfig(): {
|
|
127
|
-
title: string;
|
|
128
|
-
description: string;
|
|
129
|
-
inputSchema: {
|
|
130
|
-
command: z.ZodString;
|
|
131
|
-
args: z.ZodArray<z.ZodString, "many">;
|
|
132
|
-
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
133
|
-
cwd: z.ZodString;
|
|
134
|
-
stdout: z.ZodBoolean;
|
|
135
|
-
stderr: z.ZodBoolean;
|
|
136
|
-
timeout: z.ZodOptional<z.ZodNumber>;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
declare function exec(input: ExecInput): Promise<{
|
|
140
|
-
content: {
|
|
141
|
-
type: string;
|
|
142
|
-
text: string;
|
|
143
|
-
}[];
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type InputSchema$8 = z.infer<typeof inputSchema$8>;
|
|
73
|
+
declare function exec(input: InputSchema$8): Promise<{
|
|
74
|
+
output: string;
|
|
144
75
|
}>;
|
|
76
|
+
declare function registerExec(server: McpServer): void;
|
|
145
77
|
|
|
146
78
|
declare const inputSchema$7: z.ZodObject<{
|
|
147
79
|
path: z.ZodString;
|
|
148
|
-
},
|
|
149
|
-
path: string;
|
|
150
|
-
}, {
|
|
151
|
-
path: string;
|
|
152
|
-
}>;
|
|
80
|
+
}, z.core.$strip>;
|
|
153
81
|
type InputSchema$7 = z.infer<typeof inputSchema$7>;
|
|
154
|
-
declare function getFileInfoConfig(): {
|
|
155
|
-
title: string;
|
|
156
|
-
description: string;
|
|
157
|
-
inputSchema: {
|
|
158
|
-
path: z.ZodString;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
82
|
declare function getFileInfo(input: InputSchema$7): Promise<{
|
|
162
83
|
exists: boolean;
|
|
163
84
|
path: string;
|
|
@@ -178,14 +99,11 @@ declare function getFileInfo(input: InputSchema$7): Promise<{
|
|
|
178
99
|
executable: boolean;
|
|
179
100
|
};
|
|
180
101
|
}>;
|
|
102
|
+
declare function registerGetFileInfo(server: McpServer): void;
|
|
181
103
|
|
|
182
104
|
declare const inputSchema$6: z.ZodObject<{
|
|
183
105
|
path: z.ZodString;
|
|
184
|
-
},
|
|
185
|
-
path: string;
|
|
186
|
-
}, {
|
|
187
|
-
path: string;
|
|
188
|
-
}>;
|
|
106
|
+
}, z.core.$strip>;
|
|
189
107
|
type InputSchema$6 = z.infer<typeof inputSchema$6>;
|
|
190
108
|
interface DirectoryItem {
|
|
191
109
|
name: string;
|
|
@@ -194,182 +112,77 @@ interface DirectoryItem {
|
|
|
194
112
|
size: number;
|
|
195
113
|
modified: string;
|
|
196
114
|
}
|
|
197
|
-
declare function listDirectoryConfig(): {
|
|
198
|
-
title: string;
|
|
199
|
-
description: string;
|
|
200
|
-
inputSchema: {
|
|
201
|
-
path: z.ZodString;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
115
|
declare function listDirectory(input: InputSchema$6): Promise<{
|
|
205
116
|
path: string;
|
|
206
117
|
items: DirectoryItem[];
|
|
207
118
|
}>;
|
|
119
|
+
declare function registerListDirectory(server: McpServer): void;
|
|
208
120
|
|
|
209
121
|
declare const inputSchema$5: z.ZodObject<{
|
|
210
122
|
source: z.ZodString;
|
|
211
123
|
destination: z.ZodString;
|
|
212
|
-
},
|
|
213
|
-
source: string;
|
|
214
|
-
destination: string;
|
|
215
|
-
}, {
|
|
216
|
-
source: string;
|
|
217
|
-
destination: string;
|
|
218
|
-
}>;
|
|
124
|
+
}, z.core.$strip>;
|
|
219
125
|
type InputSchema$5 = z.infer<typeof inputSchema$5>;
|
|
220
|
-
declare function moveFileConfig(): {
|
|
221
|
-
title: string;
|
|
222
|
-
description: string;
|
|
223
|
-
inputSchema: {
|
|
224
|
-
source: z.ZodString;
|
|
225
|
-
destination: z.ZodString;
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
126
|
declare function moveFile(input: InputSchema$5): Promise<{
|
|
229
127
|
source: string;
|
|
230
128
|
destination: string;
|
|
231
129
|
}>;
|
|
130
|
+
declare function registerMoveFile(server: McpServer): void;
|
|
232
131
|
|
|
233
132
|
declare const inputSchema$4: z.ZodObject<{
|
|
234
133
|
path: z.ZodString;
|
|
235
|
-
},
|
|
236
|
-
path: string;
|
|
237
|
-
}, {
|
|
238
|
-
path: string;
|
|
239
|
-
}>;
|
|
134
|
+
}, z.core.$strip>;
|
|
240
135
|
type InputSchema$4 = z.infer<typeof inputSchema$4>;
|
|
241
|
-
declare function readImageFileConfig(): {
|
|
242
|
-
title: string;
|
|
243
|
-
description: string;
|
|
244
|
-
inputSchema: {
|
|
245
|
-
path: z.ZodString;
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
136
|
declare function readImageFile(input: InputSchema$4): Promise<{
|
|
249
137
|
path: string;
|
|
250
138
|
mimeType: string;
|
|
251
139
|
size: number;
|
|
252
140
|
}>;
|
|
141
|
+
declare function registerReadImageFile(server: McpServer): void;
|
|
253
142
|
|
|
254
143
|
declare const inputSchema$3: z.ZodObject<{
|
|
255
144
|
path: z.ZodString;
|
|
256
|
-
},
|
|
257
|
-
path: string;
|
|
258
|
-
}, {
|
|
259
|
-
path: string;
|
|
260
|
-
}>;
|
|
145
|
+
}, z.core.$strip>;
|
|
261
146
|
type InputSchema$3 = z.infer<typeof inputSchema$3>;
|
|
262
|
-
declare function readPdfFileConfig(): {
|
|
263
|
-
title: string;
|
|
264
|
-
description: string;
|
|
265
|
-
inputSchema: {
|
|
266
|
-
path: z.ZodString;
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
147
|
declare function readPdfFile(input: InputSchema$3): Promise<{
|
|
270
148
|
path: string;
|
|
271
149
|
mimeType: string;
|
|
272
150
|
size: number;
|
|
273
151
|
}>;
|
|
152
|
+
declare function registerReadPdfFile(server: McpServer): void;
|
|
274
153
|
|
|
275
154
|
declare const inputSchema$2: z.ZodObject<{
|
|
276
155
|
path: z.ZodString;
|
|
277
156
|
from: z.ZodOptional<z.ZodNumber>;
|
|
278
157
|
to: z.ZodOptional<z.ZodNumber>;
|
|
279
|
-
},
|
|
280
|
-
path: string;
|
|
281
|
-
from?: number | undefined;
|
|
282
|
-
to?: number | undefined;
|
|
283
|
-
}, {
|
|
284
|
-
path: string;
|
|
285
|
-
from?: number | undefined;
|
|
286
|
-
to?: number | undefined;
|
|
287
|
-
}>;
|
|
158
|
+
}, z.core.$strip>;
|
|
288
159
|
type InputSchema$2 = z.infer<typeof inputSchema$2>;
|
|
289
|
-
declare function readTextFileConfig(): {
|
|
290
|
-
title: string;
|
|
291
|
-
description: string;
|
|
292
|
-
inputSchema: {
|
|
293
|
-
path: z.ZodString;
|
|
294
|
-
from: z.ZodOptional<z.ZodNumber>;
|
|
295
|
-
to: z.ZodOptional<z.ZodNumber>;
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
160
|
declare function readTextFile(input: InputSchema$2): Promise<{
|
|
299
161
|
path: string;
|
|
300
162
|
content: string;
|
|
301
163
|
from: number;
|
|
302
164
|
to: number;
|
|
303
165
|
}>;
|
|
166
|
+
declare function registerReadTextFile(server: McpServer): void;
|
|
304
167
|
|
|
305
168
|
declare const inputSchema$1: z.ZodObject<{
|
|
306
|
-
urls: z.ZodArray<z.ZodString, "many">;
|
|
307
|
-
}, "strip", z.ZodTypeAny, {
|
|
308
|
-
urls: string[];
|
|
309
|
-
}, {
|
|
310
|
-
urls: string[];
|
|
311
|
-
}>;
|
|
312
|
-
type InputSchema$1 = z.infer<typeof inputSchema$1>;
|
|
313
|
-
declare function testUrlConfig(): {
|
|
314
|
-
title: string;
|
|
315
|
-
description: string;
|
|
316
|
-
inputSchema: {
|
|
317
|
-
urls: z.ZodArray<z.ZodString, "many">;
|
|
318
|
-
};
|
|
319
|
-
};
|
|
320
|
-
interface UrlTestResult {
|
|
321
|
-
url: string;
|
|
322
|
-
status: number;
|
|
323
|
-
title: string;
|
|
324
|
-
description: string;
|
|
325
|
-
}
|
|
326
|
-
declare function testUrls(input: InputSchema$1): Promise<{
|
|
327
|
-
results: UrlTestResult[];
|
|
328
|
-
}>;
|
|
329
|
-
|
|
330
|
-
declare const inputSchema: z.ZodObject<{
|
|
331
169
|
thought: z.ZodString;
|
|
332
170
|
nextThoughtNeeded: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}, {
|
|
337
|
-
thought: string;
|
|
338
|
-
nextThoughtNeeded?: boolean | undefined;
|
|
339
|
-
}>;
|
|
340
|
-
type InputSchema = z.infer<typeof inputSchema>;
|
|
341
|
-
declare function thinkConfig(): {
|
|
342
|
-
title: string;
|
|
343
|
-
description: string;
|
|
344
|
-
inputSchema: {
|
|
345
|
-
thought: z.ZodString;
|
|
346
|
-
nextThoughtNeeded: z.ZodOptional<z.ZodBoolean>;
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
declare function think(input: InputSchema): Promise<{
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
type InputSchema$1 = z.infer<typeof inputSchema$1>;
|
|
173
|
+
declare function think(input: InputSchema$1): Promise<{
|
|
350
174
|
nextThoughtNeeded: boolean | undefined;
|
|
351
175
|
thoughtHistoryLength: number;
|
|
352
176
|
}>;
|
|
177
|
+
declare function registerThink(server: McpServer): void;
|
|
353
178
|
|
|
354
179
|
declare const todoInputSchema: z.ZodObject<{
|
|
355
|
-
newTodos: z.ZodOptional<z.ZodArray<z.ZodString
|
|
356
|
-
completedTodos: z.ZodOptional<z.ZodArray<z.ZodNumber
|
|
357
|
-
},
|
|
358
|
-
newTodos?: string[] | undefined;
|
|
359
|
-
completedTodos?: number[] | undefined;
|
|
360
|
-
}, {
|
|
361
|
-
newTodos?: string[] | undefined;
|
|
362
|
-
completedTodos?: number[] | undefined;
|
|
363
|
-
}>;
|
|
180
|
+
newTodos: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
181
|
+
completedTodos: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
182
|
+
}, z.core.$strip>;
|
|
364
183
|
type TodoInputSchema = z.infer<typeof todoInputSchema>;
|
|
365
|
-
declare
|
|
366
|
-
|
|
367
|
-
description: string;
|
|
368
|
-
inputSchema: {
|
|
369
|
-
newTodos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
370
|
-
completedTodos: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
371
|
-
};
|
|
372
|
-
};
|
|
184
|
+
declare const clearTodoInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
185
|
+
type ClearTodoInputSchema = z.infer<typeof clearTodoInputSchema>;
|
|
373
186
|
declare function todo(input: TodoInputSchema): Promise<{
|
|
374
187
|
todos: {
|
|
375
188
|
id: number;
|
|
@@ -377,43 +190,25 @@ declare function todo(input: TodoInputSchema): Promise<{
|
|
|
377
190
|
completed: boolean;
|
|
378
191
|
}[];
|
|
379
192
|
}>;
|
|
380
|
-
declare
|
|
381
|
-
type ClearTodoInputSchema = z.infer<typeof clearTodoInputSchema>;
|
|
382
|
-
declare function clearTodoConfig(): {
|
|
383
|
-
title: string;
|
|
384
|
-
description: string;
|
|
385
|
-
inputSchema: {};
|
|
386
|
-
};
|
|
387
|
-
declare function clearTodo(input: ClearTodoInputSchema): Promise<{
|
|
193
|
+
declare function clearTodo(_input: ClearTodoInputSchema): Promise<{
|
|
388
194
|
todos: {
|
|
389
195
|
id: number;
|
|
390
196
|
title: string;
|
|
391
197
|
completed: boolean;
|
|
392
198
|
}[];
|
|
393
199
|
}>;
|
|
200
|
+
declare function registerTodo(server: McpServer): void;
|
|
201
|
+
declare function registerClearTodo(server: McpServer): void;
|
|
394
202
|
|
|
395
|
-
declare const
|
|
203
|
+
declare const inputSchema: z.ZodObject<{
|
|
396
204
|
path: z.ZodString;
|
|
397
205
|
text: z.ZodString;
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}, {
|
|
402
|
-
text: string;
|
|
403
|
-
path: string;
|
|
404
|
-
}>;
|
|
405
|
-
type ToolInputSchema = z.infer<typeof toolInputSchema>;
|
|
406
|
-
declare function writeTextFileConfig(): {
|
|
407
|
-
title: string;
|
|
408
|
-
description: string;
|
|
409
|
-
inputSchema: {
|
|
410
|
-
path: z.ZodString;
|
|
411
|
-
text: z.ZodString;
|
|
412
|
-
};
|
|
413
|
-
};
|
|
414
|
-
declare function writeTextFile(input: ToolInputSchema): Promise<{
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
type InputSchema = z.infer<typeof inputSchema>;
|
|
208
|
+
declare function writeTextFile(input: InputSchema): Promise<{
|
|
415
209
|
path: string;
|
|
416
210
|
text: string;
|
|
417
211
|
}>;
|
|
212
|
+
declare function registerWriteTextFile(server: McpServer): void;
|
|
418
213
|
|
|
419
|
-
export { appendTextFile,
|
|
214
|
+
export { appendTextFile, attemptCompletion, clearTodo, createDirectory, deleteDirectory, deleteFile, editTextFile, exec, getFileInfo, listDirectory, moveFile, readImageFile, readPdfFile, readTextFile, registerAppendTextFile, registerAttemptCompletion, registerClearTodo, registerCreateDirectory, registerDeleteDirectory, registerDeleteFile, registerEditTextFile, registerExec, registerGetFileInfo, registerListDirectory, registerMoveFile, registerReadImageFile, registerReadPdfFile, registerReadTextFile, registerThink, registerTodo, registerWriteTextFile, think, todo, writeTextFile };
|