import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { ConfigManager } from '../config/manager.js'; import { JenkinsBuildAPI } from '../jenkins/build-api.js'; import { type JenkinsClient, type JenkinsJobParameterDefinition } from '../jenkins/client.js'; import type { DeployInfo, NginxLocationConfig } from '../types/frontend-deploy.js'; type DeployToolArgs = { git_url?: string; project?: string; branch?: string; instance?: string; confirm_missing_file?: boolean; nginx_config_content?: string; nginx_server_name?: string; nginx_api_proxy?: string; nginx_api_path?: string; nginx_port?: number; nginx_root_path?: string; nginx_skip_default_api?: boolean; nginx_extra_locations_json?: string; }; type NginxConfigOptions = { confirmMissingFile: boolean; content?: string; serverName?: string; apiProxy?: string; apiPath?: string; nginxPort?: number; rootPath?: string; skipDefaultApi?: boolean; extraLocations?: NginxLocationConfig[]; }; type ProjectGitUrlResolver = Pick; /** * Register frontend auto deployment tool * * This tool handles the complete frontend deployment flow: * 1. Trigger Jenkins build for the specified branch * 2. Poll build status * 3. If Jenkins pauses (missing config/env), automatically handle it * 4. Resume Jenkins build * 5. Wait for completion */ export declare function registerFrontendDeployAuto(server: McpServer, configManager: ConfigManager): Promise; /** * Parse project name from Git URL * Supports both SSH and HTTPS formats */ export declare function parseProjectName(gitUrl: string): string; export declare function resolveFrontendDeploySource(args: Pick, resolver: ProjectGitUrlResolver): Promise<{ projectName: string; gitUrl: string; }>; export declare function getBranchAvailabilityError(projectName: string, branch: string, branches: string[], remoteBranches?: string[]): string | null; export declare function listRemoteBranches(gitUrl: string): Promise; export declare function getDeployConfigPath(deployInfo: DeployInfo): string; export declare function getDeployEnvCommand(deployInfo: DeployInfo): string; export declare function shouldWriteConfig(deployInfo: DeployInfo): boolean; export declare function shouldInstallEnvironment(deployInfo: DeployInfo): boolean; export declare function shouldEnsureNginxRuntime(deployInfo: DeployInfo): boolean; export declare function getDeployInfoValidationError(deployInfo: DeployInfo): string | null; export declare function resolveBuildModuleParameters(projectName: string, definitions: JenkinsJobParameterDefinition[], buildModule: 'frontend' | 'backend' | 'all'): { parameters?: Record; error?: string; }; export declare function getBuildTriggerParameters(jenkins: Pick, projectName: string, branch: string, buildModule: 'frontend' | 'backend' | 'all'): Promise<{ parameters?: Record; error?: string; }>; export declare function requiresNginxReview(deployInfo: DeployInfo, nginxOptions: NginxConfigOptions): boolean; export {};