@nexiq/cli 1.0.1 → 1.0.6

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/dist/index.d.ts DELETED
@@ -1,365 +0,0 @@
1
- import * as _nexiq_shared from '@nexiq/shared';
2
- import { JsonData, DatabaseData, ProjectStatus, ReactMapConfig, GitStatus, GitCommit, GitFileDiff } from '@nexiq/shared';
3
- import * as watcher from '@parcel/watcher';
4
- import { SqliteDB } from '@nexiq/analyser/db/sqlite';
5
- import { Extension } from '@nexiq/extension-sdk';
6
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
-
8
- interface ProjectInfo {
9
- projectPath: string;
10
- subProject?: string;
11
- graph?: JsonData;
12
- subscription?: watcher.AsyncSubscription;
13
- extensions: Extension[];
14
- sqlitePath: string;
15
- db?: SqliteDB;
16
- }
17
- interface SymbolSearchResult {
18
- kind?: string;
19
- usage_kind?: string;
20
- name: string;
21
- file: string;
22
- loc: {
23
- line: number;
24
- column: number;
25
- };
26
- props?: unknown[];
27
- in?: string;
28
- usages?: SymbolSearchResult[];
29
- }
30
- interface SymbolInfo {
31
- definitions: SymbolSearchResult[];
32
- externalUsages?: SymbolSearchResult[];
33
- }
34
- interface TreeNode {
35
- name: string;
36
- children: TreeNode[];
37
- }
38
- interface ComponentHierarchyNode {
39
- id: string;
40
- name: string;
41
- children: (ComponentHierarchyNode | {
42
- name: string;
43
- status: string;
44
- })[];
45
- status?: string;
46
- }
47
- declare class ProjectManager {
48
- private projects;
49
- private pendingProjects;
50
- openProject(projectPath: string, subProject?: string): Promise<ProjectInfo>;
51
- private _openProjectInternal;
52
- getDatabaseData(projectPath: string, subProject?: string): Promise<DatabaseData>;
53
- getOpenProjectPaths(): string[];
54
- getProject(projectPath: string, subProject?: string): ProjectInfo | undefined;
55
- getAllExtensions(): Extension[];
56
- findSymbol(projectPath: string, query: string, subProject?: string, strict?: boolean, includeProps?: boolean, includeUsages?: boolean, exclude?: string[]): Promise<SymbolInfo>;
57
- getSymbolUsagesWithContext(projectPath: string, query: string, subProject?: string, strict?: boolean, contextLines?: number, exclude?: string[]): Promise<{
58
- file: string;
59
- line: number;
60
- column: number;
61
- in: string | undefined;
62
- kind: string | undefined;
63
- context: string[];
64
- }[]>;
65
- getPropDefinitions(projectPath: string, query: string, subProject?: string): Promise<{
66
- name: string;
67
- file: string;
68
- props: unknown[];
69
- }[]>;
70
- findFiles(projectPath: string, pattern: string, subProject?: string): Promise<string[]>;
71
- getFileImports(projectPath: string, filePath: string, subProject?: string): Promise<Record<string, _nexiq_shared.ComponentFileImport>>;
72
- getProjectTree(projectPath: string, subProject?: string, maxDepth?: number): Promise<TreeNode>;
73
- getComponentHierarchy(projectPath: string, componentName: string, subProject?: string, depth?: number): Promise<{
74
- component: string;
75
- hierarchies: ComponentHierarchyNode[];
76
- renderedBy: {
77
- id: string;
78
- name: string;
79
- file: string;
80
- }[];
81
- } | {
82
- error: string;
83
- }>;
84
- getSymbolLocation(projectPath: string, query: string, subProject?: string): Promise<{
85
- id: string;
86
- name: string;
87
- file: string;
88
- loc: {
89
- line: number;
90
- column: number;
91
- };
92
- kind: string;
93
- type: string;
94
- }[]>;
95
- getSymbolContent(projectPath: string, query: string, subProject?: string): Promise<{
96
- id: string;
97
- name: string;
98
- file: string;
99
- loc: {
100
- line: number;
101
- column: number;
102
- };
103
- kind: string;
104
- type: string;
105
- content?: string;
106
- error?: string;
107
- }[] | {
108
- error: string;
109
- }>;
110
- updateGraphPosition(projectPath: string, subProject: string | undefined, _positions: unknown, _contextId?: string): Promise<boolean>;
111
- addLabel(projectPath: string, id: string, label: string, subProject?: string): Promise<string[]>;
112
- removeLabel(projectPath: string, id: string, label: string, subProject?: string): Promise<string[]>;
113
- getLabels(projectPath: string, subProject?: string): Promise<Record<string, string[]>>;
114
- findEntitiesByLabel(projectPath: string, label: string, subProject?: string): Promise<string[]>;
115
- listDirectory(projectPath: string, dirPath: string, subProject?: string): Promise<{
116
- directories: string[];
117
- files: string[];
118
- }>;
119
- getFileOutline(projectPath: string, filePath: string, subProject?: string): Promise<{
120
- id: string;
121
- name: string;
122
- kind: "ref" | "normal" | "component" | "hook" | "state" | "memo" | "callback";
123
- type: "function" | "class" | "jsx" | "data";
124
- line: number;
125
- }[]>;
126
- readFile(projectPath: string, filePath: string, subProject?: string): Promise<string>;
127
- grepSearch(projectPath: string, pattern: string, subProject?: string, exclude?: string[]): Promise<{
128
- file: string;
129
- line: number;
130
- content: string;
131
- }[]>;
132
- runShellCommand(projectPath: string, command: string, subProject?: string): Promise<{
133
- stdout?: string;
134
- stderr?: string;
135
- error?: string;
136
- exitCode: number;
137
- }>;
138
- saveAppState(projectPath: string, state: unknown): Promise<boolean>;
139
- readAppState(projectPath: string): Promise<unknown>;
140
- private _saveCache;
141
- checkProjectStatus(directoryPath: string): Promise<ProjectStatus>;
142
- saveProjectConfig(directoryPath: string, config: ReactMapConfig): Promise<boolean>;
143
- gitStatus(projectRoot: string): Promise<GitStatus>;
144
- gitLog(projectRoot: string, options?: number | {
145
- limit?: number;
146
- path?: string;
147
- }): Promise<GitCommit[]>;
148
- gitDiff(projectRoot: string, options: {
149
- file?: string;
150
- commit?: string;
151
- baseCommit?: string;
152
- staged?: boolean;
153
- }): Promise<GitFileDiff[]>;
154
- gitAnalyzeCommit(projectRoot: string, commitHash: string, subPath?: string): Promise<DatabaseData>;
155
- getProjectIcon(projectRoot: string): Promise<string | null>;
156
- writeFile(projectRoot: string, filePath: string, content: string): Promise<boolean>;
157
- replaceFileContent(projectRoot: string, filePath: string, oldString: string, newString: string): Promise<boolean>;
158
- multiReplaceFileContent(projectRoot: string, filePath: string, replacements: {
159
- oldString: string;
160
- newString: string;
161
- }[]): Promise<boolean>;
162
- closeAll(): Promise<void>;
163
- }
164
-
165
- interface OpenProjectArgs {
166
- projectPath: string;
167
- subProject?: string;
168
- }
169
- interface GetSymbolInfoArgs {
170
- projectPath: string;
171
- subProject?: string;
172
- query: string;
173
- strict?: boolean;
174
- props?: boolean;
175
- usages?: boolean;
176
- loc?: boolean;
177
- exclude?: string[];
178
- fields?: string[];
179
- }
180
- interface GetSymbolUsagesWithContextArgs {
181
- projectPath: string;
182
- subProject?: string;
183
- query: string;
184
- strict?: boolean;
185
- contextLines?: number;
186
- exclude?: string[];
187
- fields?: string[];
188
- }
189
- interface FindFilesArgs {
190
- projectPath: string;
191
- subProject?: string;
192
- pattern: string;
193
- fields?: string[];
194
- }
195
- interface GetFileImportsArgs {
196
- projectPath: string;
197
- subProject?: string;
198
- filePath: string;
199
- fields?: string[];
200
- }
201
- interface GetProjectTreeArgs {
202
- projectPath: string;
203
- subProject?: string;
204
- maxDepth?: number;
205
- fields?: string[];
206
- }
207
- interface GetComponentHierarchyArgs {
208
- projectPath: string;
209
- subProject?: string;
210
- componentName: string;
211
- depth?: number;
212
- fields?: string[];
213
- }
214
- interface GetSymbolLocationArgs {
215
- projectPath: string;
216
- subProject?: string;
217
- query: string;
218
- fields?: string[];
219
- }
220
- interface GetSymbolContentArgs {
221
- projectPath: string;
222
- subProject?: string;
223
- query: string;
224
- fields?: string[];
225
- }
226
- interface AddLabelArgs {
227
- projectPath: string;
228
- subProject?: string;
229
- id: string;
230
- label: string;
231
- }
232
- interface ListLabelsArgs {
233
- projectPath: string;
234
- subProject?: string;
235
- }
236
- interface SearchByLabelArgs {
237
- projectPath: string;
238
- subProject?: string;
239
- label: string;
240
- }
241
- interface ListDirectoryArgs {
242
- projectPath: string;
243
- subProject?: string;
244
- dirPath: string;
245
- }
246
- interface GetFileOutlineArgs {
247
- projectPath: string;
248
- subProject?: string;
249
- filePath: string;
250
- fields?: string[];
251
- }
252
- interface ReadFileArgs {
253
- projectPath: string;
254
- subProject?: string;
255
- filePath: string;
256
- }
257
- interface GrepSearchArgs {
258
- projectPath: string;
259
- subProject?: string;
260
- pattern: string;
261
- exclude?: string[];
262
- }
263
- interface RunShellCommandArgs {
264
- projectPath: string;
265
- subProject?: string;
266
- command: string;
267
- }
268
- interface ListFilesArgs {
269
- projectPath: string;
270
- subProject?: string;
271
- fields?: string[];
272
- exclude?: string[];
273
- }
274
- interface GetPropDefinitionsArgs {
275
- projectPath: string;
276
- subProject?: string;
277
- componentName: string;
278
- fields?: string[];
279
- }
280
- interface WriteFileArgs {
281
- projectPath: string;
282
- subProject?: string;
283
- filePath: string;
284
- content: string;
285
- }
286
- interface ReplaceFileContentArgs {
287
- projectPath: string;
288
- subProject?: string;
289
- filePath: string;
290
- oldString: string;
291
- newString: string;
292
- }
293
- interface MultiReplaceFileContentArgs {
294
- projectPath: string;
295
- subProject?: string;
296
- filePath: string;
297
- replacements: {
298
- oldString: string;
299
- newString: string;
300
- }[];
301
- }
302
- interface ToolArgsMap {
303
- open_project: OpenProjectArgs;
304
- get_symbol_info: GetSymbolInfoArgs;
305
- get_symbol_usages_with_context: GetSymbolUsagesWithContextArgs;
306
- get_prop_definitions: GetPropDefinitionsArgs;
307
- find_files: FindFilesArgs;
308
- get_file_imports: GetFileImportsArgs;
309
- get_project_tree: GetProjectTreeArgs;
310
- list_files: ListFilesArgs;
311
- get_component_hierarchy: GetComponentHierarchyArgs;
312
- get_symbol_location: GetSymbolLocationArgs;
313
- get_symbol_content: GetSymbolContentArgs;
314
- add_label: AddLabelArgs;
315
- list_labels: ListLabelsArgs;
316
- search_by_label: SearchByLabelArgs;
317
- list_directory: ListDirectoryArgs;
318
- get_file_outline: GetFileOutlineArgs;
319
- read_file: ReadFileArgs;
320
- grep_search: GrepSearchArgs;
321
- run_shell_command: RunShellCommandArgs;
322
- write_file: WriteFileArgs;
323
- replace_file_content: ReplaceFileContentArgs;
324
- multi_replace_file_content: MultiReplaceFileContentArgs;
325
- }
326
- type KnownToolCall = {
327
- [K in keyof ToolArgsMap]: {
328
- name: K;
329
- args: ToolArgsMap[K];
330
- };
331
- }[keyof ToolArgsMap];
332
- type UnknownToolCall = {
333
- name: Exclude<string, keyof ToolArgsMap>;
334
- args: Record<string, unknown>;
335
- };
336
- type ToolCall = KnownToolCall | UnknownToolCall;
337
- declare class BackendServer {
338
- private projectManager;
339
- private port;
340
- private mcpServer;
341
- private wss;
342
- private uiConnections;
343
- private mcpConnected;
344
- private exitTimeout;
345
- constructor(projectManager: ProjectManager, port?: number);
346
- private setupMcpHandlers;
347
- handleCallTool(toolCall: ToolCall): Promise<{
348
- content: {
349
- type: string;
350
- text: string;
351
- }[];
352
- }>;
353
- private handleKnownToolCall;
354
- private filterFields;
355
- private resolveProjectPath;
356
- private sendResponse;
357
- private sendChunkedResponse;
358
- private sendError;
359
- startWebSocketServer(): void;
360
- startMcpServer(transport: StdioServerTransport): Promise<void>;
361
- private checkExitCondition;
362
- stop(): Promise<void>;
363
- }
364
-
365
- export { BackendServer, ProjectManager };