remcode
Version:
Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.
42 lines (41 loc) • 1.64 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.RepositoryMCPHandler = void 0;
const logger_1 = require("../../utils/logger");
const repository_1 = require("../../github/repository");
const client_1 = require("../../github/client");
const logger = (0, logger_1.getLogger)('RepositoryMCPHandler');
class RepositoryMCPHandler {
constructor(githubToken) {
const githubClient = new client_1.GitHubClient({ token: githubToken });
this.githubRepository = new repository_1.GitHubRepository(githubClient);
}
async handleGetRepositoryStatus(req, res, params) {
const { owner, repo } = params || req.body;
if (!owner || !repo) {
res.status(400).json({ error: 'Owner and repo are required' });
return;
}
try {
const repoInfo = await this.githubRepository.getRepositoryInfo(owner, repo);
res.status(200).json({
repository: repoInfo,
remcodeStatus: 'initialized',
lastProcessed: new Date().toISOString()
});
}
catch (error) {
res.status(500).json({ error: 'Failed to get repository status' });
}
}
async handleListRepositories(req, res, params) {
try {
const repositories = await this.githubRepository.listUserRepositories();
res.status(200).json({ repositories, total: repositories.length });
}
catch (error) {
res.status(500).json({ error: 'Failed to list repositories' });
}
}
}
exports.RepositoryMCPHandler = RepositoryMCPHandler;
;