@grafema/mcp 0.2.0-beta ā 0.2.5-beta
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/analysis-worker.js +9 -5
- package/dist/analysis-worker.js.map +1 -0
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +1 -0
- package/dist/analysis.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -5
- package/dist/config.js.map +1 -0
- package/dist/definitions.d.ts +4 -4
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js +89 -3
- package/dist/definitions.js.map +1 -0
- package/dist/handlers.d.ts +4 -2
- package/dist/handlers.d.ts.map +1 -1
- package/dist/handlers.js +172 -20
- package/dist/handlers.js.map +1 -0
- package/dist/prompts.d.ts +25 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +33 -0
- package/dist/prompts.js.map +1 -0
- package/dist/server.js +46 -20
- package/dist/server.js.map +1 -0
- package/dist/state.js +1 -0
- package/dist/state.js.map +1 -0
- package/dist/types.d.ts +50 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.js +2 -1
- package/dist/utils.js.map +1 -0
- package/package.json +4 -3
- package/src/analysis-worker.ts +10 -7
- package/src/analysis.ts +2 -1
- package/src/config.ts +12 -4
- package/src/definitions.ts +92 -5
- package/src/handlers.ts +219 -26
- package/src/prompts.ts +56 -0
- package/src/server.ts +74 -20
- package/src/types.ts +53 -1
- package/src/utils.ts +2 -2
package/src/types.ts
CHANGED
|
@@ -45,6 +45,7 @@ export interface QueryGraphArgs {
|
|
|
45
45
|
limit?: number;
|
|
46
46
|
offset?: number;
|
|
47
47
|
format?: 'table' | 'json' | 'tree';
|
|
48
|
+
explain?: boolean;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export interface FindCallsArgs {
|
|
@@ -52,6 +53,7 @@ export interface FindCallsArgs {
|
|
|
52
53
|
limit?: number;
|
|
53
54
|
offset?: number;
|
|
54
55
|
include_indirect?: boolean;
|
|
56
|
+
className?: string;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export interface TraceAliasArgs {
|
|
@@ -190,7 +192,7 @@ export interface GraphBackend {
|
|
|
190
192
|
export interface GraphNode {
|
|
191
193
|
id: string;
|
|
192
194
|
type: string;
|
|
193
|
-
name
|
|
195
|
+
name?: string; // Optional - some nodes (BRANCH, CASE, LOOP) don't have names
|
|
194
196
|
file?: string;
|
|
195
197
|
line?: number;
|
|
196
198
|
[key: string]: unknown;
|
|
@@ -265,6 +267,27 @@ export interface GetFunctionDetailsArgs {
|
|
|
265
267
|
// Re-export types from core for convenience
|
|
266
268
|
export type { CallInfo, CallerInfo, FindCallsOptions } from '@grafema/core';
|
|
267
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Datalog query result binding
|
|
272
|
+
*/
|
|
273
|
+
export interface DatalogBinding {
|
|
274
|
+
name: string;
|
|
275
|
+
value: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Call result structure for filtering
|
|
280
|
+
*/
|
|
281
|
+
export interface CallResult {
|
|
282
|
+
id: string;
|
|
283
|
+
name?: string;
|
|
284
|
+
object?: string;
|
|
285
|
+
file?: string;
|
|
286
|
+
line?: number;
|
|
287
|
+
resolved: boolean;
|
|
288
|
+
target: { type: string; name: string; file?: string; line?: number } | null;
|
|
289
|
+
}
|
|
290
|
+
|
|
268
291
|
/**
|
|
269
292
|
* Information about a conditional guard (SCOPE node)
|
|
270
293
|
*/
|
|
@@ -276,3 +299,32 @@ export interface GuardInfo {
|
|
|
276
299
|
file: string;
|
|
277
300
|
line: number;
|
|
278
301
|
}
|
|
302
|
+
|
|
303
|
+
// === PROJECT STRUCTURE (REG-173) ===
|
|
304
|
+
|
|
305
|
+
export interface ReadProjectStructureArgs {
|
|
306
|
+
path?: string;
|
|
307
|
+
depth?: number;
|
|
308
|
+
include_files?: boolean;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// === WRITE CONFIG (REG-173) ===
|
|
312
|
+
|
|
313
|
+
export interface WriteConfigArgs {
|
|
314
|
+
services?: Array<{
|
|
315
|
+
name: string;
|
|
316
|
+
path: string;
|
|
317
|
+
entryPoint?: string;
|
|
318
|
+
}>;
|
|
319
|
+
plugins?: {
|
|
320
|
+
indexing?: string[];
|
|
321
|
+
analysis?: string[];
|
|
322
|
+
enrichment?: string[];
|
|
323
|
+
validation?: string[];
|
|
324
|
+
};
|
|
325
|
+
include?: string[];
|
|
326
|
+
exclude?: string[];
|
|
327
|
+
workspace?: {
|
|
328
|
+
roots?: string[];
|
|
329
|
+
};
|
|
330
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { appendFileSync, existsSync, mkdirSync, readdirSync, unlinkSync, statSync } from 'fs';
|
|
6
|
-
import { join
|
|
6
|
+
import { join } from 'path';
|
|
7
7
|
import type { PaginationParams, ToolResult } from './types.js';
|
|
8
8
|
|
|
9
9
|
// === CONSTANTS ===
|
|
@@ -83,7 +83,7 @@ export function normalizeLimit(limit: number | undefined | null): number {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export function formatPaginationInfo(params: PaginationParams): string {
|
|
86
|
-
const { limit, offset, returned, total, hasMore } = params;
|
|
86
|
+
const { limit: _limit, offset, returned, total, hasMore } = params;
|
|
87
87
|
let info = `\nš Pagination: showing ${returned}`;
|
|
88
88
|
if (total !== undefined) {
|
|
89
89
|
info += ` of ${total}`;
|