UNPKG

@gohcltech/bitbucket-mcp

Version:

Bitbucket integration for Claude via Model Context Protocol

111 lines 3.44 kB
/** * @fileoverview Consolidated branch management tool for v2.1. * * Replaces v2.0 tools: list_branches, get_branch, create_branch, delete_branch * Consolidates 4 tools into 1 with action-based routing. */ import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { ConsolidatedBaseTool } from './consolidated-base-tool.js'; import { ToolHandler } from './base-tool.js'; import { ToolCategory } from '../auth-capabilities.js'; import { BranchAction } from '../types/consolidated-tools.js'; /** * Consolidated branch management tool for v2.1. * * Provides unified branch management operations with action-based routing. * * **Replaces v2.0 tools:** * - list_branches * - get_branch * - create_branch * - delete_branch * * **Actions:** * - `list`: List all branches in a repository * - `get`: Get detailed branch information * - `create`: Create a new branch * - `delete`: Delete a branch * * @example * ```typescript * // List all branches * const response = await tool.execute({ * action: 'list', * workspaceSlug: 'my-workspace', * repoSlug: 'my-repo' * }); * * // Create a new branch from develop * const response = await tool.execute({ * action: 'create', * workspaceSlug: 'my-workspace', * repoSlug: 'my-repo', * branchName: 'feature/new-feature', * sourceBranch: 'develop' * }); * * // Delete a branch * const response = await tool.execute({ * action: 'delete', * workspaceSlug: 'my-workspace', * repoSlug: 'my-repo', * branchName: 'feature/old-feature' * }); * ``` */ export declare class ManageBranchesTool extends ConsolidatedBaseTool<BranchAction> { getTools(): Tool[]; getToolCategory(): ToolCategory; protected getActionHandler(action: BranchAction): ToolHandler | null; protected validateActionParams(action: BranchAction, args: Record<string, any>): void; /** * Handler for listing all branches in a repository. * * @param args - Tool arguments (workspace, repo) * @returns List of branches with commit information */ private handleListBranches; /** * Handler for getting detailed information about a specific branch. * * @param args - Tool arguments (must include branchName) * @returns Detailed branch information */ private handleGetBranch; /** * Handler for creating a new branch. * * @param args - Tool arguments (must include branchName, optional sourceBranch) * @returns Created branch information */ private handleCreateBranch; /** * Handler for deleting a branch. * * @param args - Tool arguments (must include branchName) * @returns Confirmation of deletion */ private handleDeleteBranch; /** * Handler for getting the branching model configuration. * * @param args - Tool arguments (workspace, repo) * @returns Branching model configuration */ private handleGetBranchingModel; /** * Handler for getting branch protection rules. * * @param args - Tool arguments (workspace, repo) * @returns Branch protection configuration */ private handleGetBranchPermissions; /** * Handler for getting automatic reviewer assignments. * * @param args - Tool arguments (workspace, repo) * @returns Default reviewer configuration */ private handleGetDefaultReviewers; } //# sourceMappingURL=branch-tools.d.ts.map