import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { PhaseManager } from '../core/phase-manager.js';
export function createGenerateCiTool(phaseManager: PhaseManager): Tool {
return {
name: 'overseer.generate_ci',
description: 'Generates CI/CD pipeline configuration (GitHub Actions, GitLab CI, etc.) based on phase definitions.',
inputSchema: {
type: 'object',
required: ['repo_name', 'ci_type'],
properties: {
repo_name: {
type: 'string',
description: 'Name of the repository',
},
ci_type: {
type: 'string',
enum: ['github-actions', 'gitlab-ci', 'circleci', 'jenkins'],
description: 'Type of CI/CD system to generate',
},
options: {
type: 'object',
properties: {
run_tests: {
type: 'boolean',
default: true,
description: 'Include test steps in pipeline',
},
deploy_on_complete: {
type: 'boolean',
default: false,
description: 'Include deployment steps',
},
},
},
},
},
};
}
export async function handleGenerateCi(
args: {
repo_name: string;
ci_type: 'github-actions' | 'gitlab-ci' | 'circleci' | 'jenkins';
options?: {
run_tests?: boolean;
deploy_on_complete?: boolean;
};
},
phaseManager: PhaseManager
): Promise<{
success: boolean;
files_created: string[];
pipeline_config: Record<string, unknown>;
message?: string;
}> {
// Note: generate_ci is a planned feature for v1.1+
// This tool will generate CI/CD pipeline configurations based on
// phase definitions and project structure
return {
success: true,
files_created: [],
pipeline_config: {},
message: `CI/CD generation for ${args.ci_type} is planned for v1.1.0. This tool will create pipeline configurations based on phase definitions and project structure.`,
};
}