aico-pack
Version:
A tool to pack repository contents to single file for AI consumption
55 lines (52 loc) • 2.65 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { z } from 'zod';
/**
* Register Repomix-related prompts to the MCP server
*/
export const registerPackRemoteRepositoryPrompt = (mcpServer) => {
// Pack Remote Repository Prompt
mcpServer.prompt('pack_remote_repository', 'Pack a remote GitHub repository for analysis', {
repository: z.string().describe('GitHub repository URL or owner/repo format (e.g., "yamadashy/repomix")'),
includePatterns: z
.string()
.optional()
.describe('Comma-separated list of glob patterns to include (e.g., "src/**,lib/**"). It is recommended to pack only necessary files.'),
ignorePatterns: z
.string()
.optional()
.describe('Comma-separated list of glob patterns to ignore (e.g., "**/*.test.js,**/*.spec.js"). It is recommended to pack only necessary files.'),
}, (_a) => __awaiter(void 0, [_a], void 0, function* ({ repository, includePatterns, ignorePatterns }) {
// Convert compress string to boolean
return {
messages: [
{
role: 'user',
content: {
type: 'text',
text: `Please analyze the GitHub repository at ${repository}.
First, use the pack_remote_repository tool with these parameters:
- repository: "${repository}"
${includePatterns ? `- includePatterns: "${includePatterns}"` : ''}
${ignorePatterns ? `- ignorePatterns: "${ignorePatterns}"` : ''}
Once you have the packed repository:
1. Read the code using the outputId from the tool response
2. Give me a high-level overview of this project
3. Explain its architecture and main components
4. Identify the key technologies and dependencies used
5. Highlight any interesting patterns or design decisions
Please be thorough in your analysis.`,
},
},
],
};
}));
};
//# sourceMappingURL=packRemoteRepositoryPrompts.js.map