UNPKG

deepsource-mcp-server

Version:
61 lines (60 loc) 2.18 kB
/** * @fileoverview Run handler for the DeepSource MCP server * This module provides MCP tool handlers for fetching a specific DeepSource analysis run. */ import { ApiResponse } from '../models/common.js'; import { Logger } from '../utils/logging/logger.js'; import { BaseHandlerDeps } from './base/handler.interface.js'; import { IAnalysisRunRepository } from '../domain/aggregates/analysis-run/analysis-run.repository.js'; /** * Interface for parameters for fetching a specific run * @public */ export interface DeepsourceRunParams { /** DeepSource project key to fetch the run from */ projectKey: string; /** The run identifier (runUid or commitOid) */ runIdentifier: string; /** Flag to indicate whether the runIdentifier is a commitOid (default: false) */ isCommitOid?: boolean; } /** * Extended dependencies interface for run handler */ interface RunHandlerDeps { analysisRunRepository: IAnalysisRunRepository; logger: Logger; } /** * Creates a run handler with injected dependencies using domain aggregates * @param deps - The dependencies for the handler * @returns The configured handler function */ export declare function createRunHandlerWithRepo(deps: RunHandlerDeps): (params: DeepsourceRunParams) => Promise<{ content: { type: "text"; text: string; }[]; isError?: never; } | { isError: boolean; content: { type: "text"; text: string; }[]; }>; /** * Creates a run handler with injected dependencies * @param deps - The dependencies for the handler * @returns The configured handler factory */ export declare const createRunHandler: import("./base/handler.interface.js").HandlerFactory<BaseHandlerDeps, DeepsourceRunParams, ApiResponse>; /** * Fetches and returns information about a specific analysis run using domain aggregates * @param params - Parameters for fetching the run, including project key and run identifier * @returns A response containing the run data * @throws Error if the DEEPSOURCE_API_KEY environment variable is not set * @public */ export declare function handleDeepsourceRun(params: DeepsourceRunParams): Promise<ApiResponse>; export {};