@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,
187 lines • 7.08 kB
TypeScript
/**
* @fileoverview Defines the core logic, schemas, and types for the git_clean tool.
* @module src/mcp-server/tools/gitClean/logic
*/
import { z } from "zod";
import { type RequestContext } from "../../../utils/index.js";
export declare const GitCleanInputSchema: z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
force: z.ZodBoolean;
dryRun: z.ZodDefault<z.ZodBoolean>;
directories: z.ZodDefault<z.ZodBoolean>;
ignored: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
path: string;
force: boolean;
dryRun: boolean;
directories: boolean;
ignored: boolean;
}, {
force: boolean;
path?: string | undefined;
dryRun?: boolean | undefined;
directories?: boolean | undefined;
ignored?: boolean | undefined;
}>;
export declare const GitCleanOutputSchema: z.ZodObject<{
success: z.ZodBoolean;
message: z.ZodString;
filesAffected: z.ZodArray<z.ZodString, "many">;
dryRun: 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;
dryRun: boolean;
filesAffected: string[];
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;
}, {
message: string;
success: boolean;
dryRun: boolean;
filesAffected: string[];
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;
}>;
export type GitCleanInput = z.infer<typeof GitCleanInputSchema>;
export type GitCleanOutput = z.infer<typeof GitCleanOutputSchema>;
/**
* 4. IMPLEMENT the core logic function.
* @throws {McpError} If the logic encounters an unrecoverable issue.
*/
export declare function gitCleanLogic(params: GitCleanInput, context: RequestContext & {
getWorkingDirectory: () => string | undefined;
}): Promise<GitCleanOutput>;
//# sourceMappingURL=logic.d.ts.map