google-stitch-mcp 0.3.2

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 (127) hide show
  1. package/LICENSE +212 -0
  2. package/README.md +439 -0
  3. package/bin/stitch-mcp.js +2 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +130810 -0
  6. package/dist/commands/doctor/command.d.ts +2 -0
  7. package/dist/commands/doctor/context.d.ts +19 -0
  8. package/dist/commands/doctor/handler.d.ts +12 -0
  9. package/dist/commands/doctor/spec.d.ts +130 -0
  10. package/dist/commands/doctor/steps/AdcCheckStep.d.ts +8 -0
  11. package/dist/commands/doctor/steps/ApiCheckStep.d.ts +8 -0
  12. package/dist/commands/doctor/steps/ApiKeyConnectionStep.d.ts +8 -0
  13. package/dist/commands/doctor/steps/ApiKeyDetectedStep.d.ts +8 -0
  14. package/dist/commands/doctor/steps/AuthCheckStep.d.ts +8 -0
  15. package/dist/commands/doctor/steps/GcloudCheckStep.d.ts +8 -0
  16. package/dist/commands/doctor/steps/ProjectCheckStep.d.ts +8 -0
  17. package/dist/commands/init/command.d.ts +2 -0
  18. package/dist/commands/init/context.d.ts +24 -0
  19. package/dist/commands/init/handler.d.ts +19 -0
  20. package/dist/commands/init/spec.d.ts +91 -0
  21. package/dist/commands/init/steps/AuthModeStep.d.ts +8 -0
  22. package/dist/commands/init/steps/AuthStep.d.ts +8 -0
  23. package/dist/commands/init/steps/ClientSelectionStep.d.ts +9 -0
  24. package/dist/commands/init/steps/ConfigStep.d.ts +9 -0
  25. package/dist/commands/init/steps/GcloudInstallStep.d.ts +8 -0
  26. package/dist/commands/init/steps/IamApiStep.d.ts +8 -0
  27. package/dist/commands/init/steps/ProjectSelectStep.d.ts +8 -0
  28. package/dist/commands/init/steps/TestConnectionStep.d.ts +8 -0
  29. package/dist/commands/init/steps/TransportStep.d.ts +9 -0
  30. package/dist/commands/logout/command.d.ts +2 -0
  31. package/dist/commands/logout/context.d.ts +12 -0
  32. package/dist/commands/logout/handler.d.ts +8 -0
  33. package/dist/commands/logout/spec.d.ts +77 -0
  34. package/dist/commands/logout/steps/ClearConfigStep.d.ts +8 -0
  35. package/dist/commands/logout/steps/PrepareStep.d.ts +8 -0
  36. package/dist/commands/logout/steps/RevokeAdcStep.d.ts +9 -0
  37. package/dist/commands/logout/steps/RevokeUserStep.d.ts +9 -0
  38. package/dist/commands/proxy/command.d.ts +2 -0
  39. package/dist/commands/proxy/handler.d.ts +7 -0
  40. package/dist/commands/registry.d.ts +2 -0
  41. package/dist/commands/screens/ScreensView.d.ts +16 -0
  42. package/dist/commands/screens/command.d.ts +2 -0
  43. package/dist/commands/screens/handler.d.ts +24 -0
  44. package/dist/commands/serve/ServeView.d.ts +12 -0
  45. package/dist/commands/serve/command.d.ts +2 -0
  46. package/dist/commands/serve/handler.d.ts +22 -0
  47. package/dist/commands/site/command.d.ts +2 -0
  48. package/dist/commands/site/hooks/useProjectHydration.d.ts +9 -0
  49. package/dist/commands/site/index.d.ts +12 -0
  50. package/dist/commands/site/ui/ScreenList.d.ts +11 -0
  51. package/dist/commands/site/ui/SiteBuilder.d.ts +10 -0
  52. package/dist/commands/site/ui/components/StatusIcon.d.ts +6 -0
  53. package/dist/commands/site/ui/types.d.ts +1 -0
  54. package/dist/commands/site/utils/ProjectSyncer.d.ts +8 -0
  55. package/dist/commands/site/utils/SiteManifest.d.ts +16 -0
  56. package/dist/commands/snapshot/command.d.ts +2 -0
  57. package/dist/commands/snapshot/handler.d.ts +17 -0
  58. package/dist/commands/snapshot/spec.d.ts +39 -0
  59. package/dist/commands/tool/command.d.ts +2 -0
  60. package/dist/commands/tool/context.d.ts +9 -0
  61. package/dist/commands/tool/handler.d.ts +9 -0
  62. package/dist/commands/tool/spec.d.ts +39 -0
  63. package/dist/commands/tool/steps/ExecuteToolStep.d.ts +8 -0
  64. package/dist/commands/tool/steps/ListToolsStep.d.ts +8 -0
  65. package/dist/commands/tool/steps/ParseArgsStep.d.ts +8 -0
  66. package/dist/commands/tool/steps/ShowSchemaStep.d.ts +10 -0
  67. package/dist/commands/tool/steps/ValidateToolStep.d.ts +8 -0
  68. package/dist/commands/tool/virtual-tools/build-site.d.ts +2 -0
  69. package/dist/commands/tool/virtual-tools/get-screen-code.d.ts +2 -0
  70. package/dist/commands/tool/virtual-tools/get-screen-image.d.ts +2 -0
  71. package/dist/commands/tool/virtual-tools/index.d.ts +7 -0
  72. package/dist/commands/tool/virtual-tools/list-tools.d.ts +2 -0
  73. package/dist/commands/view/command.d.ts +2 -0
  74. package/dist/commands/view/handler.d.ts +14 -0
  75. package/dist/framework/CommandDefinition.d.ts +18 -0
  76. package/dist/framework/CommandStep.d.ts +15 -0
  77. package/dist/framework/ConsoleUI.d.ts +14 -0
  78. package/dist/framework/MockUI.d.ts +16 -0
  79. package/dist/framework/StepRunner.d.ts +20 -0
  80. package/dist/framework/UserInterface.d.ts +13 -0
  81. package/dist/index.d.ts +13 -0
  82. package/dist/index.js +23583 -0
  83. package/dist/lib/server/AssetGateway.d.ts +25 -0
  84. package/dist/lib/server/vite/StitchViteServer.d.ts +11 -0
  85. package/dist/lib/server/vite/plugins/virtualContent.d.ts +7 -0
  86. package/dist/lib/services/site/SiteService.d.ts +6 -0
  87. package/dist/lib/services/site/schemas.d.ts +91 -0
  88. package/dist/lib/services/site/types.d.ts +22 -0
  89. package/dist/platform/detector.d.ts +29 -0
  90. package/dist/platform/environment.d.ts +13 -0
  91. package/dist/platform/paths.d.ts +20 -0
  92. package/dist/platform/shell.d.ts +30 -0
  93. package/dist/services/gcloud/handler.d.ts +57 -0
  94. package/dist/services/gcloud/spec.d.ts +408 -0
  95. package/dist/services/mcp-client/MockStitchMCPClient.d.ts +7 -0
  96. package/dist/services/mcp-client/client.d.ts +79 -0
  97. package/dist/services/mcp-client/spec.d.ts +27 -0
  98. package/dist/services/mcp-config/handler.d.ts +13 -0
  99. package/dist/services/mcp-config/spec.d.ts +108 -0
  100. package/dist/services/project/handler.d.ts +11 -0
  101. package/dist/services/project/spec.d.ts +86 -0
  102. package/dist/services/proxy/handler.d.ts +26 -0
  103. package/dist/services/proxy/spec.d.ts +83 -0
  104. package/dist/services/stitch/handler.d.ts +17 -0
  105. package/dist/services/stitch/spec.d.ts +279 -0
  106. package/dist/services/view/handler.d.ts +7 -0
  107. package/dist/services/view/spec.d.ts +66 -0
  108. package/dist/ui/InteractiveViewer.d.ts +17 -0
  109. package/dist/ui/JsonTree.d.ts +12 -0
  110. package/dist/ui/checklist/handler.d.ts +23 -0
  111. package/dist/ui/checklist/spec.d.ts +191 -0
  112. package/dist/ui/checklist.d.ts +54 -0
  113. package/dist/ui/copy-behaviors/clipboard.d.ts +32 -0
  114. package/dist/ui/copy-behaviors/handlers.d.ts +16 -0
  115. package/dist/ui/copy-behaviors/index.d.ts +8 -0
  116. package/dist/ui/copy-behaviors/registry.d.ts +24 -0
  117. package/dist/ui/copy-behaviors/types.d.ts +26 -0
  118. package/dist/ui/navigation-behaviors/index.d.ts +34 -0
  119. package/dist/ui/serve-behaviors/handlers.d.ts +9 -0
  120. package/dist/ui/serve-behaviors/index.d.ts +7 -0
  121. package/dist/ui/serve-behaviors/registry.d.ts +10 -0
  122. package/dist/ui/serve-behaviors/server.d.ts +8 -0
  123. package/dist/ui/serve-behaviors/types.d.ts +18 -0
  124. package/dist/ui/spinner.d.ts +11 -0
  125. package/dist/ui/theme.d.ts +18 -0
  126. package/dist/ui/wizard.d.ts +36 -0
  127. package/package.json +83 -0
