UNPKG

deepsource-mcp-server

Version:
62 lines (61 loc) 2.48 kB
/** * @fileoverview Recent run issues handler for the DeepSource MCP server * This module provides MCP tool handlers for fetching issues from the most recent run. */ import { DeepSourceClient } from '../deepsource.js'; import { ApiResponse } from '../models/common.js'; import { Logger } from '../utils/logging/logger.js'; import { PaginationParams } from '../utils/pagination/types.js'; import { BaseHandlerDeps } from './base/handler.interface.js'; import { IAnalysisRunRepository } from '../domain/aggregates/analysis-run/analysis-run.repository.js'; /** * Interface for parameters for fetching issues from the most recent run * @public */ export interface DeepsourceRecentRunIssuesParams extends PaginationParams { /** DeepSource project key to fetch issues for */ projectKey: string; /** Branch name to fetch the most recent run from */ branchName: string; } /** * Extended dependencies interface for recent run issues handler */ interface RecentRunIssuesHandlerDeps { analysisRunRepository: IAnalysisRunRepository; client: DeepSourceClient; logger: Logger; } /** * Creates a recent run issues handler with injected dependencies using domain aggregates * @param deps - The dependencies for the handler * @returns The configured handler function */ export declare function createRecentRunIssuesHandlerWithRepo(deps: RecentRunIssuesHandlerDeps): (params: DeepsourceRecentRunIssuesParams) => Promise<{ content: { type: "text"; text: string; }[]; isError?: never; } | { isError: boolean; content: { type: "text"; text: string; }[]; }>; /** * Creates a recent run issues handler with injected dependencies * @param deps - The dependencies for the handler * @returns The configured handler factory */ export declare const createRecentRunIssuesHandler: import("./base/handler.interface.js").HandlerFactory<BaseHandlerDeps, DeepsourceRecentRunIssuesParams, ApiResponse>; /** * Fetches and returns issues from the most recent analysis run on a specific branch using domain aggregates * @param params - Parameters for fetching the issues, including project key, branch name, and pagination * @returns A response containing the issues data and run information * @throws Error if the DEEPSOURCE_API_KEY environment variable is not set * @public */ export declare function handleDeepsourceRecentRunIssues(params: DeepsourceRecentRunIssuesParams): Promise<ApiResponse>; export {};