lens-engine 0.1.18 → 0.1.19
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/cli.js +1 -1
- package/daemon.js +45 -77
- package/dashboard/assets/{index-Dpgp0uUn.js → index-FwosDwb9.js} +13 -13
- package/dashboard/index.html +1 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -4639,7 +4639,7 @@ async function logoutCommand() {
|
|
|
4639
4639
|
}
|
|
4640
4640
|
|
|
4641
4641
|
// packages/cli/src/index.ts
|
|
4642
|
-
var program2 = new Command().name("lens").description("LENS \u2014 Local-first repo context engine").version("0.1.
|
|
4642
|
+
var program2 = new Command().name("lens").description("LENS \u2014 Local-first repo context engine").version("0.1.19");
|
|
4643
4643
|
function trackCommand(name) {
|
|
4644
4644
|
if (!isTelemetryEnabled()) return;
|
|
4645
4645
|
const BASE_URL2 = process.env.LENS_HOST ?? "http://127.0.0.1:4111";
|
package/daemon.js
CHANGED
|
@@ -8301,6 +8301,15 @@ function extractSections(content) {
|
|
|
8301
8301
|
}
|
|
8302
8302
|
return sections.slice(0, 15);
|
|
8303
8303
|
}
|
|
8304
|
+
function universalSkipLine(line) {
|
|
8305
|
+
const trimmed = line.trimStart();
|
|
8306
|
+
if (trimmed.startsWith("//") || trimmed.startsWith("/*") || trimmed.startsWith("*")) return true;
|
|
8307
|
+
if (trimmed.startsWith("#") && !trimmed.startsWith("#!")) return true;
|
|
8308
|
+
return EXPORT_LINE_RE.test(trimmed);
|
|
8309
|
+
}
|
|
8310
|
+
function universalSkipName(name) {
|
|
8311
|
+
return SKIP_NAMES.has(name) || name.startsWith("_");
|
|
8312
|
+
}
|
|
8304
8313
|
function collectMatches(content, regexes, exportSet, skipLine, skipName) {
|
|
8305
8314
|
const seen = /* @__PURE__ */ new Set();
|
|
8306
8315
|
const results = [];
|
|
@@ -8319,51 +8328,8 @@ function collectMatches(content, regexes, exportSet, skipLine, skipName) {
|
|
|
8319
8328
|
}
|
|
8320
8329
|
return results.slice(0, 20);
|
|
8321
8330
|
}
|
|
8322
|
-
function extractInternals(content,
|
|
8323
|
-
|
|
8324
|
-
switch (language) {
|
|
8325
|
-
case "typescript":
|
|
8326
|
-
case "javascript":
|
|
8327
|
-
case "tsx":
|
|
8328
|
-
case "jsx":
|
|
8329
|
-
return collectMatches(
|
|
8330
|
-
content,
|
|
8331
|
-
[TS_INTERNAL_FN_RE, TS_INTERNAL_CONST_RE],
|
|
8332
|
-
exportSet,
|
|
8333
|
-
(line) => line.trimStart().startsWith("export")
|
|
8334
|
-
);
|
|
8335
|
-
case "go":
|
|
8336
|
-
return collectMatches(content, GO_INTERNAL_RES, exportSet);
|
|
8337
|
-
case "python":
|
|
8338
|
-
return collectMatches(
|
|
8339
|
-
content,
|
|
8340
|
-
PY_INTERNAL_RES,
|
|
8341
|
-
exportSet,
|
|
8342
|
-
void 0,
|
|
8343
|
-
(name) => name.startsWith("_")
|
|
8344
|
-
);
|
|
8345
|
-
case "rust":
|
|
8346
|
-
return collectMatches(
|
|
8347
|
-
content,
|
|
8348
|
-
RUST_INTERNAL_RES,
|
|
8349
|
-
exportSet,
|
|
8350
|
-
(line) => /^\s*pub\s/.test(line)
|
|
8351
|
-
);
|
|
8352
|
-
case "csharp":
|
|
8353
|
-
return collectMatches(
|
|
8354
|
-
content,
|
|
8355
|
-
CSHARP_INTERNAL_RES,
|
|
8356
|
-
exportSet,
|
|
8357
|
-
(line) => /^\s*public\s/.test(line),
|
|
8358
|
-
(name) => /^(?:if|for|foreach|while|switch|using|catch|lock|return|throw|yield|try|do|else|new|await|base|this)$/.test(name)
|
|
8359
|
-
);
|
|
8360
|
-
case "java":
|
|
8361
|
-
return collectMatches(content, JAVA_INTERNAL_RES, exportSet);
|
|
8362
|
-
case "kotlin":
|
|
8363
|
-
return collectMatches(content, KOTLIN_INTERNAL_RES, exportSet);
|
|
8364
|
-
default:
|
|
8365
|
-
return [];
|
|
8366
|
-
}
|
|
8331
|
+
function extractInternals(content, _language, exports) {
|
|
8332
|
+
return collectMatches(content, UNIVERSAL_DECL_RES, new Set(exports), universalSkipLine, universalSkipName);
|
|
8367
8333
|
}
|
|
8368
8334
|
function extractFileMetadata(path, content, language) {
|
|
8369
8335
|
const exports = extractExports(content, language);
|
|
@@ -9617,7 +9583,7 @@ Context generation failed.`,
|
|
|
9617
9583
|
};
|
|
9618
9584
|
}
|
|
9619
9585
|
}
|
|
9620
|
-
var __defProp2, __getOwnPropNames2, __esm2, __export2, schema_exports, uuid, now, updatedAt, repos, chunks, fileMetadata, fileImports, fileStats, fileCochanges, usageCounters, requestLogs, settings, telemetryEvents, init_schema, queries_exports, repoQueries, chunkQueries, metadataQueries, importQueries, statsQueries, cochangeQueries, logQueries, usageQueries, telemetryQueries, settingsQueries, init_queries, _db, _raw, execFileAsync, MAX_FILE_SIZE, BINARY_EXTENSIONS, DOCS_EXTENSIONS, LANG_MAP, DEFAULT_CHUNKING_PARAMS, TS_IMPORT_RE, PY_IMPORT_RE, GO_IMPORT_RE, RUST_USE_RE, TS_EXTENSIONS, PY_EXTENSIONS, TS_EXPORT_RE, PY_EXPORT_RE, GO_EXPORT_RE, RUST_EXPORT_RE, CSHARP_EXPORT_RE, CSHARP_EXPORT_METHOD_RE, JAVA_EXPORT_RE, JSDOC_RE, PY_DOCSTRING_RE, CSHARP_DOC_RE, GO_PKG_RE, RUST_DOC_RE, SECTION_SINGLE_RE, SECTION_BLOCK_RE,
|
|
9586
|
+
var __defProp2, __getOwnPropNames2, __esm2, __export2, schema_exports, uuid, now, updatedAt, repos, chunks, fileMetadata, fileImports, fileStats, fileCochanges, usageCounters, requestLogs, settings, telemetryEvents, init_schema, queries_exports, repoQueries, chunkQueries, metadataQueries, importQueries, statsQueries, cochangeQueries, logQueries, usageQueries, telemetryQueries, settingsQueries, init_queries, _db, _raw, execFileAsync, MAX_FILE_SIZE, BINARY_EXTENSIONS, DOCS_EXTENSIONS, LANG_MAP, DEFAULT_CHUNKING_PARAMS, TS_IMPORT_RE, PY_IMPORT_RE, GO_IMPORT_RE, RUST_USE_RE, TS_EXTENSIONS, PY_EXTENSIONS, TS_EXPORT_RE, PY_EXPORT_RE, GO_EXPORT_RE, RUST_EXPORT_RE, CSHARP_EXPORT_RE, CSHARP_EXPORT_METHOD_RE, JAVA_EXPORT_RE, JSDOC_RE, PY_DOCSTRING_RE, CSHARP_DOC_RE, GO_PKG_RE, RUST_DOC_RE, SECTION_SINGLE_RE, SECTION_BLOCK_RE, UNIVERSAL_DECL_RES, EXPORT_LINE_RE, SKIP_NAMES, execFileAsync2, MAX_COMMITS, MAX_FILES_PER_COMMIT, RECENT_DAYS, _enabled, MAX_CHUNKS_PER_REPO, locks, MAX_API_CALLS, POOL_SIZE, MAX_BATCH_TOKENS, CHARS_PER_TOKEN, PURPOSE_BATCH_LIMIT, PURPOSE_CONCURRENCY, TERM_BATCH_SIZE, SIMILARITY_THRESHOLD, MAX_TERMS, MAX_CLUSTERS, MAX_CLUSTER_SIZE, STOPWORDS, watchers, debounceTimers, IGNORED, DEBOUNCE_MS, STOPWORDS2, NOISE_EXTENSIONS, NOISE_PATHS, CONCEPT_SYNONYMS, CACHE_TTL, CACHE_MAX, cache, RequestTrace;
|
|
9621
9587
|
var init_dist = __esm({
|
|
9622
9588
|
"packages/engine/dist/index.js"() {
|
|
9623
9589
|
"use strict";
|
|
@@ -10457,38 +10423,40 @@ var init_dist = __esm({
|
|
|
10457
10423
|
RUST_DOC_RE = /^(?:\s*\/\/!\s*(.*)(?:\n\s*\/\/!\s*(.*))*)/m;
|
|
10458
10424
|
SECTION_SINGLE_RE = /^(?:\/\/|#)\s*[-=]{3,}\s*(.+?)\s*[-=]{3,}\s*$/gm;
|
|
10459
10425
|
SECTION_BLOCK_RE = /^\/\*\s*[-=]{3,}\s*(.+?)\s*[-=]{3,}\s*\*\/$/gm;
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
];
|
|
10467
|
-
PY_INTERNAL_RES = [/^def\s+(\w+)/gm, /^class\s+(\w+)/gm];
|
|
10468
|
-
RUST_INTERNAL_RES = [
|
|
10469
|
-
/^(?:async\s+)?fn\s+(\w+)/gm,
|
|
10470
|
-
/^struct\s+(\w+)/gm,
|
|
10471
|
-
/^enum\s+(\w+)/gm,
|
|
10472
|
-
/^trait\s+(\w+)/gm,
|
|
10473
|
-
/^type\s+(\w+)/gm,
|
|
10474
|
-
/^const\s+(\w+)/gm
|
|
10475
|
-
];
|
|
10476
|
-
CSHARP_INTERNAL_RES = [
|
|
10477
|
-
// Types with explicit access modifier
|
|
10478
|
-
/^\s*(?:private|protected|internal)\s+(?:static\s+)?(?:abstract\s+|sealed\s+|partial\s+)?(?:class|interface|enum|struct|record)\s+(\w+)/gm,
|
|
10479
|
-
// Methods with explicit access modifier
|
|
10480
|
-
/^\s*(?:private|protected|internal)\s+(?:static\s+)?(?:async\s+)?[\w<>\[\]?.]+\s+(\w+)\s*\(/gm,
|
|
10481
|
-
// Methods with no access modifier (implicitly private in C#): returnType Name(
|
|
10482
|
-
/^\s+(?:static\s+)?(?:async\s+)?(?:override\s+)?(?:virtual\s+)?[\w<>\[\]?.]+\s+(\w+)\s*\(/gm
|
|
10483
|
-
];
|
|
10484
|
-
JAVA_INTERNAL_RES = [
|
|
10485
|
-
/^\s*(?:private|protected)\s+(?:static\s+)?(?:final\s+|abstract\s+)?(?:class|interface|enum|record)\s+(\w+)/gm,
|
|
10486
|
-
/^\s*(?:private|protected)\s+(?:static\s+)?(?:final\s+|abstract\s+)?[\w<>\[\].]+\s+(\w+)\s*\(/gm
|
|
10487
|
-
];
|
|
10488
|
-
KOTLIN_INTERNAL_RES = [
|
|
10489
|
-
/^\s*private\s+(?:suspend\s+)?fun\s+(\w+)/gm,
|
|
10490
|
-
/^\s*private\s+(?:data\s+)?(?:class|interface|object|enum)\s+(\w+)/gm
|
|
10426
|
+
UNIVERSAL_DECL_RES = [
|
|
10427
|
+
/^\s*(?:async\s+|suspend\s+)?(?:function|def|fn|func|fun)\s+(?:\([^)]+\)\s+)?(\w+)/gm,
|
|
10428
|
+
/^\s*(?:const|let|var|val)\s+(\w+)\s*[=:]/gm,
|
|
10429
|
+
/^\s*(?:abstract\s+|sealed\s+|partial\s+|data\s+)?(?:class|struct|enum|trait|interface|record|object|mod)\s+(\w+)/gm,
|
|
10430
|
+
/^\s*type\s+(\w+)\s*[=<{]/gm,
|
|
10431
|
+
/^\s*(?:private|protected|internal)\s+(?:static\s+)?(?:async\s+)?(?:suspend\s+)?(?:override\s+)?[\w<>\[\]?.]+\s+(\w+)\s*\(/gm
|
|
10491
10432
|
];
|
|
10433
|
+
EXPORT_LINE_RE = /^(?:export|pub\s|public\s)/;
|
|
10434
|
+
SKIP_NAMES = /* @__PURE__ */ new Set([
|
|
10435
|
+
"if",
|
|
10436
|
+
"for",
|
|
10437
|
+
"foreach",
|
|
10438
|
+
"while",
|
|
10439
|
+
"switch",
|
|
10440
|
+
"using",
|
|
10441
|
+
"catch",
|
|
10442
|
+
"lock",
|
|
10443
|
+
"return",
|
|
10444
|
+
"throw",
|
|
10445
|
+
"yield",
|
|
10446
|
+
"try",
|
|
10447
|
+
"do",
|
|
10448
|
+
"else",
|
|
10449
|
+
"new",
|
|
10450
|
+
"await",
|
|
10451
|
+
"base",
|
|
10452
|
+
"this",
|
|
10453
|
+
"super",
|
|
10454
|
+
"self",
|
|
10455
|
+
"import",
|
|
10456
|
+
"require",
|
|
10457
|
+
"from",
|
|
10458
|
+
"package"
|
|
10459
|
+
]);
|
|
10492
10460
|
init_queries();
|
|
10493
10461
|
init_queries();
|
|
10494
10462
|
execFileAsync2 = promisify2(execFile2);
|