UNPKG

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

50 lines 2.49 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TaskOperations = void 0; const base_1 = require("./base"); const validators_1 = require("./validators"); class TaskOperations extends base_1.CognitiveCanvasBase { async createTask(taskData) { validators_1.CognitiveCanvasValidators.validateTaskData(taskData); const result = await this.executeQuery('CREATE (t:Task {id: $id, title: $title, description: $description, status: $status, priority: $priority, projectId: $projectId, createdAt: $createdAt}) RETURN t', taskData, 't'); if (!result) { throw new Error('Failed to create task'); } return result; } async createTaskDependency(fromTaskId, toTaskId) { await this.executeQuery('MATCH (t1:Task {id: $fromTaskId}), (t2:Task {id: $toTaskId}) CREATE (t1)-[r:DEPENDS_ON]->(t2) RETURN r', { fromTaskId, toTaskId }); } async getTasksByProject(projectId) { const result = await this.executeQuery('MATCH (t:Task {projectId: $projectId}) RETURN t ORDER BY t.createdAt', { projectId }); if (!result || !result.records) return []; return result.records.map((record) => record.get('t').properties); } async getTaskDependencies(taskId) { const result = await this.executeQuery('MATCH (t:Task {id: $taskId})-[:DEPENDS_ON]->(dep:Task) RETURN dep', { taskId }); if (!result || !result.records) return []; return result.records.map((record) => record.get('dep').properties); } async updateTaskStatus(id, status) { const result = await this.executeQuery('MATCH (t:Task {id: $id}) SET t.status = $status, t.updatedAt = $updatedAt RETURN t', { id, status, updatedAt: new Date().toISOString() }, 't'); if (!result) { throw new Error(`Task with id ${id} not found`); } return result; } async getTask(id) { return this.executeQuery('MATCH (t:Task {id: $id}) RETURN t', { id }, 't'); } async deleteTask(id) { await this.executeQuery('MATCH (t:Task {id: $id}) DETACH DELETE t', { id }); } // Create snapshot method implementation (required by base class) async createSnapshot() { // This will be implemented in the main class throw new Error('createSnapshot must be implemented in the main CognitiveCanvas class'); } } exports.TaskOperations = TaskOperations; //# sourceMappingURL=task-operations.js.map