MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getIdeStatusMessageWithFiles

Function getIdeStatusMessageWithFiles

packages/cli/src/ui/commands/ideCommand.ts:83–117  ·  view source on GitHub ↗
(ideClient: IdeClient)

Source from the content-addressed store, hash-verified

81}
82
83async function getIdeStatusMessageWithFiles(ideClient: IdeClient): Promise<{
84 messageType: 'info' | 'error';
85 content: string;
86}> {
87 const connection = ideClient.getConnectionStatus();
88 switch (connection.status) {
89 case IDEConnectionStatus.Connected: {
90 let content = `🟢 Connected to ${ideClient.getDetectedIdeDisplayName()}`;
91 const context = ideContext.getIdeContext();
92 const openFiles = context?.workspaceState?.openFiles;
93 if (openFiles && openFiles.length > 0) {
94 content += formatFileList(openFiles);
95 }
96 return {
97 messageType: 'info',
98 content,
99 };
100 }
101 case IDEConnectionStatus.Connecting:
102 return {
103 messageType: 'info',
104 content: `🟡 Connecting...`,
105 };
106 default: {
107 let content = `🔴 Disconnected`;
108 if (connection?.details) {
109 content += `: ${connection.details}`;
110 }
111 return {
112 messageType: 'error',
113 content,
114 };
115 }
116 }
117}
118
119export const ideCommand = (config: Config | null): SlashCommand | null => {
120 if (!config) {

Callers 1

ideCommandFunction · 0.85

Calls 3

formatFileListFunction · 0.85
getConnectionStatusMethod · 0.80

Tested by

no test coverage detected