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.
- package/LICENSE +212 -0
- package/README.md +439 -0
- package/bin/stitch-mcp.js +2 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +130810 -0
- package/dist/commands/doctor/command.d.ts +2 -0
- package/dist/commands/doctor/context.d.ts +19 -0
- package/dist/commands/doctor/handler.d.ts +12 -0
- package/dist/commands/doctor/spec.d.ts +130 -0
- package/dist/commands/doctor/steps/AdcCheckStep.d.ts +8 -0
- package/dist/commands/doctor/steps/ApiCheckStep.d.ts +8 -0
- package/dist/commands/doctor/steps/ApiKeyConnectionStep.d.ts +8 -0
- package/dist/commands/doctor/steps/ApiKeyDetectedStep.d.ts +8 -0
- package/dist/commands/doctor/steps/AuthCheckStep.d.ts +8 -0
- package/dist/commands/doctor/steps/GcloudCheckStep.d.ts +8 -0
- package/dist/commands/doctor/steps/ProjectCheckStep.d.ts +8 -0
- package/dist/commands/init/command.d.ts +2 -0
- package/dist/commands/init/context.d.ts +24 -0
- package/dist/commands/init/handler.d.ts +19 -0
- package/dist/commands/init/spec.d.ts +91 -0
- package/dist/commands/init/steps/AuthModeStep.d.ts +8 -0
- package/dist/commands/init/steps/AuthStep.d.ts +8 -0
- package/dist/commands/init/steps/ClientSelectionStep.d.ts +9 -0
- package/dist/commands/init/steps/ConfigStep.d.ts +9 -0
- package/dist/commands/init/steps/GcloudInstallStep.d.ts +8 -0
- package/dist/commands/init/steps/IamApiStep.d.ts +8 -0
- package/dist/commands/init/steps/ProjectSelectStep.d.ts +8 -0
- package/dist/commands/init/steps/TestConnectionStep.d.ts +8 -0
- package/dist/commands/init/steps/TransportStep.d.ts +9 -0
- package/dist/commands/logout/command.d.ts +2 -0
- package/dist/commands/logout/context.d.ts +12 -0
- package/dist/commands/logout/handler.d.ts +8 -0
- package/dist/commands/logout/spec.d.ts +77 -0
- package/dist/commands/logout/steps/ClearConfigStep.d.ts +8 -0
- package/dist/commands/logout/steps/PrepareStep.d.ts +8 -0
- package/dist/commands/logout/steps/RevokeAdcStep.d.ts +9 -0
- package/dist/commands/logout/steps/RevokeUserStep.d.ts +9 -0
- package/dist/commands/proxy/command.d.ts +2 -0
- package/dist/commands/proxy/handler.d.ts +7 -0
- package/dist/commands/registry.d.ts +2 -0
- package/dist/commands/screens/ScreensView.d.ts +16 -0
- package/dist/commands/screens/command.d.ts +2 -0
- package/dist/commands/screens/handler.d.ts +24 -0
- package/dist/commands/serve/ServeView.d.ts +12 -0
- package/dist/commands/serve/command.d.ts +2 -0
- package/dist/commands/serve/handler.d.ts +22 -0
- package/dist/commands/site/command.d.ts +2 -0
- package/dist/commands/site/hooks/useProjectHydration.d.ts +9 -0
- package/dist/commands/site/index.d.ts +12 -0
- package/dist/commands/site/ui/ScreenList.d.ts +11 -0
- package/dist/commands/site/ui/SiteBuilder.d.ts +10 -0
- package/dist/commands/site/ui/components/StatusIcon.d.ts +6 -0
- package/dist/commands/site/ui/types.d.ts +1 -0
- package/dist/commands/site/utils/ProjectSyncer.d.ts +8 -0
- package/dist/commands/site/utils/SiteManifest.d.ts +16 -0
- package/dist/commands/snapshot/command.d.ts +2 -0
- package/dist/commands/snapshot/handler.d.ts +17 -0
- package/dist/commands/snapshot/spec.d.ts +39 -0
- package/dist/commands/tool/command.d.ts +2 -0
- package/dist/commands/tool/context.d.ts +9 -0
- package/dist/commands/tool/handler.d.ts +9 -0
- package/dist/commands/tool/spec.d.ts +39 -0
- package/dist/commands/tool/steps/ExecuteToolStep.d.ts +8 -0
- package/dist/commands/tool/steps/ListToolsStep.d.ts +8 -0
- package/dist/commands/tool/steps/ParseArgsStep.d.ts +8 -0
- package/dist/commands/tool/steps/ShowSchemaStep.d.ts +10 -0
- package/dist/commands/tool/steps/ValidateToolStep.d.ts +8 -0
- package/dist/commands/tool/virtual-tools/build-site.d.ts +2 -0
- package/dist/commands/tool/virtual-tools/get-screen-code.d.ts +2 -0
- package/dist/commands/tool/virtual-tools/get-screen-image.d.ts +2 -0
- package/dist/commands/tool/virtual-tools/index.d.ts +7 -0
- package/dist/commands/tool/virtual-tools/list-tools.d.ts +2 -0
- package/dist/commands/view/command.d.ts +2 -0
- package/dist/commands/view/handler.d.ts +14 -0
- package/dist/framework/CommandDefinition.d.ts +18 -0
- package/dist/framework/CommandStep.d.ts +15 -0
- package/dist/framework/ConsoleUI.d.ts +14 -0
- package/dist/framework/MockUI.d.ts +16 -0
- package/dist/framework/StepRunner.d.ts +20 -0
- package/dist/framework/UserInterface.d.ts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +23583 -0
- package/dist/lib/server/AssetGateway.d.ts +25 -0
- package/dist/lib/server/vite/StitchViteServer.d.ts +11 -0
- package/dist/lib/server/vite/plugins/virtualContent.d.ts +7 -0
- package/dist/lib/services/site/SiteService.d.ts +6 -0
- package/dist/lib/services/site/schemas.d.ts +91 -0
- package/dist/lib/services/site/types.d.ts +22 -0
- package/dist/platform/detector.d.ts +29 -0
- package/dist/platform/environment.d.ts +13 -0
- package/dist/platform/paths.d.ts +20 -0
- package/dist/platform/shell.d.ts +30 -0
- package/dist/services/gcloud/handler.d.ts +57 -0
- package/dist/services/gcloud/spec.d.ts +408 -0
- package/dist/services/mcp-client/MockStitchMCPClient.d.ts +7 -0
- package/dist/services/mcp-client/client.d.ts +79 -0
- package/dist/services/mcp-client/spec.d.ts +27 -0
- package/dist/services/mcp-config/handler.d.ts +13 -0
- package/dist/services/mcp-config/spec.d.ts +108 -0
- package/dist/services/project/handler.d.ts +11 -0
- package/dist/services/project/spec.d.ts +86 -0
- package/dist/services/proxy/handler.d.ts +26 -0
- package/dist/services/proxy/spec.d.ts +83 -0
- package/dist/services/stitch/handler.d.ts +17 -0
- package/dist/services/stitch/spec.d.ts +279 -0
- package/dist/services/view/handler.d.ts +7 -0
- package/dist/services/view/spec.d.ts +66 -0
- package/dist/ui/InteractiveViewer.d.ts +17 -0
- package/dist/ui/JsonTree.d.ts +12 -0
- package/dist/ui/checklist/handler.d.ts +23 -0
- package/dist/ui/checklist/spec.d.ts +191 -0
- package/dist/ui/checklist.d.ts +54 -0
- package/dist/ui/copy-behaviors/clipboard.d.ts +32 -0
- package/dist/ui/copy-behaviors/handlers.d.ts +16 -0
- package/dist/ui/copy-behaviors/index.d.ts +8 -0
- package/dist/ui/copy-behaviors/registry.d.ts +24 -0
- package/dist/ui/copy-behaviors/types.d.ts +26 -0
- package/dist/ui/navigation-behaviors/index.d.ts +34 -0
- package/dist/ui/serve-behaviors/handlers.d.ts +9 -0
- package/dist/ui/serve-behaviors/index.d.ts +7 -0
- package/dist/ui/serve-behaviors/registry.d.ts +10 -0
- package/dist/ui/serve-behaviors/server.d.ts +8 -0
- package/dist/ui/serve-behaviors/types.d.ts +18 -0
- package/dist/ui/spinner.d.ts +11 -0
- package/dist/ui/theme.d.ts +18 -0
- package/dist/ui/wizard.d.ts +36 -0
- package/package.json +83 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
2
|
+
interface Screen {
|
|
3
|
+
screenId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
hasCode: boolean;
|
|
6
|
+
codeUrl: string | null;
|
|
7
|
+
hasImage: boolean;
|
|
8
|
+
}
|
|
9
|
+
type ScreensHandlerResult = {
|
|
10
|
+
success: true;
|
|
11
|
+
projectId: string;
|
|
12
|
+
projectTitle: string;
|
|
13
|
+
screens: Screen[];
|
|
14
|
+
} | {
|
|
15
|
+
success: false;
|
|
16
|
+
error: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class ScreensHandler {
|
|
19
|
+
private client;
|
|
20
|
+
constructor(client: StitchMCPClient);
|
|
21
|
+
execute(projectId: string): Promise<ScreensHandlerResult>;
|
|
22
|
+
getClient(): StitchMCPClient;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface CodeScreen {
|
|
2
|
+
screenId: string;
|
|
3
|
+
title: string;
|
|
4
|
+
codeUrl: string;
|
|
5
|
+
}
|
|
6
|
+
interface ServeViewProps {
|
|
7
|
+
projectId: string;
|
|
8
|
+
projectTitle: string;
|
|
9
|
+
screens: CodeScreen[];
|
|
10
|
+
}
|
|
11
|
+
export declare function ServeView({ projectId, projectTitle, screens }: ServeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
2
|
+
interface CodeScreen {
|
|
3
|
+
screenId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
codeUrl: string;
|
|
6
|
+
}
|
|
7
|
+
type ServeHandlerResult = {
|
|
8
|
+
success: true;
|
|
9
|
+
projectId: string;
|
|
10
|
+
projectTitle: string;
|
|
11
|
+
screens: CodeScreen[];
|
|
12
|
+
} | {
|
|
13
|
+
success: false;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
export declare class ServeHandler {
|
|
17
|
+
private client;
|
|
18
|
+
constructor(client: StitchMCPClient);
|
|
19
|
+
execute(projectId: string): Promise<ServeHandlerResult>;
|
|
20
|
+
getClient(): StitchMCPClient;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StitchViteServer } from '../../../lib/server/vite/StitchViteServer.js';
|
|
2
|
+
import { ProjectSyncer } from '../utils/ProjectSyncer.js';
|
|
3
|
+
import type { UIScreen } from '../../../lib/services/site/types.js';
|
|
4
|
+
export type HydrationStatus = 'idle' | 'downloading' | 'ready' | 'error';
|
|
5
|
+
export declare function useProjectHydration(screens: UIScreen[], server: StitchViteServer | null, syncer: ProjectSyncer, activeScreenId?: string): {
|
|
6
|
+
hydrationStatus: HydrationStatus;
|
|
7
|
+
progress: number;
|
|
8
|
+
htmlContent: Map<string, string>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
2
|
+
interface SiteCommandOptions {
|
|
3
|
+
projectId: string;
|
|
4
|
+
outputDir?: string;
|
|
5
|
+
export?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class SiteCommandHandler {
|
|
8
|
+
private client?;
|
|
9
|
+
constructor(client?: StitchMCPClient | undefined);
|
|
10
|
+
execute(options: SiteCommandOptions): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UIScreen } from './types.js';
|
|
3
|
+
interface ScreenListProps {
|
|
4
|
+
items: {
|
|
5
|
+
screen: UIScreen;
|
|
6
|
+
sourceIndex: number;
|
|
7
|
+
}[];
|
|
8
|
+
activeIndex: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const ScreenList: React.FC<ScreenListProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StitchMCPClient } from '../../../services/mcp-client/client.js';
|
|
3
|
+
import type { SiteConfig } from '../../../lib/services/site/types.js';
|
|
4
|
+
interface SiteBuilderProps {
|
|
5
|
+
projectId: string;
|
|
6
|
+
client: StitchMCPClient;
|
|
7
|
+
onExit: (config: SiteConfig | null, htmlContent?: Map<string, string>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const SiteBuilder: React.FC<SiteBuilderProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { UIScreen } from '../../../lib/services/site/types.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StitchMCPClient } from '../../../services/mcp-client/client.js';
|
|
2
|
+
import type { RemoteScreen } from '../../../lib/services/site/types.js';
|
|
3
|
+
export declare class ProjectSyncer {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: StitchMCPClient);
|
|
6
|
+
fetchManifest(projectId: string): Promise<RemoteScreen[]>;
|
|
7
|
+
fetchContent(url: string): Promise<string>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface ScreenState {
|
|
2
|
+
status?: 'included' | 'ignored' | 'discarded';
|
|
3
|
+
route?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class SiteManifest {
|
|
6
|
+
private filePath;
|
|
7
|
+
private legacyPath;
|
|
8
|
+
constructor(projectId: string);
|
|
9
|
+
load(): Promise<Map<string, ScreenState>>;
|
|
10
|
+
save(screens: {
|
|
11
|
+
id: string;
|
|
12
|
+
status: string;
|
|
13
|
+
route: string;
|
|
14
|
+
}[]): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SnapshotCommand, type SnapshotInput, type SnapshotResult } from './spec.js';
|
|
2
|
+
import { type GcloudService } from '../../services/gcloud/spec.js';
|
|
3
|
+
import { type StitchService } from '../../services/stitch/spec.js';
|
|
4
|
+
import { type McpConfigService } from '../../services/mcp-config/spec.js';
|
|
5
|
+
import { type ProjectService } from '../../services/project/spec.js';
|
|
6
|
+
interface SnapshotServices {
|
|
7
|
+
gcloud?: GcloudService;
|
|
8
|
+
stitch?: StitchService;
|
|
9
|
+
mcpConfig?: McpConfigService;
|
|
10
|
+
project?: ProjectService;
|
|
11
|
+
}
|
|
12
|
+
export declare class SnapshotHandler implements SnapshotCommand {
|
|
13
|
+
private readonly services?;
|
|
14
|
+
constructor(services?: SnapshotServices | undefined);
|
|
15
|
+
execute(input: SnapshotInput): Promise<SnapshotResult>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SnapshotInputSchema: z.ZodObject<{
|
|
3
|
+
command: z.ZodOptional<z.ZodString>;
|
|
4
|
+
data: z.ZodOptional<z.ZodString>;
|
|
5
|
+
schema: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
schema: boolean;
|
|
8
|
+
data?: string | undefined;
|
|
9
|
+
command?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
data?: string | undefined;
|
|
12
|
+
command?: string | undefined;
|
|
13
|
+
schema?: boolean | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export type SnapshotInput = z.infer<typeof SnapshotInputSchema>;
|
|
16
|
+
export declare const SnapshotResultSchema: z.ZodObject<{
|
|
17
|
+
success: z.ZodBoolean;
|
|
18
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
message: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
message: string;
|
|
22
|
+
}, {
|
|
23
|
+
message: string;
|
|
24
|
+
}>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
success: boolean;
|
|
27
|
+
error?: {
|
|
28
|
+
message: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
success: boolean;
|
|
32
|
+
error?: {
|
|
33
|
+
message: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type SnapshotResult = z.infer<typeof SnapshotResultSchema>;
|
|
37
|
+
export interface SnapshotCommand {
|
|
38
|
+
execute(input: SnapshotInput): Promise<SnapshotResult>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
2
|
+
import type { ToolCommandInput, ToolCommandResult, VirtualTool } from './spec.js';
|
|
3
|
+
export interface ToolContext {
|
|
4
|
+
input: ToolCommandInput;
|
|
5
|
+
client: StitchMCPClient;
|
|
6
|
+
virtualTools: VirtualTool[];
|
|
7
|
+
parsedArgs?: Record<string, any>;
|
|
8
|
+
result?: ToolCommandResult;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
2
|
+
import type { ToolCommandInput, ToolCommandResult, VirtualTool } from './spec.js';
|
|
3
|
+
export declare class ToolCommandHandler {
|
|
4
|
+
private client;
|
|
5
|
+
private tools;
|
|
6
|
+
private steps;
|
|
7
|
+
constructor(client?: StitchMCPClient, tools?: VirtualTool[]);
|
|
8
|
+
execute(input: ToolCommandInput): Promise<ToolCommandResult>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { StitchMCPClient } from '../../services/mcp-client/client.js';
|
|
3
|
+
export declare const ToolCommandInputSchema: z.ZodObject<{
|
|
4
|
+
toolName: z.ZodOptional<z.ZodString>;
|
|
5
|
+
showSchema: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
data: z.ZodOptional<z.ZodString>;
|
|
7
|
+
dataFile: z.ZodOptional<z.ZodString>;
|
|
8
|
+
output: z.ZodDefault<z.ZodEnum<["json", "pretty", "raw"]>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
output: "json" | "pretty" | "raw";
|
|
11
|
+
showSchema: boolean;
|
|
12
|
+
data?: string | undefined;
|
|
13
|
+
toolName?: string | undefined;
|
|
14
|
+
dataFile?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
data?: string | undefined;
|
|
17
|
+
output?: "json" | "pretty" | "raw" | undefined;
|
|
18
|
+
toolName?: string | undefined;
|
|
19
|
+
showSchema?: boolean | undefined;
|
|
20
|
+
dataFile?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type ToolCommandInput = z.infer<typeof ToolCommandInputSchema>;
|
|
23
|
+
export interface ToolInfo {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
inputSchema?: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties?: Record<string, any>;
|
|
29
|
+
required?: string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ToolCommandResult {
|
|
33
|
+
success: boolean;
|
|
34
|
+
data?: any;
|
|
35
|
+
error?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface VirtualTool extends ToolInfo {
|
|
38
|
+
execute: (client: StitchMCPClient, args: any) => Promise<any>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';
|
|
2
|
+
import type { ToolContext } from '../context.js';
|
|
3
|
+
export declare class ExecuteToolStep implements CommandStep<ToolContext> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
shouldRun(context: ToolContext): Promise<boolean>;
|
|
7
|
+
run(context: ToolContext): Promise<StepResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';
|
|
2
|
+
import type { ToolContext } from '../context.js';
|
|
3
|
+
export declare class ListToolsStep implements CommandStep<ToolContext> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
shouldRun(context: ToolContext): Promise<boolean>;
|
|
7
|
+
run(context: ToolContext): Promise<StepResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';
|
|
2
|
+
import type { ToolContext } from '../context.js';
|
|
3
|
+
export declare class ParseArgsStep implements CommandStep<ToolContext> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
shouldRun(context: ToolContext): Promise<boolean>;
|
|
7
|
+
run(context: ToolContext): Promise<StepResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';
|
|
2
|
+
import type { ToolContext } from '../context.js';
|
|
3
|
+
export declare class ShowSchemaStep implements CommandStep<ToolContext> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
shouldRun(context: ToolContext): Promise<boolean>;
|
|
7
|
+
run(context: ToolContext): Promise<StepResult>;
|
|
8
|
+
private formatSchema;
|
|
9
|
+
private generateExample;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommandStep, StepResult } from '../../../framework/CommandStep.js';
|
|
2
|
+
import type { ToolContext } from '../context.js';
|
|
3
|
+
export declare class ValidateToolStep implements CommandStep<ToolContext> {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
shouldRun(context: ToolContext): Promise<boolean>;
|
|
7
|
+
run(context: ToolContext): Promise<StepResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { VirtualTool } from '../spec.js';
|
|
2
|
+
export { getScreenCodeTool } from './get-screen-code.js';
|
|
3
|
+
export { getScreenImageTool } from './get-screen-image.js';
|
|
4
|
+
export { buildSiteTool } from './build-site.js';
|
|
5
|
+
export { listToolsTool } from './list-tools.js';
|
|
6
|
+
import type { VirtualTool } from '../spec.js';
|
|
7
|
+
export declare const virtualTools: VirtualTool[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ViewOptions {
|
|
2
|
+
projects: boolean;
|
|
3
|
+
name?: string;
|
|
4
|
+
sourceScreen?: string;
|
|
5
|
+
project?: string;
|
|
6
|
+
screen?: string;
|
|
7
|
+
serve: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class ViewCommandHandler {
|
|
10
|
+
execute(options: ViewOptions): Promise<void>;
|
|
11
|
+
private executeServeMode;
|
|
12
|
+
private executeInteractiveMode;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Command } from 'commander';
|
|
2
|
+
export interface CommandDefinition {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
options?: Array<{
|
|
6
|
+
flags: string;
|
|
7
|
+
description: string;
|
|
8
|
+
defaultValue?: any;
|
|
9
|
+
fn?: (val: string) => any;
|
|
10
|
+
}>;
|
|
11
|
+
requiredOptions?: Array<{
|
|
12
|
+
flags: string;
|
|
13
|
+
description: string;
|
|
14
|
+
defaultValue?: any;
|
|
15
|
+
}>;
|
|
16
|
+
arguments?: string;
|
|
17
|
+
action: (args: any, options: any, command: Command) => Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface StepResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
detail?: string;
|
|
4
|
+
reason?: string;
|
|
5
|
+
error?: Error;
|
|
6
|
+
errorCode?: string;
|
|
7
|
+
shouldExit?: boolean;
|
|
8
|
+
status?: 'PENDING' | 'IN_PROGRESS' | 'COMPLETE' | 'SKIPPED' | 'FAILED';
|
|
9
|
+
}
|
|
10
|
+
export interface CommandStep<T> {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
run(context: T): Promise<StepResult>;
|
|
14
|
+
shouldRun(context: T): Promise<boolean>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type UserInterface } from './UserInterface.js';
|
|
2
|
+
import type { McpClient } from '../ui/wizard.js';
|
|
3
|
+
export declare class ConsoleUI implements UserInterface {
|
|
4
|
+
promptMcpClient(): Promise<McpClient>;
|
|
5
|
+
promptAuthMode(): Promise<'apiKey' | 'oauth'>;
|
|
6
|
+
promptTransportType(authMode?: 'apiKey' | 'oauth'): Promise<'http' | 'stdio'>;
|
|
7
|
+
promptApiKeyStorage(): Promise<'config' | 'skip' | '.env'>;
|
|
8
|
+
promptApiKey(): Promise<string>;
|
|
9
|
+
promptConfirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
10
|
+
log(message: string): void;
|
|
11
|
+
warn(message: string): void;
|
|
12
|
+
error(message: string): void;
|
|
13
|
+
success(message: string): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type UserInterface } from './UserInterface.js';
|
|
2
|
+
import type { McpClient } from '../ui/wizard.js';
|
|
3
|
+
export declare class MockUI implements UserInterface {
|
|
4
|
+
private readonly data;
|
|
5
|
+
constructor(data: Record<string, any>);
|
|
6
|
+
promptMcpClient(): Promise<McpClient>;
|
|
7
|
+
promptAuthMode(): Promise<'apiKey' | 'oauth'>;
|
|
8
|
+
promptTransportType(authMode?: 'apiKey' | 'oauth'): Promise<'http' | 'stdio'>;
|
|
9
|
+
promptApiKeyStorage(): Promise<'config' | 'skip' | '.env'>;
|
|
10
|
+
promptApiKey(): Promise<string>;
|
|
11
|
+
promptConfirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
12
|
+
log(message: string): void;
|
|
13
|
+
warn(message: string): void;
|
|
14
|
+
error(message: string): void;
|
|
15
|
+
success(message: string): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CommandStep, type StepResult } from './CommandStep.js';
|
|
2
|
+
export interface StepRunnerCallbacks<T> {
|
|
3
|
+
/** Called before each step runs. Use for UI (start spinner, set checklist IN_PROGRESS). */
|
|
4
|
+
onBeforeStep?: (step: CommandStep<T>, context: T) => void;
|
|
5
|
+
/** Called after each step runs. Return `true` to stop executing further steps. */
|
|
6
|
+
onAfterStep?: (step: CommandStep<T>, result: StepResult, context: T) => boolean;
|
|
7
|
+
/** Called when shouldRun() returns false. */
|
|
8
|
+
onSkippedStep?: (step: CommandStep<T>, context: T) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface StepRunnerResult {
|
|
11
|
+
results: StepResult[];
|
|
12
|
+
/** True if all steps completed (none stopped early). */
|
|
13
|
+
completed: boolean;
|
|
14
|
+
/** The result that triggered early stop, if any. */
|
|
15
|
+
stoppedAt?: {
|
|
16
|
+
step: string;
|
|
17
|
+
result: StepResult;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function runSteps<T>(steps: CommandStep<T>[], context: T, callbacks?: StepRunnerCallbacks<T>): Promise<StepRunnerResult>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { McpClient } from '../ui/wizard.js';
|
|
2
|
+
export interface UserInterface {
|
|
3
|
+
promptMcpClient(): Promise<McpClient>;
|
|
4
|
+
promptAuthMode(): Promise<'apiKey' | 'oauth'>;
|
|
5
|
+
promptTransportType(authMode?: 'apiKey' | 'oauth'): Promise<'http' | 'stdio'>;
|
|
6
|
+
promptApiKeyStorage(): Promise<'config' | 'skip' | '.env'>;
|
|
7
|
+
promptApiKey(): Promise<string>;
|
|
8
|
+
promptConfirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
9
|
+
log(message: string): void;
|
|
10
|
+
warn(message: string): void;
|
|
11
|
+
error(message: string): void;
|
|
12
|
+
success(message: string): void;
|
|
13
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -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';
|