raggrep 0.10.4 → 0.10.5

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/cli/main.js CHANGED
@@ -327,6 +327,511 @@ function createSilentLogger() {
327
327
 
328
328
  // src/infrastructure/logger/index.ts
329
329
  var init_logger = () => {};
330
+
331
+ // node_modules/fdir/dist/index.mjs
332
+ import { createRequire as createRequire2 } from "module";
333
+ import { basename, dirname, normalize, relative, resolve, sep } from "path";
334
+ import * as nativeFs from "fs";
335
+ function cleanPath(path2) {
336
+ let normalized = normalize(path2);
337
+ if (normalized.length > 1 && normalized[normalized.length - 1] === sep)
338
+ normalized = normalized.substring(0, normalized.length - 1);
339
+ return normalized;
340
+ }
341
+ function convertSlashes(path2, separator) {
342
+ return path2.replace(SLASHES_REGEX, separator);
343
+ }
344
+ function isRootDirectory(path2) {
345
+ return path2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path2);
346
+ }
347
+ function normalizePath(path2, options) {
348
+ const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
349
+ const pathNeedsCleaning = process.platform === "win32" && path2.includes("/") || path2.startsWith(".");
350
+ if (resolvePaths)
351
+ path2 = resolve(path2);
352
+ if (normalizePath$1 || pathNeedsCleaning)
353
+ path2 = cleanPath(path2);
354
+ if (path2 === ".")
355
+ return "";
356
+ const needsSeperator = path2[path2.length - 1] !== pathSeparator;
357
+ return convertSlashes(needsSeperator ? path2 + pathSeparator : path2, pathSeparator);
358
+ }
359
+ function joinPathWithBasePath(filename, directoryPath) {
360
+ return directoryPath + filename;
361
+ }
362
+ function joinPathWithRelativePath(root, options) {
363
+ return function(filename, directoryPath) {
364
+ const sameRoot = directoryPath.startsWith(root);
365
+ if (sameRoot)
366
+ return directoryPath.slice(root.length) + filename;
367
+ else
368
+ return convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
369
+ };
370
+ }
371
+ function joinPath(filename) {
372
+ return filename;
373
+ }
374
+ function joinDirectoryPath(filename, directoryPath, separator) {
375
+ return directoryPath + filename + separator;
376
+ }
377
+ function build$7(root, options) {
378
+ const { relativePaths, includeBasePath } = options;
379
+ return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
380
+ }
381
+ function pushDirectoryWithRelativePath(root) {
382
+ return function(directoryPath, paths) {
383
+ paths.push(directoryPath.substring(root.length) || ".");
384
+ };
385
+ }
386
+ function pushDirectoryFilterWithRelativePath(root) {
387
+ return function(directoryPath, paths, filters) {
388
+ const relativePath = directoryPath.substring(root.length) || ".";
389
+ if (filters.every((filter) => filter(relativePath, true)))
390
+ paths.push(relativePath);
391
+ };
392
+ }
393
+ function build$6(root, options) {
394
+ const { includeDirs, filters, relativePaths } = options;
395
+ if (!includeDirs)
396
+ return empty$2;
397
+ if (relativePaths)
398
+ return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
399
+ return filters && filters.length ? pushDirectoryFilter : pushDirectory;
400
+ }
401
+ function build$5(options) {
402
+ const { excludeFiles, filters, onlyCounts } = options;
403
+ if (excludeFiles)
404
+ return empty$1;
405
+ if (filters && filters.length)
406
+ return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
407
+ else if (onlyCounts)
408
+ return pushFileCount;
409
+ else
410
+ return pushFile;
411
+ }
412
+ function build$4(options) {
413
+ return options.group ? getArrayGroup : getArray;
414
+ }
415
+ function build$3(options) {
416
+ return options.group ? groupFiles : empty;
417
+ }
418
+ function build$2(options, isSynchronous) {
419
+ if (!options.resolveSymlinks || options.excludeSymlinks)
420
+ return null;
421
+ return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
422
+ }
423
+ function isRecursive(path2, resolved, state) {
424
+ if (state.options.useRealPaths)
425
+ return isRecursiveUsingRealPaths(resolved, state);
426
+ let parent = dirname(path2);
427
+ let depth = 1;
428
+ while (parent !== state.root && depth < 2) {
429
+ const resolvedPath = state.symlinks.get(parent);
430
+ const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
431
+ if (isSameRoot)
432
+ depth++;
433
+ else
434
+ parent = dirname(parent);
435
+ }
436
+ state.symlinks.set(path2, resolved);
437
+ return depth > 1;
438
+ }
439
+ function isRecursiveUsingRealPaths(resolved, state) {
440
+ return state.visited.includes(resolved + state.options.pathSeparator);
441
+ }
442
+ function report(error, callback$1, output, suppressErrors) {
443
+ if (error && !suppressErrors)
444
+ callback$1(error, output);
445
+ else
446
+ callback$1(null, output);
447
+ }
448
+ function build$1(options, isSynchronous) {
449
+ const { onlyCounts, group, maxFiles } = options;
450
+ if (onlyCounts)
451
+ return isSynchronous ? onlyCountsSync : onlyCountsAsync;
452
+ else if (group)
453
+ return isSynchronous ? groupsSync : groupsAsync;
454
+ else if (maxFiles)
455
+ return isSynchronous ? limitFilesSync : limitFilesAsync;
456
+ else
457
+ return isSynchronous ? defaultSync : defaultAsync;
458
+ }
459
+ function build(isSynchronous) {
460
+ return isSynchronous ? walkSync : walkAsync;
461
+ }
462
+ function promise(root, options) {
463
+ return new Promise((resolve$1, reject) => {
464
+ callback(root, options, (err2, output) => {
465
+ if (err2)
466
+ return reject(err2);
467
+ resolve$1(output);
468
+ });
469
+ });
470
+ }
471
+ function callback(root, options, callback$1) {
472
+ let walker = new Walker(root, options, callback$1);
473
+ walker.start();
474
+ }
475
+ function sync(root, options) {
476
+ const walker = new Walker(root, options);
477
+ return walker.start();
478
+ }
479
+ var __require2, SLASHES_REGEX, WINDOWS_ROOT_DIR_REGEX, pushDirectory = (directoryPath, paths) => {
480
+ paths.push(directoryPath || ".");
481
+ }, pushDirectoryFilter = (directoryPath, paths, filters) => {
482
+ const path2 = directoryPath || ".";
483
+ if (filters.every((filter) => filter(path2, true)))
484
+ paths.push(path2);
485
+ }, empty$2 = () => {}, pushFileFilterAndCount = (filename, _paths, counts, filters) => {
486
+ if (filters.every((filter) => filter(filename, false)))
487
+ counts.files++;
488
+ }, pushFileFilter = (filename, paths, _counts, filters) => {
489
+ if (filters.every((filter) => filter(filename, false)))
490
+ paths.push(filename);
491
+ }, pushFileCount = (_filename, _paths, counts, _filters) => {
492
+ counts.files++;
493
+ }, pushFile = (filename, paths) => {
494
+ paths.push(filename);
495
+ }, empty$1 = () => {}, getArray = (paths) => {
496
+ return paths;
497
+ }, getArrayGroup = () => {
498
+ return [""].slice(0, 0);
499
+ }, groupFiles = (groups, directory, files) => {
500
+ groups.push({
501
+ directory,
502
+ files,
503
+ dir: directory
504
+ });
505
+ }, empty = () => {}, resolveSymlinksAsync = function(path2, state, callback$1) {
506
+ const { queue, fs: fs2, options: { suppressErrors } } = state;
507
+ queue.enqueue();
508
+ fs2.realpath(path2, (error, resolvedPath) => {
509
+ if (error)
510
+ return queue.dequeue(suppressErrors ? null : error, state);
511
+ fs2.stat(resolvedPath, (error$1, stat) => {
512
+ if (error$1)
513
+ return queue.dequeue(suppressErrors ? null : error$1, state);
514
+ if (stat.isDirectory() && isRecursive(path2, resolvedPath, state))
515
+ return queue.dequeue(null, state);
516
+ callback$1(stat, resolvedPath);
517
+ queue.dequeue(null, state);
518
+ });
519
+ });
520
+ }, resolveSymlinks = function(path2, state, callback$1) {
521
+ const { queue, fs: fs2, options: { suppressErrors } } = state;
522
+ queue.enqueue();
523
+ try {
524
+ const resolvedPath = fs2.realpathSync(path2);
525
+ const stat = fs2.statSync(resolvedPath);
526
+ if (stat.isDirectory() && isRecursive(path2, resolvedPath, state))
527
+ return;
528
+ callback$1(stat, resolvedPath);
529
+ } catch (e) {
530
+ if (!suppressErrors)
531
+ throw e;
532
+ }
533
+ }, onlyCountsSync = (state) => {
534
+ return state.counts;
535
+ }, groupsSync = (state) => {
536
+ return state.groups;
537
+ }, defaultSync = (state) => {
538
+ return state.paths;
539
+ }, limitFilesSync = (state) => {
540
+ return state.paths.slice(0, state.options.maxFiles);
541
+ }, onlyCountsAsync = (state, error, callback$1) => {
542
+ report(error, callback$1, state.counts, state.options.suppressErrors);
543
+ return null;
544
+ }, defaultAsync = (state, error, callback$1) => {
545
+ report(error, callback$1, state.paths, state.options.suppressErrors);
546
+ return null;
547
+ }, limitFilesAsync = (state, error, callback$1) => {
548
+ report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
549
+ return null;
550
+ }, groupsAsync = (state, error, callback$1) => {
551
+ report(error, callback$1, state.groups, state.options.suppressErrors);
552
+ return null;
553
+ }, readdirOpts, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
554
+ state.queue.enqueue();
555
+ if (currentDepth < 0)
556
+ return state.queue.dequeue(null, state);
557
+ const { fs: fs2 } = state;
558
+ state.visited.push(crawlPath);
559
+ state.counts.directories++;
560
+ fs2.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
561
+ callback$1(entries, directoryPath, currentDepth);
562
+ state.queue.dequeue(state.options.suppressErrors ? null : error, state);
563
+ });
564
+ }, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
565
+ const { fs: fs2 } = state;
566
+ if (currentDepth < 0)
567
+ return;
568
+ state.visited.push(crawlPath);
569
+ state.counts.directories++;
570
+ let entries = [];
571
+ try {
572
+ entries = fs2.readdirSync(crawlPath || ".", readdirOpts);
573
+ } catch (e) {
574
+ if (!state.options.suppressErrors)
575
+ throw e;
576
+ }
577
+ callback$1(entries, directoryPath, currentDepth);
578
+ }, Queue = class {
579
+ count = 0;
580
+ constructor(onQueueEmpty) {
581
+ this.onQueueEmpty = onQueueEmpty;
582
+ }
583
+ enqueue() {
584
+ this.count++;
585
+ return this.count;
586
+ }
587
+ dequeue(error, output) {
588
+ if (this.onQueueEmpty && (--this.count <= 0 || error)) {
589
+ this.onQueueEmpty(error, output);
590
+ if (error) {
591
+ output.controller.abort();
592
+ this.onQueueEmpty = undefined;
593
+ }
594
+ }
595
+ }
596
+ }, Counter = class {
597
+ _files = 0;
598
+ _directories = 0;
599
+ set files(num) {
600
+ this._files = num;
601
+ }
602
+ get files() {
603
+ return this._files;
604
+ }
605
+ set directories(num) {
606
+ this._directories = num;
607
+ }
608
+ get directories() {
609
+ return this._directories;
610
+ }
611
+ get dirs() {
612
+ return this._directories;
613
+ }
614
+ }, Aborter = class {
615
+ aborted = false;
616
+ abort() {
617
+ this.aborted = true;
618
+ }
619
+ }, Walker = class {
620
+ root;
621
+ isSynchronous;
622
+ state;
623
+ joinPath;
624
+ pushDirectory;
625
+ pushFile;
626
+ getArray;
627
+ groupFiles;
628
+ resolveSymlink;
629
+ walkDirectory;
630
+ callbackInvoker;
631
+ constructor(root, options, callback$1) {
632
+ this.isSynchronous = !callback$1;
633
+ this.callbackInvoker = build$1(options, this.isSynchronous);
634
+ this.root = normalizePath(root, options);
635
+ this.state = {
636
+ root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
637
+ paths: [""].slice(0, 0),
638
+ groups: [],
639
+ counts: new Counter,
640
+ options,
641
+ queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
642
+ symlinks: /* @__PURE__ */ new Map,
643
+ visited: [""].slice(0, 0),
644
+ controller: new Aborter,
645
+ fs: options.fs || nativeFs
646
+ };
647
+ this.joinPath = build$7(this.root, options);
648
+ this.pushDirectory = build$6(this.root, options);
649
+ this.pushFile = build$5(options);
650
+ this.getArray = build$4(options);
651
+ this.groupFiles = build$3(options);
652
+ this.resolveSymlink = build$2(options, this.isSynchronous);
653
+ this.walkDirectory = build(this.isSynchronous);
654
+ }
655
+ start() {
656
+ this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
657
+ this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
658
+ return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
659
+ }
660
+ walk = (entries, directoryPath, depth) => {
661
+ const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
662
+ if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles)
663
+ return;
664
+ const files = this.getArray(this.state.paths);
665
+ for (let i2 = 0;i2 < entries.length; ++i2) {
666
+ const entry = entries[i2];
667
+ if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
668
+ const filename = this.joinPath(entry.name, directoryPath);
669
+ this.pushFile(filename, files, this.state.counts, filters);
670
+ } else if (entry.isDirectory()) {
671
+ let path2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
672
+ if (exclude && exclude(entry.name, path2))
673
+ continue;
674
+ this.pushDirectory(path2, paths, filters);
675
+ this.walkDirectory(this.state, path2, path2, depth - 1, this.walk);
676
+ } else if (this.resolveSymlink && entry.isSymbolicLink()) {
677
+ let path2 = joinPathWithBasePath(entry.name, directoryPath);
678
+ this.resolveSymlink(path2, this.state, (stat, resolvedPath) => {
679
+ if (stat.isDirectory()) {
680
+ resolvedPath = normalizePath(resolvedPath, this.state.options);
681
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path2 + pathSeparator))
682
+ return;
683
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path2 + pathSeparator, depth - 1, this.walk);
684
+ } else {
685
+ resolvedPath = useRealPaths ? resolvedPath : path2;
686
+ const filename = basename(resolvedPath);
687
+ const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
688
+ resolvedPath = this.joinPath(filename, directoryPath$1);
689
+ this.pushFile(resolvedPath, files, this.state.counts, filters);
690
+ }
691
+ });
692
+ }
693
+ }
694
+ this.groupFiles(this.state.groups, directoryPath, files);
695
+ };
696
+ }, APIBuilder = class {
697
+ constructor(root, options) {
698
+ this.root = root;
699
+ this.options = options;
700
+ }
701
+ withPromise() {
702
+ return promise(this.root, this.options);
703
+ }
704
+ withCallback(cb) {
705
+ callback(this.root, this.options, cb);
706
+ }
707
+ sync() {
708
+ return sync(this.root, this.options);
709
+ }
710
+ }, pm = null, Builder = class {
711
+ globCache = {};
712
+ options = {
713
+ maxDepth: Infinity,
714
+ suppressErrors: true,
715
+ pathSeparator: sep,
716
+ filters: []
717
+ };
718
+ globFunction;
719
+ constructor(options) {
720
+ this.options = {
721
+ ...this.options,
722
+ ...options
723
+ };
724
+ this.globFunction = this.options.globFunction;
725
+ }
726
+ group() {
727
+ this.options.group = true;
728
+ return this;
729
+ }
730
+ withPathSeparator(separator) {
731
+ this.options.pathSeparator = separator;
732
+ return this;
733
+ }
734
+ withBasePath() {
735
+ this.options.includeBasePath = true;
736
+ return this;
737
+ }
738
+ withRelativePaths() {
739
+ this.options.relativePaths = true;
740
+ return this;
741
+ }
742
+ withDirs() {
743
+ this.options.includeDirs = true;
744
+ return this;
745
+ }
746
+ withMaxDepth(depth) {
747
+ this.options.maxDepth = depth;
748
+ return this;
749
+ }
750
+ withMaxFiles(limit) {
751
+ this.options.maxFiles = limit;
752
+ return this;
753
+ }
754
+ withFullPaths() {
755
+ this.options.resolvePaths = true;
756
+ this.options.includeBasePath = true;
757
+ return this;
758
+ }
759
+ withErrors() {
760
+ this.options.suppressErrors = false;
761
+ return this;
762
+ }
763
+ withSymlinks({ resolvePaths = true } = {}) {
764
+ this.options.resolveSymlinks = true;
765
+ this.options.useRealPaths = resolvePaths;
766
+ return this.withFullPaths();
767
+ }
768
+ withAbortSignal(signal) {
769
+ this.options.signal = signal;
770
+ return this;
771
+ }
772
+ normalize() {
773
+ this.options.normalizePath = true;
774
+ return this;
775
+ }
776
+ filter(predicate) {
777
+ this.options.filters.push(predicate);
778
+ return this;
779
+ }
780
+ onlyDirs() {
781
+ this.options.excludeFiles = true;
782
+ this.options.includeDirs = true;
783
+ return this;
784
+ }
785
+ exclude(predicate) {
786
+ this.options.exclude = predicate;
787
+ return this;
788
+ }
789
+ onlyCounts() {
790
+ this.options.onlyCounts = true;
791
+ return this;
792
+ }
793
+ crawl(root) {
794
+ return new APIBuilder(root || ".", this.options);
795
+ }
796
+ withGlobFunction(fn) {
797
+ this.globFunction = fn;
798
+ return this;
799
+ }
800
+ crawlWithOptions(root, options) {
801
+ this.options = {
802
+ ...this.options,
803
+ ...options
804
+ };
805
+ return new APIBuilder(root || ".", this.options);
806
+ }
807
+ glob(...patterns) {
808
+ if (this.globFunction)
809
+ return this.globWithOptions(patterns);
810
+ return this.globWithOptions(patterns, ...[{ dot: true }]);
811
+ }
812
+ globWithOptions(patterns, ...options) {
813
+ const globFn = this.globFunction || pm;
814
+ if (!globFn)
815
+ throw new Error("Please specify a glob function to use glob matching.");
816
+ var isMatch = this.globCache[patterns.join("\x00")];
817
+ if (!isMatch) {
818
+ isMatch = globFn(patterns, ...options);
819
+ this.globCache[patterns.join("\x00")] = isMatch;
820
+ }
821
+ this.options.filters.push((path2) => isMatch(path2));
822
+ return this;
823
+ }
824
+ };
825
+ var init_dist = __esm(() => {
826
+ __require2 = /* @__PURE__ */ createRequire2(import.meta.url);
827
+ SLASHES_REGEX = /[\\/]/g;
828
+ WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
829
+ readdirOpts = { withFileTypes: true };
830
+ try {
831
+ __require2.resolve("picomatch");
832
+ pm = __require2("picomatch");
833
+ } catch {}
834
+ });
330
835
  // src/domain/entities/searchResult.ts
