@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,
236 lines • 8.72 kB
TypeScript
/**
* @fileoverview Defines the core logic, schemas, and types for the git_stash tool.
* @module src/mcp-server/tools/gitStash/logic
*/
import { z } from "zod";
import { type RequestContext } from "../../../utils/index.js";
export declare const GitStashBaseSchema: z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
mode: z.ZodEnum<["list", "apply", "pop", "drop", "save"]>;
stashRef: z.ZodOptional<z.ZodString>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
mode: "pop" | "list" | "apply" | "drop" | "save";
message?: string | undefined;
stashRef?: string | undefined;
}, {
mode: "pop" | "list" | "apply" | "drop" | "save";
path?: string | undefined;
message?: string | undefined;
stashRef?: string | undefined;
}>;
export declare const GitStashInputSchema: z.ZodEffects<z.ZodObject<{
path: z.ZodDefault<z.ZodString>;
mode: z.ZodEnum<["list", "apply", "pop", "drop", "save"]>;
stashRef: z.ZodOptional<z.ZodString>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
path: string;
mode: "pop" | "list" | "apply" | "drop" | "save";
message?: string | undefined;
stashRef?: string | undefined;
}, {
mode: "pop" | "list" | "apply" | "drop" | "save";
path?: string | undefined;
message?: string | undefined;
stashRef?: string | undefined;
}>, {
path: string;
mode: "pop" | "list" | "apply" | "drop" | "save";
message?: string | undefined;
stashRef?: string | undefined;
}, {
mode: "pop" | "list" | "apply" | "drop" | "save";
path?: string | undefined;
message?: string | undefined;
stashRef?: string | undefined;
}>;
export declare const GitStashOutputSchema: z.ZodObject<{
success: z.ZodBoolean;
mode: z.ZodString;
message: z.ZodOptional<z.ZodString>;
stashes: z.ZodOptional<z.ZodArray<z.ZodObject<{
ref: z.ZodString;
branch: z.ZodString;
description: z.ZodString;
}, "strip", z.ZodTypeAny, {
description: string;
branch: string;
ref: string;
}, {
description: string;
branch: string;
ref: string;
}>, "many">>;
conflicts: z.ZodOptional<z.ZodBoolean>;
stashCreated: 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, {
success: boolean;
mode: string;
message?: string | undefined;
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;
conflicts?: boolean | undefined;
stashes?: {
description: string;
branch: string;
ref: string;
}[] | undefined;
stashCreated?: boolean | undefined;
}, {
success: boolean;
mode: string;
message?: string | undefined;
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;
conflicts?: boolean | undefined;
stashes?: {
description: string;
branch: string;
ref: string;
}[] | undefined;
stashCreated?: boolean | undefined;
}>;
export type GitStashInput = z.infer<typeof GitStashInputSchema>;
export type GitStashOutput = z.infer<typeof GitStashOutputSchema>;
/**
* 4. IMPLEMENT the core logic function.
* @throws {McpError} If the logic encounters an unrecoverable issue.
*/
export declare function gitStashLogic(params: GitStashInput, context: RequestContext & {
getWorkingDirectory: () => string | undefined;
}): Promise<GitStashOutput>;
//# sourceMappingURL=logic.d.ts.map