@procedures/git 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +1130 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/module.d.ts +22 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +514 -0
- package/dist/module.js.map +1 -0
- package/dist/procedures/git/add.d.ts +12 -0
- package/dist/procedures/git/add.d.ts.map +1 -0
- package/dist/procedures/git/add.js +26 -0
- package/dist/procedures/git/add.js.map +1 -0
- package/dist/procedures/git/args.d.ts +15 -0
- package/dist/procedures/git/args.d.ts.map +1 -0
- package/dist/procedures/git/args.js +20 -0
- package/dist/procedures/git/args.js.map +1 -0
- package/dist/procedures/git/branch.d.ts +12 -0
- package/dist/procedures/git/branch.d.ts.map +1 -0
- package/dist/procedures/git/branch.js +54 -0
- package/dist/procedures/git/branch.js.map +1 -0
- package/dist/procedures/git/checkout.d.ts +12 -0
- package/dist/procedures/git/checkout.d.ts.map +1 -0
- package/dist/procedures/git/checkout.js +23 -0
- package/dist/procedures/git/checkout.js.map +1 -0
- package/dist/procedures/git/clone.d.ts +12 -0
- package/dist/procedures/git/clone.d.ts.map +1 -0
- package/dist/procedures/git/clone.js +28 -0
- package/dist/procedures/git/clone.js.map +1 -0
- package/dist/procedures/git/commit.d.ts +12 -0
- package/dist/procedures/git/commit.d.ts.map +1 -0
- package/dist/procedures/git/commit.js +41 -0
- package/dist/procedures/git/commit.js.map +1 -0
- package/dist/procedures/git/diff.d.ts +18 -0
- package/dist/procedures/git/diff.d.ts.map +1 -0
- package/dist/procedures/git/diff.js +58 -0
- package/dist/procedures/git/diff.js.map +1 -0
- package/dist/procedures/git/fetch.d.ts +12 -0
- package/dist/procedures/git/fetch.d.ts.map +1 -0
- package/dist/procedures/git/fetch.js +29 -0
- package/dist/procedures/git/fetch.js.map +1 -0
- package/dist/procedures/git/index.d.ts +15 -0
- package/dist/procedures/git/index.d.ts.map +1 -0
- package/dist/procedures/git/index.js +15 -0
- package/dist/procedures/git/index.js.map +1 -0
- package/dist/procedures/git/init.d.ts +12 -0
- package/dist/procedures/git/init.d.ts.map +1 -0
- package/dist/procedures/git/init.js +32 -0
- package/dist/procedures/git/init.js.map +1 -0
- package/dist/procedures/git/log.d.ts +12 -0
- package/dist/procedures/git/log.d.ts.map +1 -0
- package/dist/procedures/git/log.js +35 -0
- package/dist/procedures/git/log.js.map +1 -0
- package/dist/procedures/git/predicates.d.ts +40 -0
- package/dist/procedures/git/predicates.d.ts.map +1 -0
- package/dist/procedures/git/predicates.js +76 -0
- package/dist/procedures/git/predicates.js.map +1 -0
- package/dist/procedures/git/pull.d.ts +12 -0
- package/dist/procedures/git/pull.d.ts.map +1 -0
- package/dist/procedures/git/pull.js +36 -0
- package/dist/procedures/git/pull.js.map +1 -0
- package/dist/procedures/git/push.d.ts +12 -0
- package/dist/procedures/git/push.d.ts.map +1 -0
- package/dist/procedures/git/push.js +39 -0
- package/dist/procedures/git/push.js.map +1 -0
- package/dist/procedures/git/remote.d.ts +13 -0
- package/dist/procedures/git/remote.d.ts.map +1 -0
- package/dist/procedures/git/remote.js +30 -0
- package/dist/procedures/git/remote.js.map +1 -0
- package/dist/procedures/git/run.d.ts +32 -0
- package/dist/procedures/git/run.d.ts.map +1 -0
- package/dist/procedures/git/run.js +60 -0
- package/dist/procedures/git/run.js.map +1 -0
- package/dist/procedures/git/stash.d.ts +38 -0
- package/dist/procedures/git/stash.d.ts.map +1 -0
- package/dist/procedures/git/stash.js +211 -0
- package/dist/procedures/git/stash.js.map +1 -0
- package/dist/procedures/git/status.d.ts +17 -0
- package/dist/procedures/git/status.d.ts.map +1 -0
- package/dist/procedures/git/status.js +107 -0
- package/dist/procedures/git/status.js.map +1 -0
- package/dist/procedures/git.d.ts +5 -0
- package/dist/procedures/git.d.ts.map +1 -0
- package/dist/procedures/git.js +5 -0
- package/dist/procedures/git.js.map +1 -0
- package/dist/register.d.ts +7 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +9 -0
- package/dist/register.js.map +1 -0
- package/dist/types.d.ts +350 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +397 -0
- package/dist/types.js.map +1 -0
- package/package.json +77 -3
- package/src/index.ts +20 -0
- package/src/module.ts +656 -0
- package/src/procedures/git/add.ts +29 -0
- package/src/procedures/git/args.ts +21 -0
- package/src/procedures/git/branch.ts +61 -0
- package/src/procedures/git/checkout.ts +27 -0
- package/src/procedures/git/clone.ts +33 -0
- package/src/procedures/git/commit.ts +46 -0
- package/src/procedures/git/diff.ts +62 -0
- package/src/procedures/git/fetch.ts +32 -0
- package/src/procedures/git/index.ts +22 -0
- package/src/procedures/git/init.ts +43 -0
- package/src/procedures/git/log.ts +40 -0
- package/src/procedures/git/predicates.ts +90 -0
- package/src/procedures/git/pull.ts +45 -0
- package/src/procedures/git/push.ts +42 -0
- package/src/procedures/git/remote.ts +31 -0
- package/src/procedures/git/run.ts +70 -0
- package/src/procedures/git/stash.ts +255 -0
- package/src/procedures/git/status.ts +98 -0
- package/src/procedures/git.ts +5 -0
- package/src/register.ts +11 -0
- package/src/types.ts +815 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,815 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for client-git procedures
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// git.status Types - Get git status
|
|
9
|
+
// =============================================================================
|
|
10
|
+
|
|
11
|
+
export const GitStatusInputSchema: z.ZodObject<{
|
|
12
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
13
|
+
short: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14
|
+
}> = z.object({
|
|
15
|
+
/** Working directory (default: process.cwd()) */
|
|
16
|
+
cwd: z.string().optional().describe("Working directory (default: process.cwd())"),
|
|
17
|
+
/** Show short format (default: false) */
|
|
18
|
+
short: z.boolean().optional().default(false).describe("Show short format (default: false)"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type GitStatusInput = z.infer<typeof GitStatusInputSchema>;
|
|
22
|
+
|
|
23
|
+
export interface GitStatusFile {
|
|
24
|
+
/** The path of the file (for a rename or a copy, the new path) */
|
|
25
|
+
path: string;
|
|
26
|
+
/** For a rename or a copy, the old path */
|
|
27
|
+
from?: string | undefined;
|
|
28
|
+
status: "modified" | "added" | "deleted" | "renamed" | "copied" | "untracked" | "ignored";
|
|
29
|
+
staged: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GitStatusOutput {
|
|
33
|
+
branch: string;
|
|
34
|
+
ahead: number;
|
|
35
|
+
behind: number;
|
|
36
|
+
files: GitStatusFile[];
|
|
37
|
+
clean: boolean;
|
|
38
|
+
/** With `short: true`, one line per file in the format of `git status --short` */
|
|
39
|
+
lines?: string[] | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// git.add Types - Stage files
|
|
44
|
+
// =============================================================================
|
|
45
|
+
|
|
46
|
+
export const GitAddInputSchema: z.ZodObject<{
|
|
47
|
+
paths: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
48
|
+
all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
49
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}> = z.object({
|
|
51
|
+
/** Paths to stage (default: []) */
|
|
52
|
+
paths: z.array(z.string()).optional().default([]).describe("Paths to stage (default: [])"),
|
|
53
|
+
/** Stage all changes (default: false) */
|
|
54
|
+
all: z.boolean().optional().default(false).describe("Stage all changes (default: false)"),
|
|
55
|
+
/** Working directory */
|
|
56
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export type GitAddInput = z.infer<typeof GitAddInputSchema>;
|
|
60
|
+
|
|
61
|
+
export interface GitAddOutput {
|
|
62
|
+
staged: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// git.commit Types - Create commit
|
|
67
|
+
// =============================================================================
|
|
68
|
+
|
|
69
|
+
export const GitCommitInputSchema: z.ZodObject<{
|
|
70
|
+
message: z.ZodString;
|
|
71
|
+
all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
72
|
+
amend: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
73
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}> = z.object({
|
|
75
|
+
/** Commit message */
|
|
76
|
+
message: z.string().describe("Commit message"),
|
|
77
|
+
/** Automatically stage modified files (default: false) */
|
|
78
|
+
all: z.boolean().optional().default(false).describe("Automatically stage modified files (default: false)"),
|
|
79
|
+
/** Amend the last commit (default: false) */
|
|
80
|
+
amend: z.boolean().optional().default(false).describe("Amend the last commit (default: false)"),
|
|
81
|
+
/** Working directory */
|
|
82
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export type GitCommitInput = z.infer<typeof GitCommitInputSchema>;
|
|
86
|
+
|
|
87
|
+
export interface GitCommitOutput {
|
|
88
|
+
hash: string;
|
|
89
|
+
message: string;
|
|
90
|
+
author: string;
|
|
91
|
+
date: string;
|
|
92
|
+
/** True if commit was skipped (nothing to commit) */
|
|
93
|
+
skipped?: boolean | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// =============================================================================
|
|
97
|
+
// git.push Types - Push to remote
|
|
98
|
+
// =============================================================================
|
|
99
|
+
|
|
100
|
+
export const GitPushInputSchema: z.ZodObject<{
|
|
101
|
+
remote: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
102
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
103
|
+
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
104
|
+
setUpstream: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
105
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}> = z.object({
|
|
107
|
+
/** Remote name (default: origin) */
|
|
108
|
+
remote: z.string().optional().default("origin").describe("Remote name (default: origin)"),
|
|
109
|
+
/** Branch to push (default: current branch) */
|
|
110
|
+
branch: z.string().optional().describe("Branch to push (default: current branch)"),
|
|
111
|
+
/** Force push (default: false) */
|
|
112
|
+
force: z.boolean().optional().default(false).describe("Force push (default: false)"),
|
|
113
|
+
/** Set upstream tracking (default: false) */
|
|
114
|
+
setUpstream: z.boolean().optional().default(false).describe("Set upstream tracking (default: false)"),
|
|
115
|
+
/** Working directory */
|
|
116
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export type GitPushInput = z.infer<typeof GitPushInputSchema>;
|
|
120
|
+
|
|
121
|
+
export interface GitPushOutput {
|
|
122
|
+
remote: string;
|
|
123
|
+
branch: string;
|
|
124
|
+
commits: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// =============================================================================
|
|
128
|
+
// git.pull Types - Pull from remote
|
|
129
|
+
// =============================================================================
|
|
130
|
+
|
|
131
|
+
export const GitPullInputSchema: z.ZodObject<{
|
|
132
|
+
remote: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
133
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
134
|
+
rebase: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
135
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}> = z.object({
|
|
137
|
+
/** Remote name (default: origin) */
|
|
138
|
+
remote: z.string().optional().default("origin").describe("Remote name (default: origin)"),
|
|
139
|
+
/** Branch to pull (default: current branch) */
|
|
140
|
+
branch: z.string().optional().describe("Branch to pull (default: current branch)"),
|
|
141
|
+
/** Rebase instead of merge (default: false) */
|
|
142
|
+
rebase: z.boolean().optional().default(false).describe("Rebase instead of merge (default: false)"),
|
|
143
|
+
/** Working directory */
|
|
144
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export type GitPullInput = z.infer<typeof GitPullInputSchema>;
|
|
148
|
+
|
|
149
|
+
export interface GitPullOutput {
|
|
150
|
+
remote: string;
|
|
151
|
+
branch: string;
|
|
152
|
+
commits: number;
|
|
153
|
+
fastForward: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// =============================================================================
|
|
157
|
+
// git.clone Types - Clone repository
|
|
158
|
+
// =============================================================================
|
|
159
|
+
|
|
160
|
+
export const GitCloneInputSchema: z.ZodObject<{
|
|
161
|
+
url: z.ZodString;
|
|
162
|
+
dest: z.ZodOptional<z.ZodString>;
|
|
163
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
164
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}> = z.object({
|
|
167
|
+
/** Repository URL */
|
|
168
|
+
url: z.string().describe("Repository URL"),
|
|
169
|
+
/** Destination directory (default: derived from URL) */
|
|
170
|
+
dest: z.string().optional().describe("Destination directory (default: derived from URL)"),
|
|
171
|
+
/** Branch to clone (default: default branch) */
|
|
172
|
+
branch: z.string().optional().describe("Branch to clone (default: default branch)"),
|
|
173
|
+
/** Create shallow clone with depth (default: full clone) */
|
|
174
|
+
depth: z.number().optional().describe("Create shallow clone with depth (default: full clone)"),
|
|
175
|
+
/** Working directory */
|
|
176
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export type GitCloneInput = z.infer<typeof GitCloneInputSchema>;
|
|
180
|
+
|
|
181
|
+
export interface GitCloneOutput {
|
|
182
|
+
path: string;
|
|
183
|
+
branch: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// =============================================================================
|
|
187
|
+
// git.checkout Types - Checkout branch or files
|
|
188
|
+
// =============================================================================
|
|
189
|
+
|
|
190
|
+
export const GitCheckoutInputSchema: z.ZodObject<{
|
|
191
|
+
ref: z.ZodString;
|
|
192
|
+
create: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
193
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
195
|
+
}> = z.object({
|
|
196
|
+
/** Branch, tag, or commit to checkout */
|
|
197
|
+
ref: z.string().describe("Branch, tag, or commit to checkout"),
|
|
198
|
+
/** Create branch if it doesn't exist (default: false) */
|
|
199
|
+
create: z.boolean().optional().default(false).describe("Create branch if it doesn't exist (default: false)"),
|
|
200
|
+
/** Specific paths to checkout (default: all) */
|
|
201
|
+
paths: z.array(z.string()).optional().describe("Specific paths to checkout (default: all)"),
|
|
202
|
+
/** Working directory */
|
|
203
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
export type GitCheckoutInput = z.infer<typeof GitCheckoutInputSchema>;
|
|
207
|
+
|
|
208
|
+
export interface GitCheckoutOutput {
|
|
209
|
+
ref: string;
|
|
210
|
+
created: boolean;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// =============================================================================
|
|
214
|
+
// git.branch Types - Branch operations
|
|
215
|
+
// =============================================================================
|
|
216
|
+
|
|
217
|
+
export const GitBranchInputSchema: z.ZodObject<{
|
|
218
|
+
name: z.ZodOptional<z.ZodString>;
|
|
219
|
+
delete: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
220
|
+
list: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
221
|
+
remote: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
222
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}> = z.object({
|
|
224
|
+
/** Branch name (for create/delete) */
|
|
225
|
+
name: z.string().optional().describe("Branch name (for create/delete)"),
|
|
226
|
+
/** Delete the branch (default: false) */
|
|
227
|
+
delete: z.boolean().optional().default(false).describe("Delete the branch (default: false)"),
|
|
228
|
+
/** List branches (default: true if no name provided) */
|
|
229
|
+
list: z.boolean().optional().default(false).describe("List branches (default: true if no name provided)"),
|
|
230
|
+
/** Include remote branches in list (default: false) */
|
|
231
|
+
remote: z.boolean().optional().default(false).describe("Include remote branches in list (default: false)"),
|
|
232
|
+
/** Working directory */
|
|
233
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
export type GitBranchInput = z.infer<typeof GitBranchInputSchema>;
|
|
237
|
+
|
|
238
|
+
export interface GitBranchInfo {
|
|
239
|
+
name: string;
|
|
240
|
+
current: boolean;
|
|
241
|
+
remote: boolean;
|
|
242
|
+
tracking?: string | undefined;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface GitBranchOutput {
|
|
246
|
+
branches?: GitBranchInfo[] | undefined;
|
|
247
|
+
created?: string | undefined;
|
|
248
|
+
deleted?: string | undefined;
|
|
249
|
+
current: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// =============================================================================
|
|
253
|
+
// git.log Types - Show commit log
|
|
254
|
+
// =============================================================================
|
|
255
|
+
|
|
256
|
+
export const GitLogInputSchema: z.ZodObject<{
|
|
257
|
+
count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
258
|
+
oneline: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
259
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
260
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}> = z.object({
|
|
262
|
+
/** Number of commits to show (default: 10) */
|
|
263
|
+
count: z.number().optional().default(10).describe("Number of commits to show (default: 10)"),
|
|
264
|
+
/** One line per commit (default: false) */
|
|
265
|
+
oneline: z.boolean().optional().default(false).describe("One line per commit (default: false)"),
|
|
266
|
+
/** Branch/tag/commit to start from (default: HEAD) */
|
|
267
|
+
ref: z.string().optional().describe("Branch/tag/commit to start from (default: HEAD)"),
|
|
268
|
+
/** Working directory */
|
|
269
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export type GitLogInput = z.infer<typeof GitLogInputSchema>;
|
|
273
|
+
|
|
274
|
+
export interface GitLogCommit {
|
|
275
|
+
hash: string;
|
|
276
|
+
shortHash: string;
|
|
277
|
+
author: string;
|
|
278
|
+
email: string;
|
|
279
|
+
date: string;
|
|
280
|
+
message: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface GitLogOutput {
|
|
284
|
+
commits: GitLogCommit[];
|
|
285
|
+
/** With `oneline: true`, one line per commit: the short hash and the subject */
|
|
286
|
+
lines?: string[] | undefined;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// =============================================================================
|
|
290
|
+
// git.diff Types - Show changes
|
|
291
|
+
// =============================================================================
|
|
292
|
+
|
|
293
|
+
export const GitDiffInputSchema: z.ZodObject<{
|
|
294
|
+
staged: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
295
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
296
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
297
|
+
stat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
298
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}> = z.object({
|
|
300
|
+
/** Show staged changes (default: false, shows unstaged) */
|
|
301
|
+
staged: z.boolean().optional().default(false).describe("Show staged changes (default: false, shows unstaged)"),
|
|
302
|
+
/** Compare against ref (branch/commit) */
|
|
303
|
+
ref: z.string().optional().describe("Compare against ref (branch/commit)"),
|
|
304
|
+
/** Specific paths to diff */
|
|
305
|
+
paths: z.array(z.string()).optional().describe("Specific paths to diff"),
|
|
306
|
+
/** Show stat summary only (default: false) */
|
|
307
|
+
stat: z.boolean().optional().default(false).describe("Show stat summary only (default: false)"),
|
|
308
|
+
/** Working directory */
|
|
309
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
export type GitDiffInput = z.infer<typeof GitDiffInputSchema>;
|
|
313
|
+
|
|
314
|
+
export interface GitDiffFile {
|
|
315
|
+
/** The path of the file (for a rename, the new path) */
|
|
316
|
+
path: string;
|
|
317
|
+
/** For a rename, the old path */
|
|
318
|
+
from?: string | undefined;
|
|
319
|
+
/** Added lines (0 for a binary file) */
|
|
320
|
+
additions: number;
|
|
321
|
+
/** Deleted lines (0 for a binary file) */
|
|
322
|
+
deletions: number;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export interface GitDiffOutput {
|
|
326
|
+
files: GitDiffFile[];
|
|
327
|
+
additions: number;
|
|
328
|
+
deletions: number;
|
|
329
|
+
diff?: string | undefined;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// =============================================================================
|
|
333
|
+
// git.init Types - Initialize a git repository
|
|
334
|
+
// =============================================================================
|
|
335
|
+
|
|
336
|
+
export const GitInitInputSchema: z.ZodObject<{
|
|
337
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
338
|
+
bare: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
339
|
+
initialBranch: z.ZodOptional<z.ZodString>;
|
|
340
|
+
}> = z.object({
|
|
341
|
+
/** Directory to initialize (default: process.cwd()) */
|
|
342
|
+
cwd: z.string().optional().describe("Directory to initialize (default: process.cwd())"),
|
|
343
|
+
/** Create a bare repository (default: false) */
|
|
344
|
+
bare: z.boolean().optional().default(false).describe("Create a bare repository (default: false)"),
|
|
345
|
+
/** Name for the initial branch */
|
|
346
|
+
initialBranch: z.string().optional().describe("Name for the initial branch"),
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export type GitInitInput = z.infer<typeof GitInitInputSchema>;
|
|
350
|
+
|
|
351
|
+
export interface GitInitOutput {
|
|
352
|
+
/** The initialized repository path */
|
|
353
|
+
path: string;
|
|
354
|
+
/** Whether the repo was newly created */
|
|
355
|
+
created: boolean;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// =============================================================================
|
|
359
|
+
// git.remote Types - Get or set remote URLs
|
|
360
|
+
// =============================================================================
|
|
361
|
+
|
|
362
|
+
export const GitRemoteInputSchema: z.ZodObject<{
|
|
363
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
364
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
365
|
+
}> = z.object({
|
|
366
|
+
/** Remote name (default: origin) */
|
|
367
|
+
name: z.string().optional().default("origin").describe("Remote name (default: origin)"),
|
|
368
|
+
/** Working directory */
|
|
369
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
export type GitRemoteInput = z.infer<typeof GitRemoteInputSchema>;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* The input of git.remote.set. Before 0.2.0, `git.remote` with `url` set the URL: one procedure
|
|
376
|
+
* read and wrote, so a reader of the URL had to declare that it writes (CAPABILITIES-2026-10).
|
|
377
|
+
*/
|
|
378
|
+
export const GitRemoteSetInputSchema: z.ZodObject<{
|
|
379
|
+
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
380
|
+
url: z.ZodString;
|
|
381
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
382
|
+
}> = z.object({
|
|
383
|
+
/** Remote name (default: origin) */
|
|
384
|
+
name: z.string().optional().default("origin").describe("Remote name (default: origin)"),
|
|
385
|
+
/** The URL of the remote: it replaces the URL, or adds the remote when it is missing */
|
|
386
|
+
url: z.string().describe("The URL of the remote: it replaces the URL, or adds the remote when it is missing"),
|
|
387
|
+
/** Working directory */
|
|
388
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
export type GitRemoteSetInput = z.infer<typeof GitRemoteSetInputSchema>;
|
|
392
|
+
|
|
393
|
+
export interface GitRemoteOutput {
|
|
394
|
+
/** Remote name */
|
|
395
|
+
name: string;
|
|
396
|
+
/** Remote URL */
|
|
397
|
+
url: string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// =============================================================================
|
|
401
|
+
// git.fetch Types - Fetch from remote
|
|
402
|
+
// =============================================================================
|
|
403
|
+
|
|
404
|
+
export const GitFetchInputSchema: z.ZodObject<{
|
|
405
|
+
remote: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
406
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
407
|
+
all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
408
|
+
prune: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
409
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
410
|
+
}> = z.object({
|
|
411
|
+
/** Remote name (default: origin) */
|
|
412
|
+
remote: z.string().optional().default("origin").describe("Remote name (default: origin)"),
|
|
413
|
+
/** Specific branch to fetch (default: all) */
|
|
414
|
+
branch: z.string().optional().describe("Specific branch to fetch (default: all)"),
|
|
415
|
+
/** Fetch all remotes (default: false) */
|
|
416
|
+
all: z.boolean().optional().default(false).describe("Fetch all remotes (default: false)"),
|
|
417
|
+
/** Prune deleted branches (default: false) */
|
|
418
|
+
prune: z.boolean().optional().default(false).describe("Prune deleted branches (default: false)"),
|
|
419
|
+
/** Working directory */
|
|
420
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
export type GitFetchInput = z.infer<typeof GitFetchInputSchema>;
|
|
424
|
+
|
|
425
|
+
export interface GitFetchOutput {
|
|
426
|
+
remote: string;
|
|
427
|
+
fetched: boolean;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// =============================================================================
|
|
431
|
+
// git.* Predicate Types
|
|
432
|
+
// =============================================================================
|
|
433
|
+
|
|
434
|
+
export const GitPredicateInputSchema: z.ZodObject<{
|
|
435
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
436
|
+
}> = z.object({
|
|
437
|
+
/** Working directory (default: process.cwd()) */
|
|
438
|
+
cwd: z.string().optional().describe("Working directory (default: process.cwd())"),
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
export type GitPredicateInput = {
|
|
442
|
+
/** Working directory (default: process.cwd()) */
|
|
443
|
+
cwd?: string | undefined;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
export interface GitPredicateOutput {
|
|
447
|
+
/** The predicate result */
|
|
448
|
+
value: boolean;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// =============================================================================
|
|
452
|
+
// git.stash.* Types - Stash operations
|
|
453
|
+
// =============================================================================
|
|
454
|
+
|
|
455
|
+
export interface GitStashEntry {
|
|
456
|
+
/** Stash index (0 = most recent) */
|
|
457
|
+
index: number;
|
|
458
|
+
/** Stash reference (e.g., stash@{0}) */
|
|
459
|
+
ref: string;
|
|
460
|
+
/** Commit hash of the stash */
|
|
461
|
+
hash: string;
|
|
462
|
+
/** Stash message */
|
|
463
|
+
message: string;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// git.stash.list
|
|
467
|
+
export const GitStashListInputSchema: z.ZodObject<{
|
|
468
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
469
|
+
}> = z.object({
|
|
470
|
+
/** Working directory (default: process.cwd()) */
|
|
471
|
+
cwd: z.string().optional().describe("Working directory (default: process.cwd())"),
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
export type GitStashListInput = z.infer<typeof GitStashListInputSchema>;
|
|
475
|
+
|
|
476
|
+
export interface GitStashListOutput {
|
|
477
|
+
/** List of stashes */
|
|
478
|
+
stashes: GitStashEntry[];
|
|
479
|
+
/** Total count */
|
|
480
|
+
count: number;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// git.stash.push
|
|
484
|
+
export const GitStashPushInputSchema: z.ZodObject<{
|
|
485
|
+
message: z.ZodOptional<z.ZodString>;
|
|
486
|
+
includeUntracked: z.ZodOptional<z.ZodBoolean>;
|
|
487
|
+
keepIndex: z.ZodOptional<z.ZodBoolean>;
|
|
488
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
489
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}> = z.object({
|
|
491
|
+
/** Stash message */
|
|
492
|
+
message: z.string().optional().describe("Stash message"),
|
|
493
|
+
/** Include untracked files (default: false) */
|
|
494
|
+
includeUntracked: z.boolean().optional().describe("Include untracked files (default: false)"),
|
|
495
|
+
/** Keep staged changes in index (default: false) */
|
|
496
|
+
keepIndex: z.boolean().optional().describe("Keep staged changes in index (default: false)"),
|
|
497
|
+
/** Specific paths to stash */
|
|
498
|
+
paths: z.array(z.string()).optional().describe("Specific paths to stash"),
|
|
499
|
+
/** Working directory */
|
|
500
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
export type GitStashPushInput = z.infer<typeof GitStashPushInputSchema>;
|
|
504
|
+
|
|
505
|
+
export interface GitStashPushOutput {
|
|
506
|
+
/** Whether changes were stashed */
|
|
507
|
+
stashed: boolean;
|
|
508
|
+
/** Stash reference if created */
|
|
509
|
+
ref?: string | undefined;
|
|
510
|
+
/** Stash message */
|
|
511
|
+
message?: string | undefined;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// git.stash.pop
|
|
515
|
+
export const GitStashPopInputSchema: z.ZodObject<{
|
|
516
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
517
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
518
|
+
}> = z.object({
|
|
519
|
+
/** Stash index to pop (default: 0 = most recent) */
|
|
520
|
+
index: z.number().optional().describe("Stash index to pop (default: 0 = most recent)"),
|
|
521
|
+
/** Working directory */
|
|
522
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
export type GitStashPopInput = z.infer<typeof GitStashPopInputSchema>;
|
|
526
|
+
|
|
527
|
+
export interface GitStashPopOutput {
|
|
528
|
+
/** Whether stash was applied */
|
|
529
|
+
applied: boolean;
|
|
530
|
+
/** Stash reference that was popped */
|
|
531
|
+
ref: string;
|
|
532
|
+
/** Whether stash was dropped (false if conflict) */
|
|
533
|
+
dropped: boolean;
|
|
534
|
+
/** Whether there was a merge conflict */
|
|
535
|
+
conflict?: boolean | undefined;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// git.stash.apply
|
|
539
|
+
export const GitStashApplyInputSchema: z.ZodObject<{
|
|
540
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
541
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
542
|
+
}> = z.object({
|
|
543
|
+
/** Stash index to apply (default: 0 = most recent) */
|
|
544
|
+
index: z.number().optional().describe("Stash index to apply (default: 0 = most recent)"),
|
|
545
|
+
/** Working directory */
|
|
546
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
export type GitStashApplyInput = z.infer<typeof GitStashApplyInputSchema>;
|
|
550
|
+
|
|
551
|
+
export interface GitStashApplyOutput {
|
|
552
|
+
/** Whether stash was applied */
|
|
553
|
+
applied: boolean;
|
|
554
|
+
/** Stash reference that was applied */
|
|
555
|
+
ref: string;
|
|
556
|
+
/** Whether there was a merge conflict */
|
|
557
|
+
conflict?: boolean | undefined;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// git.stash.drop
|
|
561
|
+
export const GitStashDropInputSchema: z.ZodObject<{
|
|
562
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
563
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
564
|
+
}> = z.object({
|
|
565
|
+
/** Stash index to drop (default: 0 = most recent) */
|
|
566
|
+
index: z.number().optional().describe("Stash index to drop (default: 0 = most recent)"),
|
|
567
|
+
/** Working directory */
|
|
568
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
export type GitStashDropInput = z.infer<typeof GitStashDropInputSchema>;
|
|
572
|
+
|
|
573
|
+
export interface GitStashDropOutput {
|
|
574
|
+
/** Whether stash was dropped */
|
|
575
|
+
dropped: boolean;
|
|
576
|
+
/** Stash reference that was dropped */
|
|
577
|
+
ref: string;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// git.stash.export - Export stash as patch for snapshot storage
|
|
581
|
+
export const GitStashExportInputSchema: z.ZodObject<{
|
|
582
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
583
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
584
|
+
}> = z.object({
|
|
585
|
+
/** Stash index to export (default: 0 = most recent) */
|
|
586
|
+
index: z.number().optional().describe("Stash index to export (default: 0 = most recent)"),
|
|
587
|
+
/** Working directory */
|
|
588
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
export type GitStashExportInput = z.infer<typeof GitStashExportInputSchema>;
|
|
592
|
+
|
|
593
|
+
export interface GitStashExportOutput {
|
|
594
|
+
/** Stash reference */
|
|
595
|
+
ref: string;
|
|
596
|
+
/** Commit hash */
|
|
597
|
+
hash: string;
|
|
598
|
+
/** Stash message */
|
|
599
|
+
message: string;
|
|
600
|
+
/** Patch content (diff) */
|
|
601
|
+
patch: string;
|
|
602
|
+
/** Whether stash includes untracked files */
|
|
603
|
+
hasUntracked: boolean;
|
|
604
|
+
/** Untracked files patch if present */
|
|
605
|
+
untrackedPatch?: string | undefined;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// git.stash.import - Import stash from patch
|
|
609
|
+
export const GitStashImportInputSchema: z.ZodObject<{
|
|
610
|
+
patch: z.ZodString;
|
|
611
|
+
message: z.ZodOptional<z.ZodString>;
|
|
612
|
+
includeUntracked: z.ZodOptional<z.ZodBoolean>;
|
|
613
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
614
|
+
}> = z.object({
|
|
615
|
+
/** Patch content to apply and stash */
|
|
616
|
+
patch: z.string().describe("Patch content to apply and stash"),
|
|
617
|
+
/** Message for the new stash */
|
|
618
|
+
message: z.string().optional().describe("Message for the new stash"),
|
|
619
|
+
/** Include untracked files (default: false) */
|
|
620
|
+
includeUntracked: z.boolean().optional().describe("Include untracked files (default: false)"),
|
|
621
|
+
/** Working directory */
|
|
622
|
+
cwd: z.string().optional().describe("Working directory"),
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
export type GitStashImportInput = z.infer<typeof GitStashImportInputSchema>;
|
|
626
|
+
|
|
627
|
+
export interface GitStashImportOutput {
|
|
628
|
+
/** Whether import succeeded */
|
|
629
|
+
imported: boolean;
|
|
630
|
+
/** New stash reference if created */
|
|
631
|
+
ref?: string | undefined;
|
|
632
|
+
/** Error message if failed */
|
|
633
|
+
error?: string | undefined;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// =============================================================================
|
|
637
|
+
// Output schemas (roadmap 2.1)
|
|
638
|
+
// =============================================================================
|
|
639
|
+
|
|
640
|
+
// Loose objects: a field that a schema does not name stays in the result (a strict schema would
|
|
641
|
+
// remove it when the output is validated).
|
|
642
|
+
|
|
643
|
+
const statusFile = z.looseObject({
|
|
644
|
+
path: z.string().describe("The path of the file (for a rename or a copy, the new path)"),
|
|
645
|
+
from: z.string().optional().describe("For a rename or a copy, the old path"),
|
|
646
|
+
status: z
|
|
647
|
+
.enum(["modified", "added", "deleted", "renamed", "copied", "untracked", "ignored"])
|
|
648
|
+
.describe("The change of the file"),
|
|
649
|
+
staged: z.boolean().describe("True when the change is in the index"),
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
export const GitStatusOutputSchema: z.ZodType<GitStatusOutput> = z.looseObject({
|
|
653
|
+
branch: z.string().describe('The current branch ("HEAD" when detached)'),
|
|
654
|
+
ahead: z.number().describe("The commits that the upstream does not have"),
|
|
655
|
+
behind: z.number().describe("The commits of the upstream that the branch does not have"),
|
|
656
|
+
files: z.array(statusFile).describe("The changed, untracked and ignored files"),
|
|
657
|
+
clean: z.boolean().describe("True when nothing changed"),
|
|
658
|
+
lines: z.array(z.string()).optional().describe("With short: true, one line per file as git status --short gives it"),
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
export const GitAddOutputSchema: z.ZodType<GitAddOutput> = z.looseObject({
|
|
662
|
+
staged: z.array(z.string()).describe("The files that the call staged"),
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
export const GitCommitOutputSchema: z.ZodType<GitCommitOutput> = z.looseObject({
|
|
666
|
+
hash: z.string().describe("The hash of the new commit"),
|
|
667
|
+
message: z.string().describe("The commit message"),
|
|
668
|
+
author: z.string().describe("The author"),
|
|
669
|
+
date: z.string().describe("The date of the commit"),
|
|
670
|
+
skipped: z.boolean().optional().describe("True when there was nothing to commit"),
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
export const GitPushOutputSchema: z.ZodType<GitPushOutput> = z.looseObject({
|
|
674
|
+
remote: z.string().describe("The remote"),
|
|
675
|
+
branch: z.string().describe("The branch"),
|
|
676
|
+
commits: z.number().describe("The number of commits that the push sent"),
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
export const GitPullOutputSchema: z.ZodType<GitPullOutput> = z.looseObject({
|
|
680
|
+
remote: z.string().describe("The remote"),
|
|
681
|
+
branch: z.string().describe("The branch"),
|
|
682
|
+
commits: z.number().describe("The number of commits that the pull brought"),
|
|
683
|
+
fastForward: z.boolean().describe("True for a fast-forward"),
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
export const GitCloneOutputSchema: z.ZodType<GitCloneOutput> = z.looseObject({
|
|
687
|
+
path: z.string().describe("The folder of the clone"),
|
|
688
|
+
branch: z.string().describe("The branch of the clone"),
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
export const GitCheckoutOutputSchema: z.ZodType<GitCheckoutOutput> = z.looseObject({
|
|
692
|
+
ref: z.string().describe("The branch or the ref that is checked out"),
|
|
693
|
+
created: z.boolean().describe("True when the call made the branch"),
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
export const GitBranchOutputSchema: z.ZodType<GitBranchOutput> = z.looseObject({
|
|
697
|
+
branches: z
|
|
698
|
+
.array(
|
|
699
|
+
z.looseObject({
|
|
700
|
+
name: z.string().describe("The branch name"),
|
|
701
|
+
current: z.boolean().describe("True for the current branch"),
|
|
702
|
+
remote: z.boolean().describe("True for a remote-tracking branch"),
|
|
703
|
+
tracking: z.string().optional().describe("The upstream of the branch"),
|
|
704
|
+
})
|
|
705
|
+
)
|
|
706
|
+
.optional()
|
|
707
|
+
.describe("The branches, for a list"),
|
|
708
|
+
created: z.string().optional().describe("The branch that the call made"),
|
|
709
|
+
deleted: z.string().optional().describe("The branch that the call deleted"),
|
|
710
|
+
current: z.string().describe("The current branch"),
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
export const GitLogOutputSchema: z.ZodType<GitLogOutput> = z.looseObject({
|
|
714
|
+
commits: z
|
|
715
|
+
.array(
|
|
716
|
+
z.looseObject({
|
|
717
|
+
hash: z.string().describe("The commit hash"),
|
|
718
|
+
shortHash: z.string().describe("The short hash"),
|
|
719
|
+
author: z.string().describe("The author name"),
|
|
720
|
+
email: z.string().describe("The author email"),
|
|
721
|
+
date: z.string().describe("The author date"),
|
|
722
|
+
message: z.string().describe("The commit message"),
|
|
723
|
+
})
|
|
724
|
+
)
|
|
725
|
+
.describe("The commits, newest first"),
|
|
726
|
+
lines: z.array(z.string()).optional().describe("With oneline: true, the short hash and the subject of each commit"),
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
export const GitDiffOutputSchema: z.ZodType<GitDiffOutput> = z.looseObject({
|
|
730
|
+
files: z
|
|
731
|
+
.array(
|
|
732
|
+
z.looseObject({
|
|
733
|
+
path: z.string().describe("The path of the file (for a rename, the new path)"),
|
|
734
|
+
from: z.string().optional().describe("For a rename, the old path"),
|
|
735
|
+
additions: z.number().describe("The added lines (0 for a binary file)"),
|
|
736
|
+
deletions: z.number().describe("The deleted lines (0 for a binary file)"),
|
|
737
|
+
})
|
|
738
|
+
)
|
|
739
|
+
.describe("The changed files"),
|
|
740
|
+
additions: z.number().describe("The added lines of all files"),
|
|
741
|
+
deletions: z.number().describe("The deleted lines of all files"),
|
|
742
|
+
diff: z.string().optional().describe("The text of the diff"),
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
export const GitInitOutputSchema: z.ZodType<GitInitOutput> = z.looseObject({
|
|
746
|
+
path: z.string().describe("The folder of the repository"),
|
|
747
|
+
created: z.boolean().describe("True when the call made a new repository"),
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
export const GitRemoteOutputSchema: z.ZodType<GitRemoteOutput> = z.looseObject({
|
|
751
|
+
name: z.string().describe("The remote name"),
|
|
752
|
+
url: z.string().describe("The remote URL"),
|
|
753
|
+
});
|
|
754
|
+
|
|
755
|
+
export const GitFetchOutputSchema: z.ZodType<GitFetchOutput> = z.looseObject({
|
|
756
|
+
remote: z.string().describe("The remote"),
|
|
757
|
+
fetched: z.boolean().describe("True when the fetch ran"),
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
export const GitPredicateOutputSchema: z.ZodType<GitPredicateOutput> = z.looseObject({
|
|
761
|
+
value: z.boolean().describe("The answer of the predicate"),
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
export const GitStashListOutputSchema: z.ZodType<GitStashListOutput> = z.looseObject({
|
|
765
|
+
stashes: z
|
|
766
|
+
.array(
|
|
767
|
+
z.looseObject({
|
|
768
|
+
index: z.number().describe("The stash index (0 is the newest)"),
|
|
769
|
+
ref: z.string().describe("The stash reference, for example stash@{0}"),
|
|
770
|
+
hash: z.string().describe("The commit hash of the stash"),
|
|
771
|
+
message: z.string().describe("The stash message"),
|
|
772
|
+
})
|
|
773
|
+
)
|
|
774
|
+
.describe("The stashes"),
|
|
775
|
+
count: z.number().describe("The number of stashes"),
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
export const GitStashPushOutputSchema: z.ZodType<GitStashPushOutput> = z.looseObject({
|
|
779
|
+
stashed: z.boolean().describe("True when the call stashed changes"),
|
|
780
|
+
ref: z.string().optional().describe("The new stash reference"),
|
|
781
|
+
message: z.string().optional().describe("The stash message"),
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
export const GitStashPopOutputSchema: z.ZodType<GitStashPopOutput> = z.looseObject({
|
|
785
|
+
applied: z.boolean().describe("True when the stash was applied"),
|
|
786
|
+
ref: z.string().describe("The stash reference"),
|
|
787
|
+
dropped: z.boolean().describe("True when the stash was dropped (false after a conflict)"),
|
|
788
|
+
conflict: z.boolean().optional().describe("True when the stash had a merge conflict"),
|
|
789
|
+
});
|
|
790
|
+
|
|
791
|
+
export const GitStashApplyOutputSchema: z.ZodType<GitStashApplyOutput> = z.looseObject({
|
|
792
|
+
applied: z.boolean().describe("True when the stash was applied"),
|
|
793
|
+
ref: z.string().describe("The stash reference"),
|
|
794
|
+
conflict: z.boolean().optional().describe("True when the stash had a merge conflict"),
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
export const GitStashDropOutputSchema: z.ZodType<GitStashDropOutput> = z.looseObject({
|
|
798
|
+
dropped: z.boolean().describe("True when the stash was dropped"),
|
|
799
|
+
ref: z.string().describe("The stash reference"),
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
export const GitStashExportOutputSchema: z.ZodType<GitStashExportOutput> = z.looseObject({
|
|
803
|
+
ref: z.string().describe("The stash reference"),
|
|
804
|
+
hash: z.string().describe("The commit hash of the stash"),
|
|
805
|
+
message: z.string().describe("The stash message"),
|
|
806
|
+
patch: z.string().describe("The patch of the tracked changes"),
|
|
807
|
+
hasUntracked: z.boolean().describe("True when the stash has untracked files"),
|
|
808
|
+
untrackedPatch: z.string().optional().describe("The patch of the untracked files"),
|
|
809
|
+
});
|
|
810
|
+
|
|
811
|
+
export const GitStashImportOutputSchema: z.ZodType<GitStashImportOutput> = z.looseObject({
|
|
812
|
+
imported: z.boolean().describe("True when the import succeeded"),
|
|
813
|
+
ref: z.string().optional().describe("The new stash reference"),
|
|
814
|
+
error: z.string().optional().describe("Why the import failed"),
|
|
815
|
+
});
|