@_davideast/stitch-mcp 0.0.1

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.
Files changed (67) hide show
  1. package/LICENSE +212 -0
  2. package/README.md +167 -0
  3. package/bin/stitch-mcp.js +2 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +15772 -0
  6. package/dist/commands/doctor/handler.d.ts +9 -0
  7. package/dist/commands/doctor/spec.d.ts +130 -0
  8. package/dist/commands/init/handler.d.ts +17 -0
  9. package/dist/commands/init/spec.d.ts +88 -0
  10. package/dist/commands/proxy/handler.d.ts +7 -0
  11. package/dist/index.d.ts +13 -0
  12. package/dist/index.js +8905 -0
  13. package/dist/platform/detector.d.ts +29 -0
  14. package/dist/platform/paths.d.ts +20 -0
  15. package/dist/platform/shell.d.ts +26 -0
  16. package/dist/services/gcloud/handler.d.ts +48 -0
  17. package/dist/services/gcloud/spec.d.ts +405 -0
  18. package/dist/services/mcp-config/handler.d.ts +12 -0
  19. package/dist/services/mcp-config/spec.d.ts +88 -0
  20. package/dist/services/project/handler.d.ts +11 -0
  21. package/dist/services/project/spec.d.ts +86 -0
  22. package/dist/services/proxy/handler.d.ts +15 -0
  23. package/dist/services/proxy/spec.d.ts +83 -0
  24. package/dist/services/stitch/handler.d.ts +15 -0
  25. package/dist/services/stitch/spec.d.ts +262 -0
  26. package/dist/src/cli.d.ts +1 -0
  27. package/dist/src/commands/doctor/handler.d.ts +9 -0
  28. package/dist/src/commands/doctor/handler.test.d.ts +1 -0
  29. package/dist/src/commands/doctor/spec.d.ts +130 -0
  30. package/dist/src/commands/doctor/spec.test.d.ts +1 -0
  31. package/dist/src/commands/init/handler.d.ts +17 -0
  32. package/dist/src/commands/init/handler.test.d.ts +1 -0
  33. package/dist/src/commands/init/spec.d.ts +88 -0
  34. package/dist/src/commands/init/spec.test.d.ts +1 -0
  35. package/dist/src/commands/proxy/handler.d.ts +7 -0
  36. package/dist/src/commands/proxy/handler.test.d.ts +1 -0
  37. package/dist/src/index.d.ts +13 -0
  38. package/dist/src/platform/detector.d.ts +29 -0
  39. package/dist/src/platform/paths.d.ts +20 -0
  40. package/dist/src/platform/shell.d.ts +26 -0
  41. package/dist/src/services/gcloud/handler.d.ts +48 -0
  42. package/dist/src/services/gcloud/handler.test.d.ts +1 -0
  43. package/dist/src/services/gcloud/spec.d.ts +405 -0
  44. package/dist/src/services/mcp-config/handler.d.ts +12 -0
  45. package/dist/src/services/mcp-config/handler.test.d.ts +1 -0
  46. package/dist/src/services/mcp-config/spec.d.ts +88 -0
  47. package/dist/src/services/mcp-config/spec.test.d.ts +1 -0
  48. package/dist/src/services/project/handler.d.ts +11 -0
  49. package/dist/src/services/project/handler.test.d.ts +1 -0
  50. package/dist/src/services/project/spec.d.ts +86 -0
  51. package/dist/src/services/project/spec.test.d.ts +1 -0
  52. package/dist/src/services/proxy/handler.d.ts +15 -0
  53. package/dist/src/services/proxy/handler.test.d.ts +1 -0
  54. package/dist/src/services/proxy/spec.d.ts +83 -0
  55. package/dist/src/services/proxy/spec.test.d.ts +1 -0
  56. package/dist/src/services/stitch/handler.d.ts +15 -0
  57. package/dist/src/services/stitch/handler.test.d.ts +1 -0
  58. package/dist/src/services/stitch/spec.d.ts +262 -0
  59. package/dist/src/services/stitch/spec.test.d.ts +1 -0
  60. package/dist/src/ui/spinner.d.ts +11 -0
  61. package/dist/src/ui/theme.d.ts +18 -0
  62. package/dist/src/ui/wizard.d.ts +24 -0
  63. package/dist/tests/mocks/shell.d.ts +2 -0
  64. package/dist/ui/spinner.d.ts +11 -0
  65. package/dist/ui/theme.d.ts +18 -0
  66. package/dist/ui/wizard.d.ts +24 -0
  67. package/package.json +56 -0
