@teambit/cli-mcp-server 0.0.0-01a64fc189fd54260378eef7ec9b3e522f9d6315

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.
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","CliMcpServerAspect","exports","Aspect","create","id"],"sources":["cli-mcp-server.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const CliMcpServerAspect = Aspect.create({\n id: 'teambit.mcp/cli-mcp-server',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC9CC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ import type { CLIMain } from '@teambit/cli';
2
+ import type { Logger, LoggerMain } from '@teambit/logger';
3
+ import { Http } from '@teambit/scope.network';
4
+ import type { SetupOptions, RulesOptions } from '@teambit/mcp.mcp-config-writer';
5
+ export declare class CliMcpServerMain {
6
+ private cli;
7
+ private logger;
8
+ private bitBin;
9
+ private _http;
10
+ private isConsumerProjectMode;
11
+ private serverPort?;
12
+ private serverUrl?;
13
+ private serverProcess;
14
+ private readonly readOnlyCommands;
15
+ constructor(cli: CLIMain, logger: Logger);
16
+ getHttp(): Promise<Http>;
17
+ private getBitServerPort;
18
+ /**
19
+ * Start a new bit-server process
20
+ */
21
+ private startBitServer;
22
+ /**
23
+ * Call bit-server API endpoint using cli-raw route
24
+ */
25
+ private callBitServerAPI;
26
+ /**
27
+ * Call bit-server API endpoint using IDE route
28
+ */
29
+ private callBitServerIDEAPI;
30
+ /**
31
+ * Generic method to call bit-server API with different routes
32
+ */
33
+ private callBitServerAPIWithRoute;
34
+ runMcpServer(options: {
35
+ includeAdditional?: string;
36
+ bitBin?: string;
37
+ consumerProject?: boolean;
38
+ }): Promise<void>;
39
+ private shouldIncludeCommand;
40
+ private buildZodSchema;
41
+ private buildCommandArgs;
42
+ private getToolName;
43
+ private registerToolForCommand;
44
+ /**
45
+ * Read and parse workspace.jsonc file from a given directory
46
+ */
47
+ private readWorkspaceJsonc;
48
+ /**
49
+ * Extract owner from defaultScope in workspace.jsonc
50
+ * If defaultScope contains a dot, split by dot and take the first part
51
+ */
52
+ private extractOwnerFromWorkspace;
53
+ private registerRemoteSearchTool;
54
+ private registerRemoteComponentDetailsTool;
55
+ private registerWorkspaceInfoTool;
56
+ private registerComponentDetailsTool;
57
+ private registerCommandsListTool;
58
+ private registerCommandHelpTool;
59
+ private registerQueryTool;
60
+ private registerExecuteTool;
61
+ private processSubCommands;
62
+ private runBit;
63
+ /**
64
+ * Helper method to execute a bit-server API call with standardized error handling
65
+ */
66
+ private executeBitServerCommand;
67
+ /**
68
+ * Helper method to format any result as CallToolResult
69
+ */
70
+ private formatAsCallToolResult;
71
+ /**
72
+ * Helper method to format error as CallToolResult
73
+ */
74
+ private formatErrorAsCallToolResult;
75
+ /**
76
+ * Helper method to safely execute a bit command with error handling
77
+ */
78
+ private safeBitCommandExecution;
79
+ private validateBitBin;
80
+ getEditorDisplayName(editor: string): string;
81
+ /**
82
+ * Get the path to the editor config file based on editor type and scope
83
+ */
84
+ getEditorConfigPath(editor: string, isGlobal: boolean, workspaceDir?: string): string;
85
+ setupEditor(editor: string, options: SetupOptions, workspaceDir?: string): Promise<void>;
86
+ writeRulesFile(editor: string, options: RulesOptions, workspaceDir?: string): Promise<void>;
87
+ getRulesContent(consumerProject?: boolean): Promise<string>;
88
+ static slots: never[];
89
+ static dependencies: import("@teambit/harmony").Aspect[];
90
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
91
+ static provider([cli, loggerMain]: [CLIMain, LoggerMain]): Promise<CliMcpServerMain>;
92
+ }
93
+ export default CliMcpServerMain;