331
836
  var DEFAULT_SEARCH_OPTIONS;
332
837
  var init_searchResult = __esm(() => {
@@ -5200,8 +5705,8 @@ async function Module2(moduleArg = {}) {
5200
5705
  var ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != "undefined";
5201
5706
  var ENVIRONMENT_IS_NODE = typeof process == "object" && process.versions?.node && process.type != "renderer";
5202
5707
  if (ENVIRONMENT_IS_NODE) {
5203
- const { createRequire: createRequire2 } = await import("module");
5204
- var require = createRequire2(import.meta.url);
5708
+ const { createRequire: createRequire3 } = await import("module");
5709
+ var require = createRequire3(import.meta.url);
5205
5710
  }
5206
5711
  Module.currentQueryProgressCallback = null;
5207
5712
  Module.currentProgressCallback = null;
@@ -5261,13 +5766,13 @@ async function Module2(moduleArg = {}) {
5261
5766
  }
5262
5767
  readAsync = /* @__PURE__ */ __name(async (url) => {
5263
5768
  if (isFileURI(url)) {
5264
- return new Promise((resolve2, reject) => {
5769
+ return new Promise((resolve3, reject) => {
5265
5770
  var xhr = new XMLHttpRequest;
5266
5771
  xhr.open("GET", url, true);
5267
5772
  xhr.responseType = "arraybuffer";
5268
5773
  xhr.onload = () => {
5269
5774
  if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
5270
- resolve2(xhr.response);
5775
+ resolve3(xhr.response);
5271
5776
  return;
5272
5777
  }
5273
5778
  reject(xhr.status);
@@ -5457,9 +5962,9 @@ async function Module2(moduleArg = {}) {
5457
5962
  __name(receiveInstantiationResult, "receiveInstantiationResult");
5458
5963
  var info2 = getWasmImports();
5459
5964
  if (Module["instantiateWasm"]) {
5460
- return new Promise((resolve2, reject) => {
5965
+ return new Promise((resolve3, reject) => {
5461
5966
  Module["instantiateWasm"](info2, (mod, inst) => {
5462
- resolve2(receiveInstance(mod, inst));
5967
+ resolve3(receiveInstance(mod, inst));
5463
5968
  });
5464
5969
  });
5465
5970
  }
@@ -6172,9 +6677,9 @@ async function Module2(moduleArg = {}) {
6172
6677
  Module["monitorRunDependencies"]?.(runDependencies);
6173
6678
  if (runDependencies == 0) {
6174
6679
  if (dependenciesFulfilled) {
6175
- var callback = dependenciesFulfilled;
6680
+ var callback2 = dependenciesFulfilled;
6176
6681
  dependenciesFulfilled = null;
6177
- callback();
6682
+ callback2();
6178
6683
  }
6179
6684
  }
6180
6685
  }, "removeRunDependency");
@@ -6746,8 +7251,8 @@ async function Module2(moduleArg = {}) {
6746
7251
  if (runtimeInitialized) {
6747
7252
  moduleRtn = Module;
6748
7253
  } else {
6749
- moduleRtn = new Promise((resolve2, reject) => {
6750
- readyPromiseResolve = resolve2;
7254
+ moduleRtn = new Promise((resolve3, reject) => {
7255
+ readyPromiseResolve = resolve3;
6751
7256
  readyPromiseReject = reject;
6752
7257
  });
6753
7258
  }
@@ -7863,11 +8368,11 @@ ${JSON.stringify(symbolNames, null, 2)}`);
7863
8368
  C._ts_parser_set_language(this[0], address);
7864
8369
  return this;
7865
8370
  }
7866
- parse(callback, oldTree, options) {
7867
- if (typeof callback === "string") {
7868
- C.currentParseCallback = (index) => callback.slice(index);
7869
- } else if (typeof callback === "function") {
7870
- C.currentParseCallback = callback;
8371
+ parse(callback2, oldTree, options) {
8372
+ if (typeof callback2 === "string") {
8373
+ C.currentParseCallback = (index) => callback2.slice(index);
8374
+ } else if (typeof callback2 === "function") {
8375
+ C.currentParseCallback = callback2;
7871
8376
  } else {
7872
8377
  throw new Error("Argument must be a string or a function");
7873
8378
  }
@@ -7928,13 +8433,13 @@ ${JSON.stringify(symbolNames, null, 2)}`);
7928
8433
  }
7929
8434
  return result;
7930
8435
  }
7931
- setLogger(callback) {
7932
- if (!callback) {
8436
+ setLogger(callback2) {
8437
+ if (!callback2) {
7933
8438
  this.logCallback = null;
7934
- } else if (typeof callback !== "function") {
8439
+ } else if (typeof callback2 !== "function") {
7935
8440
  throw new Error("Logger callback must be a function");
7936
8441
  } else {
7937
- this.logCallback = callback;
8442
+ this.logCallback = callback2;
7938
8443
  }
7939
8444
  return this;
7940
8445
  }
@@ -11344,9 +11849,9 @@ async function watchDirectory(rootDir, options = {}) {
11344
11849
  onError(err2);
11345
11850
  }
11346
11851
  });
11347
- await new Promise((resolve3) => {
11852
+ await new Promise((resolve4) => {
11348
11853
  watcher.on("ready", () => {
11349
- resolve3();
11854
+ resolve4();
11350
11855
  });
11351
11856
  });
11352
11857
  return {
@@ -11381,7 +11886,6 @@ __export(exports_indexer, {
11381
11886
  clearFreshnessCache: () => clearFreshnessCache,
11382
11887
  cleanupIndex: () => cleanupIndex
11383
11888
  });
11384
- import { glob } from "glob";
11385
11889
  import * as fs8 from "fs/promises";
11386
11890
  import * as path22 from "path";
11387
11891
  import * as os3 from "os";
@@ -11984,15 +12488,14 @@ async function indexWithModule(rootDir, files, module2, config, verbose, introsp
11984
12488
  return result;
11985
12489
  }
11986
12490
  async function findFiles(rootDir, config) {
11987
- const patterns = config.extensions.map((ext) => `**/*${ext}`);
11988
- const ignorePatterns = config.ignorePaths.map((p) => `**/${p}/**`);
11989
- const results = await Promise.all(patterns.map((pattern) => glob(pattern, {
11990
- cwd: rootDir,
11991
- absolute: true,
11992
- ignore: ignorePatterns
11993
- })));
11994
- const allFiles = results.flat();
11995
- return [...new Set(allFiles)];
12491
+ const validExtensions = new Set(config.extensions);
12492
+ const ignoreDirs = new Set(config.ignorePaths);
12493
+ const crawler = new Builder().withFullPaths().exclude((dirName) => ignoreDirs.has(dirName)).filter((filePath) => {
12494
+ const ext = path22.extname(filePath);
12495
+ return validExtensions.has(ext);
12496
+ }).crawl(rootDir);
12497
+ const files = await crawler.withPromise();
12498
+ return files;
11996
12499
  }
11997
12500
  async function loadModuleManifest(rootDir, moduleId, config) {
11998
12501
  const manifestPath = getModuleManifestPath(rootDir, moduleId, config);
@@ -12163,6 +12666,7 @@ async function getIndexStatus(rootDir) {
12163
12666
  }
12164
12667
  var FRESHNESS_CACHE_TTL_MS = 5000, freshnessCache = null, INDEX_SCHEMA_VERSION = "2.0.0", DEFAULT_CONCURRENCY, STAT_CONCURRENCY;
12165
12668
  var init_indexer = __esm(() => {
12669
+ init_dist();
12166
12670
  init_config2();
12167
12671
  init_registry();
12168
12672
  init_introspection2();
@@ -12392,9 +12896,9 @@ var init_assert_valid_pattern = __esm(() => {
12392
12896
  });
12393
12897
 
12394
12898
  // node_modules/minimatch/dist/esm/brace-expressions.js
12395
- var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), rangesToString = (ranges) => ranges.join(""), parseClass = (glob2, position) => {
12899
+ var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), rangesToString = (ranges) => ranges.join(""), parseClass = (glob, position) => {
12396
12900
  const pos = position;
12397
- if (glob2.charAt(pos) !== "[") {
12901
+ if (glob.charAt(pos) !== "[") {
12398
12902
  throw new Error("not in a brace expression");
12399
12903
  }
12400
12904
  const ranges = [];
@@ -12407,8 +12911,8 @@ var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEsc
12407
12911
  let endPos = pos;
12408
12912
  let rangeStart = "";
12409
12913
  WHILE:
12410
- while (i2 < glob2.length) {
12411
- const c = glob2.charAt(i2);
12914
+ while (i2 < glob.length) {
12915
+ const c = glob.charAt(i2);
12412
12916
  if ((c === "!" || c === "^") && i2 === pos + 1) {
12413
12917
  negate = true;
12414
12918
  i2++;
@@ -12428,9 +12932,9 @@ var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEsc
12428
12932
  }
12429
12933
  if (c === "[" && !escaping) {
12430
12934
  for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
12431
- if (glob2.startsWith(cls, i2)) {
12935
+ if (glob.startsWith(cls, i2)) {
12432
12936
  if (rangeStart) {
12433
- return ["$.", false, glob2.length - pos, true];
12937
+ return ["$.", false, glob.length - pos, true];
12434
12938
  }
12435
12939
  i2 += cls.length;
12436
12940
  if (neg)
@@ -12453,12 +12957,12 @@ var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEsc
12453
12957
  i2++;
12454
12958
  continue;
12455
12959
  }
12456
- if (glob2.startsWith("-]", i2 + 1)) {
12960
+ if (glob.startsWith("-]", i2 + 1)) {
12457
12961
  ranges.push(braceEscape(c + "-"));
12458
12962
  i2 += 2;
12459
12963
  continue;
12460
12964
  }
12461
- if (glob2.startsWith("-", i2 + 1)) {
12965
+ if (glob.startsWith("-", i2 + 1)) {
12462
12966
  rangeStart = c;
12463
12967
  i2 += 2;
12464
12968
  continue;
@@ -12470,7 +12974,7 @@ var posixClasses, braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&"), regexpEsc
12470
12974
  return ["", false, 0, false];
12471
12975
  }
12472
12976
  if (!ranges.length && !negs.length) {
12473
- return ["$.", false, glob2.length - pos, true];
12977
+ return ["$.", false, glob.length - pos, true];
12474
12978
  }
12475
12979
  if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
12476
12980
  const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
@@ -12751,16 +13255,16 @@ class AST {
12751
13255
  toMMPattern() {
12752
13256
  if (this !== this.#root)
12753
13257
  return this.#root.toMMPattern();
12754
- const glob2 = this.toString();
13258
+ const glob = this.toString();
12755
13259
  const [re, body2, hasMagic, uflag] = this.toRegExpSource();
12756
- const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob2.toUpperCase() !== glob2.toLowerCase();
13260
+ const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
12757
13261
  if (!anyMagic) {
12758
13262
  return body2;
12759
13263
  }
12760
13264
  const flags2 = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
12761
13265
  return Object.assign(new RegExp(`^${re}$`, flags2), {
12762
13266
  _src: re,
12763
- _glob: glob2
13267
+ _glob: glob
12764
13268
  });
12765
13269
  }
12766
13270
  get options() {
@@ -12843,19 +13347,19 @@ class AST {
12843
13347
  return re;
12844
13348
  }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
12845
13349
  }
12846
- static #parseGlob(glob2, hasMagic, noEmpty = false) {
13350
+ static #parseGlob(glob, hasMagic, noEmpty = false) {
12847
13351
  let escaping = false;
12848
13352
  let re = "";
12849
13353
  let uflag = false;
12850
- for (let i2 = 0;i2 < glob2.length; i2++) {
12851
- const c = glob2.charAt(i2);
13354
+ for (let i2 = 0;i2 < glob.length; i2++) {
13355
+ const c = glob.charAt(i2);
12852
13356
  if (escaping) {
12853
13357
  escaping = false;
12854
13358
  re += (reSpecials.has(c) ? "\\" : "") + c;
12855
13359
  continue;
12856
13360
  }
12857
13361
  if (c === "\\") {
12858
- if (i2 === glob2.length - 1) {
13362
+ if (i2 === glob.length - 1) {
12859
13363
  re += "\\\\";
12860
13364
  } else {
12861
13365
  escaping = true;
@@ -12863,7 +13367,7 @@ class AST {
12863
13367
  continue;
12864
13368
  }
12865
13369
  if (c === "[") {
12866
- const [src, needUflag, consumed, magic] = parseClass(glob2, i2);
13370
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
12867
13371
  if (consumed) {
12868
13372
  re += src;
12869
13373
  uflag = uflag || needUflag;
@@ -12873,7 +13377,7 @@ class AST {
12873
13377
  }
12874
13378
  }
12875
13379
  if (c === "*") {
12876
- if (noEmpty && glob2 === "*")
13380
+ if (noEmpty && glob === "*")
12877
13381
  re += starNoEmpty;
12878
13382
  else
12879
13383
  re += star;
@@ -12887,7 +13391,7 @@ class AST {
12887
13391
  }
12888
13392
  re += regExpEscape(c);
12889
13393
  }
12890
- return [re, unescape(glob2), !!hasMagic, uflag];
13394
+ return [re, unescape(glob), !!hasMagic, uflag];
12891
13395
  }
12892
13396
  }
12893
13397
  var types, isExtglobType = (c) => types.has(c), startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))", startNoDot = "(?!\\.)", addPatternStart, justDots, reSpecials, regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), qmark = "[^/]", star, starNoEmpty;
@@ -13488,7 +13992,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
13488
13992
  }, qmarksTestNoExtDot = ([$0]) => {
13489
13993
  const len = $0.length;
13490
13994
  return (f) => f.length === len && f !== "." && f !== "..";
13491
- }, defaultPlatform, path23, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
13995
+ }, defaultPlatform, path23, sep2, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
13492
13996
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
13493
13997
  return minimatch;
13494
13998
  }
@@ -13550,8 +14054,8 @@ var init_esm = __esm(() => {
13550
14054
  win32: { sep: "\\" },
13551
14055
  posix: { sep: "/" }
13552
14056
  };
13553
- sep = defaultPlatform === "win32" ? path23.win32.sep : path23.posix.sep;
13554
- minimatch.sep = sep;
14057
+ sep2 = defaultPlatform === "win32" ? path23.win32.sep : path23.posix.sep;
14058
+ minimatch.sep = sep2;
13555
14059
  GLOBSTAR = Symbol("globstar **");
13556
14060
  minimatch.GLOBSTAR = GLOBSTAR;
13557
14061
  star2 = qmark2 + "*?";
@@ -13654,8 +14158,8 @@ function createSearchContext(rootDir, moduleId, config) {
13654
14158
  const files = [];
13655
14159
  await traverseDirectory(indexPath, files, indexPath);
13656
14160
  return files.filter((f) => f.endsWith(".json") && !f.endsWith("manifest.json")).map((f) => {
13657
- const relative4 = path24.relative(indexPath, f);
13658
- return relative4.replace(/\.json$/, "");
14161
+ const relative5 = path24.relative(indexPath, f);
14162
+ return relative5.replace(/\.json$/, "");
13659
14163
  });
13660
14164
  }
13661
14165
  };
@@ -13743,7 +14247,7 @@ init_logger();
13743
14247
  // package.json
13744
14248
  var package_default = {
13745
14249
  name: "raggrep",
13746
- version: "0.10.4",
14250
+ version: "0.10.5",
13747
14251
  description: "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
13748
14252
  type: "module",
13749
14253
  main: "./dist/index.js",
@@ -13800,6 +14304,7 @@ var package_default = {
13800
14304
  dependencies: {
13801
14305
  "@xenova/transformers": "^2.17.0",
13802
14306
  chokidar: "^5.0.0",
14307
+ fdir: "^6.5.0",
13803
14308
  glob: "^10.0.0",
13804
14309
  typescript: "^5.0.0",
13805
14310
  "web-tree-sitter": "^0.26.3"
@@ -14359,4 +14864,4 @@ Run 'raggrep <command> --help' for more information.
14359
14864
  }
14360
14865
  main();
14361
14866
 
14362
- //# debugId=5A4116C9AF3188E264756E2164756E21
14867
+ //# debugId=D79BF0530F7DE02664756E2164756E21