sdl-mcp 0.9.2 → 0.9.3

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.
@@ -96,14 +96,14 @@ class CAdapter {
96
96
  for (const symbol of extractedSymbols) {
97
97
  symbolMap.set(symbol.name, symbol);
98
98
  }
99
- const callQuery = createQuery("c", `
100
- (call_expression
101
- function: (identifier) @callee)
102
-
103
- (call_expression
104
- function: (field_expression
105
- argument: (_) @obj
106
- field: (field_identifier) @field))
99
+ const callQuery = createQuery("c", `
100
+ (call_expression
101
+ function: (identifier) @callee)
102
+
103
+ (call_expression
104
+ function: (field_expression
105
+ argument: (_) @obj
106
+ field: (field_identifier) @field))
107
107
  `);
108
108
  if (!callQuery) {
109
109
  return [];
@@ -494,30 +494,30 @@ function extractCalls(tree, extractedSymbols) {
494
494
  for (const symbol of extractedSymbols) {
495
495
  symbolMap.set(symbol.name, symbol);
496
496
  }
497
- const callQuery = createQuery("kotlin", `
498
- (call_expression
499
- (simple_identifier) @callee)
500
-
501
- (call_expression
502
- (navigation_expression
503
- (simple_identifier) @recv
504
- (navigation_suffix
505
- (simple_identifier) @attr)))
506
-
507
- (call_expression
508
- (navigation_expression
509
- (this_expression) @recv
510
- (navigation_suffix
511
- (simple_identifier) @attr)))
512
-
513
- (call_expression
514
- (navigation_expression
515
- (navigation_expression
516
- (simple_identifier) @recv
517
- (navigation_suffix
518
- (simple_identifier) @attr1))
519
- (navigation_suffix
520
- (simple_identifier) @attr2)))
497
+ const callQuery = createQuery("kotlin", `
498
+ (call_expression
499
+ (simple_identifier) @callee)
500
+
501
+ (call_expression
502
+ (navigation_expression
503
+ (simple_identifier) @recv
504
+ (navigation_suffix
505
+ (simple_identifier) @attr)))
506
+
507
+ (call_expression
508
+ (navigation_expression
509
+ (this_expression) @recv
510
+ (navigation_suffix
511
+ (simple_identifier) @attr)))
512
+
513
+ (call_expression
514
+ (navigation_expression
515
+ (navigation_expression
516
+ (simple_identifier) @recv
517
+ (navigation_suffix
518
+ (simple_identifier) @attr1))
519
+ (navigation_suffix
520
+ (simple_identifier) @attr2)))
521
521
  `);
522
522
  if (!callQuery) {
523
523
  return [];
@@ -452,26 +452,26 @@ function extractRange(node) {
452
452
  }
453
453
  function extractImports(tree) {
454
454
  const imports = [];
455
- const importQuery = createQuery("php", `
456
- (namespace_use_declaration
457
- (namespace_use_clause
458
- (qualified_name) @import_name))
459
-
460
- (namespace_use_declaration
461
- (namespace_use_clause
462
- (name) @import_name))
463
-
464
- (include_expression
465
- (string) @include_path)
466
-
467
- (include_once_expression
468
- (string) @include_path)
469
-
470
- (require_expression
471
- (string) @include_path)
472
-
473
- (require_once_expression
474
- (string) @include_path)
455
+ const importQuery = createQuery("php", `
456
+ (namespace_use_declaration
457
+ (namespace_use_clause
458
+ (qualified_name) @import_name))
459
+
460
+ (namespace_use_declaration
461
+ (namespace_use_clause
462
+ (name) @import_name))
463
+
464
+ (include_expression
465
+ (string) @include_path)
466
+
467
+ (include_once_expression
468
+ (string) @include_path)
469
+
470
+ (require_expression
471
+ (string) @include_path)
472
+
473
+ (require_once_expression
474
+ (string) @include_path)
475
475
  `);
476
476
  if (!importQuery) {
477
477
  return [];
@@ -548,27 +548,27 @@ function extractCalls(tree, extractedSymbols) {
548
548
  for (const symbol of extractedSymbols) {
549
549
  symbolMap.set(symbol.name, symbol);
550
550
  }
551
- const callQuery = createQuery("php", `(function_call_expression
552
- (name) @callee)
553
-
554
- (function_call_expression
555
- (variable_name) @var_callee)
556
-
557
- (member_call_expression
558
- object: (variable_name) @recv
559
- name: (name) @attr)
560
-
561
- (member_call_expression
562
- object: (variable_name) @recv
563
- name: (variable_name) @var_attr)
564
-
565
- (scoped_call_expression
566
- (name) @scope
567
- (name) @static_callee)
568
-
569
- (scoped_call_expression
570
- (qualified_name) @qualified_scope
571
- (name) @static_callee)
551
+ const callQuery = createQuery("php", `(function_call_expression
552
+ (name) @callee)
553
+
554
+ (function_call_expression
555
+ (variable_name) @var_callee)
556
+
557
+ (member_call_expression
558
+ object: (variable_name) @recv
559
+ name: (name) @attr)
560
+
561
+ (member_call_expression
562
+ object: (variable_name) @recv
563
+ name: (variable_name) @var_attr)
564
+
565
+ (scoped_call_expression
566
+ (name) @scope
567
+ (name) @static_callee)
568
+
569
+ (scoped_call_expression
570
+ (qualified_name) @qualified_scope
571
+ (name) @static_callee)
572
572
  `);
573
573
  if (!callQuery) {
574
574
  return [];
@@ -256,23 +256,23 @@ function extractRange(node) {
256
256
  }
257
257
  function extractImports(tree) {
258
258
  const imports = [];
259
- const importQuery = createQuery("python", `
260
- (import_statement
261
- name: (dotted_name) @import_name)
262
-
263
- (import_statement
264
- name: (aliased_import
265
- name: (dotted_name) @import_name))
266
-
267
- (import_from_statement
268
- module_name: (dotted_name) @module_name)
269
-
270
- (import_from_statement
271
- module_name: (relative_import) @relative_import)
272
-
273
- (import_from_statement
274
- module_name: (relative_import
275
- (dotted_name) @module_name))
259
+ const importQuery = createQuery("python", `
260
+ (import_statement
261
+ name: (dotted_name) @import_name)
262
+
263
+ (import_statement
264
+ name: (aliased_import
265
+ name: (dotted_name) @import_name))
266
+
267
+ (import_from_statement
268
+ module_name: (dotted_name) @module_name)
269
+
270
+ (import_from_statement
271
+ module_name: (relative_import) @relative_import)
272
+
273
+ (import_from_statement
274
+ module_name: (relative_import
275
+ (dotted_name) @module_name))
276
276
  `);
277
277
  if (!importQuery) {
278
278
  return [];
@@ -375,13 +375,13 @@ function extractCalls(tree, extractedSymbols) {
375
375
  for (const symbol of extractedSymbols) {
376
376
  symbolMap.set(symbol.name, symbol);
377
377
  }
378
- const callQuery = createQuery("python", `(call
379
- function: (identifier) @callee)
380
-
381
- (call
382
- function: (attribute
383
- object: (_) @recv
384
- attribute: (identifier) @attr))
378
+ const callQuery = createQuery("python", `(call
379
+ function: (identifier) @callee)
380
+
381
+ (call
382
+ function: (attribute
383
+ object: (_) @recv
384
+ attribute: (identifier) @attr))
385
385
  `);
386
386
  if (!callQuery) {
387
387
  return [];
@@ -449,16 +449,16 @@ function extractCalls(tree, extractedSymbols) {
449
449
  return calls;
450
450
  }
451
451
  function extractDecoratorCalls(tree, _extractedSymbols, symbolMap, calls, seenCallNodes) {
452
- const decoratorQuery = createQuery("python", `
453
- (decorator
454
- (call
455
- function: (identifier) @callee))
456
-
457
- (decorator
458
- (call
459
- function: (attribute
460
- object: (_) @recv
461
- attribute: (identifier) @attr)))
452
+ const decoratorQuery = createQuery("python", `
453
+ (decorator
454
+ (call
455
+ function: (identifier) @callee))
456
+
457
+ (decorator
458
+ (call
459
+ function: (attribute
460
+ object: (_) @recv
461
+ attribute: (identifier) @attr)))
462
462
  `);
463
463
  if (!decoratorQuery)
464
464
  return;
@@ -557,24 +557,24 @@ function extractCalls(tree, extractedSymbols) {
557
557
  symbolMap.set(symbol.name, symbol);
558
558
  symbolMap.set(symbol.nodeId, symbol);
559
559
  }
560
- const callQuery = createQuery("rust", `
561
-
562
- (call_expression
563
- function: (identifier) @callee) @call
564
-
565
- (call_expression
566
- function: (scoped_identifier
567
- path: (identifier) @type
568
- name: (identifier) @name)) @call
569
-
570
- (call_expression
571
- function: (field_expression
572
- value: (_) @recv
573
- field: (field_identifier) @field)) @call
574
-
575
- (macro_invocation
576
- macro: (identifier) @macro) @macro_call
577
-
560
+ const callQuery = createQuery("rust", `
561
+
562
+ (call_expression
563
+ function: (identifier) @callee) @call
564
+
565
+ (call_expression
566
+ function: (scoped_identifier
567
+ path: (identifier) @type
568
+ name: (identifier) @name)) @call
569
+
570
+ (call_expression
571
+ function: (field_expression
572
+ value: (_) @recv
573
+ field: (field_identifier) @field)) @call
574
+
575
+ (macro_invocation
576
+ macro: (identifier) @macro) @macro_call
577
+
578
578
  `);
579
579
  if (!callQuery) {
580
580
  return [];
@@ -86,93 +86,93 @@ export function extractCalls(tree, extractedSymbols) {
86
86
  }
87
87
  }
88
88
  // --- Standard call queries ---
89
- const functionQuery = `
90
- (call_expression
91
- function: (identifier) @callee
92
- arguments: (_) @args
93
- ) @call
89
+ const functionQuery = `
90
+ (call_expression
91
+ function: (identifier) @callee
92
+ arguments: (_) @args
93
+ ) @call
94
94
  `;
95
- const memberCallQuery = `
96
- (call_expression
97
- function: (member_expression
98
- object: (_) @obj
99
- property: (property_identifier) @prop
100
- )
101
- arguments: (_) @args
102
- ) @call
95
+ const memberCallQuery = `
96
+ (call_expression
97
+ function: (member_expression
98
+ object: (_) @obj
99
+ property: (property_identifier) @prop
100
+ )
101
+ arguments: (_) @args
102
+ ) @call
103
103
  `;
104
- const newExpressionQuery = `
105
- (new_expression
106
- constructor: (identifier) @callee
107
- arguments: (_) @args
108
- ) @call
104
+ const newExpressionQuery = `
105
+ (new_expression
106
+ constructor: (identifier) @callee
107
+ arguments: (_) @args
108
+ ) @call
109
109
  `;
110
- const newMemberExpressionQuery = `
111
- (new_expression
112
- constructor: (member_expression
113
- object: (_) @obj
114
- property: (property_identifier) @prop
115
- )
116
- arguments: (_) @args
117
- ) @call
110
+ const newMemberExpressionQuery = `
111
+ (new_expression
112
+ constructor: (member_expression
113
+ object: (_) @obj
114
+ property: (property_identifier) @prop
115
+ )
116
+ arguments: (_) @args
117
+ ) @call
118
118
  `;
119
- const superCallQuery = `
120
- (call_expression
121
- function: (super) @callee
122
- ) @call
119
+ const superCallQuery = `
120
+ (call_expression
121
+ function: (super) @callee
122
+ ) @call
123
123
  `;
124
124
  // --- 36-1.1: Computed property call detection ---
125
125
  // Matches: obj[methodName]() or obj["method"]()
126
- const computedCallQuery = `
127
- (call_expression
128
- function: (subscript_expression
129
- object: (_) @obj
130
- index: (_) @index
131
- )
132
- arguments: (_) @args
133
- ) @call
126
+ const computedCallQuery = `
127
+ (call_expression
128
+ function: (subscript_expression
129
+ object: (_) @obj
130
+ index: (_) @index
131
+ )
132
+ arguments: (_) @args
133
+ ) @call
134
134
  `;
135
135
  // --- 36-1.4: Tagged template string detection ---
136
136
  // Matches: tag`template` or obj.method`template`
137
- const taggedTemplateQuery = `
138
- (call_expression
139
- function: (identifier) @callee
140
- arguments: (template_string)
141
- ) @call
137
+ const taggedTemplateQuery = `
138
+ (call_expression
139
+ function: (identifier) @callee
140
+ arguments: (template_string)
141
+ ) @call
142
142
  `;
143
- const taggedTemplateMemberQuery = `
144
- (call_expression
145
- function: (member_expression
146
- object: (_) @obj
147
- property: (property_identifier) @prop
148
- )
149
- arguments: (template_string)
150
- ) @call
143
+ const taggedTemplateMemberQuery = `
144
+ (call_expression
145
+ function: (member_expression
146
+ object: (_) @obj
147
+ property: (property_identifier) @prop
148
+ )
149
+ arguments: (template_string)
150
+ ) @call
151
151
  `;
152
152
  // Note: tagged_template_expression doesn't exist in tree-sitter-typescript 0.23.x
153
153
  // Tagged templates are parsed as call_expression with template_string arguments
154
154
  // The taggedTemplateQuery and taggedTemplateMemberQuery above already handle these cases
155
155
  // --- 36-1.7: Optional chaining call detection ---
156
156
  // Note: In tree-sitter-typescript 0.23.x, optional_chain is a sibling of object/property
157
- const optionalChainedCallQuery = `
158
- (call_expression
159
- function: (member_expression
160
- object: (_) @obj
161
- (optional_chain)
162
- property: (property_identifier) @prop
163
- )
164
- arguments: (_) @args
165
- ) @call
157
+ const optionalChainedCallQuery = `
158
+ (call_expression
159
+ function: (member_expression
160
+ object: (_) @obj
161
+ (optional_chain)
162
+ property: (property_identifier) @prop
163
+ )
164
+ arguments: (_) @args
165
+ ) @call
166
166
  `;
167
- const optionalChainedNewQuery = `
168
- (new_expression
169
- constructor: (member_expression
170
- object: (_) @obj
171
- (optional_chain)
172
- property: (property_identifier) @prop
173
- )
174
- arguments: (_) @args
175
- ) @call
167
+ const optionalChainedNewQuery = `
168
+ (new_expression
169
+ constructor: (member_expression
170
+ object: (_) @obj
171
+ (optional_chain)
172
+ property: (property_identifier) @prop
173
+ )
174
+ arguments: (_) @args
175
+ ) @call
176
176
  `;
177
177
  // Collect all matches
178
178
  const standardMatches = [
@@ -8,12 +8,12 @@ const BUILTIN_MODULES = new Set([...builtinModules, "test"].flatMap((moduleName)
8
8
  }));
9
9
  export function extractImports(tree) {
10
10
  const imports = [];
11
- const importQuery = createQuery("typescript", `
12
- (import_statement
13
- source: (string (string_fragment) @specifier))
14
-
15
- (export_statement
16
- source: (string (string_fragment) @specifier))
11
+ const importQuery = createQuery("typescript", `
12
+ (import_statement
13
+ source: (string (string_fragment) @specifier))
14
+
15
+ (export_statement
16
+ source: (string (string_fragment) @specifier))
17
17
  `);
18
18
  if (!importQuery) {
19
19
  return [];
package/dist/server.js CHANGED
@@ -99,7 +99,7 @@ export class MCPServer {
99
99
  })),
100
100
  },
101
101
  };
102
- process.stderr.write(`[sdl-mcp] Tool ${request.params.name} validation error: ${JSON.stringify(validationError)}
102
+ process.stderr.write(`[sdl-mcp] Tool ${request.params.name} validation error: ${JSON.stringify(validationError)}
103
103
  `);
104
104
  logToolCall({
105
105
  tool: request.params.name,
@@ -197,7 +197,7 @@ export class MCPServer {
197
197
  await hook(request.params.name, parseResult.data, finalResult, toolContext);
198
198
  }
199
199
  catch (err) {
200
- process.stderr.write(`[sdl-mcp] Post-dispatch hook failed for tool ${request.params.name}: ${err instanceof Error ? err.message : String(err)}
200
+ process.stderr.write(`[sdl-mcp] Post-dispatch hook failed for tool ${request.params.name}: ${err instanceof Error ? err.message : String(err)}
201
201
  `);
202
202
  }
203
203
  }