@liendev/lien 0.29.1 → 0.30.0
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.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8524,7 +8524,8 @@ var ListFunctionsSchema = external_exports.object({
|
|
|
8524
8524
|
),
|
|
8525
8525
|
language: external_exports.string().optional().describe(
|
|
8526
8526
|
"Filter by programming language.\n\nExamples: 'typescript', 'python', 'javascript', 'php'\n\nIf omitted, searches all languages."
|
|
8527
|
-
)
|
|
8527
|
+
),
|
|
8528
|
+
symbolType: external_exports.enum(["function", "method", "class", "interface"]).optional().describe("Filter by symbol type. If omitted, returns all types.")
|
|
8528
8529
|
});
|
|
8529
8530
|
|
|
8530
8531
|
// src/mcp/schemas/dependents.schema.ts
|
|
@@ -8647,6 +8648,10 @@ Batch calls are more efficient than multiple single-file calls.`
|
|
|
8647
8648
|
Examples:
|
|
8648
8649
|
- "Show all controllers" \u2192 list_functions({ pattern: ".*Controller.*" })
|
|
8649
8650
|
- "Find service classes" \u2192 list_functions({ pattern: ".*Service$" })
|
|
8651
|
+
- "List all class methods" \u2192 list_functions({ symbolType: "method" })
|
|
8652
|
+
- "Find standalone functions" \u2192 list_functions({ symbolType: "function" })
|
|
8653
|
+
|
|
8654
|
+
Filter by symbol type (function, method, class, interface) to narrow results.
|
|
8650
8655
|
|
|
8651
8656
|
10x faster than semantic_search for structural/architectural queries. Use semantic_search instead when searching by what code DOES.`
|
|
8652
8657
|
),
|
|
@@ -9240,6 +9245,7 @@ async function handleGetFilesContext(args, ctx) {
|
|
|
9240
9245
|
}
|
|
9241
9246
|
|
|
9242
9247
|
// src/mcp/handlers/list-functions.ts
|
|
9248
|
+
import { SYMBOL_TYPE_MATCHES } from "@liendev/core";
|
|
9243
9249
|
async function performContentScan(vectorDB, args, log) {
|
|
9244
9250
|
log("Falling back to content scan...");
|
|
9245
9251
|
let results = await vectorDB.scanWithFilter({
|
|
@@ -9254,6 +9260,13 @@ async function performContentScan(vectorDB, args, log) {
|
|
|
9254
9260
|
return symbolName && regex.test(symbolName);
|
|
9255
9261
|
});
|
|
9256
9262
|
}
|
|
9263
|
+
if (args.symbolType) {
|
|
9264
|
+
const allowedTypes = SYMBOL_TYPE_MATCHES[args.symbolType];
|
|
9265
|
+
results = results.filter((r) => {
|
|
9266
|
+
const recordType2 = r.metadata?.symbolType;
|
|
9267
|
+
return recordType2 && allowedTypes?.has(recordType2);
|
|
9268
|
+
});
|
|
9269
|
+
}
|
|
9257
9270
|
return {
|
|
9258
9271
|
results: results.slice(0, 50),
|
|
9259
9272
|
method: "content"
|
|
@@ -9271,9 +9284,10 @@ async function handleListFunctions(args, ctx) {
|
|
|
9271
9284
|
const results = await vectorDB.querySymbols({
|
|
9272
9285
|
language: validatedArgs.language,
|
|
9273
9286
|
pattern: validatedArgs.pattern,
|
|
9287
|
+
symbolType: validatedArgs.symbolType,
|
|
9274
9288
|
limit: 50
|
|
9275
9289
|
});
|
|
9276
|
-
if (results.length === 0 && (validatedArgs.language || validatedArgs.pattern)) {
|
|
9290
|
+
if (results.length === 0 && (validatedArgs.language || validatedArgs.pattern || validatedArgs.symbolType)) {
|
|
9277
9291
|
log("No symbol results, falling back to content scan...");
|
|
9278
9292
|
queryResult = await performContentScan(vectorDB, validatedArgs, log);
|
|
9279
9293
|
} else {
|