@@ -0,0 +1,86 @@
1
+ import { z } from 'zod';
2
+ export declare const SelectProjectInputSchema: z.ZodObject<{
3
+ allowSearch: z.ZodDefault<z.ZodBoolean>;
4
+ limit: z.ZodDefault<z.ZodNumber>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ limit: number;
7
+ allowSearch: boolean;
8
+ }, {
9
+ limit?: number | undefined;
10
+ allowSearch?: boolean | undefined;
11
+ }>;
12
+ export type SelectProjectInput = z.infer<typeof SelectProjectInputSchema>;
13
+ export declare const ProjectErrorCode: z.ZodEnum<["NO_PROJECTS_FOUND", "SELECTION_CANCELLED", "SEARCH_FAILED", "PROJECT_FETCH_FAILED", "PROJECT_NOT_FOUND", "UNKNOWN_ERROR"]>;
14
+ export declare const ProjectSelectionSuccess: z.ZodObject<{
15
+ success: z.ZodLiteral<true>;
16
+ data: z.ZodObject<{
17
+ projectId: z.ZodString;
18
+ name: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ name: string;
21
+ projectId: string;
22
+ }, {
23
+ name: string;
24
+ projectId: string;
25
+ }>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ success: true;
28
+ data: {
29
+ name: string;
30
+ projectId: string;
31
+ };
32
+ }, {
33
+ success: true;
34
+ data: {
35
+ name: string;
36
+ projectId: string;
37
+ };
38
+ }>;
39
+ export declare const ProjectSelectionFailure: z.ZodObject<{
40
+ success: z.ZodLiteral<false>;
41
+ error: z.ZodObject<{
42
+ code: z.ZodEnum<["NO_PROJECTS_FOUND", "SELECTION_CANCELLED", "SEARCH_FAILED", "PROJECT_FETCH_FAILED", "PROJECT_NOT_FOUND", "UNKNOWN_ERROR"]>;
43
+ message: z.ZodString;
44
+ suggestion: z.ZodOptional<z.ZodString>;
45
+ recoverable: z.ZodBoolean;
46
+ }, "strip", z.ZodTypeAny, {
47
+ code: "UNKNOWN_ERROR" | "NO_PROJECTS_FOUND" | "SELECTION_CANCELLED" | "SEARCH_FAILED" | "PROJECT_FETCH_FAILED" | "PROJECT_NOT_FOUND";
48
+ message: string;
49
+ recoverable: boolean;
50
+ suggestion?: string | undefined;
51
+ }, {
52
+ code: "UNKNOWN_ERROR" | "NO_PROJECTS_FOUND" | "SELECTION_CANCELLED" | "SEARCH_FAILED" | "PROJECT_FETCH_FAILED" | "PROJECT_NOT_FOUND";
53
+ message: string;
54
+ recoverable: boolean;
55
+ suggestion?: string | undefined;
56
+ }>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ success: false;
59
+ error: {
60
+ code: "UNKNOWN_ERROR" | "NO_PROJECTS_FOUND" | "SELECTION_CANCELLED" | "SEARCH_FAILED" | "PROJECT_FETCH_FAILED" | "PROJECT_NOT_FOUND";
61
+ message: string;
62
+ recoverable: boolean;
63
+ suggestion?: string | undefined;
64
+ };
65
+ }, {
66
+ success: false;
67
+ error: {
68
+ code: "UNKNOWN_ERROR" | "NO_PROJECTS_FOUND" | "SELECTION_CANCELLED" | "SEARCH_FAILED" | "PROJECT_FETCH_FAILED" | "PROJECT_NOT_FOUND";
69
+ message: string;
70
+ recoverable: boolean;
71
+ suggestion?: string | undefined;
72
+ };
73
+ }>;
74
+ export type ProjectSelectionResult = z.infer<typeof ProjectSelectionSuccess> | z.infer<typeof ProjectSelectionFailure>;
75
+ export interface ProjectService {
76
+ /**
77
+ * Prompt user to select a project
78
+ */
79
+ selectProject(input: SelectProjectInput): Promise<ProjectSelectionResult>;
80
+ /**
81
+ * Get details for a specific project
82
+ */
83
+ getProjectDetails(input: {
84
+ projectId: string;
85
+ }): Promise<ProjectSelectionResult>;
86
+ }
@@ -0,0 +1,26 @@
1
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
+ import { createWriteStream, existsSync, mkdirSync } from 'node:fs';
3
+ import { type ProxyService, type StartProxyInput, type ProxyResult } from './spec.js';
4
+ import { GcloudHandler } from '../gcloud/handler.js';
5
+ import { getStitchDir } from '../../platform/detector.js';
6
+ /**
7
+ * Internal dependencies for testing
8
+ */
9
+ export declare const deps: {
10
+ createWriteStream: typeof createWriteStream;
11
+ existsSync: typeof existsSync;
12
+ mkdirSync: typeof mkdirSync;
13
+ getStitchDir: typeof getStitchDir;
14
+ };
15
+ export declare class ProxyHandler implements ProxyService {
16
+ private gcloud;
17
+ private transportFactory;
18
+ private currentToken;
19
+ private refreshTimer;
20
+ private pendingToolListIds;
21
+ constructor(gcloud?: GcloudHandler, transportFactory?: () => StdioServerTransport);
22
+ start(input: StartProxyInput): Promise<ProxyResult>;
23
+ private refreshToken;
24
+ private startRefreshTimer;
25
+ private stopRefreshTimer;
26
+ }
@@ -0,0 +1,83 @@
1
+ import { z } from 'zod';
2
+ export declare const StartProxyInputSchema: z.ZodObject<{
3
+ transport: z.ZodDefault<z.ZodEnum<["stdio", "sse"]>>;
4
+ port: z.ZodOptional<z.ZodNumber>;
5
+ debug: z.ZodOptional<z.ZodBoolean>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ transport: "stdio" | "sse";
8
+ debug?: boolean | undefined;
9
+ port?: number | undefined;
10
+ }, {
11
+ debug?: boolean | undefined;
12
+ port?: number | undefined;
13
+ transport?: "stdio" | "sse" | undefined;
14
+ }>;
15
+ export type StartProxyInput = z.infer<typeof StartProxyInputSchema>;
16
+ export declare const ProxyErrorCode: z.ZodEnum<["START_FAILED", "TRANSPORT_ERROR", "AUTH_REFRESH_FAILED", "UNKNOWN_ERROR"]>;
17
+ export type ProxyErrorCodeType = z.infer<typeof ProxyErrorCode>;
18
+ export declare const ProxySuccess: z.ZodObject<{
19
+ success: z.ZodLiteral<true>;
20
+ data: z.ZodObject<{
21
+ status: z.ZodEnum<["running", "stopped"]>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ status: "running" | "stopped";
24
+ }, {
25
+ status: "running" | "stopped";
26
+ }>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ success: true;
29
+ data: {
30
+ status: "running" | "stopped";
31
+ };
32
+ }, {
33
+ success: true;
34
+ data: {
35
+ status: "running" | "stopped";
36
+ };
37
+ }>;
38
+ export declare const ProxyFailure: z.ZodObject<{
39
+ success: z.ZodLiteral<false>;
40
+ error: z.ZodObject<{
41
+ code: z.ZodEnum<["START_FAILED", "TRANSPORT_ERROR", "AUTH_REFRESH_FAILED", "UNKNOWN_ERROR"]>;
42
+ message: z.ZodString;
43
+ suggestion: z.ZodOptional<z.ZodString>;
44
+ recoverable: z.ZodBoolean;
45
+ }, "strip", z.ZodTypeAny, {
46
+ code: "UNKNOWN_ERROR" | "START_FAILED" | "TRANSPORT_ERROR" | "AUTH_REFRESH_FAILED";
47
+ message: string;
48
+ recoverable: boolean;
49
+ suggestion?: string | undefined;
50
+ }, {
51
+ code: "UNKNOWN_ERROR" | "START_FAILED" | "TRANSPORT_ERROR" | "AUTH_REFRESH_FAILED";
52
+ message: string;
53
+ recoverable: boolean;
54
+ suggestion?: string | undefined;
55
+ }>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ success: false;
58
+ error: {
59
+ code: "UNKNOWN_ERROR" | "START_FAILED" | "TRANSPORT_ERROR" | "AUTH_REFRESH_FAILED";
60
+ message: string;
61
+ recoverable: boolean;
62
+ suggestion?: string | undefined;
63
+ };
64
+ }, {
65
+ success: false;
66
+ error: {
67
+ code: "UNKNOWN_ERROR" | "START_FAILED" | "TRANSPORT_ERROR" | "AUTH_REFRESH_FAILED";
68
+ message: string;
69
+ recoverable: boolean;
70
+ suggestion?: string | undefined;
71
+ };
72
+ }>;
73
+ export type ProxyResult = z.infer<typeof ProxySuccess> | z.infer<typeof ProxyFailure>;
74
+ export interface ProxyService {
75
+ /**
76
+ * Start the MCP proxy server
77
+ *
78
+ * @remarks
79
+ * This is a long-running operation. The promise settles only when the server stops
80
+ * or if initial startup fails.
81
+ */
82
+ start(input: StartProxyInput): Promise<ProxyResult>;
83
+ }
@@ -0,0 +1,17 @@
1
+ import { type StitchService, type ConfigureIAMInput, type EnableAPIInput, type TestConnectionInput, type TestConnectionWithApiKeyInput, type IAMConfigResult, type APIEnableResult, type ConnectionTestResult } from './spec.js';
2
+ export declare class StitchHandler implements StitchService {
3
+ private getGcloudEnv;
4
+ private gcloudBinaryPromise;
5
+ private getGcloudBinary;
6
+ configureIAM(input: ConfigureIAMInput): Promise<IAMConfigResult>;
7
+ enableAPI(input: EnableAPIInput): Promise<APIEnableResult>;
8
+ checkIAMRole(input: {
9
+ projectId: string;
10
+ userEmail: string;
11
+ }): Promise<boolean>;
12
+ checkAPIEnabled(input: {
13
+ projectId: string;
14
+ }): Promise<boolean>;
15
+ testConnectionWithApiKey(input: TestConnectionWithApiKeyInput): Promise<ConnectionTestResult>;
16
+ testConnection(input: TestConnectionInput): Promise<ConnectionTestResult>;
17
+ }
@@ -0,0 +1,279 @@
1
+ import { z } from 'zod';
2
+ export declare const ConfigureIAMInputSchema: z.ZodObject<{
3
+ projectId: z.ZodString;
4
+ userEmail: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ projectId: string;
7
+ userEmail: string;
8
+ }, {
9
+ projectId: string;
10
+ userEmail: string;
11
+ }>;
12
+ export type ConfigureIAMInput = z.infer<typeof ConfigureIAMInputSchema>;
13
+ export declare const EnableAPIInputSchema: z.ZodObject<{
14
+ projectId: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ projectId: string;
17
+ }, {
18
+ projectId: string;
19
+ }>;
20
+ export type EnableAPIInput = z.infer<typeof EnableAPIInputSchema>;
21
+ export declare const TestConnectionInputSchema: z.ZodObject<{
22
+ projectId: z.ZodString;
23
+ accessToken: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ accessToken: string;
26
+ projectId: string;
27
+ }, {
28
+ accessToken: string;
29
+ projectId: string;
30
+ }>;
31
+ export type TestConnectionInput = z.infer<typeof TestConnectionInputSchema>;
32
+ export declare const TestConnectionWithApiKeyInputSchema: z.ZodObject<{
33
+ apiKey: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ apiKey: string;
36
+ }, {
37
+ apiKey: string;
38
+ }>;
39
+ export type TestConnectionWithApiKeyInput = z.infer<typeof TestConnectionWithApiKeyInputSchema>;
40
+ export declare const StitchErrorCode: z.ZodEnum<["IAM_CONFIG_FAILED", "API_ENABLE_FAILED", "CONNECTION_TEST_FAILED", "PERMISSION_DENIED", "UNKNOWN_ERROR"]>;
41
+ export declare const IAMConfigSuccess: z.ZodObject<{
42
+ success: z.ZodLiteral<true>;
43
+ data: z.ZodObject<{
44
+ role: z.ZodString;
45
+ member: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ role: string;
48
+ member: string;
49
+ }, {
50
+ role: string;
51
+ member: string;
52
+ }>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ success: true;
55
+ data: {
56
+ role: string;
57
+ member: string;
58
+ };
59
+ }, {
60
+ success: true;
61
+ data: {
62
+ role: string;
63
+ member: string;
64
+ };
65
+ }>;
66
+ export declare const IAMConfigFailure: z.ZodObject<{
67
+ success: z.ZodLiteral<false>;
68
+ error: z.ZodObject<{
69
+ code: z.ZodEnum<["IAM_CONFIG_FAILED", "API_ENABLE_FAILED", "CONNECTION_TEST_FAILED", "PERMISSION_DENIED", "UNKNOWN_ERROR"]>;
70
+ message: z.ZodString;
71
+ suggestion: z.ZodOptional<z.ZodString>;
72
+ recoverable: z.ZodBoolean;
73
+ details: z.ZodOptional<z.ZodString>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
76
+ message: string;
77
+ recoverable: boolean;
78
+ suggestion?: string | undefined;
79
+ details?: string | undefined;
80
+ }, {
81
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
82
+ message: string;
83
+ recoverable: boolean;
84
+ suggestion?: string | undefined;
85
+ details?: string | undefined;
86
+ }>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ success: false;
89
+ error: {
90
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
91
+ message: string;
92
+ recoverable: boolean;
93
+ suggestion?: string | undefined;
94
+ details?: string | undefined;
95
+ };
96
+ }, {
97
+ success: false;
98
+ error: {
99
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
100
+ message: string;
101
+ recoverable: boolean;
102
+ suggestion?: string | undefined;
103
+ details?: string | undefined;
104
+ };
105
+ }>;
106
+ export type IAMConfigResult = z.infer<typeof IAMConfigSuccess> | z.infer<typeof IAMConfigFailure>;
107
+ export declare const APIEnableSuccess: z.ZodObject<{
108
+ success: z.ZodLiteral<true>;
109
+ data: z.ZodObject<{
110
+ api: z.ZodString;
111
+ enabled: z.ZodBoolean;
112
+ }, "strip", z.ZodTypeAny, {
113
+ api: string;
114
+ enabled: boolean;
115
+ }, {
116
+ api: string;
117
+ enabled: boolean;
118
+ }>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ success: true;
121
+ data: {
122
+ api: string;
123
+ enabled: boolean;
124
+ };
125
+ }, {
126
+ success: true;
127
+ data: {
128
+ api: string;
129
+ enabled: boolean;
130
+ };
131
+ }>;
132
+ export declare const APIEnableFailure: z.ZodObject<{
133
+ success: z.ZodLiteral<false>;
134
+ error: z.ZodObject<{
135
+ code: z.ZodEnum<["IAM_CONFIG_FAILED", "API_ENABLE_FAILED", "CONNECTION_TEST_FAILED", "PERMISSION_DENIED", "UNKNOWN_ERROR"]>;
136
+ message: z.ZodString;
137
+ suggestion: z.ZodOptional<z.ZodString>;
138
+ recoverable: z.ZodBoolean;
139
+ details: z.ZodOptional<z.ZodString>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
142
+ message: string;
143
+ recoverable: boolean;
144
+ suggestion?: string | undefined;
145
+ details?: string | undefined;
146
+ }, {
147
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
148
+ message: string;
149
+ recoverable: boolean;
150
+ suggestion?: string | undefined;
151
+ details?: string | undefined;
152
+ }>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ success: false;
155
+ error: {
156
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
157
+ message: string;
158
+ recoverable: boolean;
159
+ suggestion?: string | undefined;
160
+ details?: string | undefined;
161
+ };
162
+ }, {
163
+ success: false;
164
+ error: {
165
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
166
+ message: string;
167
+ recoverable: boolean;
168
+ suggestion?: string | undefined;
169
+ details?: string | undefined;
170
+ };
171
+ }>;
172
+ export type APIEnableResult = z.infer<typeof APIEnableSuccess> | z.infer<typeof APIEnableFailure>;
173
+ export declare const ConnectionTestSuccess: z.ZodObject<{
174
+ success: z.ZodLiteral<true>;
175
+ data: z.ZodObject<{
176
+ connected: z.ZodBoolean;
177
+ statusCode: z.ZodNumber;
178
+ url: z.ZodString;
179
+ response: z.ZodOptional<z.ZodAny>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ url: string;
182
+ connected: boolean;
183
+ statusCode: number;
184
+ response?: any;
185
+ }, {
186
+ url: string;
187
+ connected: boolean;
188
+ statusCode: number;
189
+ response?: any;
190
+ }>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ success: true;
193
+ data: {
194
+ url: string;
195
+ connected: boolean;
196
+ statusCode: number;
197
+ response?: any;
198
+ };
199
+ }, {
200
+ success: true;
201
+ data: {
202
+ url: string;
203
+ connected: boolean;
204
+ statusCode: number;
205
+ response?: any;
206
+ };
207
+ }>;
208
+ export declare const ConnectionTestFailure: z.ZodObject<{
209
+ success: z.ZodLiteral<false>;
210
+ error: z.ZodObject<{
211
+ code: z.ZodEnum<["IAM_CONFIG_FAILED", "API_ENABLE_FAILED", "CONNECTION_TEST_FAILED", "PERMISSION_DENIED", "UNKNOWN_ERROR"]>;
212
+ message: z.ZodString;
213
+ suggestion: z.ZodOptional<z.ZodString>;
214
+ recoverable: z.ZodBoolean;
215
+ details: z.ZodOptional<z.ZodString>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
218
+ message: string;
219
+ recoverable: boolean;
220
+ suggestion?: string | undefined;
221
+ details?: string | undefined;
222
+ }, {
223
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
224
+ message: string;
225
+ recoverable: boolean;
226
+ suggestion?: string | undefined;
227
+ details?: string | undefined;
228
+ }>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ success: false;
231
+ error: {
232
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
233
+ message: string;
234
+ recoverable: boolean;
235
+ suggestion?: string | undefined;
236
+ details?: string | undefined;
237
+ };
238
+ }, {
239
+ success: false;
240
+ error: {
241
+ code: "UNKNOWN_ERROR" | "IAM_CONFIG_FAILED" | "API_ENABLE_FAILED" | "CONNECTION_TEST_FAILED" | "PERMISSION_DENIED";
242
+ message: string;
243
+ recoverable: boolean;
244
+ suggestion?: string | undefined;
245
+ details?: string | undefined;
246
+ };
247
+ }>;
248
+ export type ConnectionTestResult = z.infer<typeof ConnectionTestSuccess> | z.infer<typeof ConnectionTestFailure>;
249
+ export interface StitchService {
250
+ /**
251
+ * Configure IAM permissions for Stitch API
252
+ */
253
+ configureIAM(input: ConfigureIAMInput): Promise<IAMConfigResult>;
254
+ /**
255
+ * Enable Stitch API for the project
256
+ */
257
+ enableAPI(input: EnableAPIInput): Promise<APIEnableResult>;
258
+ /**
259
+ * Test the connection to the Stitch API
260
+ */
261
+ testConnection(input: TestConnectionInput): Promise<ConnectionTestResult>;
262
+ /**
263
+ * Test the connection to the Stitch API using an API key
264
+ */
265
+ testConnectionWithApiKey(input: TestConnectionWithApiKeyInput): Promise<ConnectionTestResult>;
266
+ /**
267
+ * Check if a user has a specific IAM role on a project
268
+ */
269
+ checkIAMRole(input: {
270
+ projectId: string;
271
+ userEmail: string;
272
+ }): Promise<boolean>;
273
+ /**
274
+ * Check if the Stitch API is enabled for a project
275
+ */
276
+ checkAPIEnabled(input: {
277
+ projectId: string;
278
+ }): Promise<boolean>;
279
+ }
@@ -0,0 +1,7 @@
1
+ import { type ViewSpec, type ViewInput, type ViewResult } from './spec.js';
2
+ import { StitchMCPClient } from '../mcp-client/client.js';
3
+ export declare class ViewHandler implements ViewSpec {
4
+ private client;
5
+ constructor(client?: StitchMCPClient);
6
+ execute(input: ViewInput): Promise<ViewResult>;
7
+ }
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ export declare const ViewInputSchema: z.ZodObject<{
3
+ projects: z.ZodDefault<z.ZodBoolean>;
4
+ name: z.ZodOptional<z.ZodString>;
5
+ sourceScreen: z.ZodOptional<z.ZodString>;
6
+ project: z.ZodOptional<z.ZodString>;
7
+ screen: z.ZodOptional<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ projects: boolean;
10
+ name?: string | undefined;
11
+ sourceScreen?: string | undefined;
12
+ project?: string | undefined;
13
+ screen?: string | undefined;
14
+ }, {
15
+ projects?: boolean | undefined;
16
+ name?: string | undefined;
17
+ sourceScreen?: string | undefined;
18
+ project?: string | undefined;
19
+ screen?: string | undefined;
20
+ }>;
21
+ export type ViewInput = z.infer<typeof ViewInputSchema>;
22
+ export declare const ViewErrorCode: z.ZodEnum<["INVALID_ARGS", "FETCH_FAILED", "UNKNOWN_ERROR"]>;
23
+ export declare const ViewSuccess: z.ZodObject<{
24
+ success: z.ZodLiteral<true>;
25
+ data: z.ZodAny;
26
+ }, "strip", z.ZodTypeAny, {
27
+ success: true;
28
+ data?: any;
29
+ }, {
30
+ success: true;
31
+ data?: any;
32
+ }>;
33
+ export declare const ViewFailure: z.ZodObject<{
34
+ success: z.ZodLiteral<false>;
35
+ error: z.ZodObject<{
36
+ code: z.ZodEnum<["INVALID_ARGS", "FETCH_FAILED", "UNKNOWN_ERROR"]>;
37
+ message: z.ZodString;
38
+ recoverable: z.ZodBoolean;
39
+ }, "strip", z.ZodTypeAny, {
40
+ code: "INVALID_ARGS" | "FETCH_FAILED" | "UNKNOWN_ERROR";
41
+ message: string;
42
+ recoverable: boolean;
43
+ }, {
44
+ code: "INVALID_ARGS" | "FETCH_FAILED" | "UNKNOWN_ERROR";
45
+ message: string;
46
+ recoverable: boolean;
47
+ }>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ success: false;
50
+ error: {
51
+ code: "INVALID_ARGS" | "FETCH_FAILED" | "UNKNOWN_ERROR";
52
+ message: string;
53
+ recoverable: boolean;
54
+ };
55
+ }, {
56
+ success: false;
57
+ error: {
58
+ code: "INVALID_ARGS" | "FETCH_FAILED" | "UNKNOWN_ERROR";
59
+ message: string;
60
+ recoverable: boolean;
61
+ };
62
+ }>;
63
+ export type ViewResult = z.infer<typeof ViewSuccess> | z.infer<typeof ViewFailure>;
64
+ export interface ViewSpec {
65
+ execute(input: ViewInput): Promise<ViewResult>;
66
+ }
@@ -0,0 +1,17 @@
1
+ export interface ViewerState {
2
+ data: any;
3
+ rootLabel?: string;
4
+ resourcePath?: string;
5
+ }
6
+ interface InteractiveViewerProps {
7
+ initialData: any;
8
+ initialRootLabel?: string;
9
+ /** Pre-populated navigation history (for back navigation from deep links) */
10
+ initialHistory?: ViewerState[];
11
+ /** Fetch function to load new resource data */
12
+ onFetch: (resourceName: string) => Promise<any>;
13
+ /** Called when exiting the viewer */
14
+ onExit?: () => void;
15
+ }
16
+ export declare const InteractiveViewer: ({ initialData, initialRootLabel, initialHistory, onFetch, onExit, }: InteractiveViewerProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type NavigationResult } from './navigation-behaviors/index.js';
2
+ interface JsonTreeProps {
3
+ data: any;
4
+ /** Optional label for root object - when set, root is selectable for copying */
5
+ rootLabel?: string;
6
+ /** Called when user navigates into a resource (Enter on screenInstances) */
7
+ onNavigate?: (result: NavigationResult) => void;
8
+ /** Called when user wants to go back (Backspace/Delete) */
9
+ onBack?: () => void;
10
+ }
11
+ export declare const JsonTree: ({ data, rootLabel, onNavigate, onBack }: JsonTreeProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { ChecklistUI, ChecklistConfig, UpdateItemInput, UpdateResult, RenderResult } from './spec.js';
2
+ export declare class ChecklistUIHandler implements ChecklistUI {
3
+ private config;
4
+ private states;
5
+ private lastOutputLines;
6
+ initialize(config: ChecklistConfig): void;
7
+ updateItem(input: UpdateItemInput): UpdateResult;
8
+ render(): RenderResult;
9
+ print(options?: {
10
+ clearPrevious?: boolean;
11
+ }): void;
12
+ getProgress(): {
13
+ completed: number;
14
+ total: number;
15
+ percent: number;
16
+ };
17
+ isComplete(): boolean;
18
+ private getStateColor;
19
+ }
20
+ /**
21
+ * Create a new ChecklistUI instance
22
+ */
23
+ export declare function createChecklistUI(): ChecklistUI;