@cainmaila/gemini-cli-mcp 1.0.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/LICENSE +21 -0
- package/README.md +196 -0
- package/README.zh-TW.md +196 -0
- package/build/cli/buildArgs.d.ts +12 -0
- package/build/cli/buildArgs.js +19 -0
- package/build/cli/buildArgs.js.map +1 -0
- package/build/cli/geminiCommandRunner.d.ts +2 -0
- package/build/cli/geminiCommandRunner.js +108 -0
- package/build/cli/geminiCommandRunner.js.map +1 -0
- package/build/cli/geminiInspector.d.ts +10 -0
- package/build/cli/geminiInspector.js +336 -0
- package/build/cli/geminiInspector.js.map +1 -0
- package/build/cli/geminiRunner.d.ts +2 -0
- package/build/cli/geminiRunner.js +20 -0
- package/build/cli/geminiRunner.js.map +1 -0
- package/build/cli/taskPrompt.d.ts +7 -0
- package/build/cli/taskPrompt.js +31 -0
- package/build/cli/taskPrompt.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +14 -0
- package/build/index.js.map +1 -0
- package/build/mcp/tools.d.ts +244 -0
- package/build/mcp/tools.js +500 -0
- package/build/mcp/tools.js.map +1 -0
- package/build/server.d.ts +3 -0
- package/build/server.js +12 -0
- package/build/server.js.map +1 -0
- package/build/types.d.ts +95 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import type { ExecutePromptInput, GeminiCliInspectionResult, GeminiCommandInput, GeminiExecutionResult, GeminiRunnerOptions } from "../types.js";
|
|
4
|
+
export declare const executePromptInputSchema: z.ZodObject<{
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
model: z.ZodOptional<z.ZodString>;
|
|
7
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
8
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
approvalMode: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
default: "default";
|
|
11
|
+
auto_edit: "auto_edit";
|
|
12
|
+
yolo: "yolo";
|
|
13
|
+
plan: "plan";
|
|
14
|
+
}>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const executePromptOutputSchema: z.ZodObject<{
|
|
17
|
+
ok: z.ZodBoolean;
|
|
18
|
+
finalText: z.ZodString;
|
|
19
|
+
stdout: z.ZodString;
|
|
20
|
+
stderr: z.ZodString;
|
|
21
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
23
|
+
elapsedMs: z.ZodNumber;
|
|
24
|
+
timedOut: z.ZodBoolean;
|
|
25
|
+
aborted: z.ZodBoolean;
|
|
26
|
+
command: z.ZodString;
|
|
27
|
+
args: z.ZodArray<z.ZodString>;
|
|
28
|
+
effectiveApprovalMode: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
default: "default";
|
|
30
|
+
auto_edit: "auto_edit";
|
|
31
|
+
yolo: "yolo";
|
|
32
|
+
plan: "plan";
|
|
33
|
+
}>>;
|
|
34
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
35
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const executeTaskInputSchema: z.ZodObject<{
|
|
38
|
+
task: z.ZodString;
|
|
39
|
+
context: z.ZodOptional<z.ZodString>;
|
|
40
|
+
expectedOutput: z.ZodOptional<z.ZodString>;
|
|
41
|
+
model: z.ZodOptional<z.ZodString>;
|
|
42
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
43
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
approvalMode: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
default: "default";
|
|
46
|
+
auto_edit: "auto_edit";
|
|
47
|
+
yolo: "yolo";
|
|
48
|
+
plan: "plan";
|
|
49
|
+
}>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const executeTaskOutputSchema: z.ZodObject<{
|
|
52
|
+
answer: z.ZodString;
|
|
53
|
+
ok: z.ZodBoolean;
|
|
54
|
+
stdout: z.ZodString;
|
|
55
|
+
stderr: z.ZodString;
|
|
56
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
57
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
58
|
+
elapsedMs: z.ZodNumber;
|
|
59
|
+
timedOut: z.ZodBoolean;
|
|
60
|
+
aborted: z.ZodBoolean;
|
|
61
|
+
command: z.ZodString;
|
|
62
|
+
args: z.ZodArray<z.ZodString>;
|
|
63
|
+
effectiveApprovalMode: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
default: "default";
|
|
65
|
+
auto_edit: "auto_edit";
|
|
66
|
+
yolo: "yolo";
|
|
67
|
+
plan: "plan";
|
|
68
|
+
}>>;
|
|
69
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
70
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const inspectGeminiCliInputSchema: z.ZodObject<{
|
|
73
|
+
includeModelReportedTools: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const inspectGeminiCliOutputSchema: z.ZodObject<{
|
|
77
|
+
version: z.ZodString;
|
|
78
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
79
|
+
command: z.ZodString;
|
|
80
|
+
description: z.ZodString;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
extensions: z.ZodArray<z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
version: z.ZodString;
|
|
85
|
+
path: z.ZodOptional<z.ZodString>;
|
|
86
|
+
source: z.ZodOptional<z.ZodString>;
|
|
87
|
+
enabledUser: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
enabledWorkspace: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
mcpServers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
enabled: z.ZodBoolean;
|
|
94
|
+
builtIn: z.ZodBoolean;
|
|
95
|
+
description: z.ZodOptional<z.ZodString>;
|
|
96
|
+
location: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
mcpServers: z.ZodArray<z.ZodObject<{
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
target: z.ZodString;
|
|
101
|
+
transport: z.ZodString;
|
|
102
|
+
status: z.ZodString;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
modelReportedTools: z.ZodOptional<z.ZodString>;
|
|
105
|
+
modelReportedSummary: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
builtInTools: z.ZodArray<z.ZodString>;
|
|
107
|
+
extensions: z.ZodArray<z.ZodString>;
|
|
108
|
+
skills: z.ZodArray<z.ZodString>;
|
|
109
|
+
mcpServers: z.ZodArray<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
notes: z.ZodArray<z.ZodString>;
|
|
112
|
+
raw: z.ZodObject<{
|
|
113
|
+
help: z.ZodString;
|
|
114
|
+
extensions: z.ZodString;
|
|
115
|
+
skills: z.ZodString;
|
|
116
|
+
mcpServers: z.ZodString;
|
|
117
|
+
modelReportedTools: z.ZodOptional<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export declare const executeImageTaskInputSchema: z.ZodObject<{
|
|
121
|
+
prompt: z.ZodString;
|
|
122
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
styles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
124
|
+
variations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
126
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
approvalMode: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
default: "default";
|
|
129
|
+
auto_edit: "auto_edit";
|
|
130
|
+
yolo: "yolo";
|
|
131
|
+
plan: "plan";
|
|
132
|
+
}>>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export declare const executeImageTaskOutputSchema: z.ZodObject<{
|
|
135
|
+
ok: z.ZodBoolean;
|
|
136
|
+
responseText: z.ZodString;
|
|
137
|
+
imagePaths: z.ZodArray<z.ZodString>;
|
|
138
|
+
primaryImagePath: z.ZodOptional<z.ZodString>;
|
|
139
|
+
stdout: z.ZodString;
|
|
140
|
+
stderr: z.ZodString;
|
|
141
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
142
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
143
|
+
elapsedMs: z.ZodNumber;
|
|
144
|
+
timedOut: z.ZodBoolean;
|
|
145
|
+
aborted: z.ZodBoolean;
|
|
146
|
+
command: z.ZodString;
|
|
147
|
+
args: z.ZodArray<z.ZodString>;
|
|
148
|
+
effectiveApprovalMode: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
default: "default";
|
|
150
|
+
auto_edit: "auto_edit";
|
|
151
|
+
yolo: "yolo";
|
|
152
|
+
plan: "plan";
|
|
153
|
+
}>>;
|
|
154
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
155
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export interface ExecutePromptDependencies {
|
|
158
|
+
runner?: (input: ExecutePromptInput, options?: GeminiRunnerOptions) => Promise<GeminiExecutionResult>;
|
|
159
|
+
commandRunner?: (input: GeminiCommandInput, options?: GeminiRunnerOptions) => Promise<GeminiExecutionResult>;
|
|
160
|
+
}
|
|
161
|
+
export type ExecutePromptToolInput = z.input<typeof executePromptInputSchema>;
|
|
162
|
+
export type ExecuteTaskToolInput = z.input<typeof executeTaskInputSchema>;
|
|
163
|
+
export type ExecuteImageTaskToolInput = z.input<typeof executeImageTaskInputSchema>;
|
|
164
|
+
export type InspectGeminiCliToolInput = z.input<typeof inspectGeminiCliInputSchema>;
|
|
165
|
+
export declare function executePromptTool(input: ExecutePromptToolInput, dependencies?: ExecutePromptDependencies, options?: GeminiRunnerOptions): Promise<{
|
|
166
|
+
isError: boolean;
|
|
167
|
+
content: {
|
|
168
|
+
type: "text";
|
|
169
|
+
text: string;
|
|
170
|
+
}[];
|
|
171
|
+
structuredContent: {
|
|
172
|
+
effectiveApprovalMode?: "default" | "auto_edit" | "yolo" | "plan";
|
|
173
|
+
ok: boolean;
|
|
174
|
+
finalText: string;
|
|
175
|
+
stdout: string;
|
|
176
|
+
stderr: string;
|
|
177
|
+
exitCode: number | null;
|
|
178
|
+
signal: NodeJS.Signals | null;
|
|
179
|
+
elapsedMs: number;
|
|
180
|
+
timedOut: boolean;
|
|
181
|
+
aborted: boolean;
|
|
182
|
+
command: string;
|
|
183
|
+
args: string[];
|
|
184
|
+
workingDirectory?: string;
|
|
185
|
+
errorMessage?: string;
|
|
186
|
+
};
|
|
187
|
+
}>;
|
|
188
|
+
export declare function executeTaskTool(input: ExecuteTaskToolInput, dependencies?: ExecutePromptDependencies, options?: GeminiRunnerOptions): Promise<{
|
|
189
|
+
isError: boolean;
|
|
190
|
+
content: {
|
|
191
|
+
type: "text";
|
|
192
|
+
text: string;
|
|
193
|
+
}[];
|
|
194
|
+
structuredContent: {
|
|
195
|
+
errorMessage?: string;
|
|
196
|
+
workingDirectory?: string;
|
|
197
|
+
effectiveApprovalMode?: "default" | "auto_edit" | "yolo" | "plan";
|
|
198
|
+
answer: string;
|
|
199
|
+
ok: boolean;
|
|
200
|
+
stdout: string;
|
|
201
|
+
stderr: string;
|
|
202
|
+
exitCode: number | null;
|
|
203
|
+
signal: NodeJS.Signals | null;
|
|
204
|
+
elapsedMs: number;
|
|
205
|
+
timedOut: boolean;
|
|
206
|
+
aborted: boolean;
|
|
207
|
+
command: string;
|
|
208
|
+
args: string[];
|
|
209
|
+
};
|
|
210
|
+
}>;
|
|
211
|
+
export declare function inspectGeminiCliTool(input: InspectGeminiCliToolInput, dependencies?: ExecutePromptDependencies, options?: GeminiRunnerOptions): Promise<{
|
|
212
|
+
isError: boolean;
|
|
213
|
+
content: {
|
|
214
|
+
type: "text";
|
|
215
|
+
text: string;
|
|
216
|
+
}[];
|
|
217
|
+
structuredContent: GeminiCliInspectionResult;
|
|
218
|
+
}>;
|
|
219
|
+
export declare function executeImageTaskTool(input: ExecuteImageTaskToolInput, dependencies?: ExecutePromptDependencies, options?: GeminiRunnerOptions): Promise<{
|
|
220
|
+
isError: boolean;
|
|
221
|
+
content: {
|
|
222
|
+
type: "text";
|
|
223
|
+
text: string;
|
|
224
|
+
}[];
|
|
225
|
+
structuredContent: {
|
|
226
|
+
errorMessage?: string;
|
|
227
|
+
workingDirectory?: string;
|
|
228
|
+
stdout: string;
|
|
229
|
+
stderr: string;
|
|
230
|
+
exitCode: number | null;
|
|
231
|
+
signal: NodeJS.Signals | null;
|
|
232
|
+
elapsedMs: number;
|
|
233
|
+
timedOut: boolean;
|
|
234
|
+
aborted: boolean;
|
|
235
|
+
command: string;
|
|
236
|
+
args: string[];
|
|
237
|
+
effectiveApprovalMode: "default" | "auto_edit" | "yolo" | "plan";
|
|
238
|
+
primaryImagePath?: string;
|
|
239
|
+
ok: boolean;
|
|
240
|
+
responseText: string;
|
|
241
|
+
imagePaths: string[];
|
|
242
|
+
};
|
|
243
|
+
}>;
|
|
244
|
+
export declare function registerGeminiTools(server: McpServer, dependencies?: ExecutePromptDependencies): void;
|