@@ -0,0 +1,88 @@
1
+ import { z } from 'zod';
2
+ export declare const InitInputSchema: z.ZodObject<{
3
+ local: z.ZodDefault<z.ZodBoolean>;
4
+ defaults: z.ZodDefault<z.ZodBoolean>;
5
+ client: z.ZodOptional<z.ZodString>;
6
+ transport: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ local: boolean;
9
+ defaults: boolean;
10
+ client?: string | undefined;
11
+ transport?: string | undefined;
12
+ }, {
13
+ local?: boolean | undefined;
14
+ defaults?: boolean | undefined;
15
+ client?: string | undefined;
16
+ transport?: string | undefined;
17
+ }>;
18
+ export type InitInput = z.infer<typeof InitInputSchema>;
19
+ export declare const InitErrorCode: z.ZodEnum<["GCLOUD_SETUP_FAILED", "AUTH_FAILED", "PROJECT_SELECTION_FAILED", "API_CONFIG_FAILED", "CONFIG_GENERATION_FAILED", "USER_CANCELLED", "UNKNOWN_ERROR"]>;
20
+ export declare const InitSuccess: z.ZodObject<{
21
+ success: z.ZodLiteral<true>;
22
+ data: z.ZodObject<{
23
+ projectId: z.ZodString;
24
+ mcpConfig: z.ZodString;
25
+ instructions: z.ZodString;
26
+ }, "strip", z.ZodTypeAny, {
27
+ projectId: string;
28
+ mcpConfig: string;
29
+ instructions: string;
30
+ }, {
31
+ projectId: string;
32
+ mcpConfig: string;
33
+ instructions: string;
34
+ }>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ success: true;
37
+ data: {
38
+ projectId: string;
39
+ mcpConfig: string;
40
+ instructions: string;
41
+ };
42
+ }, {
43
+ success: true;
44
+ data: {
45
+ projectId: string;
46
+ mcpConfig: string;
47
+ instructions: string;
48
+ };
49
+ }>;
50
+ export declare const InitFailure: z.ZodObject<{
51
+ success: z.ZodLiteral<false>;
52
+ error: z.ZodObject<{
53
+ code: z.ZodEnum<["GCLOUD_SETUP_FAILED", "AUTH_FAILED", "PROJECT_SELECTION_FAILED", "API_CONFIG_FAILED", "CONFIG_GENERATION_FAILED", "USER_CANCELLED", "UNKNOWN_ERROR"]>;
54
+ message: z.ZodString;
55
+ suggestion: z.ZodOptional<z.ZodString>;
56
+ recoverable: z.ZodBoolean;
57
+ }, "strip", z.ZodTypeAny, {
58
+ code: "GCLOUD_SETUP_FAILED" | "AUTH_FAILED" | "PROJECT_SELECTION_FAILED" | "API_CONFIG_FAILED" | "CONFIG_GENERATION_FAILED" | "USER_CANCELLED" | "UNKNOWN_ERROR";
59
+ message: string;
60
+ recoverable: boolean;
61
+ suggestion?: string | undefined;
62
+ }, {
63
+ code: "GCLOUD_SETUP_FAILED" | "AUTH_FAILED" | "PROJECT_SELECTION_FAILED" | "API_CONFIG_FAILED" | "CONFIG_GENERATION_FAILED" | "USER_CANCELLED" | "UNKNOWN_ERROR";
64
+ message: string;
65
+ recoverable: boolean;
66
+ suggestion?: string | undefined;
67
+ }>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ success: false;
70
+ error: {
71
+ code: "GCLOUD_SETUP_FAILED" | "AUTH_FAILED" | "PROJECT_SELECTION_FAILED" | "API_CONFIG_FAILED" | "CONFIG_GENERATION_FAILED" | "USER_CANCELLED" | "UNKNOWN_ERROR";
72
+ message: string;
73
+ recoverable: boolean;
74
+ suggestion?: string | undefined;
75
+ };
76
+ }, {
77
+ success: false;
78
+ error: {
79
+ code: "GCLOUD_SETUP_FAILED" | "AUTH_FAILED" | "PROJECT_SELECTION_FAILED" | "API_CONFIG_FAILED" | "CONFIG_GENERATION_FAILED" | "USER_CANCELLED" | "UNKNOWN_ERROR";
80
+ message: string;
81
+ recoverable: boolean;
82
+ suggestion?: string | undefined;
83
+ };
84
+ }>;
85
+ export type InitResult = z.infer<typeof InitSuccess> | z.infer<typeof InitFailure>;
86
+ export interface InitCommand {
87
+ execute(input: InitInput): Promise<InitResult>;
88
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ProxyHandler } from '../../services/proxy/handler.js';
2
+ import type { StartProxyInput, ProxyResult } from '../../services/proxy/spec.js';
3
+ export declare class ProxyCommandHandler {
4
+ private proxyService;
5
+ constructor(proxyService?: ProxyHandler);
6
+ execute(input: StartProxyInput): Promise<ProxyResult>;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export { GcloudHandler } from './services/gcloud/handler.js';
2
+ export { ProjectHandler } from './services/project/handler.js';
3
+ export { StitchHandler } from './services/stitch/handler.js';
4
+ export { McpConfigHandler } from './services/mcp-config/handler.js';
5
+ export { InitHandler } from './commands/init/handler.js';
6
+ export { DoctorHandler } from './commands/doctor/handler.js';
7
+ export type { GcloudService } from './services/gcloud/spec.js';
8
+ export type { ProjectService } from './services/project/spec.js';
9
+ export type { StitchService } from './services/stitch/spec.js';
10
+ export type { McpConfigService } from './services/mcp-config/spec.js';
11
+ export type { InitCommand } from './commands/init/spec.js';
12
+ export type { DoctorCommand } from './commands/doctor/spec.js';
13
+ export type { McpClient } from './ui/wizard.js';
@@ -0,0 +1,29 @@
1
+ export type OS = 'macos' | 'linux' | 'windows';
2
+ export type Arch = 'arm64' | 'x86_64';
3
+ export interface Platform {
4
+ os: OS;
5
+ arch: Arch;
6
+ gcloudDownloadUrl: string;
7
+ gcloudBinaryName: string;
8
+ isWindows: boolean;
9
+ }
10
+ /**
11
+ * Detect the current platform and architecture
12
+ */
13
+ export declare function detectPlatform(): Platform;
14
+ /**
15
+ * Get the user's home directory
16
+ */
17
+ export declare function getHomeDir(): string;
18
+ /**
19
+ * Get the Stitch MCP directory path
20
+ */
21
+ export declare function getStitchDir(): string;
22
+ /**
23
+ * Get the gcloud SDK installation path
24
+ */
25
+ export declare function getGcloudSdkPath(): string;
26
+ /**
27
+ * Get the gcloud config directory path
28
+ */
29
+ export declare function getGcloudConfigPath(): string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Get cross-platform path join
3
+ */
4
+ export declare function joinPath(...parts: string[]): string;
5
+ /**
6
+ * Get the directory name from a path
7
+ */
8
+ export declare function dirname(filepath: string): string;
9
+ /**
10
+ * Get the basename from a path
11
+ */
12
+ export declare function basename(filepath: string): string;
13
+ /**
14
+ * Normalize path separators for the current platform
15
+ */
16
+ export declare function normalizePath(filepath: string): string;
17
+ /**
18
+ * Convert a path to use forward slashes (for consistency)
19
+ */
20
+ export declare function toUnixPath(filepath: string): string;
@@ -0,0 +1,26 @@
1
+ export interface ShellResult {
2
+ success: boolean;
3
+ stdout: string;
4
+ stderr: string;
5
+ exitCode: number;
6
+ error?: string;
7
+ }
8
+ /**
9
+ * Execute a shell command and return the result
10
+ */
11
+ export declare function execCommand(command: string[], options?: {
12
+ cwd?: string;
13
+ env?: Record<string, string>;
14
+ timeout?: number;
15
+ }): Promise<ShellResult>;
16
+ /**
17
+ * Execute a shell command and stream output
18
+ */
19
+ export declare function execCommandStreaming(command: string[], onStdout?: (data: string) => void, onStderr?: (data: string) => void, options?: {
20
+ cwd?: string;
21
+ env?: Record<string, string>;
22
+ }): Promise<ShellResult>;
23
+ /**
24
+ * Check if a command exists in PATH
25
+ */
26
+ export declare function commandExists(command: string): Promise<boolean>;
@@ -0,0 +1,48 @@
1
+ import { type GcloudService, type EnsureGcloudInput, type AuthenticateInput, type ListProjectsInput, type SetProjectInput, type GcloudResult, type AuthResult, type ProjectListResult, type ProjectSetResult } from './spec.js';
2
+ export declare class GcloudHandler implements GcloudService {
3
+ private platform;
4
+ private gcloudPath;
5
+ /**
6
+ * Ensure gcloud is installed and available
7
+ */
8
+ ensureInstalled(input: EnsureGcloudInput): Promise<GcloudResult>;
9
+ /**
10
+ * Authenticate user
11
+ */
12
+ authenticate(input: AuthenticateInput): Promise<AuthResult>;
13
+ /**
14
+ * Authenticate application default credentials
15
+ */
16
+ authenticateADC(input: AuthenticateInput): Promise<AuthResult>;
17
+ /**
18
+ * List projects
19
+ */
20
+ listProjects(input: ListProjectsInput): Promise<ProjectListResult>;
21
+ /**
22
+ * Set active project
23
+ */
24
+ setProject(input: SetProjectInput): Promise<ProjectSetResult>;
25
+ /**
26
+ * Get access token
27
+ */
28
+ getAccessToken(): Promise<string | null>;
29
+ getProjectId(): Promise<string | null>;
30
+ /**
31
+ * Install beta components
32
+ */
33
+ installBetaComponents(): Promise<{
34
+ success: boolean;
35
+ error?: {
36
+ message: string;
37
+ };
38
+ }>;
39
+ private findGlobalGcloud;
40
+ private getVersionFromPath;
41
+ private isVersionValid;
42
+ private installLocal;
43
+ private setupEnvironment;
44
+ private getEnvironment;
45
+ private getGcloudCommand;
46
+ getActiveAccount(): Promise<string | null>;
47
+ hasADC(): Promise<boolean>;
48
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,405 @@
1
+ import { z } from 'zod';
2
+ export declare const EnsureGcloudInputSchema: z.ZodObject<{
3
+ minVersion: z.ZodDefault<z.ZodString>;
4
+ forceLocal: z.ZodDefault<z.ZodBoolean>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ minVersion: string;
7
+ forceLocal: boolean;
8
+ }, {
9
+ minVersion?: string | undefined;
10
+ forceLocal?: boolean | undefined;
11
+ }>;
12
+ export type EnsureGcloudInput = z.infer<typeof EnsureGcloudInputSchema>;
13
+ export declare const AuthenticateInputSchema: z.ZodObject<{
14
+ skipIfActive: z.ZodDefault<z.ZodBoolean>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ skipIfActive: boolean;
17
+ }, {
18
+ skipIfActive?: boolean | undefined;
19
+ }>;
20
+ export type AuthenticateInput = z.infer<typeof AuthenticateInputSchema>;
21
+ export declare const ListProjectsInputSchema: z.ZodObject<{
22
+ limit: z.ZodOptional<z.ZodNumber>;
23
+ filter: z.ZodOptional<z.ZodString>;
24
+ sortBy: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ filter?: string | undefined;
27
+ limit?: number | undefined;
28
+ sortBy?: string | undefined;
29
+ }, {
30
+ filter?: string | undefined;
31
+ limit?: number | undefined;
32
+ sortBy?: string | undefined;
33
+ }>;
34
+ export type ListProjectsInput = z.infer<typeof ListProjectsInputSchema>;
35
+ export declare const SetProjectInputSchema: z.ZodObject<{
36
+ projectId: z.ZodString;
37
+ }, "strip", z.ZodTypeAny, {
38
+ projectId: string;
39
+ }, {
40
+ projectId: string;
41
+ }>;
42
+ export type SetProjectInput = z.infer<typeof SetProjectInputSchema>;
43
+ export declare const GcloudErrorCode: z.ZodEnum<["DOWNLOAD_FAILED", "EXTRACTION_FAILED", "VERSION_CHECK_FAILED", "INVALID_VERSION", "AUTH_FAILED", "ADC_FAILED", "PROJECT_LIST_FAILED", "PROJECT_SET_FAILED", "COMMAND_NOT_FOUND", "UNKNOWN_ERROR"]>;
44
+ export type GcloudErrorCodeType = z.infer<typeof GcloudErrorCode>;
45
+ export declare const GcloudInstallDataSchema: z.ZodObject<{
46
+ version: z.ZodString;
47
+ location: z.ZodEnum<["system", "bundled"]>;
48
+ path: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ path: string;
51
+ version: string;
52
+ location: "system" | "bundled";
53
+ }, {
54
+ path: string;
55
+ version: string;
56
+ location: "system" | "bundled";
57
+ }>;
58
+ export declare const GcloudSuccess: z.ZodObject<{
59
+ success: z.ZodLiteral<true>;
60
+ data: z.ZodObject<{
61
+ version: z.ZodString;
62
+ location: z.ZodEnum<["system", "bundled"]>;
63
+ path: z.ZodString;
64
+ }, "strip", z.ZodTypeAny, {
65
+ path: string;
66
+ version: string;
67
+ location: "system" | "bundled";
68
+ }, {
69
+ path: string;
70
+ version: string;
71
+ location: "system" | "bundled";
72
+ }>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ success: true;
75
+ data: {
76
+ path: string;
77
+ version: string;
78
+ location: "system" | "bundled";
79
+ };
80
+ }, {
81
+ success: true;
82
+ data: {
83
+ path: string;
84
+ version: string;
85
+ location: "system" | "bundled";
86
+ };
87
+ }>;
88
+ export declare const GcloudFailure: z.ZodObject<{
89
+ success: z.ZodLiteral<false>;
90
+ error: z.ZodObject<{
91
+ code: z.ZodEnum<["DOWNLOAD_FAILED", "EXTRACTION_FAILED", "VERSION_CHECK_FAILED", "INVALID_VERSION", "AUTH_FAILED", "ADC_FAILED", "PROJECT_LIST_FAILED", "PROJECT_SET_FAILED", "COMMAND_NOT_FOUND", "UNKNOWN_ERROR"]>;
92
+ message: z.ZodString;
93
+ suggestion: z.ZodOptional<z.ZodString>;
94
+ recoverable: z.ZodBoolean;
95
+ }, "strip", z.ZodTypeAny, {
96
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
97
+ message: string;
98
+ recoverable: boolean;
99
+ suggestion?: string | undefined;
100
+ }, {
101
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
102
+ message: string;
103
+ recoverable: boolean;
104
+ suggestion?: string | undefined;
105
+ }>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ success: false;
108
+ error: {
109
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
110
+ message: string;
111
+ recoverable: boolean;
112
+ suggestion?: string | undefined;
113
+ };
114
+ }, {
115
+ success: false;
116
+ error: {
117
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
118
+ message: string;
119
+ recoverable: boolean;
120
+ suggestion?: string | undefined;
121
+ };
122
+ }>;
123
+ export type GcloudResult = z.infer<typeof GcloudSuccess> | z.infer<typeof GcloudFailure>;
124
+ export declare const AuthDataSchema: z.ZodObject<{
125
+ account: z.ZodString;
126
+ type: z.ZodEnum<["user", "adc"]>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ type: "user" | "adc";
129
+ account: string;
130
+ }, {
131
+ type: "user" | "adc";
132
+ account: string;
133
+ }>;
134
+ export declare const AuthSuccess: z.ZodObject<{
135
+ success: z.ZodLiteral<true>;
136
+ data: z.ZodObject<{
137
+ account: z.ZodString;
138
+ type: z.ZodEnum<["user", "adc"]>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ type: "user" | "adc";
141
+ account: string;
142
+ }, {
143
+ type: "user" | "adc";
144
+ account: string;
145
+ }>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ success: true;
148
+ data: {
149
+ type: "user" | "adc";
150
+ account: string;
151
+ };
152
+ }, {
153
+ success: true;
154
+ data: {
155
+ type: "user" | "adc";
156
+ account: string;
157
+ };
158
+ }>;
159
+ export declare const AuthFailure: z.ZodObject<{
160
+ success: z.ZodLiteral<false>;
161
+ error: z.ZodObject<{
162
+ code: z.ZodEnum<["DOWNLOAD_FAILED", "EXTRACTION_FAILED", "VERSION_CHECK_FAILED", "INVALID_VERSION", "AUTH_FAILED", "ADC_FAILED", "PROJECT_LIST_FAILED", "PROJECT_SET_FAILED", "COMMAND_NOT_FOUND", "UNKNOWN_ERROR"]>;
163
+ message: z.ZodString;
164
+ suggestion: z.ZodOptional<z.ZodString>;
165
+ recoverable: z.ZodBoolean;
166
+ }, "strip", z.ZodTypeAny, {
167
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
168
+ message: string;
169
+ recoverable: boolean;
170
+ suggestion?: string | undefined;
171
+ }, {
172
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
173
+ message: string;
174
+ recoverable: boolean;
175
+ suggestion?: string | undefined;
176
+ }>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ success: false;
179
+ error: {
180
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
181
+ message: string;
182
+ recoverable: boolean;
183
+ suggestion?: string | undefined;
184
+ };
185
+ }, {
186
+ success: false;
187
+ error: {
188
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
189
+ message: string;
190
+ recoverable: boolean;
191
+ suggestion?: string | undefined;
192
+ };
193
+ }>;
194
+ export type AuthResult = z.infer<typeof AuthSuccess> | z.infer<typeof AuthFailure>;
195
+ export declare const ProjectSchema: z.ZodObject<{
196
+ projectId: z.ZodString;
197
+ name: z.ZodString;
198
+ projectNumber: z.ZodOptional<z.ZodString>;
199
+ createTime: z.ZodOptional<z.ZodString>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ projectId: string;
202
+ name: string;
203
+ projectNumber?: string | undefined;
204
+ createTime?: string | undefined;
205
+ }, {
206
+ projectId: string;
207
+ name: string;
208
+ projectNumber?: string | undefined;
209
+ createTime?: string | undefined;
210
+ }>;
211
+ export declare const ProjectListSuccess: z.ZodObject<{
212
+ success: z.ZodLiteral<true>;
213
+ data: z.ZodObject<{
214
+ projects: z.ZodArray<z.ZodObject<{
215
+ projectId: z.ZodString;
216
+ name: z.ZodString;
217
+ projectNumber: z.ZodOptional<z.ZodString>;
218
+ createTime: z.ZodOptional<z.ZodString>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ projectId: string;
221
+ name: string;
222
+ projectNumber?: string | undefined;
223
+ createTime?: string | undefined;
224
+ }, {
225
+ projectId: string;
226
+ name: string;
227
+ projectNumber?: string | undefined;
228
+ createTime?: string | undefined;
229
+ }>, "many">;
230
+ }, "strip", z.ZodTypeAny, {
231
+ projects: {
232
+ projectId: string;
233
+ name: string;
234
+ projectNumber?: string | undefined;
235
+ createTime?: string | undefined;
236
+ }[];
237
+ }, {
238
+ projects: {
239
+ projectId: string;
240
+ name: string;
241
+ projectNumber?: string | undefined;
242
+ createTime?: string | undefined;
243
+ }[];
244
+ }>;
245
+ }, "strip", z.ZodTypeAny, {
246
+ success: true;
247
+ data: {
248
+ projects: {
249
+ projectId: string;
250
+ name: string;
251
+ projectNumber?: string | undefined;
252
+ createTime?: string | undefined;
253
+ }[];
254
+ };
255
+ }, {
256
+ success: true;
257
+ data: {
258
+ projects: {
259
+ projectId: string;
260
+ name: string;
261
+ projectNumber?: string | undefined;
262
+ createTime?: string | undefined;
263
+ }[];
264
+ };
265
+ }>;
266
+ export declare const ProjectListFailure: z.ZodObject<{
267
+ success: z.ZodLiteral<false>;
268
+ error: z.ZodObject<{
269
+ code: z.ZodEnum<["DOWNLOAD_FAILED", "EXTRACTION_FAILED", "VERSION_CHECK_FAILED", "INVALID_VERSION", "AUTH_FAILED", "ADC_FAILED", "PROJECT_LIST_FAILED", "PROJECT_SET_FAILED", "COMMAND_NOT_FOUND", "UNKNOWN_ERROR"]>;
270
+ message: z.ZodString;
271
+ suggestion: z.ZodOptional<z.ZodString>;
272
+ recoverable: z.ZodBoolean;
273
+ }, "strip", z.ZodTypeAny, {
274
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
275
+ message: string;
276
+ recoverable: boolean;
277
+ suggestion?: string | undefined;
278
+ }, {
279
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
280
+ message: string;
281
+ recoverable: boolean;
282
+ suggestion?: string | undefined;
283
+ }>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ success: false;
286
+ error: {
287
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
288
+ message: string;
289
+ recoverable: boolean;
290
+ suggestion?: string | undefined;
291
+ };
292
+ }, {
293
+ success: false;
294
+ error: {
295
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
296
+ message: string;
297
+ recoverable: boolean;
298
+ suggestion?: string | undefined;
299
+ };
300
+ }>;
301
+ export type ProjectListResult = z.infer<typeof ProjectListSuccess> | z.infer<typeof ProjectListFailure>;
302
+ export declare const ProjectSetSuccess: z.ZodObject<{
303
+ success: z.ZodLiteral<true>;
304
+ data: z.ZodObject<{
305
+ projectId: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ projectId: string;
308
+ }, {
309
+ projectId: string;
310
+ }>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ success: true;
313
+ data: {
314
+ projectId: string;
315
+ };
316
+ }, {
317
+ success: true;
318
+ data: {
319
+ projectId: string;
320
+ };
321
+ }>;
322
+ export declare const ProjectSetFailure: z.ZodObject<{
323
+ success: z.ZodLiteral<false>;
324
+ error: z.ZodObject<{
325
+ code: z.ZodEnum<["DOWNLOAD_FAILED", "EXTRACTION_FAILED", "VERSION_CHECK_FAILED", "INVALID_VERSION", "AUTH_FAILED", "ADC_FAILED", "PROJECT_LIST_FAILED", "PROJECT_SET_FAILED", "COMMAND_NOT_FOUND", "UNKNOWN_ERROR"]>;
326
+ message: z.ZodString;
327
+ suggestion: z.ZodOptional<z.ZodString>;
328
+ recoverable: z.ZodBoolean;
329
+ }, "strip", z.ZodTypeAny, {
330
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
331
+ message: string;
332
+ recoverable: boolean;
333
+ suggestion?: string | undefined;
334
+ }, {
335
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
336
+ message: string;
337
+ recoverable: boolean;
338
+ suggestion?: string | undefined;
339
+ }>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ success: false;
342
+ error: {
343
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
344
+ message: string;
345
+ recoverable: boolean;
346
+ suggestion?: string | undefined;
347
+ };
348
+ }, {
349
+ success: false;
350
+ error: {
351
+ code: "AUTH_FAILED" | "UNKNOWN_ERROR" | "DOWNLOAD_FAILED" | "EXTRACTION_FAILED" | "VERSION_CHECK_FAILED" | "INVALID_VERSION" | "ADC_FAILED" | "PROJECT_LIST_FAILED" | "PROJECT_SET_FAILED" | "COMMAND_NOT_FOUND";
352
+ message: string;
353
+ recoverable: boolean;
354
+ suggestion?: string | undefined;
355
+ };
356
+ }>;
357
+ export type ProjectSetResult = z.infer<typeof ProjectSetSuccess> | z.infer<typeof ProjectSetFailure>;
358
+ export interface GcloudService {
359
+ /**
360
+ * Ensure gcloud is installed and meets minimum version requirements
361
+ */
362
+ ensureInstalled(input: EnsureGcloudInput): Promise<GcloudResult>;
363
+ /**
364
+ * Authenticate user with gcloud
365
+ */
366
+ authenticate(input: AuthenticateInput): Promise<AuthResult>;
367
+ /**
368
+ * Authenticate application default credentials
369
+ */
370
+ authenticateADC(input: AuthenticateInput): Promise<AuthResult>;
371
+ /**
372
+ * List user's projects
373
+ */
374
+ listProjects(input: ListProjectsInput): Promise<ProjectListResult>;
375
+ /**
376
+ * Set the active project
377
+ */
378
+ setProject(input: SetProjectInput): Promise<ProjectSetResult>;
379
+ /**
380
+ * Get access token for API requests
381
+ */
382
+ getAccessToken(): Promise<string | null>;
383
+ /**
384
+ * Install beta components
385
+ */
386
+ installBetaComponents(): Promise<{
387
+ success: boolean;
388
+ error?: {
389
+ message: string;
390
+ };
391
+ }>;
392
+ /**
393
+ * Check if Application Default Credentials (ADC) exist.
394
+ */
395
+ hasADC(): Promise<boolean>;
396
+ /**
397
+ /**
398
+ * Get the active project ID.
399
+ */
400
+ getProjectId(): Promise<string | null>;
401
+ /**
402
+ * Get the active user account.
403
+ */
404
+ getActiveAccount(): Promise<string | null>;
405
+ }
@@ -0,0 +1,12 @@
1
+ import { type McpConfigService, type GenerateConfigInput, type McpConfigResult } from './spec.js';
2
+ export declare class McpConfigHandler implements McpConfigService {
3
+ generateConfig(input: GenerateConfigInput): Promise<McpConfigResult>;
4
+ private generateHttpConfig;
5
+ private generateCursorConfig;
6
+ private generateAntigravityConfig;
7
+ private generateVSCodeConfig;
8
+ private generateClaudeCodeConfig;
9
+ private generateGeminiCliConfig;
10
+ private generateStdioConfig;
11
+ private getInstructionsForClient;
12
+ }
@@ -0,0 +1 @@
1
+ export {};