cortexweaver
Version:
CortexWeaver is a command-line interface (CLI) tool that orchestrates a swarm of specialized AI agents, powered by Claude Code and Gemini CLI, to assist in software development. It transforms a high-level project plan (plan.md) into a series of coordinate
139 lines • 5.2 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MCPClient = void 0;
const client_operations_1 = require("./client-operations");
/**
* MCPClient provides a unified interface for interacting with MCP (Model Context Protocol) servers
* for Neo4j and GitHub operations, with support for agent diagnostics and knowledge management
*/
class MCPClient {
constructor(config = {}) {
// Initialize configuration with environment variables if not provided
const finalConfig = this.initializeConfig(config);
this.operations = new client_operations_1.MCPClientOperations(finalConfig);
}
/**
* Initialize configuration with environment variables fallback
*/
initializeConfig(config) {
const finalConfig = { ...config };
if (!finalConfig.neo4j && process.env.NEO4J_URI) {
finalConfig.neo4j = {
uri: process.env.NEO4J_URI,
username: process.env.NEO4J_USERNAME || 'neo4j',
password: process.env.NEO4J_PASSWORD || '',
mcpServerUrl: process.env.MCP_NEO4J_SERVER_URL
};
}
if (!finalConfig.github && process.env.GITHUB_TOKEN) {
finalConfig.github = {
token: process.env.GITHUB_TOKEN,
mcpServerUrl: process.env.MCP_GITHUB_SERVER_URL
};
}
return finalConfig;
}
// Core connection methods
async connectToNeo4j() {
return this.operations.connectToNeo4j();
}
async connectToGitHub() {
return this.operations.connectToGitHub();
}
async disconnect() {
return this.operations.disconnect();
}
async healthCheck() {
return this.operations.healthCheck();
}
// State query methods
isConnected() {
return this.operations.isConnected();
}
isNeo4jConnected() {
return this.operations.isNeo4jConnected();
}
isGitHubConnected() {
return this.operations.isGitHubConnected();
}
// Configuration methods
updateConfig(config) {
return this.operations.updateConfig(config);
}
getConfig() {
return this.operations.getConfig();
}
// Neo4j operations
async executeCypherQuery(query, parameters) {
return this.operations.executeCypherQuery(query, parameters);
}
async createProjectNode(projectData) {
return this.operations.createProjectNode(projectData);
}
async createTaskNode(taskData) {
return this.operations.createTaskNode(taskData);
}
async linkTaskToProject(taskId, projectId) {
return this.operations.linkTaskToProject(taskId, projectId);
}
// GitHub operations
async createWorktree(branchName, baseBranch = 'main') {
return this.operations.createWorktree(branchName, baseBranch);
}
async writeFileToWorktree(filePath, fileName, content) {
return this.operations.writeFileToWorktree(filePath, fileName, content);
}
async commitToWorktree(worktreePath, message, files) {
return this.operations.commitToWorktree(worktreePath, message, files);
}
async mergeWorktree(branchName, targetBranch = 'main') {
return this.operations.mergeWorktree(branchName, targetBranch);
}
async removeWorktree(worktreePath) {
return this.operations.removeWorktree(worktreePath);
}
// Agent support methods
async scanWorktreeForChanges(projectId) {
return this.operations.scanWorktreeForChanges(projectId);
}
async analyzeLogs(projectId) {
return this.operations.analyzeLogs(projectId);
}
async getStackTrace(errorId) {
return this.operations.getStackTrace(errorId);
}
async getSystemMetrics() {
return this.operations.getSystemMetrics();
}
async runDiagnosticCommands(commands) {
return this.operations.runDiagnosticCommands(commands);
}
async getEnvironmentInfo() {
return this.operations.getEnvironmentInfo();
}
async captureErrorContext(errorId) {
return this.operations.captureErrorContext(errorId);
}
async commitKnowledgeUpdates(projectId, updates) {
return this.operations.commitKnowledgeUpdates(projectId, updates);
}
}
exports.MCPClient = MCPClient;
// Re-export types for backward compatibility
__exportStar(require("./client-operations"), exports);
__exportStar(require("./diagnostic-operations"), exports);
//# sourceMappingURL=index.js.map