UNPKG

@cyanheads/git-mcp-server

Version:

An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management,

242 lines 9.81 kB
/** * @fileoverview Defines the core logic, schemas, and types for the git_rebase tool. * @module src/mcp-server/tools/gitRebase/logic */ import { z } from "zod"; import { type RequestContext } from "../../../utils/index.js"; export declare const GitRebaseBaseSchema: z.ZodObject<{ path: z.ZodDefault<z.ZodString>; mode: z.ZodDefault<z.ZodEnum<["start", "continue", "abort", "skip"]>>; upstream: z.ZodOptional<z.ZodString>; branch: z.ZodOptional<z.ZodString>; interactive: z.ZodDefault<z.ZodBoolean>; strategy: z.ZodOptional<z.ZodEnum<["recursive", "resolve", "ours", "theirs", "octopus", "subtree"]>>; strategyOption: z.ZodOptional<z.ZodString>; onto: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { path: string; mode: "abort" | "start" | "continue" | "skip"; interactive: boolean; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; strategyOption?: string | undefined; onto?: string | undefined; }, { path?: string | undefined; mode?: "abort" | "start" | "continue" | "skip" | undefined; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; interactive?: boolean | undefined; strategyOption?: string | undefined; onto?: string | undefined; }>; export declare const GitRebaseInputSchema: z.ZodEffects<z.ZodObject<{ path: z.ZodDefault<z.ZodString>; mode: z.ZodDefault<z.ZodEnum<["start", "continue", "abort", "skip"]>>; upstream: z.ZodOptional<z.ZodString>; branch: z.ZodOptional<z.ZodString>; interactive: z.ZodDefault<z.ZodBoolean>; strategy: z.ZodOptional<z.ZodEnum<["recursive", "resolve", "ours", "theirs", "octopus", "subtree"]>>; strategyOption: z.ZodOptional<z.ZodString>; onto: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { path: string; mode: "abort" | "start" | "continue" | "skip"; interactive: boolean; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; strategyOption?: string | undefined; onto?: string | undefined; }, { path?: string | undefined; mode?: "abort" | "start" | "continue" | "skip" | undefined; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; interactive?: boolean | undefined; strategyOption?: string | undefined; onto?: string | undefined; }>, { path: string; mode: "abort" | "start" | "continue" | "skip"; interactive: boolean; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; strategyOption?: string | undefined; onto?: string | undefined; }, { path?: string | undefined; mode?: "abort" | "start" | "continue" | "skip" | undefined; branch?: string | undefined; strategy?: "recursive" | "resolve" | "ours" | "theirs" | "octopus" | "subtree" | undefined; upstream?: string | undefined; interactive?: boolean | undefined; strategyOption?: string | undefined; onto?: string | undefined; }>; export declare const GitRebaseOutputSchema: z.ZodObject<{ success: z.ZodBoolean; message: z.ZodString; rebaseCompleted: z.ZodOptional<z.ZodBoolean>; needsManualAction: z.ZodOptional<z.ZodBoolean>; status: z.ZodOptional<z.ZodObject<{ current_branch: z.ZodNullable<z.ZodString>; staged_changes: z.ZodObject<{ Added: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Modified: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Deleted: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Renamed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Copied: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; TypeChanged: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }, { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }>; unstaged_changes: z.ZodObject<{ Added: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Modified: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Deleted: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Renamed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; Copied: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; TypeChanged: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }, { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }>; untracked_files: z.ZodArray<z.ZodString, "many">; conflicted_files: z.ZodArray<z.ZodString, "many">; is_clean: z.ZodBoolean; }, "strip", z.ZodTypeAny, { current_branch: string | null; staged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; unstaged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; untracked_files: string[]; conflicted_files: string[]; is_clean: boolean; }, { current_branch: string | null; staged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; unstaged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; untracked_files: string[]; conflicted_files: string[]; is_clean: boolean; }>>; }, "strip", z.ZodTypeAny, { message: string; success: boolean; status?: { current_branch: string | null; staged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; unstaged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; untracked_files: string[]; conflicted_files: string[]; is_clean: boolean; } | undefined; rebaseCompleted?: boolean | undefined; needsManualAction?: boolean | undefined; }, { message: string; success: boolean; status?: { current_branch: string | null; staged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; unstaged_changes: { Added?: string[] | undefined; Modified?: string[] | undefined; Deleted?: string[] | undefined; Renamed?: string[] | undefined; Copied?: string[] | undefined; TypeChanged?: string[] | undefined; }; untracked_files: string[]; conflicted_files: string[]; is_clean: boolean; } | undefined; rebaseCompleted?: boolean | undefined; needsManualAction?: boolean | undefined; }>; export type GitRebaseInput = z.infer<typeof GitRebaseInputSchema>; export type GitRebaseOutput = z.infer<typeof GitRebaseOutputSchema>; /** * 4. IMPLEMENT the core logic function. * @throws {McpError} If the logic encounters an unrecoverable issue. */ export declare function gitRebaseLogic(params: GitRebaseInput, context: RequestContext & { getWorkingDirectory: () => string | undefined; }): Promise<GitRebaseOutput>; //# sourceMappingURL=logic.d.ts.map