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,

211 lines 7.9 kB
/** * @fileoverview Defines the core logic, schemas, and types for the git_commit tool. * @module src/mcp-server/tools/gitCommit/logic */ import { z } from "zod"; import { type RequestContext } from "../../../utils/index.js"; export declare const GitCommitInputSchema: z.ZodObject<{ path: z.ZodDefault<z.ZodString>; message: z.ZodString; author: z.ZodOptional<z.ZodObject<{ name: z.ZodString; email: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; email: string; }, { name: string; email: string; }>>; allowEmpty: z.ZodDefault<z.ZodBoolean>; amend: z.ZodDefault<z.ZodBoolean>; forceUnsignedOnFailure: z.ZodDefault<z.ZodBoolean>; filesToStage: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { path: string; message: string; allowEmpty: boolean; amend: boolean; forceUnsignedOnFailure: boolean; author?: { name: string; email: string; } | undefined; filesToStage?: string[] | undefined; }, { message: string; path?: string | undefined; author?: { name: string; email: string; } | undefined; allowEmpty?: boolean | undefined; amend?: boolean | undefined; forceUnsignedOnFailure?: boolean | undefined; filesToStage?: string[] | undefined; }>; export declare const GitCommitOutputSchema: z.ZodObject<{ success: z.ZodBoolean; message: z.ZodString; commitHash: z.ZodOptional<z.ZodString>; committedFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; nothingToCommit: 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; commitHash?: string | undefined; committedFiles?: string[] | undefined; nothingToCommit?: 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; commitHash?: string | undefined; committedFiles?: string[] | undefined; nothingToCommit?: boolean | undefined; }>; export type GitCommitInput = z.infer<typeof GitCommitInputSchema>; export type GitCommitOutput = z.infer<typeof GitCommitOutputSchema>; /** * 4. IMPLEMENT the core logic function. * @throws {McpError} If the logic encounters an unrecoverable issue. */ export declare function commitGitChanges(params: GitCommitInput, context: RequestContext & { getWorkingDirectory: () => string | undefined; }): Promise<GitCommitOutput>; //# sourceMappingURL=logic.d.ts.map