@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,
178 lines • 6.97 kB
TypeScript
/**
* @fileoverview Defines the core logic, schemas, and types for the git_reset tool.
* @module src/mcp-server/tools/gitReset/logic
*/
import { z } from "zod";
import { type RequestContext } from "../../../utils/index.js";
export declare const GitResetInputSchema: z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
mode: z.ZodDefault<z.ZodEnum<["soft", "mixed", "hard", "merge", "keep"]>>;
commit: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
mode: "merge" | "soft" | "mixed" | "hard" | "keep";
commit?: string | undefined;
}, {
path?: string | undefined;
mode?: "merge" | "soft" | "mixed" | "hard" | "keep" | undefined;
commit?: string | undefined;
}>;
export declare const GitResetOutputSchema: z.ZodObject<{
success: z.ZodBoolean;
message: z.ZodString;
changesSummary: z.ZodOptional<z.ZodString>;
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;
changesSummary?: string | 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;
changesSummary?: string | undefined;
}>;
export type GitResetInput = z.infer<typeof GitResetInputSchema>;
export type GitResetOutput = z.infer<typeof GitResetOutputSchema>;
/**
* 4. IMPLEMENT the core logic function.
* @throws {McpError} If the logic encounters an unrecoverable issue.
*/
export declare function resetGitState(params: GitResetInput, context: RequestContext & {
getWorkingDirectory: () => string | undefined;
}): Promise<GitResetOutput>;
//# sourceMappingURL=logic.d.ts.map