/** * `cockpit_merge` MCP tool handler. * * Wraps `runMerge` (or `runMergeWithExplicitPr` when `pr` is supplied). Takes * an issue ref, resolves it to a linked PR, and squash-merges IFF the PR is * green and the issue carries `completed:validate`. Fully symmetric with the * CLI verb `cockpit merge ` — the same contract on both transports. * * If the caller's `issue` resolves to a *PR* node (rather than an issue), the * resolver returns `{ kind: 'pr-number' }` and the CLI emits exit-2 with * `reason: 'pr-number'`. `toMcpResult` maps that to `class: 'wrong-kind'` * with the guidance hint carried over verbatim. * * Optional `pr: ` mirrors the CLI's `--pr ` escape hatch: * skips resolution but keeps every safety precondition (linkage verification, * completed:validate, checks green). Never a resolution bypass of safety. */ import type { CommandRunner, GhWrapper } from '@generacy-ai/cockpit'; import { type ToolResult } from '../errors.js'; import { type IssueRefInput } from '../schemas.js'; export interface CockpitMergeInput { issue: IssueRefInput; pr?: number; } export interface CockpitMergeData { pr: { owner: string; repo: string; number: number; url: string; }; action: 'merged' | 'blocked'; checksState: 'success' | 'failure' | 'pending' | 'none'; mergeCommitSha?: string; reason?: string; raw?: unknown; } export interface CockpitMergeDeps { runner?: CommandRunner; gh?: GhWrapper; } export declare function cockpitMerge(input: CockpitMergeInput, deps?: CockpitMergeDeps): Promise>; //# sourceMappingURL=cockpit_merge.d.ts.map